/* Shared by the staff dashboard and the customer page. Colours are tokens; dark mode follows the visitor's system setting. */
:root {
  --bg: #e4e6e1;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --ink: #1c2433;
  --ink-2: #566070;
  --line: #d0d4cd;
  --navy: #263350;
  --teal: #3f7a86;
  --accent: #263350;
  --accent-ink: #ffffff;
  --accent-soft: #d5e4e8;
  --coral: #c9605a;
  --warn: #9a4a07;
  --warn-soft: #fbe9d0;
  --bad: #b3382f;
  --bad-soft: #f8e1de;
  --ok: #1e7a3c;
  --ok-soft: #dcf0e2;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Plus Jakarta Sans", "Nunito", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; padding-inline: 16px; padding-block: 0 56px; }
.wrap { max-width: 880px; margin: 0 auto; padding-top: 28px; display: flex; flex-direction: column; gap: 22px; }
.wrap.narrow { max-width: 560px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; font-family: var(--font-head); }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--teal); }
h2 { font-size: 21px; font-weight: 700; color: var(--navy); }
h3 { font-size: 17px; font-weight: 700; color: var(--navy); }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.wrap-text { overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* layout helpers (no inline styles, so the strict content-security-policy holds) */
.stack { display: grid; gap: 14px; align-content: start; }
.stack-sm { display: grid; gap: 8px; }
.cluster { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.cols > * { min-width: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 15px; color: var(--ink); }
.field-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }

/* controls */
input[type=text], input[type=email], input[type=password], select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; color: var(--ink); background: #fff; }
textarea { min-height: 64px; resize: vertical; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 18px; font-weight: 700; font-size: 14px; letter-spacing: .03em; text-transform: uppercase; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); text-decoration: underline; text-transform: none; letter-spacing: 0; font-weight: 600; padding-inline: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* staff list */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; display: inline-flex; gap: 7px; align-items: baseline; }
.chip b { font-family: var(--font-mono); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.attn { border-color: var(--warn); color: var(--warn); }
.chip.attn[aria-pressed="true"] { background: var(--warn); color: var(--surface); }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.order { border-top: 1px solid var(--line); }
.order:first-child { border-top: 0; }
.row { width: 100%; text-align: left; background: transparent; border: 0; padding: 14px 16px; display: grid; gap: 10px; }
.row:hover { background: var(--surface-2); }
.row-main { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.row-main .no { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
.row-main .nm { font-weight: 600; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.row-state { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; }
.flag { background: var(--warn-soft); color: var(--warn); padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.pipe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; max-width: 280px; }
.pipe i { height: 6px; border-radius: 2px; background: var(--line); display: block; }
.pipe i.done { background: var(--teal); }
.pipe i.now { background: var(--teal); outline: 2px solid var(--accent-soft); }
.pipe.complete i { background: var(--ok); outline: 0; }
.detail { padding: 4px 16px 18px; display: grid; gap: 18px; background: var(--surface); }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); display: grid; gap: 6px; justify-items: center; }
.empty h3 { color: var(--ink); }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 6px 0; align-items: start; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); margin-top: 6px; justify-self: center; background: var(--surface); }
.tl li.done .dot { background: var(--teal); border-color: var(--teal); }
.tl li.now .dot { border-color: var(--teal); background: var(--accent-soft); }
.tl li.todo { color: var(--ink-2); }
.tl .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); padding-top: 2px; }

/* panels and results */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; background: var(--surface-2); }
.res { padding: 10px 12px; border-radius: 6px; display: grid; gap: 2px; }
.res.ok { background: var(--ok-soft); }
.res.bad { background: var(--bad-soft); }
.res.mid { background: var(--warn-soft); }
.res .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.res .v { font-weight: 600; }
.big-stage { font-size: 24px; font-weight: 800; font-family: var(--font-head); color: var(--navy); }
.notice { padding: 10px 12px; border-radius: 6px; background: var(--bad-soft); color: var(--ink); }
.imp-row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.imp-row:first-child { border-top: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 420px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px; z-index: 9; }
.seg { display: inline-flex; gap: 8px; align-items: center; }

@media (prefers-reduced-motion: no-preference) { .pipe i { transition: background .2s; } }

/* HomeSAFE header bar (like the main website): logo links to the main site. */
.site-header { background: #fff; border-bottom: 1px solid var(--line); margin-inline: -16px; padding: 12px 16px; }
.site-header .in { max-width: 880px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: block; line-height: 0; }
.brand img { display: block; width: 128px; height: auto; }
.site-link { font-size: 14px; font-weight: 600; color: var(--navy); text-decoration: none; border-bottom: 2px solid var(--navy); padding-bottom: 1px; }
.site-link:hover { color: var(--teal); border-color: var(--teal); }
.brand:focus-visible, .site-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.kicker { display: block; width: fit-content; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 8px 14px; margin-bottom: 14px; }
@media (max-width: 420px) { h1 { font-size: 28px; } .brand img { width: 108px; } }
