:root {
    color-scheme: light dark;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3ee;
    --positive: #0f766e;
    --negative: #b45309;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #07111f;
        --card: #0f1b2d;
        --text: #e7eef8;
        --muted: #9fb0c6;
        --border: #24344a;
        --shadow: 0 12px 34px rgba(0, 0, 0, .25);
    }
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
.container { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 40px; }
.header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.status-pill { border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: var(--card); white-space: nowrap; }
.status-pill.online { color: var(--positive); }
.status-pill.stale { color: var(--negative); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { padding: 18px; min-height: 142px; display: flex; flex-direction: column; }
.kpi-card span { color: var(--muted); font-size: .92rem; }
.kpi-card strong { margin-top: auto; font-size: clamp(1.55rem, 4vw, 2.2rem); letter-spacing: -.03em; }
.kpi-card small { margin-top: 5px; color: var(--muted); }
.chart-card { padding: 18px; margin-top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 1.1rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.chart { min-height: 310px; overflow-x: auto; }
.chart svg { width: 100%; min-width: 700px; height: 310px; display: block; }
.chart-empty { height: 280px; display: grid; place-items: center; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: .85rem; margin: 18px 0 0; }

@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .container { width: min(100% - 18px, 1180px); padding-top: 16px; }
    .header { align-items: flex-start; flex-direction: column; }
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-card { min-height: 120px; }
}
