/* The control plane's pages, in the web app's look (web/src/styles.css): the brand kit's tokens and
   Space Grotesk, a card in the middle of the page. */
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #1b1f26;
  --ink-2: #5a616c;
  --cobalt: #2f52c7;
  --on-cobalt: #ffffff;
  --ground: #f6f5f1;
  --rail: #efede7;
  --card: #ffffff;
  --line: #d8d5cc;
  --danger: #a3302a;
  /* The dashboard's charts: the accent for the series that matters, gray for the context around it. */
  --chart-muted: #8d939c;
  --radius: 8px;
  --sans: "Space Grotesk", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f6f5f1;
    --ink-2: #a9aeb6;
    --cobalt: #4c6fe8;
    --ground: #15181e;
    --rail: #1b1f26;
    --card: #20252d;
    --line: #333944;
    --danger: #f0857d;
    --chart-muted: #7a818c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { display: grid; place-items: center; padding: 16px; }
h1 { font-weight: 600; font-size: 24px; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--ink-2); }

.card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  display: grid;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 22px;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.head { display: grid; gap: 6px; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 500; font-size: 14px; }
label .hint { font-weight: 400; color: var(--ink-2); }
input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  min-width: 0;
  width: 100%;
}
textarea { resize: vertical; min-height: 88px; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 400; font-size: 13px; }
button {
  font: inherit;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--cobalt);
  background: var(--cobalt);
  color: var(--on-cobalt);
  cursor: pointer;
}
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

.note { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--rail); }
.note.error { border-color: var(--danger); color: var(--danger); }

/* A field people never see, which only a form-filling bot fills in. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

footer { display: flex; justify-content: center; gap: 18px; padding: 16px; font-size: 13px; color: var(--ink-2); }
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* Staff's pages: the counts dashboard, wider than a card, with its figures, charts and tables. */
body.staff { display: block; }
.staff-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.staff-bar .brand { font-size: 17px; gap: 8px; }
.staff-bar .brand img { width: 26px; height: 26px; }
.staff-bar form { display: block; margin-left: auto; }
button.quiet { background: transparent; color: var(--ink); border-color: var(--line); padding: 6px 12px; }
main.wide { display: grid; place-items: stretch; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.staff-head { display: grid; gap: 8px; }
h2 { font-weight: 600; font-size: 18px; line-height: 1.3; margin: 0; }
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.choice { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; }
.choice[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.company { display: grid; gap: 12px; }
.company-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.reported { font-size: 14px; color: var(--ink-2); }
.reported.late { color: var(--danger); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tile-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tile-value { font-size: 28px; font-weight: 600; line-height: 1.2; }
.tile-detail { font-size: 13px; color: var(--ink-2); }
.block { display: grid; gap: 10px; }

svg .line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; vector-effect: non-scaling-stroke; }
svg .wide-line { stroke-width: 2; }
svg .muted-line { stroke: var(--chart-muted); }
svg .accent-line { stroke: var(--cobalt); }
svg .dot { stroke: var(--card); stroke-width: 2; pointer-events: none; }
svg .muted-dot { fill: var(--chart-muted); }
svg .accent-dot { fill: var(--cobalt); }
svg .hit { fill: transparent; }
svg .hit:hover { fill: var(--rail); }
svg .grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
svg text { fill: var(--ink-2); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
svg .baseline { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; vector-effect: non-scaling-stroke; }
/* A halo in the card's color keeps the baseline's label clear of the lines it crosses. */
svg .baseline-label { fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; }
.spark { display: block; margin: 2px 0; }
.chart-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.chart { display: block; width: 100%; min-width: 720px; height: auto; }
.chart text { font-size: 12px; }
/* Narrower than its 720px, the chart scrolls in its card, and its text grows to stay readable. */
@media (max-width: 800px) { .chart text { font-size: 17px; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.swatch.accent { background: var(--cobalt); }
.swatch.muted-swatch { background: var(--chart-muted); }
.swatch.baseline-swatch { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
thead th { font-weight: 500; color: var(--ink-2); vertical-align: bottom; white-space: normal; min-width: 56px; }
tbody tr:last-child > * { border-bottom: 0; }
th[scope="row"], thead th:first-child, .text { text-align: left; }
td.text { white-space: normal; min-width: 150px; }
th[scope="row"] { font-weight: 500; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
