* { box-sizing: border-box; }
body { margin: 0; background: #f7f8fa; color: #202b36; font-family: system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: #176b56; text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: #104536; }
button, input, select { font: inherit; }
button, select, input[type=date] { min-height: 38px; border: 1px solid #aebbc5; border-radius: 4px; padding: 7px 10px; background: white; color: inherit; }
button { background: #176b56; color: white; border-color: #176b56; cursor: pointer; font-weight: 600; }
button:hover { background: #104536; }
:focus-visible { outline: 3px solid #397fc4; outline-offset: 3px; }
.shell { max-width: 1160px; margin: auto; padding: 0 24px; }
.topbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #d5dde3; }
.brand { font-weight: 750; font-size: 19px; text-decoration: none; }
h1 { margin: 0; font-size: 28px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { margin: 0 0 16px; font-size: 20px; }
p { margin: 10px 0; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading { margin: 24px 0 12px; }
.inline-form { display: flex; align-items: center; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; }
.muted, small { color: #536471; }
.panel, .empty { background: white; border: 1px solid #d5dde3; border-radius: 6px; padding: 20px; }
.table-wrap { overflow: auto; }
.server-table { background: white; border: 1px solid #d5dde3; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 11px 14px; border-bottom: 1px solid #e1e6eb; vertical-align: middle; }
th { color: #536471; font-weight: 600; background: #f4f6f8; position: sticky; top: 0; }
caption { text-align: left; color: #536471; padding: 10px 0; font-size: 13px; }
.server-table tbody tr:hover { background: #f3f8f6; }
.server-table th, .server-table td:not(:first-child) { white-space: nowrap; }
.server-link { font-weight: 650; }
td small { display: block; margin-top: 3px; }
.population { font-weight: 700; font-variant-numeric: tabular-nums; }
.status { display: inline-block; background: #e5f3ec; color: #176b56; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; vertical-align: middle; letter-spacing: 0; }
.status.inactive { background: #f4ede2; color: #815016; }
.detail-heading { padding: 24px 0 16px; }
.history-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.history-controls label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.range-heading { margin: 18px 0; font-size: 13px; }
.range-heading a { white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #d5dde3; border-radius: 4px; }
.metrics div { padding: 14px; }
.metrics span { display: block; color: #536471; font-size: 12px; }
.metrics strong { display: block; margin-top: 4px; font-size: 24px; font-variant-numeric: tabular-nums; }
.metrics div:last-child strong { font-size: 20px; }
.chart-wrap { margin-top: 20px; overflow-x: auto; }
.population-chart { width: 100%; min-width: 600px; display: block; }
.grid-line { stroke: #dce3e9; stroke-width: 1; }
.axis-label { fill: #536471; font-size: 11px; }
.trend-line { fill: none; stroke: #176b56; stroke-width: 2.5; }
.chart-bar, .chart-dot { fill: #328c73; }
.range-line { stroke: #202b36; stroke-width: 1.5; }
.chart-caption { font-size: 12px; }
.breakdown { max-height: 360px; margin-top: 16px; }
.pagination { display: flex; gap: 16px; justify-content: center; margin-top: 12px; }
.live-panel { margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; }
.agent-list { display: grid; gap: 10px; max-height: 400px; overflow: auto; margin-top: 16px; }
.agent { padding: 12px; border: 1px solid #d5dde3; border-radius: 4px; }
.agent div { display: flex; gap: 12px; justify-content: space-between; padding: 3px; overflow-wrap: anywhere; }
.agent span { color: #536471; }
.notice { color: #815016; background: #fff8e9; border-left: 3px solid #b88631; padding: 12px; }
footer { margin-top: 24px; border-top: 1px solid #d5dde3; padding: 18px 0; color: #536471; font-size: 12px; }
#blazor-error-ui { display: none; background: #fff3cd; bottom: 0; position: fixed; width: 100%; padding: 1rem; }
@media (max-width: 700px) {
    .shell { padding: 0 12px; }
    .page-heading, .section-heading { align-items: start; flex-direction: column; }
    .panel { padding: 14px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .history-controls label { flex: 1 1 140px; }
    .history-controls select, .history-controls input { width: 100%; min-width: 0; }
    .history-controls button { width: 100%; }
    .inline-form { flex-wrap: wrap; }
    .pagination { flex-wrap: wrap; }
}
