:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #657083;
    --line: #dce4ef;
    --strong-line: #c8d2df;
    --primary: #1f6feb;
    --primary-soft: #e8f1ff;
    --good: #047857;
    --warn: #a16207;
    --bad: #b42318;
    --ink: #111827;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 64px;
    padding: 0 24px;
    background: #101827;
    color: #fff;
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-weight: 750;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #fff;
    color: #101827;
    font-size: 12px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.main-nav a {
    padding: 9px 11px;
    border-radius: 7px;
    color: #cbd5e1;
    text-decoration: none;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.demo-pill {
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #dbeafe;
    font-size: 12px;
    white-space: nowrap;
}

.page {
    width: min(1500px, calc(100vw - 40px));
    margin: 26px auto 48px;
}

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

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 30px;
    line-height: 1.12;
}

h2 {
    font-size: 17px;
}

h3 {
    font-size: 14px;
}

.muted,
.page-heading p,
.panel-heading span,
small {
    color: var(--muted);
}

.section {
    margin-top: 22px;
}

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

.metric,
.panel,
.alert-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric {
    padding: 15px 16px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin-top: 5px;
    font-size: 24px;
    letter-spacing: 0;
}

.metric small {
    display: block;
    margin-top: 5px;
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 16px;
}

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

.panel {
    overflow: hidden;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f6;
}

.chart-box {
    height: 310px;
    padding: 12px 14px 16px;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.alerts {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.alert-item {
    padding: 12px 13px;
}

.alert-item strong {
    display: block;
    margin-bottom: 4px;
}

.tag,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.good {
    color: var(--good);
}

.warn {
    color: var(--warn);
}

.bad {
    color: var(--bad);
}

.neutral {
    color: var(--muted);
}

.tag.good,
.status.good {
    background: #ecfdf3;
    color: var(--good);
}

.tag.warn,
.status.warn {
    background: #fffbeb;
    color: var(--warn);
}

.tag.bad,
.status.bad {
    background: #fef3f2;
    color: var(--bad);
}

.tag.neutral,
.status.neutral {
    background: #f1f5f9;
    color: var(--muted);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 9px 10px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
}

td.num,
th.num {
    text-align: right;
    white-space: nowrap;
}

tbody tr:hover td {
    background: #f8fafc;
}

.compact-table td strong,
.compact-table td small {
    display: block;
}

.compact-table td small {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
}

.scenario-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #edf1f6;
    background: #fbfdff;
}

.scenario-bar label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.summary-list {
    display: grid;
    gap: 10px;
    padding: 14px 16px 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid #edf1f6;
}

.summary-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

@media (max-width: 1100px) {
    .metrics,
    .grid-two,
    .grid-equal {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .demo-pill {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .page {
        width: min(100vw - 24px, 1500px);
    }

    .page-heading {
        display: block;
    }

    h1 {
        font-size: 25px;
    }
}

