/* ══════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — shared with Wave Planner (wave-planner/src/index.css).
   Tokens and component names are copied from there so both apps look and
   behave the same. Change a token here only if it changes there too.
     1. Tokens   2. Base   3. Chrome   4. Surfaces   5. Controls   6. Data
     7. Pages    8. Responsive   9. Print
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ────────────────────────────────────────────────────────────── */
:root {
  --font-sans: "Nunito Sans", "Segoe UI", "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
  --font-display: "Poppins", "Nunito Sans", "Segoe UI", Arial, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Segoe UI Mono", monospace;

  /* Brand */
  --evri-blue: #0072ce;
  --evri-blue-dark: #005ca8;
  --evri-blue-deep: #004886;
  --evri-blue-bright: #009fe3;
  --evri-navy: #000d4e;
  --evri-navy-light: #0d2170;
  --evri-gold: #fbc55b;
  --evri-gold-dark: #e0a62f;

  /* Neutrals */
  --evri-ink: #0e2340;
  --evri-ink-soft: #33475d;
  --evri-ink-mute: #4a5f76;
  --evri-muted: #5b7189;
  --evri-faint: #5e7287;
  --evri-line: #dce5ee;
  --evri-line-soft: #edf2f7;
  --evri-line-strong: #c3d1df;
  --evri-bg: #f1f5f9;
  --evri-surface: #ffffff;
  --evri-surface-soft: #fbfdff;
  --evri-stripe: #f8fbfe;
  --evri-tint: #eaf4fc;
  --evri-hover: #f2f7fc;

  /* Status */
  --evri-ok: #0b8151;
  --evri-ok-soft: #e8f8f0;
  --evri-ok-line: #99dfbc;
  --evri-warn: #96620f;
  --evri-warn-soft: #fff7e6;
  --evri-warn-line: #ffdc93;
  --evri-alert: #b31d30;
  --evri-alert-soft: #fdedee;
  --evri-alert-line: #f6b1b8;

  /* Type */
  --fs-2xs: 10px; --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px;
  --fs-lg: 15px; --fs-xl: 17px; --fs-2xl: 20px; --fs-3xl: 26px; --fs-4xl: 30px;
  --track-label: 0.05em; --track-caps: 0.09em; --track-display: -0.02em;

  /* Shape */
  --r-xs: 4px; --r-sm: 7px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px; --r-2xl: 14px; --r-pill: 999px;

  /* Elevation & motion */
  --evri-shadow: 0 1px 2px rgba(14, 35, 64, 0.06), 0 1px 3px rgba(14, 35, 64, 0.04);
  --evri-shadow-lg: 0 12px 32px rgba(14, 35, 64, 0.12);
  --evri-ring: 0 0 0 2px var(--evri-blue);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms; --t-base: 180ms;

  /* Layout */
  --topbar-h: 62px; --rail-w: 52px; --rail-w-open: 224px; --control-h: 38px;
}

/* ── 2. Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--evri-bg); color: var(--evri-ink);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; color: var(--evri-ink); margin: 0; }
p { margin: 0; }
a { color: var(--evri-blue); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
button, select, summary { cursor: pointer; }
button { font: inherit; background: none; border: 0; color: inherit; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--evri-blue-bright); outline-offset: 2px; border-radius: var(--r-xs); }
.evri-topbar :focus-visible { outline-color: #fff; }
::selection { background: var(--evri-tint); color: var(--evri-ink); }
.muted { color: var(--evri-muted); }
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.evri-sidebar, .du-table-wrap { scrollbar-width: thin; scrollbar-color: var(--evri-line-strong) transparent; }

/* ── 3. Chrome: application bar ───────────────────────────────────────────── */
.evri-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 20px;
  background: var(--evri-blue); color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.evri-topbar .spacer { flex: 1 1 auto; }
.evri-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.evri-brand-divider { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.35); flex-shrink: 0; }
.evri-brand-titles { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.15; }
.evri-brand-step { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); color: #fff; white-space: nowrap; }
.evri-brand-note { font-size: var(--fs-xs); line-height: 1.3; font-weight: 600; color: rgba(255, 255, 255, 0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evri-home-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h); padding: 0; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r-pill); color: #fff;
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.evri-home-btn:hover { background: rgba(255, 255, 255, 0.26); border-color: rgba(255, 255, 255, 0.6); text-decoration: none; }
.evri-home-btn .home-ico { display: inline-flex; }
.evri-topbar-field {
  display: flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 12px; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.depot-pick select {
  appearance: none; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding-right: 14px; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: right 5px center, right 0 center; background-size: 5px 5px; background-repeat: no-repeat;
}
.depot-pick select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 2px; }
.depot-pick option { color: #111; }
a.evri-topbar-field:hover { background: rgba(255, 255, 255, 0.26); text-decoration: none; }
.evri-topbar-field .role { font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-caps); text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.evri-topbar-views { display: flex; gap: 2px; height: var(--control-h); padding: 3px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--r-md); }
.evri-topbar-views a { display: flex; align-items: center; padding: 0 12px; border-radius: calc(var(--r-md) - 3px); color: #fff; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.evri-topbar-views a:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.evri-topbar-views a.active { background: #fff; color: var(--evri-blue); }
.evri-topbar-views.shift-toggle a.night.active { background: #fff; color: var(--evri-navy); }
.period-pick { position: relative; display: flex; }
.period-pick summary { display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: calc(var(--r-md) - 3px); color: #fff; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; cursor: pointer; list-style: none; }
.period-pick summary::-webkit-details-marker { display: none; }
.period-pick summary:hover { background: rgba(255, 255, 255, 0.2); }
.period-pick.active summary { background: #fff; color: var(--evri-blue); }
.period-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; display: grid; gap: 10px; min-width: 220px; padding: 14px;
  background: var(--evri-surface); color: var(--evri-ink); border: 1px solid var(--evri-line); border-radius: var(--r-md); box-shadow: var(--evri-shadow-lg);
}
.period-pop label { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 700; }
.period-pop input[type=date] { height: var(--control-h); padding: 0 8px; border: 1px solid var(--evri-line); border-radius: var(--r-md); font: inherit; font-weight: 400; }

/* ── 3. Chrome: workspace and the icon rail ───────────────────────────────── */
.evri-shell {
  display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: 14px;
  max-width: 1900px; margin: 0 auto; padding: 16px 22px 56px;
}
.evri-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.evri-sidebar {
  position: sticky; top: calc(var(--topbar-h) + 10px); align-self: start; z-index: 40;
  width: var(--rail-w); max-height: calc(100vh - var(--topbar-h) - 26px); overflow: hidden;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--evri-surface); border: 1px solid var(--evri-line); border-radius: var(--r-xl);
  box-shadow: var(--evri-shadow);
  transition: width var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.evri-sidebar:hover, .evri-sidebar:focus-within { width: var(--rail-w-open); overflow-y: auto; box-shadow: var(--evri-shadow-lg); }
.evri-side-item {
  display: flex; align-items: center; gap: 12px; width: 210px; height: 38px; flex-shrink: 0;
  padding: 0 10px; border-radius: var(--r-md); text-align: left;
  font-size: var(--fs-base); font-weight: 600; line-height: 1; color: var(--evri-ink-mute);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.evri-side-item:hover { background: var(--evri-hover); color: var(--evri-blue-dark); text-decoration: none; }
.evri-side-item[aria-current] { background: var(--evri-tint); color: var(--evri-blue-deep); font-weight: 700; box-shadow: inset 3px 0 0 var(--evri-blue); }
.evri-side-item[aria-current] .ico { color: var(--evri-blue); }
.evri-side-item .ico { flex-shrink: 0; width: 18px; height: 18px; }
.evri-side-item .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; transition: opacity var(--t-fast) var(--ease); }
.evri-side-label {
  display: flex; align-items: flex-end; height: 30px; flex-shrink: 0; padding: 0 10px 6px;
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--evri-faint); white-space: nowrap;
}
.evri-sidebar:not(:hover):not(:focus-within) .label { opacity: 0; }
.evri-sidebar:not(:hover):not(:focus-within) .evri-side-item { padding-left: 11px; padding-right: 0; }
.evri-sidebar:not(:hover):not(:focus-within) .evri-side-label { align-items: center; padding: 0 8px; font-size: 0; color: transparent; }
.evri-sidebar:not(:hover):not(:focus-within) .evri-side-label::before { content: ""; display: block; width: 100%; height: 1px; background: var(--evri-line); }
.evri-sidebar:not(:hover):not(:focus-within) > .evri-side-label:first-child::before { background: none; }

/* ── 4. Surfaces: hero, metrics, cards, pills, notices ────────────────────── */
.evri-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  padding: 18px 24px; border-radius: var(--r-2xl); color: #fff; background: var(--evri-navy);
}
.evri-hero h1 { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: var(--track-display); line-height: 1.1; color: var(--evri-gold); }
.evri-hero p { margin-top: 7px; font-size: var(--fs-base); font-weight: 600; line-height: 1.5; color: rgba(255, 255, 255, 0.82); }
.evri-hero-status {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 5px 12px 5px 10px;
  border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: var(--fs-sm); font-weight: 700; color: #fff;
}
.evri-hero-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); }
.evri-hero-status.ok::before { background: #5cc994; }
.evri-hero-status.warn::before { background: var(--evri-gold); }
.evri-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.evri-hero-tag { min-width: 110px; padding: 8px 13px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); }
.evri-hero-tag strong { display: block; font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.evri-hero-tag span { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: rgba(255, 255, 255, 0.68); }
.evri-hero-tag.warn strong { color: var(--evri-gold); }

/* KPI figures strip (Wave Planner's plan-metrics) */
.plan-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: stretch;
  background: var(--evri-surface); border: 1px solid var(--evri-line); border-radius: var(--r-xl); box-shadow: var(--evri-shadow);
}
.plan-metric { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; min-width: 0; border-left: 1px solid var(--evri-line-soft); }
.plan-metric:first-child { border-left: 0; }
.plan-metric .label { font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--evri-muted); }
.plan-metric strong { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; line-height: 1.25; color: var(--evri-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-metric small { font-size: var(--fs-xs); font-weight: 600; color: var(--evri-muted); }
.plan-metric.warn strong { color: var(--evri-alert); }
.plan-metric.ok strong { color: var(--evri-ok); }
.plan-metric.amber strong { color: var(--evri-warn); }

.evri-card { background: var(--evri-surface); border: 1px solid var(--evri-line); border-radius: var(--r-2xl); box-shadow: var(--evri-shadow); min-width: 0; }
.evri-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--evri-surface-soft);
  border-bottom: 1px solid var(--evri-line); border-radius: var(--r-2xl) var(--r-2xl) 0 0;
}
.evri-card-head .titles { display: flex; align-items: center; gap: 12px; min-width: 0; }
.evri-card-head h2, .evri-card-head h3 { font-size: var(--fs-xl); font-weight: 700; }
.evri-card-head p { margin-top: 3px; font-size: var(--fs-sm); font-weight: 600; color: var(--evri-muted); }
.evri-card-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-lg); background: var(--evri-tint); color: var(--evri-blue); }
.evri-card-icon.navy { background: var(--evri-navy); color: #fff; }
.evri-card-icon.alert { background: var(--evri-alert-soft); color: var(--evri-alert); }
.evri-card-body { padding: 16px 20px; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 440px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.evri-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border: 1px solid var(--evri-line); border-radius: var(--r-pill);
  background: var(--evri-surface); color: var(--evri-ink); font-size: var(--fs-sm); font-weight: 700;
}
.evri-pill.sm { padding: 2px 9px; font-size: var(--fs-2xs); letter-spacing: var(--track-label); text-transform: uppercase; }
.count-pill { margin-left: 6px; padding: 2px 9px; border-radius: var(--r-pill); vertical-align: middle; background: var(--evri-tint); color: var(--evri-blue); font-size: var(--fs-base); font-weight: 700; }
.issue-label {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--evri-alert-soft); color: var(--evri-alert);
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-label); text-transform: uppercase; white-space: nowrap;
}
.issue-label.warning { background: var(--evri-warn-soft); color: var(--evri-warn); }
.issue-label.ok { background: var(--evri-ok-soft); color: var(--evri-ok); }
.issue-label.info { background: var(--evri-tint); color: var(--evri-blue-dark); }

.notice {
  padding: 14px 18px; border: 1px solid #a8d1f2; border-left: 4px solid var(--evri-blue); border-radius: var(--r-lg);
  background: var(--evri-tint); color: var(--evri-blue-deep); font-size: var(--fs-base); font-weight: 600; line-height: 1.6;
}
.notice.error { background: var(--evri-alert-soft); border-color: var(--evri-alert-line); border-left-color: var(--evri-alert); color: var(--evri-alert); }
.notice.warn { background: var(--evri-warn-soft); border-color: var(--evri-warn-line); border-left-color: var(--evri-gold-dark); color: var(--evri-warn); }
.notice.ok { background: var(--evri-ok-soft); border-color: var(--evri-ok-line); border-left-color: var(--evri-ok); color: var(--evri-ok); }
.notice ul { margin: 0; padding-left: 18px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; color: var(--evri-muted); }
.empty-state-title { font-size: var(--fs-md); font-weight: 700; color: var(--evri-ink); }
.empty-state-text { font-size: var(--fs-sm); font-weight: 600; }

/* ── 5. Controls ──────────────────────────────────────────────────────────── */
.evri-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-md);
  font-family: var(--font-display); font-size: var(--fs-base); font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.evri-btn:hover { text-decoration: none; }
.evri-btn:active:not(:disabled) { transform: translateY(1px); }
.evri-btn-primary { background: var(--evri-blue); border-color: var(--evri-blue); color: #fff; }
.evri-btn-primary:hover:not(:disabled) { background: var(--evri-blue-dark); border-color: var(--evri-blue-dark); }
.evri-btn-ghost { background: var(--evri-surface); border-color: var(--evri-line); color: var(--evri-ink); }
.evri-btn-ghost:hover:not(:disabled) { background: var(--evri-tint); border-color: #a8d1f2; color: var(--evri-blue-dark); }
.evri-btn-danger { background: var(--evri-surface); border-color: var(--evri-alert-line); color: var(--evri-alert); }
.evri-btn-danger:hover:not(:disabled) { background: var(--evri-alert-soft); }
.evri-btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }

.field-label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--evri-ink-mute); }
.field-label input, .field-label select, .search-input, .inline-input {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 11px;
  background-color: var(--evri-surface); border: 1px solid var(--evri-line); border-radius: var(--r-md);
  color: var(--evri-ink); font-weight: 600;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.inline-input { width: auto; height: 32px; }
.field-label input:focus, .field-label select:focus, .search-input:focus, .inline-input:focus { border-color: var(--evri-blue); box-shadow: var(--evri-ring); outline: none; }
.field-help { font-size: var(--fs-xs); font-weight: 600; line-height: 1.65; color: var(--evri-muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; align-items: end; }

.evri-segmented { display: inline-flex; overflow: hidden; border: 1px solid var(--evri-line); border-radius: var(--r-md); background: var(--evri-surface); }
.evri-segmented a {
  padding: 8px 14px; font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600;
  color: var(--evri-ink-mute); background: var(--evri-surface-soft);
}
.evri-segmented a + a { border-left: 1px solid var(--evri-line); }
.evri-segmented a:hover:not(.active) { background: var(--evri-tint); color: var(--evri-blue-dark); text-decoration: none; }
.evri-segmented a.active { background: var(--evri-blue); color: #fff; }
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── 6. Data: tables ──────────────────────────────────────────────────────── */
.du-table-wrap { overflow: auto; max-height: 620px; background: var(--evri-surface); }
.evri-card > .du-table-wrap { border-radius: 0 0 var(--r-2xl) var(--r-2xl); }
.du-table { width: 100%; border-collapse: collapse; }
.du-table thead th {
  position: sticky; top: 0; z-index: 2; padding: 6px 10px; text-align: left; white-space: nowrap;
  background: var(--evri-navy); color: #fff; font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600;
}
.du-table thead th.n { text-align: right; }
.du-table thead th, .du-table tbody td { vertical-align: middle; }
.du-table tbody td { height: 36px; padding: 4px 10px; border-bottom: 1px solid var(--evri-line-soft); font-size: var(--fs-sm); line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.du-table tbody tr:nth-child(even) { background: var(--evri-stripe); }
.du-table tbody tr { transition: background var(--t-fast) var(--ease); }
.du-table tbody tr:hover { background: var(--evri-tint); }
.du-table td.strong { font-weight: 700; }
.du-table .empty td { text-align: center; padding: 18px; color: var(--evri-muted); font-weight: 600; }
.cands { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.cands li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cands .t { font-size: var(--fs-sm); font-weight: 700; color: var(--evri-muted); font-variant-numeric: tabular-nums; }
.cands .p { font-size: var(--fs-xs); color: var(--evri-faint); }
details.table-view { border-top: 1px solid var(--evri-line); }
details.table-view summary { padding: 10px 20px; font-size: var(--fs-xs); font-weight: 700; color: var(--evri-blue); }

/* ── 7. Pages ─────────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--evri-bg); }
.auth-card { width: min(400px, 100%); overflow: hidden; }
.auth-card .evri-modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: var(--evri-navy); color: #fff; }
.auth-card .evri-modal-head h1 { font-size: var(--fs-xl); color: var(--evri-gold); }
.auth-card .evri-modal-head p { font-size: var(--fs-sm); font-weight: 600; color: rgba(255, 255, 255, 0.72); }
.auth-card form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px; text-align: center;
  border: 2px dashed var(--evri-line-strong); border-radius: var(--r-xl); background: var(--evri-surface-soft);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone.drag { border-color: var(--evri-blue); background: var(--evri-tint); }
.dropzone strong { font-family: var(--font-display); font-size: var(--fs-lg); }
.dropzone .files { font-size: var(--fs-sm); font-weight: 700; color: var(--evri-blue-dark); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Shifts: Twilight reads blue, Nights navy, as in Wave Planner's processing plan */
.shift-pill {
  display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); vertical-align: middle; white-space: nowrap;
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-label); text-transform: uppercase;
}
.shift-pill.twilight { background: var(--evri-tint); color: var(--evri-blue-dark); box-shadow: inset 0 0 0 1px #a8d1f2; }
.shift-pill.night { background: var(--evri-navy); color: #fff; }
.cands .shift-pill { margin-left: 2px; }

.shift-toggle a { display: inline-flex; align-items: center; gap: 5px; }
.shift-toggle a.night.active { background: var(--evri-navy); }

.shift-hint { margin: 0 0 -4px; color: var(--evri-ink-soft); font-size: var(--fs-sm); }
.shift-panels { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.shift-panel {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg);
  color: #fff; text-decoration: none; outline: 3px solid transparent; outline-offset: 2px;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), outline-color var(--t-fast) var(--ease);
}
.shift-panel:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(14, 35, 64, 0.16); }
.shift-panel.twilight { background: var(--evri-blue); }
.shift-panel.night { background: var(--evri-navy); }
.shift-panel.all { background: var(--evri-surface); color: var(--evri-ink); border: 1px solid var(--evri-line); box-shadow: var(--evri-shadow); }
.shift-panel.active { outline-color: var(--evri-gold); }
.shift-panel-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: var(--fs-base); font-weight: 700;
  letter-spacing: var(--track-label); text-transform: uppercase; color: rgba(255, 255, 255, 0.88);
}
.shift-panel.all .shift-panel-head { color: var(--evri-ink-soft); }
.shift-panel-head .hours { padding: 1px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.14); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.shift-panel-head .showing { margin-left: auto; padding: 1px 8px; border-radius: var(--r-pill); background: var(--evri-gold); color: var(--evri-navy); font-size: var(--fs-2xs); }
.shift-fields { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.shift-field { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-width: 0; padding: 5px 10px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); }
.shift-panel.all .shift-field { background: var(--evri-stripe); border-color: var(--evri-line-soft); }
.shift-field > span { display: block; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: rgba(255, 255, 255, 0.68); line-height: 1.25; overflow-wrap: anywhere; }
.shift-panel.all .shift-field > span { color: var(--evri-muted); }
.shift-field strong { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-field .dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; }
.shift-field .dot.ok { background: #5cc994; }
.shift-field .dot.amber { background: var(--evri-gold); }
.shift-field .dot.warn { background: #ff8a95; }
.shift-panel.all .dot.ok { background: var(--evri-ok); }
.shift-panel.all .dot.amber { background: var(--evri-gold-dark); }
.shift-panel.all .dot.warn { background: var(--evri-alert); }

/* Config: shift times (Wave Planner's processing plan shift panels) */
.shift-row { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .shift-row { grid-template-columns: auto auto minmax(0, 1fr); } }
.proc-shift { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 14px; border-radius: var(--r-lg); color: #fff; }
.proc-shift.twilight { background: var(--evri-blue); }
.proc-shift.night { background: var(--evri-navy); }
.proc-shift-head {
  display: flex; align-items: center; gap: 8px; min-width: 92px;
  font-family: var(--font-display); font-size: var(--fs-base); font-weight: 700;
  letter-spacing: var(--track-label); text-transform: uppercase; color: rgba(255, 255, 255, 0.88);
}
.proc-fields { display: flex; gap: 8px; }
.proc-field {
  width: 96px; padding: 4px 10px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28);
  transition: background var(--t-fast) var(--ease);
}
.proc-field:hover, .proc-field:focus-within { background: rgba(255, 255, 255, 0.22); }
.proc-field:has(input[aria-invalid]) { border-color: var(--evri-gold); box-shadow: 0 0 0 1px var(--evri-gold); }
.proc-field > span { display: block; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: rgba(255, 255, 255, 0.65); }
.proc-field input {
  width: 100%; height: auto; padding: 0; background: transparent; border: 0; outline: none; box-shadow: none; color: #fff;
  font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums;
}
.proc-field input:disabled { opacity: 0.85; cursor: default; }
.shift-note { margin: 0; }
.shift-save-status { font-size: var(--fs-sm); font-weight: 700; color: var(--evri-muted); }
.shift-save-status.ok { color: var(--evri-ok); }
.shift-save-status.error { color: var(--evri-alert); }
@media (max-width: 480px) { .proc-shift { flex-wrap: wrap; } }

/* Timeline & Map: DU x hour heat map of issues */
.tl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tl-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evri-segmented button {
  padding: 8px 14px; border: 0; font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600;
  color: var(--evri-ink-mute); background: var(--evri-surface-soft);
}
.evri-segmented button + button { border-left: 1px solid var(--evri-line); }
.evri-segmented button:hover:not(.active) { background: var(--evri-tint); color: var(--evri-blue-dark); }
.evri-segmented button.active { background: var(--evri-blue); color: #fff; }
.tl-wrap { overflow: auto; max-height: 640px; padding: 0 12px 4px; }
.tl-map { border-collapse: separate; border-spacing: 2px; width: 100%; font-variant-numeric: tabular-nums; }
.tl-map button { font: inherit; border: 0; background: none; padding: 0; color: inherit; }
.tl-map thead th { position: sticky; top: 0; z-index: 2; background: var(--evri-surface); padding: 6px 0 4px; }
.tl-map thead th button, .tl-map th.du button {
  font-size: var(--fs-2xs); font-weight: 800; color: var(--evri-muted); border-radius: var(--r-xs); padding: 2px 4px;
}
.tl-map th.du { position: sticky; left: 0; z-index: 1; background: var(--evri-surface); text-align: left; padding-right: 8px; white-space: nowrap; }
.tl-map thead th.du { z-index: 3; font-size: var(--fs-2xs); font-weight: 800; color: var(--evri-muted); text-transform: uppercase; letter-spacing: var(--track-caps); }
.tl-map th.du button { font-size: var(--fs-sm); font-weight: 700; color: var(--evri-ink); text-align: left; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tl-map th button:hover, .tl-map th button.on { background: var(--evri-navy); color: #fff; }
.tl-map td { padding: 0; }
.tl-map .c {
  width: 100%; min-width: 28px; height: 28px; border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: 800;
  color: var(--evri-alert); background: color-mix(in srgb, var(--evri-alert) calc(var(--a) * 100%), var(--evri-surface));
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tl-map .c.hi { color: #fff; }
.tl-map .c.z { background: var(--evri-stripe); cursor: default; }
.tl-map .c:not(.z):hover { transform: scale(1.12); box-shadow: var(--evri-shadow-lg); position: relative; z-index: 1; }
.tl-map .c.dim { opacity: .28; }
.tl-map .c.on { box-shadow: 0 0 0 2px var(--evri-navy); }
.tl-map td.n, .tl-map tfoot .n { text-align: right; font-size: var(--fs-xs); font-weight: 800; color: var(--evri-muted); padding: 0 4px; }
.tl-map tfoot th.du { font-size: var(--fs-2xs); font-weight: 800; color: var(--evri-muted); text-transform: uppercase; letter-spacing: var(--track-caps); }
.tl-map tfoot td, .tl-map tfoot th { border-top: 1px solid var(--evri-line); padding-top: 6px; }
.tl-none { padding: 28px; color: var(--evri-muted); font-weight: 600; text-align: center; }
.tl-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 10px 20px 14px; font-size: var(--fs-xs); font-weight: 700; color: var(--evri-muted); }
.tl-legend i { width: 18px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--evri-alert) calc(var(--a) * 100%), var(--evri-surface)); }
.tl-legend .spacer { flex: 1; min-width: 12px; }
.tl-sel { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-display); font-size: var(--fs-lg); }
.tl-people { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tl-people li { display: flex; align-items: stretch; gap: 4px; border-radius: var(--r-md); }
.tl-people li.on { background: var(--evri-tint); box-shadow: inset 0 0 0 1px var(--evri-blue); }
.tl-people li.more { padding: 6px 8px; font-size: var(--fs-sm); font-weight: 600; }
.tl-people button {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 6px 8px; text-align: left;
  font: inherit; border: 0; background: none; border-radius: var(--r-md); color: var(--evri-ink);
}
.tl-people button:hover { background: var(--evri-hover); }
.tl-people .nm { font-weight: 700; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-people .mono { grid-row: 2; font-size: var(--fs-xs); }
.tl-people .v { grid-column: 2; grid-row: 1 / 3; align-self: center; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); color: var(--evri-alert); }
.tl-people .bar { grid-column: 1 / 3; height: 4px; border-radius: var(--r-pill); background: var(--evri-line-soft); overflow: hidden; margin-top: 4px; }
.tl-people .bar i { display: block; height: 100%; background: var(--evri-alert); border-radius: inherit; }
.tl-people .sub { grid-column: 1 / 3; font-size: var(--fs-xs); font-weight: 600; color: var(--evri-muted); }
.tl-people a { display: flex; align-items: center; padding: 0 8px; border-radius: var(--r-md); color: var(--evri-muted); font-size: var(--fs-lg); }
.tl-people a:hover { background: var(--evri-tint); color: var(--evri-blue); text-decoration: none; }
.tl-side .du-table-wrap { max-height: 420px; }

/* Shared bits used across pages */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card-foot { display: block; padding: 11px 20px; border-top: 1px solid var(--evri-line); font-size: var(--fs-sm); background: var(--evri-surface-soft); border-radius: 0 0 var(--r-2xl) var(--r-2xl); }
.card-foot:hover { background: var(--evri-tint); text-decoration: none; }
.small-note { font-size: var(--fs-xs); font-weight: 600; }
details.more { margin-top: 4px; }
details.more summary { font-size: var(--fs-xs); font-weight: 700; color: var(--evri-blue); }
details.more .cands { margin-top: 4px; }

/* Config: daily upload steps */
.upload-steps { display: flex; flex-direction: column; gap: 22px; }
.upload-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
.upload-step h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 4px; }
.step-num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--evri-blue); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md);
}
.export-list { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.export-list li { padding-left: 4px; }
.export-list li::marker { font-weight: 700; color: var(--evri-blue); }
.export-list li > strong { display: block; font-size: var(--fs-md); }
.export-list span { font-size: var(--fs-sm); font-weight: 600; color: var(--evri-muted); }

/* Config: upload progress popup (same look as Wave Planner's planning overlay). Blocks the page until done. */
.upload-busy-backdrop {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 13, 78, 0.55); animation: upload-fade-in var(--t-base) var(--ease);
}
.upload-busy-backdrop[hidden] { display: none; }
.upload-busy-card {
  width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 32px 36px; text-align: center;
  background: var(--evri-surface); color: var(--evri-ink);
  border: 1px solid var(--evri-line); border-radius: var(--r-2xl); box-shadow: var(--evri-shadow-lg);
}
.upload-busy-icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--evri-tint); color: var(--evri-blue); animation: upload-bob 1.6s ease-in-out infinite;
}
.upload-busy-card h2 { margin: 16px 0 0; font-size: var(--fs-3xl); font-weight: 700; }
.upload-busy-eta { margin: 8px 0 0; font-size: var(--fs-lg); font-weight: 600; color: var(--evri-blue); overflow-wrap: anywhere; }
.upload-progress-block { margin-top: 22px; }
.upload-progress-meta {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 8px;
  font-size: var(--fs-sm); color: var(--evri-muted); font-variant-numeric: tabular-nums;
}
.upload-progress-meta .pct { font-family: var(--font-display); font-weight: 700; color: var(--evri-blue); }
.upload-busy-card progress {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 12px; margin: 0;
  border: 0; border-radius: var(--r-pill); overflow: hidden; background: var(--evri-line-soft);
}
.upload-busy-card progress::-webkit-progress-bar { background: var(--evri-line-soft); border-radius: var(--r-pill); }
.upload-busy-card progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--evri-blue) 0%, var(--evri-blue-bright) 100%);
  border-radius: var(--r-pill); transition: width 0.3s var(--ease);
}
.upload-busy-card progress::-moz-progress-bar { background: var(--evri-blue); border-radius: var(--r-pill); }
.upload-file-status { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.upload-file-status li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 12px; border-radius: var(--r-md); background: var(--evri-stripe); border: 1px solid var(--evri-line-soft);
  font-size: var(--fs-sm); font-weight: 600;
}
.upload-file-status .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-status .state { font-size: var(--fs-xs); font-weight: 800; color: var(--evri-muted); white-space: nowrap; }
.upload-file-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--evri-line-strong); }
.upload-file-status .active { background: var(--evri-tint); border-color: #d4e8f9; }
.upload-file-status .active .dot { background: var(--evri-blue); animation: upload-pulse 1.1s ease-in-out infinite; }
.upload-file-status .active .state { color: var(--evri-blue); }
.upload-file-status .done .dot { background: var(--evri-ok); }
.upload-file-status .done .state { color: var(--evri-ok); }
.upload-file-status .failed { background: var(--evri-alert-soft); border-color: var(--evri-alert-line); }
.upload-file-status .failed .dot { background: var(--evri-alert); }
.upload-file-status .failed .state { color: var(--evri-alert); }
.upload-busy-card small { display: block; margin-top: 20px; font-size: var(--fs-xs); line-height: 1.6; color: var(--evri-faint); }
@keyframes upload-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes upload-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes upload-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (max-width: 520px) { .upload-busy-card { padding: 24px 20px; } }
@media (prefers-reduced-motion: reduce) { .upload-busy-icon, .upload-file-status .active .dot { animation: none; } }

/* Quick "Upload new files" link in the top bar (admins) */
a.evri-topbar-upload { background: var(--evri-gold); border-color: var(--evri-gold); color: var(--evri-navy); }
a.evri-topbar-upload:hover { background: var(--evri-gold-dark); border-color: var(--evri-gold-dark); }
@media (max-width: 640px) { .evri-topbar-upload { font-size: 0; gap: 0; } }

/* Overview: one block per shift — the shift panel (with short notes), then four top-5 tables */
.ov-section {
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border-radius: var(--r-2xl); background: #e2e8f0; border: 1px solid #cfd8e3; border-top: 4px solid #94a3b8;
}
.ov-section.twilight { background: #dcebf8; border-color: #bcd7ef; border-top-color: var(--evri-blue); }
.ov-section.night { background: #dde2ee; border-color: #c3cbdd; border-top-color: var(--evri-navy); }
.ov-section + .ov-section { margin-top: 20px; }
@media (max-width: 640px) { .ov-section { padding: 10px; } }
.shift-panel.static:hover { transform: none; box-shadow: none; }
.shift-panel.static.all:hover { box-shadow: var(--evri-shadow); }
.shift-panel-head .showing.ok { background: var(--evri-ok-soft); color: var(--evri-ok); }
.shift-panel.all .shift-panel-head .showing:not(.ok) { background: var(--evri-alert-soft); color: var(--evri-alert); }
.shift-panel.static .shift-panel-head { font-size: var(--fs-md); }
.shift-notes { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; color: rgba(255, 255, 255, 0.85); }
.shift-notes b { color: #fff; }
.shift-panel.all .shift-notes { color: var(--evri-ink-soft); }
.shift-panel.all .shift-notes b { color: var(--evri-ink); }
.top5 { display: flex; flex-direction: column; }
/* Reserve two subtitle lines so one-line and wrapped subtitles give the same head height */
.top5 .evri-card-head p { line-height: 1.45; min-height: 2.9em; }
/* Same fixed columns in every top-5 table so they line up across cards and sections */
.top5-table { flex: 1; table-layout: fixed; }
.top5-table col.c-rank { width: 46px; }
.top5-table col.c-shift { width: 96px; }
.top5-table col.c-num { width: 104px; }
.g3 .top5-table col.c-num { width: 84px; }
.g3 .top5-table col.c-shift { width: 88px; }
.top5-table thead th { white-space: nowrap; }
.top5-table thead th.rank { text-align: center; padding-right: 0; }
.top5-table tbody td { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; font-variant-numeric: tabular-nums; }
.top5-table td.rank { text-align: center; padding-right: 0; }
.top5-table td.scanner { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top5-table td.scanner .mono { margin-left: 8px; font-size: var(--fs-xs); }
.top5-table td.n.strong { font-size: var(--fs-md); color: var(--evri-ink); }
.top5-table td.n.muted { font-weight: 600; }
.top5-table tr.empty td { height: 190px; vertical-align: middle; }
.rank-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--evri-line-soft); color: var(--evri-ink-mute); font-size: var(--fs-2xs); font-weight: 800; }
.du-table .rank-badge { vertical-align: middle; }
.rank-badge.first { background: var(--evri-alert-soft); color: var(--evri-alert); }
/* Overview DU tables: four in a row, compact, the same DU on the same line in each */
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g4 { grid-template-columns: 1fr; } }
.du-grid { gap: 10px; align-items: start; }
.du-score .evri-card-head { padding: 8px 12px; min-height: 52px; flex-wrap: nowrap; gap: 8px; }
.du-score .evri-card-head h3 { font-size: var(--fs-md); }
.du-score .evri-card-head p { margin-top: 0; font-size: var(--fs-2xs); }
.du-score .evri-card-icon { width: 28px; height: 28px; }
.du-score .evri-card-icon svg { width: 16px; height: 16px; }
.du-score .du-table { table-layout: fixed; }
.du-score col.c-vol { width: 48px; }
.du-score col.c-score { width: 74px; }
.du-score .du-table thead th { padding: 4px 8px; white-space: nowrap; }
.du-score .du-table tbody td { height: auto; padding: 2px 8px; font-size: var(--fs-sm); line-height: 1.35; vertical-align: middle; font-variant-numeric: tabular-nums; }
.du-score td.du-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.du-score .du-id { display: inline-block; min-width: 22px; font-weight: 800; color: var(--evri-ink); }
.du-score .score { display: inline-block; min-width: 56px; padding: 0 6px; border-radius: 999px; font-weight: 800; text-align: center; }
.du-score .score.ok { background: var(--evri-ok-soft); color: var(--evri-ok); }
.du-score .score.amber { background: var(--evri-warn-soft); color: var(--evri-warn); }
.du-score .score.warn { background: var(--evri-alert-soft); color: var(--evri-alert); }
.du-score tr.total td { background: var(--evri-surface-soft); border-bottom: 2px solid var(--evri-line-strong); font-weight: 800; color: var(--evri-ink); padding-top: 4px; padding-bottom: 4px; }
.du-score tr.total .issue-label { margin-right: 4px; padding: 0 5px; }
.du-score .card-foot { padding: 6px 12px; font-size: var(--fs-xs); }
.du-score td.du-name a { color: inherit; }
.sup-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
details.ov-more > summary {
  align-self: flex-start; display: inline-block; padding: 8px 16px; border-radius: 999px; list-style: none;
  background: var(--evri-surface); border: 1px solid var(--evri-line); font-size: var(--fs-sm); font-weight: 700; color: var(--evri-blue);
}
details.ov-more > summary::-webkit-details-marker { display: none; }
details.ov-more > summary:hover { background: var(--evri-tint); }
details.ov-more .when-open, details.ov-more[open] .when-closed { display: none; }
details.ov-more[open] .when-open { display: inline; }
details.ov-more[open] > summary { margin-bottom: 12px; }
details.ov-more > .grid + .grid { margin-top: 12px; }
.du-table th.rank, .du-table td.rank { width: 46px; text-align: center; padding-right: 0; }
.du-table .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.du-table .dot.ok { background: var(--evri-ok); }
.du-table .dot.amber { background: var(--evri-gold-dark); }
.du-table .dot.warn { background: var(--evri-alert); }
.top5 .card-foot { margin-top: auto; }
.shift-panel.static .shift-fields { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }

/* Overview: copy a shift panel as an image */
.snap-only { display: none; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0; text-transform: none; opacity: 0.85; }
.snap-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); border: 0; background: var(--evri-gold); color: var(--evri-navy);
  font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; text-transform: none;
  cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(14, 35, 64, 0.18);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.snap-btn:hover { background: var(--evri-gold-dark); }
.snap-btn:active { transform: translateY(1px); }
.snap-btn:focus-visible { outline: 3px solid var(--evri-blue); outline-offset: 2px; }
.showing ~ .snap-btn { margin-left: 0; }
.snap-btn.busy { cursor: progress; opacity: 0.8; }
.snap-btn.done { background: var(--evri-ok); color: #fff; }
.snap-btn.saved { background: var(--evri-blue); color: #fff; }
.snap-btn.failed { background: var(--evri-alert); color: #fff; }
@media (max-width: 640px) { .snap-btn { padding: 0 10px; font-size: var(--fs-xs); } }
/* Icon-only variant on the DU cards; the state shows as colour, the label stays for screen readers */
.snap-btn.mini { flex: none; width: 30px; height: 30px; padding: 0; justify-content: center; box-shadow: none; }
.snap-btn.mini .snap-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evri-card-head .snap-only { margin-left: auto; color: var(--evri-muted); white-space: nowrap; }

/* Layout helpers (instead of inline styles in the templates) */
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.nowrap { white-space: nowrap; }
.evri-card-body.flush-top { padding-top: 0; }
.du-table-wrap.full { max-height: none; }
.du-table td.du-cell { min-width: 110px; }
.du-table td.barcodes-cell { min-width: 180px; }
.du-table td.why-cell { min-width: 260px; max-width: 420px; white-space: normal; }
.du-table .empty td { white-space: normal; }
.du-table .cands li { flex-wrap: nowrap; }
details.more.in-card { margin: 0; padding: 10px 20px 16px; }
/* Report pages: table cards two to a row, the same height, each table scrolling inside its card */
/* Exactly two per row; each card spans three subgrid rows (head, table, extras) so the heads and table headers line up across the row */
.tbl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1100px) { .tbl-grid { grid-template-columns: minmax(0, 1fr); } }
.tbl-grid > .evri-card { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
.tbl-grid > .evri-card > .du-table-wrap { max-height: 520px; }
.chart-caption {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--evri-muted);
}
.field-label.inline { flex-direction: row; align-items: center; }
.inline-input.wide { width: min(260px, 100%); }
.search-input[type="search"] { width: 220px; }
.textarea {
  width: 100%; min-height: 150px; padding: 10px 11px; resize: vertical;
  background: var(--evri-surface); border: 1px solid var(--evri-line); border-radius: var(--r-md); color: var(--evri-ink);
  font-size: var(--fs-sm); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea:focus { border-color: var(--evri-blue); box-shadow: var(--evri-ring); outline: none; }
/* Overview: a figure's breakdown under it (e.g. Misroutes ND · STD) */
.shift-field small { font-size: var(--fs-2xs); font-weight: 700; color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; }
.shift-panel.all .shift-field small { color: var(--evri-muted); }

/* User performance: leaderboard and a user's review page */
.ellipsis { overflow: hidden; text-overflow: ellipsis; }
.section-title { margin-top: 8px; font-size: var(--fs-xl); font-weight: 700; color: var(--evri-ink); }
.rank-badge.gold { background: var(--evri-gold); color: var(--evri-navy); }
.score-pill { display: inline-block; min-width: 40px; padding: 1px 8px; border-radius: var(--r-pill); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.score-pill.ok { background: var(--evri-ok-soft); color: var(--evri-ok); }
.score-pill.amber { background: var(--evri-warn-soft); color: var(--evri-warn); }
.score-pill.warn { background: var(--evri-alert-soft); color: var(--evri-alert); }
.perf-table td { vertical-align: middle; }
.perf-table td.measure { white-space: nowrap; font-variant-numeric: tabular-nums; }
.perf-table td.measure strong small { font-size: 0.7em; font-weight: 700; color: var(--evri-muted); }
.perf-table .rank-of { display: block; font-size: var(--fs-2xs); font-weight: 700; color: var(--evri-muted); }
.perf-table .issue-label { margin: 1px 0; }
.perf-rules { display: grid; gap: 8px; padding-left: 38px; font-size: var(--fs-sm); line-height: 1.5; color: var(--evri-ink-soft); }
.perf-back { display: inline-block; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 700; color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.perf-back:hover { color: #fff; }
.evri-hero-tag strong small { font-size: var(--fs-sm); font-weight: 600; color: rgba(255, 255, 255, 0.68); }
.evri-hero-tag.rank-tag { background: var(--evri-gold); border-color: var(--evri-gold); }
.evri-hero-tag.rank-tag strong, .evri-hero-tag.rank-tag strong small { color: var(--evri-navy); }
.evri-hero-tag.rank-tag span { color: rgba(0, 13, 78, 0.7); }
.perf-name { margin-top: 10px; font-size: var(--fs-sm); }
.perf-name summary { cursor: pointer; font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.perf-name summary:hover { color: #fff; }
.perf-name form { margin-top: 8px; padding: 8px 10px; background: var(--evri-surface); border-radius: var(--r-lg); }
.score-rows { display: grid; }
.score-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(90px, 0.7fr) minmax(120px, 1fr) 90px;
  align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--evri-line-soft);
}
.score-row:last-child { border-bottom: 0; }
.score-name strong { display: block; font-size: var(--fs-md); color: var(--evri-ink); }
.score-name small { font-size: var(--fs-xs); font-weight: 600; color: var(--evri-muted); }
.score-val { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; color: var(--evri-ink); font-variant-numeric: tabular-nums; }
.score-val small { font-size: 0.6em; color: var(--evri-muted); }
.score-row.ok .score-val { color: var(--evri-ok); }
.score-row.amber .score-val { color: var(--evri-warn); }
.score-row.warn .score-val { color: var(--evri-alert); }
.score-place span { font-size: var(--fs-sm); font-weight: 800; color: var(--evri-ink); }
.score-verdict { text-align: right; }
@media (max-width: 640px) {
  .score-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .score-place { grid-column: 1; }
}
.heat-lead { margin-bottom: 12px; font-size: var(--fs-md); color: var(--evri-ink); }
.heat-lead .muted { display: block; font-size: var(--fs-xs); }
.heat-wrap { overflow-x: auto; }
.heat-map { border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.heat-map thead th { padding: 6px 4px; font-size: var(--fs-2xs); font-weight: 800; color: #fff; background: var(--evri-blue); text-align: center; white-space: nowrap; }
.heat-map thead th:first-child { text-align: left; }
.heat-map td.avg { padding: 0 10px; font-size: var(--fs-sm); font-weight: 800; color: var(--evri-ink); text-align: right; white-space: nowrap; }
.heat-map thead th.avg { text-align: right; }
.heat-map tbody th { padding-right: 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--evri-ink); text-align: left; white-space: nowrap; }
.heat-map tr.total th, .heat-map tr.total td { padding-top: 6px; }
.heat-map tr.total th { color: var(--evri-navy); font-weight: 800; }
.heat-map td { padding: 0; }
.heat-map .c {
  display: grid; place-items: center; min-width: 58px; height: 30px; padding: 0 6px; border-radius: var(--r-xs);
  font-size: var(--fs-xs); font-weight: 800; color: var(--evri-navy);
  background: color-mix(in srgb, var(--evri-blue) calc(var(--a) * 100%), var(--evri-surface));
}
.heat-map .c.hi { color: #fff; }
.heat-map .c.below { outline: 2px dashed var(--evri-alert); outline-offset: -2px; }
.rank-bar { display: block; height: 6px; margin: 4px 0 2px; border-radius: var(--r-pill); background: var(--evri-line-soft); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: var(--evri-blue); }
.rank-bar.ok i { background: var(--evri-ok); }
.rank-bar.amber i { background: var(--evri-gold-dark); }
.rank-bar.warn i { background: var(--evri-alert); }

/* ── 8. Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .tl-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .evri-shell { grid-template-columns: 1fr; padding: 12px 16px 40px; }
  .evri-sidebar { position: static; width: 100%; max-height: none; flex-direction: row; overflow-x: auto; }
  .evri-sidebar:not(:hover):not(:focus-within) .label { opacity: 1; }
  .evri-sidebar .evri-side-item { width: auto; }
  .evri-side-label { display: none !important; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .evri-topbar { padding: 0 16px; }
  .evri-brand-divider, .evri-brand-titles { display: none; }
}
@media (max-width: 640px) {
  /* Top-5 tables: narrower figure columns so the name still fits on a phone */
  .top5-table col.c-num { width: 72px; }
  .top5-table col.c-shift { width: 84px; }
  .top5-table col.c-rank { width: 36px; }
}

/* ── 9. Print ─────────────────────────────────────────────────────────────── */
@media print {
  .evri-topbar, .evri-sidebar, .filter-bar, .evri-btn, details.table-view, .snap-btn, .card-foot { display: none !important; }
  .evri-shell { display: block; padding: 0; }
  .evri-card { break-inside: avoid; box-shadow: none; }
  .du-table-wrap { max-height: none; overflow: visible; }
  .perf-name, .perf-back, .section-title, .section-title + .grid { display: none !important; }
  .evri-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Sortable table headers (click to sort; arrow shows direction) */
.du-table thead th.sortable { cursor: pointer; user-select: none; }
.du-table thead th.sortable:hover { background: var(--evri-blue-dark); }
.du-table thead th.sortable::after { content: "↕"; margin-left: 6px; opacity: .4; font-size: .85em; }
.du-table thead th[aria-sort="ascending"]::after { content: "▲"; opacity: 1; }
.du-table thead th[aria-sort="descending"]::after { content: "▼"; opacity: 1; }
