/* The admin panel: a calm operations console in the AskForIt look (saffron, teal, ink). No script, nothing from anywhere else: the two faces are served from /fonts. Colour pairs are checked in src/components/views.test.tsx. */
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --bg: #f6f3ea;
  --fg: #16130c;
  --muted: #5a5240;
  --line: #8a8266;
  --linesoft: #e3dcc6;
  --panel: #ffffff;
  --sunk: #efe9d8;
  --link: #0b6f6e;
  --btn-bg: #16130c;
  --btn-fg: #fffaeb;
  --ok-bg: #d9f2e1;
  --ok-fg: #0b3d1c;
  --warn-bg: #ffecb3;
  --warn-fg: #4a3500;
  --bad-bg: #fde1df;
  --bad-fg: #6b0f0a;
  --focus: #2f5fd0;
  --sidebg: #16130c;
  --sidefg: #fff6dc;
  --sidemuted: #c9bd9c;
  --accent: #ffd54a;
  --accentfg: #16130c;
  --stagebg: #ffc93c;
  --stagefg: #3b2a00;
  --prodbg: #b3261e;
  --prodfg: #ffffff;
  --teal: #14a09e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e08;
    --fg: #fff6dc;
    --muted: #bdb190;
    --line: #8a8274;
    --linesoft: #342d1b;
    --panel: #1c1810;
    --sunk: #261f12;
    --link: #5fd6d2;
    --btn-bg: #ffd54a;
    --btn-fg: #16130c;
    --ok-bg: #123d23;
    --ok-fg: #c8f1d5;
    --warn-bg: #4a3a0a;
    --warn-fg: #ffe9a8;
    --bad-bg: #5a1a16;
    --bad-fg: #ffd9d6;
    --focus: #8daef7;
    --sidebg: #0a0905;
    --sidefg: #fff6dc;
    --sidemuted: #bdb190;
    --accent: #ffd54a;
    --accentfg: #16130c;
    --stagebg: #ffc93c;
    --stagefg: #3b2a00;
    --prodbg: #e0463d;
    --prodfg: #1a0503;
    --teal: #2bc4c0;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 "Figtree", system-ui, sans-serif; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); color: var(--fg); padding: 0.5rem 1rem; z-index: 30; }
.skip:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* frame: a dark side rail and a content column */
.app { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--sidebg); color: var(--sidefg); display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0.75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0.5rem 0.5rem; font: 700 1.1rem/1 "Bricolage Grotesque", "Figtree", sans-serif; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.brand small { display: block; font: 500 0.7rem/1.2 "Figtree", sans-serif; color: var(--sidemuted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.2rem; }
.side nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 0.7rem; min-height: 2.5rem; padding: 0.4rem 0.75rem; border-radius: 10px; color: var(--sidemuted); text-decoration: none; font-weight: 600; }
.side nav a:hover { background: rgba(255, 246, 220, 0.08); color: var(--sidefg); }
.side nav a[aria-current="page"] { background: var(--accent); color: var(--accentfg); }
.side nav a:focus-visible { outline-color: var(--accent); }
.side nav svg { flex: none; width: 1.15rem; height: 1.15rem; }
.side .count { margin-inline-start: auto; min-width: 1.5rem; padding: 0 0.45rem; border-radius: 999px; text-align: center; font-size: 0.78rem; font-weight: 800; background: var(--accent); color: var(--accentfg); line-height: 1.4rem; }
.side nav a[aria-current="page"] .count { background: var(--accentfg); color: var(--accent); }
.who { margin-top: auto; border-top: 1px solid rgba(255, 246, 220, 0.16); padding: 0.9rem 0.5rem 0; font-size: 0.85rem; color: var(--sidemuted); }
.who strong { display: block; color: var(--sidefg); overflow-wrap: anywhere; font-weight: 600; }
.who form { margin-top: 0.6rem; }
.who button { margin: 0; width: 100%; background: transparent; color: var(--sidefg); box-shadow: inset 0 0 0 1.5px rgba(255, 246, 220, 0.4); }
.who button:hover { background: rgba(255, 246, 220, 0.1); }
.who button:focus-visible { outline-color: var(--accent); }
.content { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 2rem; border-bottom: 1px solid var(--linesoft); background: var(--panel); min-height: 3.4rem; position: sticky; top: 0; z-index: 5; }
.top .crumb { margin: 0; font-weight: 700; color: var(--muted); }
.env { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; }
.env-staging { background: var(--stagebg); color: var(--stagefg); }
.env-production { background: var(--prodbg); color: var(--prodfg); }
.env-local { background: var(--sunk); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.top .env { margin-inline-start: auto; }
main { padding: 1.75rem 2rem 3rem; width: 100%; max-width: 84rem; }
footer { margin-top: auto; padding: 1rem 2rem; color: var(--muted); border-top: 1px solid var(--linesoft); font-size: 0.85rem; }
.app-bare { display: block; }
.app-bare .content { align-items: center; min-height: 100vh; justify-content: center; padding: 1.5rem; }
.app-bare main { max-width: 26rem; padding: 2rem; background: var(--panel); border: 1px solid var(--linesoft); border-radius: 20px; box-shadow: 0 1px 0 var(--linesoft), 0 18px 40px -24px rgba(22, 19, 12, 0.35); }
.app-bare .login-brand { display: flex; align-items: center; gap: 0.6rem; font: 700 1.25rem/1 "Bricolage Grotesque", sans-serif; margin-bottom: 1.25rem; }
.app-bare footer { border: 0; text-align: center; max-width: 26rem; padding-top: 1rem; }

h1 { font: 700 1.75rem/1.15 "Bricolage Grotesque", "Figtree", sans-serif; letter-spacing: -0.015em; margin: 0 0 1.25rem; }
h2 { font: 700 1.1rem/1.3 "Bricolage Grotesque", "Figtree", sans-serif; margin: 2rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 0 0 0.3rem; }
p { margin: 0.5rem 0; }
.lede { color: var(--muted); max-width: 46rem; }
code { background: var(--sunk); padding: 0.05rem 0.35rem; border-radius: 5px; font-size: 0.88em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
ul.plain { margin: 0.25rem 0; padding-inline-start: 1.2rem; }
details { margin-top: 0.5rem; }
summary { cursor: pointer; font-weight: 600; min-height: 1.75rem; }
main > nav ul.plain { padding-inline-start: 0; flex-wrap: wrap; overflow: visible; }
main > nav ul { display: flex; gap: 0.35rem; list-style: none; margin: 0 0 1.25rem; padding: 0 0 0.1rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
main > nav a { display: block; white-space: nowrap; padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none; color: var(--fg); font-weight: 600; box-shadow: inset 0 0 0 1px var(--linesoft); background: var(--panel); min-height: 2.25rem; }
main > nav a:hover { box-shadow: inset 0 0 0 1px var(--line); }
main > nav a[aria-current="page"] { background: var(--btn-bg); color: var(--btn-fg); box-shadow: none; }

/* tables: quiet rows, a sticky header inside the scroll area */
table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--panel); }
.table-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--linesoft); border-radius: 14px; background: var(--panel); margin: 0.5rem 0 1rem; }
.table-wrap table { border-radius: 14px; }
main > table { border: 1px solid var(--linesoft); border-radius: 14px; overflow: hidden; margin: 0.5rem 0 1rem; }
th, td { text-align: start; vertical-align: top; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--linesoft); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { position: sticky; top: 0; background: var(--sunk); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; z-index: 1; white-space: nowrap; }
tbody th { font-weight: 600; }
tbody tr:hover > * { background: color-mix(in srgb, var(--sunk) 55%, var(--panel)); }
caption { text-align: start; font-weight: 700; padding: 0.7rem 0.9rem; background: var(--panel); }
td form { display: inline-block; margin-inline-end: 0.35rem; }
td button { margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--linesoft); border-radius: 16px; padding: 1.1rem 1.25rem; margin: 0.9rem 0; box-shadow: 0 1px 0 var(--linesoft); }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin-top: 0; }

/* status pills: ok is green, warn is saffron, bad is red; the neutral one is a grey chip */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.65rem; border-radius: 999px; font-weight: 700; font-size: 0.8rem; line-height: 1.4rem; white-space: nowrap; }
.badge::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; flex: none; }
.badge-on { background: var(--ok-bg); color: var(--ok-fg); }
.badge-off, .badge-pending { background: var(--warn-bg); color: var(--warn-fg); }
.badge-missing { background: var(--bad-bg); color: var(--bad-fg); }
.badge-none { background: var(--sunk); color: var(--fg); box-shadow: inset 0 0 0 1px var(--linesoft); }

/* messages: the flash after an action reads as a toast bar at the top of the page */
.notice { border-radius: 12px; padding: 0.7rem 1rem; margin: 0.75rem 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--linesoft); border-inline-start: 5px solid var(--line); }
.notice-ok { background: var(--ok-bg); color: var(--ok-fg); border-inline-start-color: var(--ok-fg); box-shadow: none; }
.notice-error { background: var(--bad-bg); color: var(--bad-fg); border-inline-start-color: var(--bad-fg); box-shadow: none; }
.notice a { color: inherit; }
.notice-ok[role="status"], .notice-error[role="alert"] { font-weight: 600; }

/* forms */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-top: 0.8rem; margin-bottom: 0.25rem; }
label:has(> input[type="checkbox"]) { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--btn-bg); flex: none; }
input[type="text"], input[type="time"], input[type="search"], input[type="email"], input[type="date"], input[type="number"], select, textarea { font: inherit; min-height: 2.5rem; padding: 0.4rem 0.7rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); min-width: 12rem; max-width: 100%; }
textarea { width: 100%; max-width: 40rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
button { font: inherit; font-weight: 700; min-height: 2.5rem; padding: 0.4rem 1.1rem; border: 0; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); cursor: pointer; margin-top: 0.8rem; box-shadow: 0 2px 0 var(--teal); }
button:hover { filter: brightness(1.12); }
button:active { transform: translateY(1px); box-shadow: none; }
td button, .who button { box-shadow: none; }
td button { background: var(--panel); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line); min-height: 2.25rem; padding: 0.25rem 0.8rem; font-size: 0.9rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; }
.fields input, .fields select { width: 100%; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 1rem 0; }
dt { color: var(--muted); font-weight: 600; }
dd { margin: 0; }

/* overview: cards and the first-run checklist */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--linesoft); border-radius: 16px; padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; box-shadow: 0 1px 0 var(--linesoft); }
.card h2 { margin: 0; font: 700 0.78rem/1.3 "Figtree", sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.card .big { font: 800 2.1rem/1.1 "Bricolage Grotesque", "Figtree", sans-serif; letter-spacing: -0.02em; margin: 0.2rem 0 0; }
.card .big small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.card p { margin: 0.15rem 0; }
.card .more { margin-top: auto; padding-top: 0.5rem; font-weight: 600; }
.card-warn { border-color: var(--warn-fg); background: var(--warn-bg); color: var(--warn-fg); }
.card-warn h2, .card-warn .big small { color: inherit; }
.card-warn a { color: inherit; }
.card-bad { border-color: var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg); }
.card-bad h2 { color: inherit; }
.card-bad a { color: inherit; }
.bar { display: flex; height: 0.5rem; border-radius: 999px; overflow: hidden; background: var(--sunk); margin: 0.5rem 0; gap: 2px; }
.bar > i { display: block; height: 100%; }
.bar .b-on { background: var(--ok-fg); }
.bar .b-off { background: var(--accent); box-shadow: inset 0 0 0 1px var(--warn-fg); }
.bar .b-miss { background: var(--bad-fg); }
.steps { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--sunk); counter-increment: s; }
.steps li::before { content: counter(s); flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line); }
.steps li.done::before { content: "\2713"; background: var(--ok-bg); color: var(--ok-fg); box-shadow: none; }
.steps li.done .what { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--muted); }
.steps .what { font-weight: 600; flex: 1; }
.steps .state { font-size: 0.8rem; font-weight: 700; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); border: 1.5px dashed var(--linesoft); border-radius: 16px; }
.empty strong { display: block; color: var(--fg); font: 700 1.15rem/1.3 "Bricolage Grotesque", sans-serif; }
.funnel { display: grid; gap: 0.4rem; margin: 0.6rem 0 0; padding: 0; list-style: none; }
.funnel li { display: grid; grid-template-columns: 11rem 1fr 2.5rem; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.funnel .track { height: 0.55rem; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.funnel .track i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.funnel b { text-align: end; }

@media (max-width: 52rem) {
  .app { display: block; }
  .side { position: static; height: auto; flex-direction: column; gap: 0.5rem; padding: 0.6rem 0.75rem; }
  .brand { margin: 0; }
  .side nav ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side nav a { white-space: nowrap; min-height: 2.75rem; gap: 0.45rem; padding: 0.4rem 0.7rem; }
  .who { margin-top: 0; padding: 0.4rem 0 0; display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; border: 0; }
  .who form { margin: 0; flex: none; }
  .who button { width: auto; min-height: 2.75rem; }
  .top { padding: 0.5rem 1rem; position: static; }
  main { padding: 1.25rem 1rem 2.5rem; }
  footer { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .funnel li { grid-template-columns: 7rem 1fr 2rem; }
  dl { grid-template-columns: 1fr; gap: 0.1rem; }
  dd { margin-bottom: 0.6rem; }
  input[type="text"], input[type="time"], input[type="search"], input[type="email"], input[type="date"], input[type="number"], select { min-width: 0; width: 100%; }
}
@media (forced-colors: active) {
  .badge, .env, button, .side .count { border: 1px solid CanvasText; }
  .side nav a[aria-current="page"] { outline: 2px solid Highlight; }
  .bar > i, .funnel .track i { background: Highlight; }
}
@media print { .side, .top { display: none; } .app { display: block; } }
@media (max-width: 52rem) { .table-wrap table { min-width: 36rem; } }

.w-0 { width: 0%; }
.w-1 { width: 10%; }
.w-2 { width: 20%; }
.w-3 { width: 30%; }
.w-4 { width: 40%; }
.w-5 { width: 50%; }
.w-6 { width: 60%; }
.w-7 { width: 70%; }
.w-8 { width: 80%; }
.w-9 { width: 90%; }
.w-10 { width: 100%; }
