:root {
    --bg:            #0d1117;
    --surface:       #161b22;
    --surface-hover: #1c2230;
    --border:        #21262d;
    --text:          #e6edf3;
    --text-muted:    #7d8590;
    --accent:        #58a6ff;
    --accent-dim:    rgba(88, 166, 255, 0.12);
    --green:         #3fb950;
    --card-radius:   8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
                 Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 0.15em 0.4em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-bottom: 1.25rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.header-run code {
    font-size: 0.85rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

/* ── Main ────────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 1.75rem 0;
}

/* ── Stat cards ──────────────────────────────────────────── */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    transition: border-color 0.15s;
}

.card:hover { border-color: #30363d; }

.card-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--green);
    line-height: 1;
}

.card-since {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ── Chart sections ──────────────────────────────────────── */
.chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.chart-section.half {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chart-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
}

.chart-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Range buttons */
.range-controls {
    display: flex;
    gap: 0.3rem;
}

.range-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 5px;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}

.range-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.range-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* "No data" message inside chart wrappers */
.no-data-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 1rem;
}

/* Chart canvas wrappers */
.chart-wrapper               { position: relative; height: 280px; }
.chart-wrapper--bar          { height: 340px; }
.chart-wrapper--doughnut     { height: 300px; }
.chart-section.half .chart-wrapper {
    flex: 1;
    min-height: 340px;
}
.chart-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ── Bottom row ──────────────────────────────────────────── */
.charts-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 0.9rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-sep { margin: 0 0.4rem; }
.footer-link { color: var(--text-muted); }
.footer-link:hover { color: var(--accent); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .charts-row { flex-direction: column; }
    .chart-section.half { margin-bottom: 1.25rem; }
    .chart-section.half:last-child { margin-bottom: 0; }
}

@media (max-width: 640px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .header-run { display: none; }
}

@media (max-width: 400px) {
    .card-value { font-size: 1.6rem; }
}
