:root {
    color-scheme: dark;
    --bg: #07131d;
    --bg-soft: #0e1d2b;
    --panel: rgba(12, 24, 36, 0.82);
    --panel-strong: rgba(17, 31, 46, 0.94);
    --text: #f4f7f1;
    --muted: #9fb1b8;
    --line: rgba(202, 234, 222, 0.14);
    --accent: #9fe870;
    --accent-strong: #cbff7a;
    --accent-soft: rgba(159, 232, 112, 0.14);
    --cyan: #76d1db;
    --cyan-soft: rgba(118, 209, 219, 0.14);
    --warn: #ffd37a;
    --bad: #ff8e88;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(159, 232, 112, 0.16), transparent 34%),
        linear-gradient(225deg, rgba(118, 209, 219, 0.13), transparent 28%),
        linear-gradient(180deg, #06111a 0%, #081723 52%, #0a1720 100%);
    font-family: "Aptos", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(202, 234, 222, 0.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(202, 234, 222, 0.026) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.52;
    animation: gridDrift 24s linear infinite;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.wrap {
    position: relative;
    z-index: 1;
    width: min(1360px, calc(100% - 44px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.hero {
    display: block;
}

.card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-main,
.section-card {
    padding: 22px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.toolbar-actions,
.section-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

button,
.button-link {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 12px 18px;
    color: #06111a;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    box-shadow: 0 12px 28px rgba(159, 232, 112, 0.18);
    cursor: pointer;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease;
}

button:hover,
.button-link:hover {
    transform: translateY(-1px);
}

button.button-secondary,
.button-link {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.summary-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.summary-panel.main {
    background:
        linear-gradient(135deg, rgba(159, 232, 112, 0.11), transparent 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
}

.summary-label,
.group-chip-label,
.eyebrow {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent-strong);
}

.summary-value {
    margin-top: 10px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0;
}

.summary-value.main {
    font-size: 60px;
    line-height: 0.98;
}

.summary-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.summary-change {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}

.delta-positive {
    color: var(--accent);
}

.delta-negative {
    color: #ff8f8f;
}

.delta-flat {
    color: var(--muted);
}

.status-box,
.admin-message {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    line-height: 1.5;
}

.admin-panel {
    margin-top: 18px;
}

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

.section-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0;
}

.pill {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.pill.accent {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.pill.cyan {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.group-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.group-chip {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.group-chip-value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 800;
}

.group-chip-sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.sections {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 9, 15, 0.28);
}

table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.025);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.name-cell {
    min-width: 180px;
    font-weight: 700;
}

.info-cell {
    min-width: 300px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    white-space: normal;
}

.daily-cell {
    min-width: 158px;
}

.status-ok {
    color: var(--accent-strong);
    font-weight: 700;
}

.status-error {
    color: var(--bad);
    font-weight: 700;
}

.exclude-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.exclude-toggle {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #d66d5b;
    cursor: pointer;
}

.is-excluded {
    opacity: 0.58;
}

code {
    padding: 2px 7px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 0.92em;
}

td::before {
    content: none;
}

@keyframes gridDrift {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 72px 72px, -72px 72px;
    }
}

@media (max-width: 1040px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 12px;
    }

    tbody tr {
        display: block;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.02);
    }

    tbody tr:last-child td {
        border-bottom: 1px solid var(--line);
    }

    tbody tr:last-child td:last-child {
        border-bottom: none;
    }

    td {
        display: grid;
        grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
        gap: 10px;
        padding: 11px 14px;
    }

    td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .name-cell,
    .info-cell {
        min-width: 0;
    }

    .admin-table-wrap {
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(2, 9, 15, 0.28);
    }

    .admin-table-wrap table {
        min-width: 980px;
    }

    .admin-table-wrap thead {
        display: table-header-group;
    }

    .admin-table-wrap tbody {
        display: table-row-group;
    }

    .admin-table-wrap tbody tr {
        display: table-row;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .admin-table-wrap td,
    .admin-table-wrap th {
        display: table-cell;
        padding: 13px 14px;
    }

    .admin-table-wrap td::before {
        content: none;
    }
}

@media (max-width: 700px) {
    .wrap {
        width: min(100% - 28px, 1360px);
        padding: 18px 0 28px;
    }

    .hero-main,
    .section-card {
        padding: 18px;
    }

    .group-strip {
        grid-template-columns: 1fr;
    }

    .summary-value.main {
        font-size: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
