/* GG Ops Brief — one design system for the app and the TV (public/tv.css uses the same token names).
   Colors are roles. Status colors (good / crit / warn / pend) are reserved for state and always travel with an
   icon and a word; the interactive accent is the TV's series blue; basil green is identity only (the GG mark).
   Light and dark are two selected sets, not an automatic flip: prefers-color-scheme picks one unless the
   person chose with the toggle (html[data-theme]). */
:root {
  color-scheme: light;
  --page: #f1f0ec; --surface: #fcfcfb; --surface-2: #f6f5f2; --sunken: #e6e5df;
  --line: #e1e0d9; --line-strong: #c3c2b7; --ring: rgba(11, 11, 11, 0.10);
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #6b6963;
  --grid: #e1e0d9; --axis: #c3c2b7;
  --s1: #2a78d6; --ma: #1baf7a;
  --accent: #1f63b8; --accent-ink: #1f63b8; --on-accent: #ffffff; --accent-soft: #e6eefa;
  --basil: #2f6b3a; --on-basil: #ffffff;
  /* status: --x marks (fills, bars, dots); --x-ink text and icons on a tinted background (AA on surface) */
  --good: #0ca30c; --good-ink: #0b7d22; --crit: #d03b3b; --crit-ink: #b42323;
  --warn: #e09a00; --warn-ink: #8a5a00; --pend: #898781; --pend-ink: #5f5d58;
  --shadow: 0 1px 2px rgba(11, 11, 11, .05), 0 6px 20px -12px rgba(11, 11, 11, .18);
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tap: 44px; --bar-h: 60px; --bottom-h: 64px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --sunken: #2c2c2a;
  --line: #2c2c2a; --line-strong: #46463f; --ring: rgba(255, 255, 255, 0.10);
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a988f;
  --grid: #2c2c2a; --axis: #46463f;
  --s1: #3987e5; --ma: #199e70;
  --accent: #3987e5; --accent-ink: #6aa6ef; --on-accent: #0b0b0b; --accent-soft: #1b2a3d;
  --good: #0ca30c; --good-ink: #4ccf4c; --crit: #d03b3b; --crit-ink: #ff6b6b;
  --warn: #fab219; --warn-ink: #fab219; --pend: #898781; --pend-ink: #b4b2a9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --sunken: #2c2c2a;
    --line: #2c2c2a; --line-strong: #46463f; --ring: rgba(255, 255, 255, 0.10);
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a988f;
    --grid: #2c2c2a; --axis: #46463f;
    --s1: #3987e5; --ma: #199e70;
    --accent: #3987e5; --accent-ink: #6aa6ef; --on-accent: #0b0b0b; --accent-soft: #1b2a3d;
    --good: #0ca30c; --good-ink: #4ccf4c; --crit: #d03b3b; --crit-ink: #ff6b6b;
    --warn: #fab219; --warn-ink: #fab219; --pend: #898781; --pend-ink: #b4b2a9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

/* ---------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (max-width: 900px) { html { scroll-padding-bottom: calc(var(--bottom-h) + 24px); } }
body { margin: 0; font: 15px/1.45 var(--font); background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 720; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-ink); }
[hidden] { display: none !important; }
.tnum, input[inputmode] { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--crit-ink); font-weight: 600; }
.err:empty { display: none; }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.sr:focus { position: fixed; z-index: 60; top: 8px; left: 8px; width: auto; height: auto; clip: auto; padding: 10px 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
:focus-visible { outline: 3px solid var(--s1); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controls */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink); width: 100%; min-width: 0;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--s1) 50%, transparent); outline-offset: 0; border-color: var(--s1); }
input[aria-invalid="true"] { border-color: var(--crit); box-shadow: inset 0 0 0 1px var(--crit); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: var(--r); border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  font-weight: 650; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: filter .12s, background-color .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.quiet { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); filter: none; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r); border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer; padding: 0; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- shell */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
/* the mark is a leaf: two opposite corners rounded */
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 4px 17px 4px 17px; flex: none;
  background: var(--basil); color: var(--on-basil); font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand-name span { color: var(--muted); font-weight: 600; margin-left: 6px; padding-left: 9px; border-left: 1px solid var(--line-strong); }
.plant { min-width: 0; flex: 0 1 auto; display: flex; }
.plant select { min-height: 38px; width: auto; max-width: 240px; text-overflow: ellipsis; padding: 6px 34px 6px 14px; border-radius: var(--r-pill); font-weight: 650; font-size: 14px;
  background-color: var(--surface-2); border-color: var(--line); }
.plant-static { font-weight: 650; font-size: 14px; color: var(--ink-2); }
.nav { display: flex; gap: 2px; align-items: center; min-width: 0; height: 100%; }
.nav a { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; color: var(--ink-2); gap: 7px;
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; position: relative; }
.nav a svg.ic { width: 17px; height: 17px; opacity: .8; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); }
.nav a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.actor { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--line); font-size: 14px; font-weight: 600; max-width: 220px; margin-left: 4px; }
.actor .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 750;
  background: color-mix(in srgb, var(--hue, var(--s1)) 24%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ring); letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.bottomnav { display: none; }
@media (max-width: 900px) {
  .topbar { gap: 8px; padding: 0 10px 0 12px; }
  .plant select { max-width: 100%; }
  .bar-right { gap: 0; flex: none; }
  .nav, .actor .who, .topbar .brand-name span { display: none; }
  .actor { padding: 0; border: 0; background: transparent; margin-left: 0; }
  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); }
  .bottomnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    text-decoration: none; font-size: 11px; font-weight: 650; min-width: 0; }
  .bottomnav a.on { color: var(--accent-ink); }
  .bottomnav a.on::before { content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .bottomnav a svg.ic { width: 22px; height: 22px; }
  body.has-shell main { padding-bottom: calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) { .topbar .brand-name { display: none; } }

main { padding: 28px 24px 56px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 640px) { main { padding: 18px 16px 40px; } }
.loading { color: var(--muted); padding: 48px 0; text-align: center; }
.fail { display: flex; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }

/* ---------- page header */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-h .title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-h .sub { color: var(--ink-2); font-size: 14px; }
.page-h .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.datenav { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); min-height: var(--tap); }
.datenav input { border: 0; min-height: 42px; width: 150px; background: transparent; padding: 6px 4px; text-align: center; font-weight: 650; }
.datenav input:focus-visible { outline-offset: -3px; }
.datenav .icon-btn { width: 44px; height: 42px; border-radius: 9px; }
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .page-h { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
  .page-h .tools { width: 100%; }
  .page-h .tools > * { flex: 1; }
  .datenav { justify-content: space-between; }
  .datenav input { flex: 1; width: auto; }
}

/* ---------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.panel-h { display: flex; align-items: center; gap: 10px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 60px; }
.panel-h .end { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mb { margin-bottom: 16px; }
.clip { overflow: hidden; }
.h-sm { font-size: 16px; }
@media (max-width: 640px) { .pad { padding: 16px; } .panel-h { padding: 12px 16px; } }

/* ---------- status: color + icon + word, never color alone */
.st-ok { --st: var(--good); --st-ink: var(--good-ink); }
.st-off { --st: var(--crit); --st-ink: var(--crit-ink); }
.st-miss { --st: var(--warn); --st-ink: var(--warn-ink); }
.st-pend { --st: var(--pend); --st-ink: var(--pend-ink); }
.st-info { --st: var(--line-strong); --st-ink: var(--muted); }
/* na = not applicable that day (no photo, no route, no production): grey, never orange or blue */
.st-na { --st: var(--line-strong); --st-ink: var(--muted); }
.muted.na { font-size: 13px; }
.m-lbl .src { margin-left: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: 13px; font-weight: 650; color: var(--ink); background: color-mix(in srgb, var(--st) 13%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 42%, transparent); }
.pill i { font-style: normal; font-weight: 900; color: var(--st-ink); min-width: 12px; text-align: center; }
.pill.st-info, .pill.st-pend { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.src { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-sm); font-size: 11px; font-weight: 700;
  color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); white-space: nowrap; vertical-align: 3px; letter-spacing: .01em; }
.src.ovr { color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.esc { background: var(--crit); color: #fff; letter-spacing: .03em; }
.badge.count { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); font-variant-numeric: tabular-nums; }
.badge.closed { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.due { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 650;
  white-space: nowrap; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.due i { font-style: normal; font-weight: 900; color: var(--st-ink, var(--muted)); }
.due.st-off, .due.st-miss, .nodate { background: color-mix(in srgb, var(--st) 13%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 42%, transparent); }
.nodate { --st: var(--warn); --st-ink: var(--warn-ink); display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 650; white-space: nowrap; }
.nodate i { font-style: normal; font-weight: 900; color: var(--warn-ink); }

/* ---------- banners */
.banner { --st: var(--warn); --st-ink: var(--warn-ink); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--st) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 40%, transparent); }
.banner.st-off { --st: var(--crit); --st-ink: var(--crit-ink); }
.banner.st-info { --st: var(--line-strong); --st-ink: var(--ink-2); background: var(--surface); }
.banner.st-na { --st: var(--line-strong); --st-ink: var(--ink-2); background: var(--surface-2); }
.pill.st-na { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.banner > i { font-style: normal; font-weight: 900; color: var(--st-ink); font-size: 16px; line-height: 1.3; width: 16px; text-align: center; flex: none; }
.banner .detail { color: var(--ink-2); display: block; margin-top: 2px; word-break: break-word; }

/* ---------- stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 14px 20px; min-width: 0; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st, var(--line)); }
.stat.st-info::before { background: var(--line); }
.stat.st-info .s-sub i { color: var(--muted); }
.stat .s-lbl { font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s-val { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .s-val small { font-size: 15px; color: var(--ink-2); font-weight: 650; margin-left: 4px; letter-spacing: 0; }
.stat .s-sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s-sub i { font-style: normal; font-weight: 900; color: var(--st-ink); margin-right: 4px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stats > .stat.wide:nth-child(odd) { grid-column: 1 / -1; } .stat { padding: 12px 12px 12px 16px; } .stat .s-val { font-size: 24px; } }

/* ---------- filter chips / jump links */
.fchips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.fchips::-webkit-scrollbar { display: none; }
.fchips.fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 650; white-space: nowrap; cursor: pointer; text-decoration: none; flex: none; }
.fchip:hover { color: var(--ink); background: var(--surface-2); }
.fchip[aria-pressed="true"], .fchip[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fchip .n { font-size: 12px; font-weight: 700; opacity: .8; font-variant-numeric: tabular-nums; }
.fchip .off { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--crit-ink); }
.fchip[aria-pressed="true"] .off, .fchip[aria-current="true"] .off { color: inherit; }

/* ---------- progress */
.progress { display: flex; align-items: center; gap: 14px; }
.progress .bar { flex: 1; height: 10px; border-radius: 10px; background: var(--sunken); overflow: hidden; min-width: 80px; }
.progress .bar > span { display: block; height: 100%; background: var(--s1); border-radius: 10px; transition: width .3s ease; }
.progress.done .bar > span { background: var(--good); }
.progress .lbl { font-size: 14px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress .lbl b { color: var(--ink); font-size: 17px; }
.progress .lbl i { font-style: normal; font-weight: 900; color: var(--good-ink); margin-right: 4px; }

/* ---------- toast */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); font-weight: 650; font-size: 14px;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow); transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast i { font-style: normal; font-weight: 900; }
.toast.st-off { background: var(--crit); color: #fff; }
@media (max-width: 900px) { body.has-shell .toast { bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); } }

/* ---------- tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl thead th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.retired td { opacity: .55; }
.tbl .sub-h th { background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 700; }
.tbl input, .tbl select { min-height: 40px; }

/* ---------- sparkline (charts.js, shared with the TV) */
.spark-box { width: 116px; height: 36px; flex: none; }
.spark { display: block; overflow: visible; }
.sp-line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .7; }
.sp-target { stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 4 4; }
.sp-dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2.5; }
.sp-dot.off { fill: var(--crit); } .sp-dot.ok { fill: var(--good); }
.spark-empty { font-size: 12px; color: var(--muted); }

/* =======================================================================  login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; padding: 32px 28px 28px; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { font-size: 25px; margin-bottom: 6px; }
.login-card .lead { color: var(--ink-2); font-size: 15px; margin-bottom: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 18px; }
.login-card input { min-height: 52px; font-size: 17px; }
.login-card .code-input { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.login-card .btn { min-height: 54px; font-size: 16px; width: 100%; margin-top: 4px; }
.login-card .field .hint { font-size: 12px; }
.login-err { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--crit) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crit) 40%, transparent); }
.login-err i { font-style: normal; font-weight: 900; color: var(--crit-ink); }
.login-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.float-theme { position: fixed; top: 12px; right: 12px; }
@media (max-width: 640px) { .login-card { padding: 26px 20px 22px; } .login { place-items: start center; padding-top: 48px; } }

/* =======================================================================  report */
.rep-top { display: grid; gap: 14px; margin-bottom: 8px; }
.rep-progress { padding: 14px 18px; }
.dept-title { display: flex; align-items: center; gap: 8px 12px; margin: 28px 0 12px; flex-wrap: wrap; }
.dept-title h2 { font-size: 19px; }
.owner { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.dept-title .end { margin-left: auto; }
.dept-body { display: grid; gap: 12px; }
details.sys > summary svg.ic:first-child { width: 18px; height: 18px; color: var(--muted); }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 190px 168px; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .e-lbl { font-weight: 650; font-size: 15px; display: block; }
.entry .e-meta { display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; color: var(--muted); }
.entry .e-meta b { color: var(--ink-2); font-weight: 650; }
.entry input { min-height: 54px; font-size: 22px; font-weight: 700; text-align: right; padding-right: 14px; }
.entry .e-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 54px; justify-content: center; }
.e-saved { font-size: 12px; font-weight: 650; color: var(--muted); min-height: 16px; display: inline-flex; gap: 4px; align-items: center; }
.e-saved.ok { color: var(--good-ink); }
.e-saved.bad { color: var(--crit-ink); }
.entry.saving input { border-color: var(--s1); }
@media (max-width: 640px) {
  .entry { grid-template-columns: minmax(0, 1fr) 140px; grid-template-areas: "lbl lbl" "inp st"; gap: 10px 12px; padding: 14px 16px; }
  .entry .e-head { grid-area: lbl; } .entry .e-inp { grid-area: inp; } .entry .e-state { grid-area: st; }
  .entry input { font-size: 24px; min-height: 56px; }
}
.prod-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px 20px; align-items: start; }
.prod-fields input { min-height: 54px; font-size: 20px; font-weight: 700; }
.prod-fields .hint { min-height: 18px; font-size: 12px; }
@media (max-width: 640px) { .prod-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 16px 12px; gap: 12px; } .prod-fields input { font-size: 18px; padding: 8px 10px; } }
.calc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 20px 18px; }
.calc .c { background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; min-width: 0; box-shadow: inset 0 0 0 1px var(--line); }
.calc .c span { display: block; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc .c b { display: block; font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.calc .c em { display: block; font-style: normal; font-size: 12px; font-weight: 650; color: var(--ink-2); margin-top: 1px; }
.calc .c em i { font-style: normal; font-weight: 900; color: var(--st-ink); margin-right: 4px; }
.calc .c.st-ok, .calc .c.st-off { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 42%, transparent); background: color-mix(in srgb, var(--st) 9%, var(--surface)); }
.calc .c.dim b { color: var(--muted); }
@media (max-width: 640px) { .calc { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 16px; } }
.empty-note { padding: 16px 20px; color: var(--muted); font-size: 14px; }

details.sys { overflow: hidden; }
details.sys > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 20px; cursor: pointer; font-weight: 650; font-size: 14px; color: var(--ink-2); }
details.sys > summary::-webkit-details-marker { display: none; }
details.sys > summary .chev { margin-left: auto; transition: transform .15s; }
details.sys[open] > summary { border-bottom: 1px solid var(--line); }
details.sys[open] > summary .chev { transform: rotate(180deg); }
.sysrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px; gap: 8px 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.sysrow:last-child { border-bottom: 0; }
.sysrow .s-val { font-weight: 750; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sysrow .s-val.soft { white-space: normal; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.sysrow .ovr-note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.fixform { grid-column: 1 / -1; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 8px; }
.fixform input { min-height: 40px; }
@media (max-width: 640px) {
  .sysrow { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .sysrow .s-head { grid-column: 1 / -1; }
  .fixform { grid-template-columns: 1fr 1fr; }
  .fixform input[data-f="comment"] { grid-column: 1 / -1; grid-row: 1; }
  details.sys > summary { padding: 0 16px; }
}

/* =======================================================================  board */
.jump { position: sticky; top: var(--bar-h); z-index: 20; background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 10px 0; margin: 0 0 6px; }
.jump .fchip { min-height: 38px; padding: 0 13px; font-size: 13px; }
.dcard { margin-bottom: 18px; overflow: hidden; scroll-margin-top: calc(var(--bar-h) + 66px); }
.dcard .panel-h h2 { font-size: 18px; }
.dcard .tally { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.dcard .tally .pill { height: 26px; font-size: 12px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 180px 120px 150px 124px; gap: 16px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
/* core vs detail: detail rows sit under a quiet sub-header, opened per department with the bar below the card */
.detail-rows .mrow.sub { display: block; padding: 7px 20px; background: var(--surface-2); font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--line); }
.detail-rows .mrow .m-lbl { font-weight: 550; }
.mrow.empty-core { display: block; }
.detail-bar { display: flex; justify-content: flex-start; padding: 6px 12px; border-top: 1px solid var(--line); }
.detail-btn { gap: 8px; font-weight: 650; }
.detail-btn .off { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--crit-ink); }
.mrow.head { padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.mrow.head .r { text-align: right; }
.mrow .m-lbl { font-weight: 650; display: block; }
.mrow .m-en { display: block; font-size: 13px; color: var(--muted); }
.mrow .m-val { text-align: right; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.mrow .m-val .src { margin-left: 6px; }
.mrow .m-val.soft { font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: normal; }
.mrow .m-val .ovr-note { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; white-space: normal; }
.mrow .m-tgt { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-tgt-sm { display: none; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .mrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lbl val" "st spark"; gap: 8px 12px; padding: 12px 16px; }
  .mrow.head { display: none; }
  .mrow .m-l { grid-area: lbl; } .mrow .m-val { grid-area: val; align-self: start; }
  .mrow .m-st { grid-area: st; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .mrow .m-tgt { display: none; } .m-tgt-sm { display: inline; }
  .mrow .m-spark { grid-area: spark; justify-self: end; }
  .mrow .m-en { display: none; }
}
.prodline { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.prodline b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .prodline { padding: 12px 16px; } }

/* =======================================================================  actions */
.newact { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) 170px 170px auto; gap: 12px; align-items: end; padding: 18px 20px; }
@media (max-width: 1000px) { .newact { grid-template-columns: 1fr 1fr; } .newact .f-issue { grid-column: 1 / -1; } .newact .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) { .newact { padding: 16px; } }
.act-tbl .a-issue { font-weight: 650; max-width: 560px; display: block; }
.act-tbl .a-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.act-tbl .a-own { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.act-tbl .a-flags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.act-tbl .a-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.act-tbl td.c-btns { width: 1%; white-space: nowrap; }
.act-tbl td.c-flags { width: 110px; }
.act-tbl td.c-due { width: 150px; }
.act-tbl tr.editing td.c-due { width: 190px; }
.act-tbl tr.is-over td:first-child { box-shadow: inset 4px 0 0 var(--crit); }
.act-tbl tr.is-closed td { opacity: .6; }
.act-tbl tr.editing td { background: var(--accent-soft); }
.act-tbl .edit-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.act-tbl .empty td { padding: 44px 20px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .act-tbl, .act-tbl tbody, .act-tbl td { display: block; }
  .act-tbl thead { display: none; }
  .act-tbl tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; }
  .act-tbl tbody tr:last-child { border-bottom: 0; }
  .act-tbl td, .act-tbl td:first-child, .act-tbl td:last-child { padding: 0; border: 0; }
  .act-tbl td.c-issue, .act-tbl td.c-btns, .act-tbl td.c-flags { grid-column: 1 / -1; }
  .act-tbl td.c-flags:has(.a-flags:empty) { display: none; }
  .act-tbl td.c-btns, .act-tbl td.c-flags, .act-tbl td.c-due { width: auto; }
  .act-tbl .a-btns { justify-content: stretch; }
  .act-tbl .a-btns .btn { flex: 1 1 auto; }
  .act-tbl tr.is-over { box-shadow: inset 4px 0 0 var(--crit); }
  .act-tbl tr.is-over td:first-child { box-shadow: none; }
  .act-tbl td.c-due { justify-self: end; }
  .act-tbl tr.editing td.c-own, .act-tbl tr.editing td.c-due { grid-column: 1 / -1; justify-self: stretch; }
  .act-tbl .empty { display: block; }
}

/* =======================================================================  admin */
.adm-new { display: grid; grid-template-columns: minmax(0, 1.4fr) 150px 130px 180px auto auto; gap: 12px; align-items: end; padding: 18px 20px; }
@media (max-width: 1000px) { .adm-new { grid-template-columns: 1fr 1fr; } .adm-new .f-name { grid-column: 1 / -1; } .adm-new .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) { .adm-new { padding: 16px; } }
.codebox { margin: 0 20px 18px; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); font-size: 15px; font-weight: 600; }
.codebox:empty { display: none; }
.codebox b { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; }
.banner.inset { margin: 0 20px 16px; }
.who-cell { display: inline-flex; gap: 10px; align-items: center; font-weight: 650; }
.adm-metrics td input { max-width: 220px; }
.adm-metrics td select { max-width: 140px; min-height: 38px; }
.role { display: inline-flex; height: 24px; align-items: center; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.u-btns { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 760px) {
  .adm-users, .adm-users tbody, .adm-users td { display: block; }
  .adm-users thead { display: none; }
  .adm-users tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
  .adm-users td, .adm-users td:first-child, .adm-users td:last-child { padding: 0; border: 0; }
  .adm-users td.u-name { width: 100%; }
  .adm-users td.u-btns { width: 100%; }
  .adm-users td.u-btns .btn { flex: 1; }
  .adm-metrics thead { display: none; }
  .adm-metrics, .adm-metrics tbody, .adm-metrics td, .adm-metrics th { display: block; }
  .adm-metrics tr { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
  .adm-metrics td, .adm-metrics td:first-child, .adm-metrics td:last-child { padding: 0; border: 0; }
  .adm-metrics td.m-name { grid-column: 1 / -1; }
  .adm-metrics tr.sub-h { display: block; padding: 0; }
  .adm-metrics tr.sub-h th { padding: 12px 16px; border: 0; }
}

/* =======================================================================  presentación (meeting mode)
   Always the TV's dark set: it is projected or screen-shared, read from across the room. */
.present {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --sunken: #2c2c2a;
  --line: #2c2c2a; --line-strong: #46463f; --ring: rgba(255, 255, 255, 0.10);
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a988f; --s1: #3987e5;
  --accent: #3987e5; --accent-ink: #6aa6ef; --on-accent: #0b0b0b; --accent-soft: #1b2a3d;
  --good-ink: #4ccf4c; --crit-ink: #ff6b6b; --warn: #fab219; --warn-ink: #fab219; --pend-ink: #b4b2a9;
  --shadow: none;
  position: fixed; inset: 0; z-index: 40; overflow: auto; background: var(--page); color: var(--ink);
}
.p-stage { min-height: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 40px 0; display: flex; flex-direction: column; gap: 22px; }
.p-head { display: flex; align-items: flex-start; gap: 24px; justify-content: space-between; }
.p-id { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.p-id .mark { width: 44px; height: 44px; font-size: 17px; border-radius: 5px 22px 5px 22px; margin-top: 4px; }
.p-plant { display: block; font-size: 17px; color: var(--ink-2); font-weight: 600; }
.p-head h1 { font-size: 44px; font-weight: 760; letter-spacing: -.02em; margin-top: 2px; }
.p-when { color: var(--ink); }
.p-skipped { font-size: 14px; font-weight: 500; color: var(--muted); }
.p-date { display: inline-flex; align-items: center; gap: 4px; }
.p-date input { height: 36px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.p-big.soft { color: var(--ink-2); }
.p-en { font-size: .55em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.p-clock { text-align: right; flex: none; }
.p-timer { display: block; font-size: 84px; font-weight: 780; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.p-timer.over { color: var(--crit-ink); }
.p-timer.over::before { content: '✕ '; font-size: 40px; vertical-align: 18px; }
.p-total { display: block; font-size: 17px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.p-total b { color: var(--ink-2); }

.p-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.p-steps li { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.p-steps button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--muted); font-weight: 650; font-size: 16px; min-width: 0; border-radius: 8px; }
.p-steps button:focus-visible { outline: 3px solid var(--s1); outline-offset: 2px; }
.p-sn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; font-size: 14px; font-weight: 800;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); font-variant-numeric: tabular-nums; }
.p-st-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-steps li.on button { color: var(--ink); }
.p-steps li.on .p-sn { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.p-steps li.done button { color: var(--ink-2); }
.p-steps li.done .p-sn { background: var(--surface-2); color: var(--good-ink); }
.p-sbar { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.p-sbar > span { display: block; height: 100%; background: var(--s1); border-radius: 5px; transition: width 1s linear; }
.p-steps li.done .p-sbar > span { background: var(--line-strong); }

.p-body { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.p-panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.p-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px 200px 200px; gap: 20px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.p-row:last-child, .p-act:last-child { border-bottom: 0; }
.p-lbl { font-size: 23px; font-weight: 650; min-width: 0; }
.p-own { display: block; font-size: 16px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.p-val { font-size: 32px; font-weight: 780; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.p-val.soft { font-size: 18px; font-weight: 650; color: var(--ink-2); }
.p-tgt { font-size: 18px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-st .pill { height: 36px; font-size: 16px; padding: 0 14px 0 11px; }
.p-h3 { font-size: 22px; font-weight: 720; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.p-n { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.p-act { display: grid; grid-template-columns: minmax(0, 1fr) 240px 190px 170px; gap: 18px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.p-act.is-over { box-shadow: inset 5px 0 0 var(--crit); }
.p-act.assign { grid-template-columns: minmax(0, 1fr) 240px 190px auto; }
.p-act .due, .p-act .nodate { height: 32px; font-size: 15px; }
.p-issue { font-size: 20px; font-weight: 650; }
.p-who { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.p-flags { display: flex; gap: 6px; justify-content: flex-end; }
.p-note { color: var(--muted); font-size: 16px; }
.p-big { font-size: 30px; font-weight: 700; padding: 28px 24px; }
.p-ok { color: var(--good-ink); font-weight: 900; }
.p-empty { padding: 24px; color: var(--muted); font-size: 18px; }
.p-err { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--crit) 16%, var(--surface)); font-weight: 650; }
.p-err i { font-style: normal; color: var(--crit-ink); font-weight: 900; }

.p-pager { display: flex; gap: 6px; flex-wrap: wrap; }
.p-tab { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.p-tab:hover { color: var(--ink); }
.p-tab:focus-visible { outline: 3px solid var(--s1); outline-offset: 2px; }
.p-tab.done { color: var(--ink-2); }
.p-tab.done::before { content: '✓ '; color: var(--good-ink); font-weight: 900; }
.p-tab.on { background: var(--surface); color: var(--ink); font-weight: 750; box-shadow: inset 0 0 0 1px var(--ring); }
.p-dept-h { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.p-dept-h h2 { font-size: 36px; font-weight: 760; }
.p-count { color: var(--muted); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.p-dtimer { margin-left: auto; font-size: 44px; font-weight: 780; font-variant-numeric: tabular-nums; padding: 2px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); }
.p-dtimer.over { color: var(--crit-ink); box-shadow: inset 0 0 0 2px var(--crit); }
.p-dtimer.over::before { content: '✕ '; font-size: 26px; vertical-align: 6px; }
.p-facts { display: flex; gap: 12px; flex-wrap: wrap; }
.p-fact { padding: 10px 18px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); }
.p-fact span { display: block; font-size: 14px; color: var(--muted); font-weight: 650; }
.p-fact b { font-size: 30px; font-weight: 760; font-variant-numeric: tabular-nums; }
.p-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.p-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 200px auto; gap: 12px; }
.p-form input, .p-act input { min-height: 52px; font-size: 18px; }
.p-new { margin: 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 8px; }
.p-new li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 20px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); font-size: 20px; font-weight: 650; }
.p-new li::before { content: counter(n); font-size: 22px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-agenda { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.p-agenda-i { padding: 36px 32px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); font-size: 34px; font-weight: 740; }
.p-finish { align-self: flex-start; min-height: 56px; font-size: 18px; padding: 0 28px; }
.p-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 16px 0 22px; margin-top: 8px;
  background: linear-gradient(to top, var(--page) 70%, transparent); }
.p-foot .btn { min-height: 52px; font-size: 17px; padding: 0 22px; }
.p-keys { color: var(--muted); font-size: 14px; margin-left: 8px; }
.p-exit { margin-left: auto; }
@media (max-width: 900px) {
  .p-stage { padding: 16px 16px 0; gap: 16px; }
  .p-id .mark { display: none; }
  .p-head h1 { font-size: 26px; }
  .p-plant { font-size: 14px; }
  .p-timer { font-size: 48px; }
  .p-timer.over::before { font-size: 24px; vertical-align: 10px; }
  .p-total { font-size: 13px; }
  .p-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .p-st-t { display: none; }
  .p-steps li.on .p-st-t { display: none; }
  .p-steps button { justify-content: center; }
  .p-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px; }
  .p-lbl { font-size: 17px; } .p-own { font-size: 13px; }
  .p-val { font-size: 22px; } .p-val.soft { font-size: 14px; }
  .p-tgt { font-size: 14px; } .p-st { justify-self: end; }
  .p-st .pill { height: 28px; font-size: 13px; }
  .p-act, .p-act.assign { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 16px; }
  .p-act .p-issue { grid-column: 1 / -1; font-size: 16px; }
  .p-act.assign input, .p-act.assign .btn { grid-column: 1 / -1; }
  .p-who { font-size: 14px; }
  .p-dept-h h2 { font-size: 24px; }
  .p-dtimer { font-size: 28px; }
  .p-fact b { font-size: 22px; }
  .p-form { grid-template-columns: 1fr 1fr; } .p-form input[name="issue"], .p-form .btn { grid-column: 1 / -1; }
  .p-new li { grid-template-columns: 28px minmax(0, 1fr); font-size: 16px; } .p-new li > :nth-child(n+2) { grid-column: 2; }
  .p-agenda { grid-template-columns: 1fr; } .p-agenda-i { font-size: 22px; padding: 20px; }
  .p-big { font-size: 22px; }
  .p-keys { display: none; }
  .p-foot { gap: 8px; }
  .p-foot .btn { min-height: 48px; font-size: 15px; padding: 0 14px; flex: 1 1 auto; min-width: 0; }
  .p-foot .p-exit { flex: 0 0 auto; padding: 0 12px; }
  .p-exit span, .p-en { display: none; }
  .p-pager { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

/* ---------- board: period selector (Día · Semana · Mes · 7 días) and period values */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 3px; gap: 2px; min-height: var(--tap); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 650; padding: 0 13px;
  border-radius: 8px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.page-h .sub .range { color: var(--ink); font-weight: 700; }
.mrow .m-val .agg-hint { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.depttabs { margin-bottom: 12px; }
@media (max-width: 640px) {
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 6px; }
  .page-h .tools .btn { flex: 1 1 100%; }
}
.mrow .m-tgt .tgt-note { display: block; font-size: 12px; color: var(--muted); }
.m-tgt-sm .tgt-note { font-size: 12px; }
@media (max-width: 640px) { .stats > .stat.wide { grid-column: 1 / -1; } }

/* ---------- language (ES | EN): one segmented control for the top bar, the login card, Presentación and the TV */
.lang { display: inline-flex; align-items: center; height: 34px; padding: 2px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-right: 4px; }
.lang button { all: unset; cursor: pointer; display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: var(--r-pill);
  font: inherit; font-size: 12px; font-weight: 750; letter-spacing: .04em; color: var(--muted); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.lang button:focus-visible { outline: 3px solid var(--s1); outline-offset: 1px; }
.float-theme { display: flex; align-items: center; gap: 6px; }
.p-foot .lang { margin-left: 8px; }
@media (max-width: 900px) { .p-foot .lang { margin-left: 0; } }
html[lang="en"] .only-es, html:not([lang="en"]) .only-en { display: none; }

/* ---------- loading: a route never shows a blank screen; the placeholder is replaced by the view's first paint */
.route-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--line-strong); } }

/* ---------- metric name badges: the 6:00 snapshot clock (replaces "(foto 6:00)" in the label) */
.clock { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px 0 4px; margin-left: 6px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
  color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); vertical-align: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock svg.ic { width: 13px; height: 13px; stroke-width: 2.2; }
.clock.other { font-weight: 600; font-style: italic; }   /* a photo borrowed from another day: "foto 11 oct" */

/* a word target ("Meta: medir" while a metric is calibrated) is grey and never a number */
.tgt-soft { color: var(--muted); font-weight: 600; white-space: nowrap; }
.p-tgt .tgt-soft { font-size: 16px; }

/* the stat strip names its scope ("Resumen · Producción") so a remembered department never reads as the whole plant */
.stats-scope { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 2px 0 8px; }
/* tile text may wrap to a second line; numbers stay whole (.nw) and are never cut with an ellipsis */
.stat .s-lbl { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.stat .s-sub { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere; }
.stat .s-sub .nw { overflow-wrap: normal; }

/* comparison with the previous period: arrow + word, green when better, red when worse, grey when flat / no data */
.cmp { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  white-space: nowrap; vertical-align: 3px; color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.cmp i { font-style: normal; font-size: 10px; }
.cmp.up { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent); }
.cmp.down { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crit) 40%, transparent); }
.mrow .m-val .cmp-line { display: block; margin-top: 3px; white-space: normal; }
.mrow .m-val .cmp-line .cmp { vertical-align: 0; }
.stat .s-sub .cmp { vertical-align: 0; margin-top: 2px; }
.p-val .cmp { display: inline-flex; height: 24px; font-size: 13px; margin-left: 8px; vertical-align: 6px; }
@media (max-width: 900px) { .mrow .m-val .cmp-line { text-align: right; } }

/* inline field validation (Admin target) */
.field-err { display: block; margin-top: 4px; font-size: 12px; font-weight: 650; color: var(--crit-ink); }
.t-cell { min-width: 150px; }
.adm-metrics td input { max-width: 180px; }
.adm-metrics td select { min-width: 112px; }

/* the top bar must fit six links, the plant, the language and the person at 1280 px: tighter links, a shorter name */
.nav a { padding: 0 10px; }
.actor { max-width: 170px; }
.plant select { max-width: 200px; }
@media (max-width: 1280px) { .actor .who { display: none; } .actor { padding: 0; border: 0; background: transparent; } }
@media (max-width: 640px) { .lang button { min-width: 28px; padding: 0 5px; font-size: 11px; } .plant select { min-width: 100px; } .topbar .bar-right { gap: 2px; } }
@media (max-width: 1100px) and (min-width: 901px) { .nav a { padding: 0 8px; font-size: 13px; } .brand-name span { display: none; } }
.tier-help { cursor: help; color: var(--muted); font-weight: 700; border-radius: 50%; }
.tier-help:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }

/* ---- robustness (2026-10-11): data summary line, weekday chip, empty-department hint, no-production banner, screen error */
.data-line { display: inline-block; font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: help; }
.data-line.gaps { color: var(--warn-ink); }
.data-line.none { color: var(--crit-ink); }
.wkday { padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; text-transform: capitalize; }
.wkday.weekend { color: var(--warn-ink); }
.dept-empty a { font-weight: 700; text-decoration: underline; }
.banner.noprod-top { font-size: 15px; padding: 16px 18px; border: 2px solid var(--line-strong); }
.auto-line { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.err-toast { position: fixed; left: 12px; right: 12px; top: 12px; z-index: 100; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--r); background: var(--crit); color: #fff; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.3); word-break: break-word; }
.err-toast[hidden] { display: none; }
.err-toast i { font-style: normal; font-weight: 900; }
.err-toast span { flex: 1; }
.err-toast .x { background: transparent; border: 0; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; min-width: 32px; min-height: 32px; }
