/* vfc-dispatch (VFC-1792) - the signed-in pages. A calm neutral palette. No red or green for "good" or
   "bad", no medals: a number is shown against two averages and the leader makes the judgement. */
:root {
  --ground: #F4F3F0; --surface: #FCFCFB; --surface-2: #ECEBE7; --ink: #1F2328; --ink-2: #4B5058;
  --mute: #7A7F87; --rule: #DEDCD6; --accent: #3F5B73; --accent-2: #2E4558; --note-bg: #ECEFF3;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #4a3aa7;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Public Sans', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #141413; --surface: #1a1a19; --surface-2: #242422; --ink: #F2F1EC; --ink-2: #C3C2B7;
    --mute: #93928A; --rule: #34342F; --accent: #9DB7CD; --accent-2: #BFD1E0; --note-bg: #232A31;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #141413; --surface: #1a1a19; --surface-2: #242422; --ink: #F2F1EC; --ink-2: #C3C2B7;
  --mute: #93928A; --rule: #34342F; --accent: #9DB7CD; --accent-2: #BFD1E0; --note-bg: #232A31;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--mute); }
.mono { font-family: var(--mono); font-size: 12.5px; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--rule); background: var(--surface); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.crest { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--mute); }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.tab.active { background: var(--surface-2); color: var(--ink); }
.tab:hover { text-decoration: none; background: var(--surface-2); }
.tools { display: flex; align-items: center; gap: 10px; }
.whoami { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

button, select, input { font: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid transparent; font-weight: 600; }
.btn-primary { background: var(--accent); color: var(--surface); padding: 10px 16px; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--surface); border-color: var(--rule); color: var(--ink); padding: 6px 12px; font-size: 12.5px; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent); }
select, input[type="date"] { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; }

.view { max-width: 1280px; margin: 0 auto; padding: 24px; }
.state { max-width: 560px; margin: 64px auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 28px; }
.state h1 { margin-top: 0; font-size: 20px; }
.notice { background: var(--note-bg); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); font-weight: 600; }
.heading { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.heading h1 { font-size: 22px; margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; }
.tile .label { font-size: 12px; color: var(--mute); font-weight: 600; }
.tile .value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.tile .sub { font-size: 12px; color: var(--ink-2); }
.nodata { color: var(--mute); font-style: italic; font-weight: 400; }
.tile .value.nodata { font-size: 15px; padding-top: 8px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
table.grid { border-collapse: collapse; width: 100%; }
table.grid th, table.grid td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
table.grid th:first-child, table.grid td:first-child { text-align: left; }
table.grid thead th { font-size: 12px; color: var(--mute); font-weight: 600; background: var(--surface); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tfoot td { font-weight: 600; background: var(--surface-2); }
td .num { font-variant-numeric: tabular-nums; font-weight: 600; }
td .marks { display: block; font-size: 11px; color: var(--mute); }
td.due { background: var(--surface-2); }
.legend-line { font-size: 12px; color: var(--mute); margin: 8px 2px 18px; }
.sources { font-size: 12px; color: var(--ink-2); margin-top: 14px; }
.sources span { margin-right: 14px; }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.chart { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; position: relative; }
.chart h2 { font-size: 14px; margin: 0 0 6px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--mute); font-size: 10px; }
.chart .gridline { stroke: var(--rule); stroke-width: 1; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 14px; }
.legend .sw { display: inline-block; width: 16px; height: 0; border-top-width: 2px; border-top-style: solid; vertical-align: middle; margin-right: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12); white-space: nowrap; z-index: 3; }
.tip .k { color: var(--mute); }
details.tableview { margin-top: 6px; font-size: 12px; }
details.tableview summary { cursor: pointer; color: var(--accent); }
details.tableview table.grid th, details.tableview table.grid td { padding: 4px 8px; }
