/* NHC Digitisation Unit — design tokens and shared chrome.
   "Technical paper" light interface. Tokens mirror docs/dashboard-mockup.html. */

:root {
  --ink: #15191F;
  --paper: #F6F7F9;
  --surface: #FFFFFF;
  --slate: #59616E;
  --line: #E4E7EC;
  --ahead: #0E8C76;
  --ahead-deep: #0B6F5C;
  --behind: #C8742A;
  --accent: #1A5FB4;
  --accent-deep: #134A8E;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* identity keyline */
body::before { content: ""; display: block; height: 3px; background: var(--accent); }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

a { color: var(--accent-deep); }

/* topbar */
.topbar {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 16px; gap: 16px; flex-wrap: wrap;
}
.mark { display: flex; align-items: baseline; gap: 10px; }
.mark .nhc { font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: .02em; color: var(--accent-deep); }
.mark .unit { font-size: 13px; color: var(--slate); font-weight: 500; }
.topbar .who { font-family: var(--mono); font-size: 13px; color: var(--slate); display: flex; align-items: center; gap: 14px; }
.topbar .who b { color: var(--ink); font-weight: 600; }
a.mark { text-decoration: none; }

/* primary navigation */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.navlink {
  font-size: 14px; font-weight: 500; color: var(--slate); text-decoration: none;
  padding: 7px 12px; border-radius: 8px; line-height: 1; white-space: nowrap;
}
.navlink:hover { color: var(--ink); background: rgba(21, 25, 31, .05); }
.navlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.navlink.is-active { color: var(--accent-deep); background: rgba(26, 95, 180, .10); font-weight: 600; }

/* flash messages */
.flash { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 14px; border: 1px solid var(--line); }
.flash-success { background: rgba(14, 140, 118, .10); border-color: rgba(14, 140, 118, .35); color: #0b6b59; }
.flash-error { background: rgba(178, 58, 46, .08); border-color: rgba(178, 58, 46, .35); color: #9a2f24; }

/* settings form */
.settings-form { margin-top: 6px; }
.field-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row label { font-weight: 600; font-size: 14px; }
.field-row input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; max-width: 280px; }
.field-help { font-size: 12.5px; color: var(--slate); }
.field-error { font-size: 12.5px; color: #9a2f24; font-weight: 500; }
.settings-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

/* pace summary tiles (used on the analysis page, outside .report scope) */
.panel .progress-line { display: flex; gap: 30px; flex-wrap: wrap; }
.panel .progress-line .m { display: flex; flex-direction: column; gap: 3px; }
.panel .progress-line .m .v { font-family: var(--mono); font-weight: 700; font-size: 24px; line-height: 1.05; }
.panel .progress-line .m .k { font-size: 11px; color: var(--slate); text-transform: uppercase; letter-spacing: .06em; }

/* analysis: verdict banner + status badges */
.verdict { border-left: 4px solid var(--line); }
.verdict h2 { margin-top: 0; }
.verdict p { margin: 8px 0 0; line-height: 1.5; }
.verdict-ok { border-left-color: var(--accent, #0e8c76); }
.verdict-warn { border-left-color: #c9772a; background: rgba(201, 119, 42, .05); }
.verdict-names { color: var(--ink); }
.status { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status-behind { background: rgba(178, 58, 46, .12); color: #9a2f24; }
.status-ahead { background: rgba(14, 140, 118, .14); color: #0b6b59; }
.status-on_track { background: rgba(26, 95, 180, .10); color: var(--accent-deep); }
.status-gap { display: inline-block; margin-left: 8px; font-size: 12px; color: #9a2f24; }
.analysis-table td, .analysis-table th { white-space: nowrap; }
.cell-sub { color: var(--slate); font-weight: 400; font-size: 12px; }

/* live auto-update badge */
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--slate); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #0e8c76); box-shadow: 0 0 0 0 rgba(14,140,118,.5); animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(14,140,118,.5); } 70% { box-shadow: 0 0 0 7px rgba(14,140,118,0); } 100% { box-shadow: 0 0 0 0 rgba(14,140,118,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* reports: person select + period presets */
.report-controls select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.report-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 20px; }
.report-presets .presets-label { font-size: 13px; color: var(--slate); }
.chip { font-size: 13px; text-decoration: none; color: var(--accent-deep); background: rgba(26, 95, 180, .08); padding: 5px 12px; border-radius: 999px; border: 1px solid transparent; }
.chip:hover { border-color: rgba(26, 95, 180, .30); }

/* scanning roster editor + reassigned markers */
.roster { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
.roster th, .roster td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.roster th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); font-weight: 600; }
.roster th.ac, .roster td.ac { text-align: center; width: 120px; }
.roster td input[type="text"] { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.roster input[type="checkbox"] { width: 18px; height: 18px; }
.reassigned-list { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; }
.reassigned-tag { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; color: #9a2f24; background: rgba(178, 58, 46, .10); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* clerk-facing 'you're behind' banner (persists until the deficit clears) */
.behind-banner { display: flex; align-items: flex-start; gap: 14px; margin: 8px 0 20px; padding: 14px 16px; border-radius: 12px; background: rgba(201, 119, 42, .09); border: 1px solid rgba(201, 119, 42, .35); }
.behind-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #c9772a; color: #fff; font-weight: 800; font-family: var(--display); display: flex; align-items: center; justify-content: center; line-height: 1; }
.behind-copy { display: flex; flex-direction: column; gap: 3px; }
.behind-copy > b { color: #8a4f16; font-size: 15px; }
.behind-copy span { color: var(--ink); font-size: 13.5px; line-height: 1.5; }

/* clerk-facing 'daily target met — keep pushing' banner (shows ~5 minutes) */
.celebrate-banner { display: flex; align-items: center; gap: 14px; margin: 8px 0 20px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(100deg, rgba(14,140,118,.14), rgba(26,95,180,.10)); border: 1px solid rgba(14,140,118,.35); }
.celebrate-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent, #0e8c76); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
.celebrate-copy { display: flex; flex-direction: column; gap: 2px; }
.celebrate-copy > b { color: #0b6b59; font-size: 15px; }
.celebrate-copy span { color: var(--ink); font-size: 13.5px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 600; color: var(--slate); }

/* role chip */
.role-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(26, 95, 180, .10); color: var(--accent-deep);
}
.role-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* weekly recognition */
.award-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(100deg, rgba(14,140,118,.12), rgba(26,95,180,.10));
  border: 1px solid rgba(14,140,118,.30); border-radius: 14px;
  padding: 14px 16px; margin: 8px 0 22px;
}
.award-banner .medal { font-size: 26px; color: var(--ahead-deep); line-height: 1; }
.award-copy { display: flex; flex-direction: column; gap: 2px; }
.award-copy b { font-size: 15px; }
.award-sub { font-size: 12.5px; color: var(--slate); }
.award-x { margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1; color: var(--slate); padding: 4px 8px; border-radius: 8px; }
.award-x:hover { color: var(--ink); }
.badge-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(201,168,76,.16); color: #8A6D1F;
}

/* cards / panels */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 24px;
}
.panel h2 { font-family: var(--body); font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.panel .sub { font-size: 12.5px; color: var(--slate); margin-bottom: 16px; }

.actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.action {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  background: var(--surface); transition: border-color 120ms ease, box-shadow 120ms ease;
}
.action:hover { border-color: var(--accent); box-shadow: 0 8px 22px -18px rgba(21, 25, 31, .5); }
.action .t { font-weight: 700; font-size: 15px; }
.action .d { font-size: 12.5px; color: var(--slate); margin-top: 4px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--slate); }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; font-family: var(--body); font-size: 15px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26, 95, 180, .15); }
.form-error { color: var(--behind); font-size: 13px; margin-bottom: 14px; }

/* password show/hide toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--slate); cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

/* login */
.login-shell { min-height: calc(100vh - 3px); display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.login-card .brand .nhc { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--accent-deep); }
.login-card h1 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 18px 0 4px; }
.login-card .lede { color: var(--slate); font-size: 13.5px; margin: 0 0 22px; }

footer.foot {
  max-width: var(--maxw); margin: 34px auto 0; padding: 0 24px 28px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 11.5px; color: var(--slate); font-family: var(--mono);
}

/* accessibility floor */
a:focus-visible, button:focus-visible, input:focus-visible, .action:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .action { transition: none; }
}

@media (max-width: 540px) {
  .topbar { padding: 14px 18px; }
  .wrap { padding: 0 18px 48px; }
}
