:root {
    color-scheme: dark;
    --bg: #050505;
    --panel: #101010;
    --panel-2: #171717;
    --panel-3: #1f1d17;
    --line: rgba(222, 192, 98, 0.16);
    --muted: #a6a09a;
    --text: #f7f1df;
    --gold: #d8bd5f;
    --gold-light: #fff08a;
    --gold-dark: #8c742d;
    --emerald: #61d394;
    --champagne: #f2e3a3;
    --red: #d96d61;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        linear-gradient(135deg, rgba(216, 189, 95, 0.08), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #050505, #0c0b09);
    padding: 28px 20px;
}

.brand {
    margin-bottom: 34px;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border: 1px solid rgba(216, 189, 95, 0.22);
    border-radius: 8px;
    background: #000;
    padding: 12px;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: min(100%, 132px);
    height: auto;
}

.brand span,
.eyebrow {
    display: block;
    color: var(--gold-light);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.brand strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    color: #fff7cf;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-radius: 8px;
    padding: 0 12px;
    color: #bbb3a0;
    text-decoration: none;
    transition: 160ms ease;
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(216, 189, 95, 0.12);
    color: #fff;
}

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, #080806, #12100b);
    padding: 28px 34px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    margin-top: 8px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
}

h2 {
    font-size: 19px;
}

.status-pill {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff7cf;
    white-space: nowrap;
}

.status-pill.ready {
    border-color: rgba(97, 211, 148, 0.34);
    background: rgba(97, 211, 148, 0.1);
}

.status-pill.warning {
    border-color: rgba(216, 189, 95, 0.34);
    background: rgba(216, 189, 95, 0.1);
}

.kpi-grid,
.dashboard-grid {
    display: grid;
    gap: 18px;
    padding: 22px 34px 0;
}

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

.dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
}

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

.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-bottom: 34px;
}

.panel,
.kpi-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.kpi-card {
    min-height: 132px;
    padding: 20px;
}

.kpi-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.kpi-card strong {
    display: block;
    margin-top: 22px;
    color: #fff7cf;
    font-size: 26px;
}

.kpi-card.gold {
    border-top-color: var(--gold);
}

.kpi-card.emerald {
    border-top-color: var(--emerald);
}

.kpi-card.champagne {
    border-top-color: var(--champagne);
}

.panel {
    padding: 22px;
}

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

.panel-heading strong {
    color: #fff7cf;
    font-size: 20px;
}

.line-chart {
    display: block;
    width: 100%;
    height: auto;
}

.line-chart line {
    stroke: rgba(255, 255, 255, 0.12);
}

.line-chart polyline {
    fill: none;
    stroke: var(--gold-light);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-chart text {
    fill: var(--muted);
    font-size: 13px;
    text-anchor: middle;
}

.target-meter {
    display: grid;
    gap: 14px;
    margin-top: 34px;
}

.meter-value {
    color: #fff7cf;
    font-size: 46px;
    font-weight: 800;
}

.target-meter p {
    color: var(--muted);
    line-height: 1.6;
}

.bar {
    overflow: hidden;
    height: 9px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.bar.gold span {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

td {
    color: #eee4c5;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(216, 189, 95, 0.24);
    padding: 0 9px;
    color: #fff7cf;
    font-size: 12px;
    text-transform: capitalize;
}

.source-badge.pennylane {
    border-color: rgba(97, 211, 148, 0.36);
    color: var(--emerald);
}

.source-badge.missing {
    border-color: rgba(217, 109, 97, 0.36);
    color: var(--red);
}

.stack {
    display: grid;
    gap: 16px;
}

.participation-row,
.debt-row,
.asset-card,
.tax-summary,
.deadline {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(216, 189, 95, 0.035);
    padding: 14px;
}

.participation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
}

.participation-row span,
.asset-card span,
.debt-row span,
.tax-summary span,
.deadline span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.participation-row .bar {
    grid-column: 1 / -1;
}

.asset-card {
    display: grid;
    gap: 9px;
}

.asset-card div,
.deadline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.asset-card em {
    color: var(--emerald);
    font-style: normal;
}

.debt-row {
    display: grid;
    gap: 10px;
}

.tax-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-grid,
    .dashboard-grid,
    .two-columns,
    .three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .topbar,
    .panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpi-grid,
    .dashboard-grid,
    .two-columns,
    .three-columns,
    .nav-list {
        grid-template-columns: 1fr;
    }

    .topbar,
    .kpi-grid,
    .dashboard-grid {
        padding-left: 18px;
        padding-right: 18px;
    }

    .status-pill {
        white-space: normal;
    }
}
