:root {
    --screen-bg: #06080d;
    --screen-panel: rgba(10, 18, 29, 0.78);
    --screen-panel-strong: rgba(14, 25, 40, 0.92);
    --screen-line: rgba(101, 222, 255, 0.18);
    --screen-line-strong: rgba(101, 222, 255, 0.34);
    --screen-text: #f6fbff;
    --screen-muted: #8ca0b5;
    --screen-cyan: #52d6ff;
    --screen-green: #20e29a;
    --screen-amber: #f4c95d;
    --screen-rose: #ff6b9a;
    --screen-purple: #9b8cff;
    --screen-danger: #ff5f72;
    --screen-radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--screen-bg);
}

body.screen-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--screen-text);
    background:
        linear-gradient(120deg, rgba(6, 8, 13, 0.96), rgba(8, 18, 22, 0.94) 48%, rgba(18, 10, 24, 0.92)),
        var(--screen-bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.screen-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.screen-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(82, 214, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(82, 214, 255, 0.08) 1px, transparent 1px),
        linear-gradient(135deg, transparent 0, transparent 40%, rgba(32, 226, 154, 0.08) 40%, rgba(32, 226, 154, 0.08) 40.3%, transparent 40.3%),
        linear-gradient(45deg, transparent 0, transparent 57%, rgba(244, 201, 93, 0.06) 57%, rgba(244, 201, 93, 0.06) 57.4%, transparent 57.4%);
    background-size: 68px 68px, 68px 68px, 360px 360px, 420px 420px;
    animation: gridDrift 20s linear infinite;
}

.screen-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, transparent 0 36%, rgba(82, 214, 255, 0.1) 36.2%, transparent 36.6% 100%),
        linear-gradient(70deg, transparent 0 62%, rgba(32, 226, 154, 0.08) 62.2%, transparent 62.6% 100%),
        linear-gradient(160deg, transparent 0 72%, rgba(255, 107, 154, 0.06) 72.2%, transparent 72.5% 100%);
    opacity: 0.74;
    animation: hazeShift 14s ease-in-out infinite alternate;
}

.scan-line {
    position: absolute;
    top: -18%;
    left: 0;
    width: 100%;
    height: 18%;
    background: linear-gradient(180deg, transparent, rgba(82, 214, 255, 0.12), transparent);
    animation: scanMove 6s ease-in-out infinite;
}

@keyframes gridDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-68px, -68px, 0); }
}

@keyframes hazeShift {
    from { transform: translate3d(-2%, 1%, 0); }
    to { transform: translate3d(2%, -1%, 0); }
}

@keyframes scanMove {
    0% { transform: translateY(0); opacity: 0; }
    18% { opacity: 1; }
    100% { transform: translateY(760%); opacity: 0; }
}

.screen-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 18px 34px;
    border-bottom: 1px solid rgba(101, 222, 255, 0.14);
    background: rgba(6, 8, 13, 0.72);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.back-link,
.clock,
.topbar-center {
    font-size: 13px;
    font-weight: 700;
    color: var(--screen-muted);
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
    color: var(--screen-text);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    color: var(--screen-cyan);
    transform: translateX(-2px);
}

.topbar-center {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--screen-cyan);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--screen-green);
    box-shadow: 0 0 18px rgba(32, 226, 154, 0.9);
    animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.7); opacity: 0.55; }
}

.clock {
    justify-self: end;
    color: var(--screen-amber);
}

.screen-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.screen-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    min-height: 190px;
    padding: 34px;
    border: 1px solid var(--screen-line);
    border-radius: var(--screen-radius);
    background:
        linear-gradient(135deg, rgba(82, 214, 255, 0.09), transparent 38%),
        linear-gradient(315deg, rgba(32, 226, 154, 0.08), transparent 36%),
        rgba(10, 18, 29, 0.64);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.screen-hero::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 46%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--screen-cyan), var(--screen-green));
    box-shadow: 0 0 22px rgba(82, 214, 255, 0.75);
}

.eyebrow,
.panel-kicker {
    margin-bottom: 10px;
    color: var(--screen-cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.screen-hero h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: 0;
}

.screen-hero p {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--screen-muted);
    font-size: 15px;
    line-height: 1.8;
}

.hero-pulse {
    position: relative;
    width: 164px;
    height: 164px;
    flex: 0 0 auto;
}

.hero-pulse span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(82, 214, 255, 0.5);
    border-radius: 50%;
    animation: ringPulse 3.4s ease-out infinite;
}

.hero-pulse span:nth-child(2) {
    animation-delay: 0.8s;
    border-color: rgba(32, 226, 154, 0.45);
}

.hero-pulse span:nth-child(3) {
    animation-delay: 1.6s;
    border-color: rgba(244, 201, 93, 0.38);
}

.hero-pulse::before,
.hero-pulse::after {
    content: "";
    position: absolute;
    background: rgba(82, 214, 255, 0.48);
}

.hero-pulse::before {
    top: 50%;
    left: 7%;
    width: 86%;
    height: 1px;
}

.hero-pulse::after {
    top: 7%;
    left: 50%;
    width: 1px;
    height: 86%;
}

@keyframes ringPulse {
    from { transform: scale(0.38); opacity: 0.9; }
    to { transform: scale(1); opacity: 0; }
}

.control-panel,
.screen-panel,
.kpi-card {
    border: 1px solid var(--screen-line);
    background: var(--screen-panel);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.control-panel {
    display: grid;
    grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.4fr) minmax(180px, 0.8fr);
    gap: 18px;
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--screen-radius);
}

.control-block label {
    display: block;
    margin-bottom: 10px;
    color: var(--screen-muted);
    font-size: 12px;
    font-weight: 800;
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(101, 222, 255, 0.18);
    border-radius: 999px;
    background: rgba(8, 15, 26, 0.78);
    color: var(--screen-text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.segmented button:hover {
    border-color: rgba(82, 214, 255, 0.74);
    color: var(--screen-cyan);
    transform: translateY(-1px);
}

.segmented button.active {
    border-color: rgba(32, 226, 154, 0.78);
    background: linear-gradient(135deg, rgba(32, 226, 154, 0.26), rgba(82, 214, 255, 0.18));
    color: #ffffff;
    box-shadow: 0 0 24px rgba(32, 226, 154, 0.16);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.kpi-card {
    position: relative;
    min-height: 136px;
    padding: 22px;
    border-radius: var(--screen-radius);
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--screen-cyan), transparent);
}

.kpi-card.accent::before {
    background: linear-gradient(90deg, var(--screen-green), var(--screen-amber), transparent);
}

.kpi-card span,
.kpi-card em {
    display: block;
    color: var(--screen-muted);
    font-style: normal;
}

.kpi-card span {
    font-size: 12px;
    font-weight: 800;
}

.kpi-card strong {
    display: block;
    margin: 16px 0 10px;
    color: var(--screen-text);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 900;
}

.kpi-card.accent strong {
    color: var(--screen-green);
    text-shadow: 0 0 20px rgba(32, 226, 154, 0.26);
}

.kpi-card em {
    font-size: 12px;
    line-height: 1.5;
}

.screen-panel {
    margin-top: 18px;
    padding: 24px;
    border-radius: var(--screen-radius);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}

.panel-meta {
    color: var(--screen-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.panel-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(32, 226, 154, 0.36);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(32, 226, 154, 0.18), rgba(82, 214, 255, 0.1));
    color: var(--screen-text);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.export-btn:hover {
    border-color: rgba(32, 226, 154, 0.82);
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(32, 226, 154, 0.18);
}

.export-btn svg {
    flex: 0 0 auto;
}

.chart-wrap {
    position: relative;
    min-height: 304px;
    border: 1px solid rgba(101, 222, 255, 0.12);
    border-radius: 14px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        rgba(4, 10, 18, 0.62);
    background-size: 100% 25%, 10% 100%, auto;
    overflow: hidden;
}

.suggestion-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.suggestion-card {
    position: relative;
    min-height: 128px;
    padding: 18px;
    border: 1px solid rgba(101, 222, 255, 0.14);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(32, 226, 154, 0.1), transparent 46%),
        rgba(4, 10, 18, 0.56);
    overflow: hidden;
}

.suggestion-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--screen-green), var(--screen-cyan), transparent);
}

.suggestion-date {
    color: var(--screen-text);
    font-size: 15px;
    font-weight: 900;
}

.suggestion-price {
    margin-top: 14px;
    color: var(--screen-green);
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(32, 226, 154, 0.22);
}

.suggestion-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.suggestion-foot span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(101, 222, 255, 0.12);
    border-radius: 999px;
    color: var(--screen-muted);
    background: rgba(8, 15, 26, 0.64);
    font-size: 11px;
    font-weight: 800;
}

.chart-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(82, 214, 255, 0.09), transparent);
    transform: translateX(-100%);
    animation: chartSweep 5.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes chartSweep {
    0% { transform: translateX(-100%); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.chart-svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 304px;
    touch-action: manipulation;
}

.chart-line {
    fill: none;
    stroke: var(--screen-green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 12px rgba(32, 226, 154, 0.45));
}

.chart-area {
    fill: url(#screenArea);
    opacity: 0.78;
}

.chart-min-line {
    stroke: rgba(255, 95, 114, 0.64);
    stroke-width: 2;
    stroke-dasharray: 8 8;
    pointer-events: none;
}

.chart-label {
    fill: var(--screen-muted);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.chart-hit-dot {
    fill: rgba(32, 226, 154, 0.24);
    stroke: rgba(32, 226, 154, 0.5);
    stroke-width: 1.5;
    opacity: 0;
    transition: opacity 0.18s ease, r 0.18s ease, fill 0.18s ease;
    pointer-events: none;
}

.chart-hit-dot.is-active {
    opacity: 1;
    fill: rgba(32, 226, 154, 0.92);
}

.chart-crosshair {
    stroke: rgba(82, 214, 255, 0.7);
    stroke-width: 2;
    stroke-dasharray: 5 7;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(82, 214, 255, 0.6));
}

.chart-focus-dot {
    fill: var(--screen-green);
    stroke: #ffffff;
    stroke-width: 3;
    pointer-events: none;
    filter: drop-shadow(0 0 16px rgba(32, 226, 154, 0.88));
}

.chart-sensor {
    fill: transparent;
    cursor: crosshair;
    pointer-events: all;
}

.chart-tooltip {
    position: absolute;
    z-index: 4;
    width: 172px;
    padding: 12px 14px;
    border: 1px solid rgba(82, 214, 255, 0.38);
    border-radius: 12px;
    background: rgba(5, 12, 22, 0.92);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34), 0 0 26px rgba(82, 214, 255, 0.14);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: var(--screen-text);
    pointer-events: none;
    transform: translateX(-50%);
}

.chart-tooltip strong,
.chart-tooltip span,
.chart-tooltip em {
    display: block;
}

.chart-tooltip strong {
    margin-bottom: 8px;
    color: var(--screen-cyan);
    font-size: 14px;
    font-weight: 900;
}

.chart-tooltip span {
    margin-top: 4px;
    color: var(--screen-muted);
    font-size: 12px;
    font-weight: 700;
}

.chart-tooltip em {
    margin-top: 8px;
    color: var(--screen-green);
    font-size: 16px;
    font-style: normal;
    font-weight: 900;
}

.date-list {
    border: 1px solid rgba(101, 222, 255, 0.12);
    border-radius: 14px;
    background: rgba(4, 10, 18, 0.48);
    overflow: hidden;
}

.date-list-head,
.date-row {
    display: grid;
    grid-template-columns: 1.08fr 0.86fr 0.86fr 0.86fr 0.72fr 0.92fr;
    align-items: center;
}

.date-list-head {
    position: sticky;
    top: 58px;
    z-index: 5;
    min-height: 50px;
    background: var(--screen-panel-strong);
    border-bottom: 1px solid rgba(101, 222, 255, 0.18);
}

.date-list-head div {
    padding: 14px 12px;
    color: var(--screen-muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.date-list-head div:first-child {
    text-align: left;
}

.date-row {
    min-height: 62px;
    border-bottom: 1px solid rgba(101, 222, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.date-row:last-child {
    border-bottom: none;
}

.date-row:hover {
    background: rgba(82, 214, 255, 0.06);
    transform: translateX(2px);
}

.date-row.is-active {
    background: rgba(32, 226, 154, 0.1);
    box-shadow: inset 3px 0 0 var(--screen-green), inset 0 0 0 1px rgba(32, 226, 154, 0.18);
}

.date-cell {
    min-width: 0;
    padding: 12px;
    text-align: center;
    color: var(--screen-text);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.date-cell:first-child {
    text-align: left;
}

.date-cell .sub {
    display: block;
    margin-top: 4px;
    color: var(--screen-muted);
    font-size: 11px;
    font-weight: 700;
}

.date-sale {
    color: var(--screen-cyan);
}

.date-profit {
    color: var(--screen-green);
    text-shadow: 0 0 16px rgba(32, 226, 154, 0.22);
}

.date-profit.negative {
    color: var(--screen-danger);
    text-shadow: 0 0 16px rgba(255, 95, 114, 0.2);
}

.loading,
.empty {
    padding: 42px 20px;
    color: var(--screen-muted);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 1080px) {
    .screen-shell {
        width: min(100% - 28px, 980px);
    }

    .control-panel {
        grid-template-columns: 1fr 1fr;
    }

    .package-block {
        grid-column: 1 / -1;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .screen-topbar {
        grid-template-columns: 1fr auto;
        padding: 14px 16px;
    }

    .topbar-center {
        display: none;
    }

    .screen-shell {
        width: 100%;
        padding: 12px 10px 32px;
    }

    .screen-hero {
        min-height: auto;
        padding: 22px;
    }

    .screen-hero h1 {
        font-size: 28px;
    }

    .screen-hero p {
        font-size: 13px;
    }

    .hero-pulse {
        display: none;
    }

    .control-panel {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .segmented button {
        min-height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi-card {
        min-height: 110px;
        padding: 16px;
    }

    .kpi-card strong {
        font-size: 20px;
    }

    .screen-panel {
        padding: 14px;
    }

    .panel-head {
        align-items: flex-start;
        margin-bottom: 14px;
    }

    .panel-head h2 {
        font-size: 17px;
    }

    .panel-meta {
        font-size: 11px;
    }

    .panel-actions {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .export-btn {
        min-height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }

    .chart-wrap,
    .chart-svg {
        min-height: 220px;
        height: 220px;
    }

    .suggestion-list {
        grid-template-columns: 1fr;
    }

    .suggestion-card {
        min-height: 112px;
        padding: 15px;
    }

    .suggestion-price {
        font-size: 28px;
    }

    .date-list-head,
    .date-row {
        grid-template-columns: 1.12fr 0.74fr 0.74fr 0.74fr 0.64fr 0.78fr;
    }

    .date-list-head {
        top: 49px;
        min-height: 42px;
    }

    .date-list-head div {
        padding: 10px 3px;
        font-size: 10px;
    }

    .date-row {
        min-height: 52px;
    }

    .date-cell {
        padding: 8px 3px;
        font-size: 11px;
    }

    .date-cell .sub {
        font-size: 9px;
    }
}

@media (max-width: 390px) {
    .screen-shell {
        padding-left: 6px;
        padding-right: 6px;
    }

    .screen-hero,
    .control-panel,
    .screen-panel {
        border-radius: 14px;
    }

    .screen-hero h1 {
        font-size: 25px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .date-list-head,
    .date-row {
        grid-template-columns: 1.03fr 0.68fr 0.68fr 0.68fr 0.58fr 0.72fr;
    }

    .date-list-head div {
        font-size: 9px;
    }

    .date-cell {
        font-size: 10px;
    }
}
