@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=Barlow:wght@400;500;600;700&display=swap');
:root {
  color-scheme: light dark;
  --bg:#eff2ef; --surface:#ffffff; --surface2:#f5f7f6; --ink:#193234;
  --muted:#65777a; --line:#d7e1df; --teal:#146d70; --teal-dark:#123a3c;
  --amber:#a9680f; --purple:#7858a7; --danger:#ad4140; --glow:rgba(20,109,112,.15);
  font-family:Barlow,system-ui,-apple-system,sans-serif;
  font-synthesis:none;
}
* {box-sizing:border-box}
html {scroll-behavior:smooth}
body {margin:0; background:var(--bg); color:var(--ink); min-height:100dvh}
button,input,select,textarea {font:inherit; font-size:16px}
button {cursor:pointer}
button:disabled {opacity:.45;cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {outline:3px solid var(--teal);outline-offset:2px}
a {color:var(--teal)}
[hidden] {display:none!important}
.shell {max-width:1024px;margin:auto;padding:0 15px 35px}
.topbar {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:21px 0 20px;border-bottom:1px solid var(--line)}
.identity {display:flex;align-items:center;gap:11px;min-width:0}
.brandmark {background:var(--teal-dark);color:#fff;display:grid;place-content:center;font-family:'Barlow Condensed',Impact,sans-serif;font-size:25px;font-weight:800;letter-spacing:-1.6px;width:49px;height:49px;border-radius:12px;flex:none}
.brandmark span {color:#a7dbcc}
.eyebrow,.section-kicker {font:700 11px 'Barlow Condensed',Impact,sans-serif;letter-spacing:1.9px;color:var(--teal);text-transform:uppercase}
.brandtitle {font:700 21px 'Barlow Condensed',Impact,sans-serif;line-height:1.1;margin-top:3px}
.save-state {font-size:12px;color:var(--muted);font-weight:700;text-align:right;flex:none}
.save-state.good {color:var(--teal)}.save-state.bad {color:var(--danger)}
.sync-indicators {display:flex;flex-direction:column;gap:5px;align-items:flex-end;max-width:160px}
.sync-state {font-size:12px;font-weight:700;color:var(--muted);text-align:right;overflow-wrap:anywhere}
.sync-state.good {color:var(--teal)}.sync-state.bad {color:var(--danger)}
.cloud-login {position:fixed;z-index:2000;inset:0;overflow-y:auto;background:var(--bg);display:grid;place-items:center;padding:16px}
.cloud-login-card {width:min(100%,450px);background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:26px;box-shadow:0 12px 70px rgba(0,0,0,.16)}
.cloud-login-card h1 {color:var(--teal-dark);margin:14px 0}
.cloud-login-card p {color:var(--muted);line-height:1.5}
.cloud-login-card>label {display:flex;flex-direction:column;gap:7px;font-size:14px;font-weight:800;margin-top:15px}
.cloud-login-card .remember-line {display:flex;flex-direction:row;align-items:center;gap:10px;font-size:15px;font-weight:600}
.cloud-login-card .remember-line input {width:22px;height:22px}
.cloud-login-card button {width:100%;margin-top:10px}
.cloud-login-card .login-error {min-height:20px;color:var(--danger);font-weight:700;margin:10px 0 0}
.page-head {display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:14px;margin:27px 0 23px}
h1,h2,h3,p {margin-top:0}
h1,h2,h3 {font-family:'Barlow Condensed',Impact,'Arial Narrow',sans-serif;letter-spacing:.1px}
h1 {font-size:clamp(36px,8vw,52px);line-height:.96;margin:7px 0 7px;font-weight:700}
h2 {font-size:28px;margin:0;line-height:1.12}
h3 {font-size:23px;margin:0}
.subhead {font-size:14px;color:var(--muted);margin:9px 0 0;line-height:1.45}
.btn {border:1px solid var(--line);border-radius:13px;display:inline-flex;justify-content:center;align-items:center;gap:9px;min-height:46px;padding:10px 17px;background:var(--surface);color:var(--ink);font-weight:700;line-height:1.15;transition:transform .08s,background .15s;text-decoration:none}
.btn:active {transform:scale(.98)}
.btn-primary {background:var(--teal-dark);border-color:var(--teal-dark);color:#fff;min-height:50px}
.btn-light {background:var(--surface2)}
.btn-danger {color:var(--danger);border-color:color-mix(in srgb,var(--danger) 25%,var(--line))}
.btn-danger-solid {background:var(--danger);border-color:var(--danger);color:#fff}
.btn-small {min-height:38px;padding:7px 12px;border-radius:10px;font-size:14px}
.btn-wide {width:100%}
.button-group {display:flex;flex-wrap:wrap;gap:9px}
.tools {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin-bottom:16px}
input,select,textarea {width:100%;min-width:0;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:11px;padding:12px 13px;outline:none}
input:focus,select:focus,textarea:focus {border-color:var(--teal);box-shadow:0 0 0 3px var(--glow)}
input[type='checkbox'] {width:20px;height:20px;accent-color:var(--teal)}
input[type='range'] {padding:0;box-shadow:none!important;border:0;height:29px;background:transparent;accent-color:var(--teal);cursor:pointer}
input[type='number'] {font-variant-numeric:tabular-nums}
textarea {resize:vertical;min-height:110px}
.search-wrap {position:relative}
.search-wrap input {padding-left:39px}
.search-wrap::before {content:'⌕';position:absolute;top:9px;left:13px;font-size:27px;color:var(--muted);pointer-events:none}
.card {background:var(--surface);border:1px solid var(--line);border-radius:17px;box-shadow:0 4px 20px rgba(7,36,37,.025)}
.set-list {display:grid;gap:11px}
.set-card {width:100%;background:var(--surface);color:var(--ink);display:flex;text-align:left;align-items:center;gap:13px;border:1px solid var(--line);padding:16px;border-radius:17px;min-height:112px}
.set-card:active {background:var(--surface2)}
.set-badge {width:6px;align-self:stretch;background:var(--teal);border-radius:8px;flex:none}
.set-badge.ready {background:var(--amber)}.set-badge.issued {background:#809091}
.set-body {flex:1;min-width:0}
.set-serial {font-size:12px;letter-spacing:1px;color:var(--teal);font-weight:800}
.set-name {font:700 25px 'Barlow Condensed',Impact,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:3px 0}
.set-meta {color:var(--muted);font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.set-side {text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:9px;flex:none;max-width:90px}
.status {border-radius:100px;padding:5px 8px;font-size:11px;font-weight:800;white-space:nowrap;background:#e2f1ef;color:#136368}
.status.ready {background:#fdf1dc;color:#8b5b0f}.status.issued {background:#e7eded;color:#607173}
.list-time {font:700 16px 'Barlow Condensed',Impact,sans-serif}
.chevron {font-size:24px;color:var(--muted)}
.empty {text-align:center;padding:54px 24px;margin:20px 0}
.empty-symbol {font-size:56px;opacity:.6;margin-bottom:15px}
.empty p {font-size:15px;color:var(--muted);max-width:350px;margin:12px auto 20px}
.backup-panel {padding:21px;margin-top:30px}
.backup-panel h3 {margin-bottom:5px}.backup-panel p {font-size:14px;color:var(--muted);line-height:1.5}
.notice {font-size:12px;color:var(--muted);line-height:1.5;margin-top:12px}
.notice strong {color:var(--ink)}
.back-button {border:0;background:transparent;padding:12px 0;color:var(--teal);font-weight:700}
.detail-header {margin-bottom:17px}
.serial-row {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:7px 0}
.serial {font:800 clamp(27px,7vw,39px) 'Barlow Condensed',Impact,sans-serif;letter-spacing:.8px}
.detail-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}
.panel {padding:19px;margin:13px 0}
.panel-title {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px}
.field-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.field {min-width:0;display:flex;flex-direction:column;gap:6px}
.field.full {grid-column:1/-1}
.field label {font-size:13px;font-weight:800;color:var(--muted);letter-spacing:.2px}
.field .hint {font-size:12px;color:var(--muted)}
.checkfield {display:flex;align-items:center;gap:10px;min-height:45px;font-size:15px;font-weight:700}
.swatches {display:flex;gap:9px;flex-wrap:wrap;margin-top:4px}
.swatch {height:34px;width:34px;border-radius:10px;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line);padding:0}
.swatch.selected {box-shadow:0 0 0 3px var(--teal)}
.color-pair {display:flex;gap:9px;align-items:center}
.color-pair input[type='color'] {width:56px;height:47px;padding:3px;flex:none}
.color-pair input[type='text'] {flex:1}
.section-title {margin:31px 0 12px}
.legend {display:flex;gap:14px;flex-wrap:wrap;margin:12px 0 18px}
.legend-item {display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px;font-weight:700}
.legend-dot {width:11px;height:11px;border-radius:4px;background:var(--teal)}
.legend-dot.wait {background:repeating-linear-gradient(135deg,var(--amber),var(--amber) 4px,transparent 4px,transparent 7px);border:1px solid var(--amber)}
.legend-dot.chem {background:var(--purple)}
.step-grid {display:grid;gap:11px}
.step-card {padding:16px 18px 14px;border-left:5px solid var(--teal)}
.step-card.wait {border-left-color:var(--amber)}.step-card.chem {border-left-color:var(--purple)}
.step-top {display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.step-name {font-weight:800;font-size:16px;line-height:1.3}
.step-name small {display:block;font-size:12px;color:var(--muted);font-weight:500;margin-top:5px}
.step-pill {font-size:11px;text-transform:uppercase;letter-spacing:.6px;white-space:nowrap;color:var(--teal);font-weight:800}
.step-card.wait .step-pill {color:var(--amber)}.step-card.chem .step-pill {color:var(--purple)}
.step-controls {display:grid;grid-template-columns:minmax(0,1fr) 89px;gap:13px;align-items:center;margin-top:12px}
.step-controls input[type='number'] {padding:11px 8px;text-align:center;font-weight:700}
.step-footer {display:flex;justify-content:space-between;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin-top:3px}
.step-value {font-weight:800;color:var(--ink);font-size:13px}
.step-card.wait input[type='range'] {accent-color:var(--amber)}.step-card.chem input[type='range'] {accent-color:var(--purple)}
.optional-heading {font-size:19px;margin:24px 0 11px;color:var(--muted)}
.photo-actions {display:flex;flex-wrap:wrap;gap:9px}
.photo-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:10px;margin-top:15px}
.photo-tile {position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:var(--surface2);border:1px solid var(--line)}
.photo-open {border:0;padding:0;width:100%;height:100%;background:transparent}
.photo-open img {width:100%;height:100%;object-fit:cover}
.photo-delete {position:absolute;right:4px;top:4px;border:0;border-radius:8px;background:rgba(10,20,20,.85);color:#fff;font-weight:800;width:31px;height:31px}
.totals-bar {position:fixed;bottom:0;left:0;right:0;z-index:5;background:var(--teal-dark);color:#fff;box-shadow:0 -8px 28px rgba(0,0,0,.18);padding:11px max(13px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.total-stat {min-width:0;display:flex;flex-direction:column;gap:4px;text-align:center;border-right:1px solid rgba(255,255,255,.18)}
.total-stat:last-child {border:0}.total-stat span {font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:#bfd0ce;font-weight:700}
.total-stat strong {font:700 20px 'Barlow Condensed',Impact,sans-serif;white-space:nowrap}
.total-stat.work strong {color:#75d1c4}.total-stat.wait strong {color:#ffc673}.total-stat.chem strong {color:#d0b3ff}
.with-totals {padding-bottom:105px}
.modal-layer,.photo-viewer {position:fixed;inset:0;z-index:20;background:rgba(5,19,19,.73);display:flex;align-items:center;justify-content:center;padding:18px}
.modal {background:var(--surface);color:var(--ink);width:min(100%,440px);border-radius:20px;padding:23px;box-shadow:0 30px 60px rgba(0,0,0,.3)}
.modal h2 {margin-bottom:10px}.modal p {color:var(--muted);font-size:15px;line-height:1.5}
.modal .button-group {margin-top:20px}
.photo-viewer {background:rgba(1,8,9,.96);flex-direction:column;gap:12px}
.photo-viewer img {object-fit:contain;max-width:100%;max-height:calc(100dvh - 100px)}
.photo-viewer button {align-self:flex-end;margin-right:10px;background:#fff;color:#111;border:0;padding:10px 18px;border-radius:12px;font-weight:800}
.gantt-row {display:grid;grid-template-columns:115px 1fr;gap:9px;align-items:center;margin:10px 0;font-size:12px}
.gantt-label {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gantt-track {height:23px;display:flex;align-items:center;background:var(--surface2);border-radius:5px;overflow:hidden}
.gantt-fill {min-width:2px;height:100%;background:var(--teal);border-radius:3px;position:relative}
.gantt-fill.wait {background:repeating-linear-gradient(135deg,var(--amber),var(--amber) 6px,#dca85c 6px,#dca85c 10px)}
.gantt-fill.chem {background:var(--purple)}
.gantt-time {font-weight:800;font-size:11px;margin-left:5px}
.metric-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin:16px 0}
.metric {padding:16px 14px;min-width:0;display:flex;flex-direction:column;gap:5px}
.metric span {color:var(--muted);font-size:12px;font-weight:800;line-height:1.3}
.metric strong {font:800 clamp(25px,3vw,36px) 'Barlow Condensed',Impact,sans-serif;line-height:1.05}
.metric small {font-size:11px;color:var(--muted);line-height:1.4}
.metric.work {border-top:4px solid var(--teal)}.metric.wait {border-top:4px solid var(--amber)}.metric.chem {border-top:4px solid var(--purple)}
.week-chart {display:flex;align-items:flex-end;gap:7px;margin:18px 0 8px;min-height:170px}
.week-col {display:flex;flex-direction:column;align-items:center;gap:6px;flex:1;min-width:0}
.week-count {font-weight:800;font-size:13px;font-variant-numeric:tabular-nums}
.week-track {height:121px;width:100%;max-width:64px;background:var(--surface2);border-radius:7px 7px 3px 3px;display:flex;align-items:flex-end;overflow:hidden}
.week-fill {width:100%;background:var(--teal);border-radius:7px 7px 0 0}
.week-label {color:var(--muted);font-weight:700;font-size:11px}
.insight-row {display:flex;align-items:center;gap:13px;padding:12px 0;border-bottom:1px solid var(--line)}
.insight-row strong {display:block;font-size:15px}.insight-row small {display:block;color:var(--muted);font-size:12px;margin-top:3px}
.insight-rank {display:grid;place-items:center;height:35px;width:35px;flex:none;border-radius:11px;background:var(--teal-dark);color:#fff;font:700 20px 'Barlow Condensed',Impact,sans-serif}
.insight-subtitle {font-size:20px;margin:25px 0 3px}
.deviation {font-weight:800;font-size:13px;flex:none;color:var(--amber);min-width:56px}
.stage-stat {padding:13px 0;border-bottom:1px solid var(--line)}.stage-stat:last-child {border:0}
.stage-stat-head,.stage-stat-foot {display:flex;align-items:center;justify-content:space-between;gap:10px}
.stage-stat-head {font-size:14px}.stage-stat-head span {font-weight:800;white-space:nowrap;font-variant-numeric:tabular-nums}
.stage-stat-head em {font-style:normal;color:var(--muted);font-weight:500;font-size:12px}
.stage-stat-foot {font-size:11px;color:var(--muted);margin-top:5px}
.stat-track {background:var(--surface2);border-radius:4px;height:9px;overflow:hidden;margin-top:9px}
.stat-fill {height:100%;border-radius:4px;background:var(--teal);min-width:0}
.stat-fill.wait {background:repeating-linear-gradient(135deg,var(--amber),var(--amber) 5px,transparent 5px,transparent 8px);border:1px solid var(--amber)}
.stat-fill.chem {background:var(--purple)}
.print-only {display:none}
.loading {padding:70px;text-align:center;color:var(--muted)}
@media(max-width:440px) {
  .shell {padding:0 12px 28px}.topbar {padding:14px 0}
  .brandtitle {font-size:19px}.save-state {font-size:11px}
  .field-grid {gap:12px}.panel {padding:16px}
  .tools {grid-template-columns:1fr}.tools .btn {width:100%}
  .page-head .btn {width:100%}
  .step-card {padding:13px 13px 11px}.step-controls {gap:8px;grid-template-columns:minmax(0,1fr) 79px}
  .step-name {font-size:15px}.total-stat strong {font-size:17px}.total-stat span {font-size:9px}
  .metric-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .metric {padding:14px 12px}.metric strong {font-size:29px}
  .week-chart {gap:3px}.week-label {font-size:9px}
  .stage-stat-head {font-size:13px}
}
@media(prefers-color-scheme:dark) {
  :root {--bg:#10191b;--surface:#1a272a;--surface2:#233236;--ink:#e5efeb;--muted:#a1b2b1;--line:#334447;--teal:#6ebdb5;--teal-dark:#154346;--amber:#e0a347;--purple:#bf9bf0;--danger:#f08d88;--glow:rgba(110,189,181,.17)}
  .status {background:#194842;color:#a8eee0}.status.ready {background:#45331b;color:#ffcb77}.status.issued {background:#344345;color:#c5d7d9}
  .btn-primary {color:#fff}.brandmark {background:#1d5558}
}
@media print {
  body {background:#fff;color:#000}
  .shell,.totals-bar,.modal-layer,.photo-viewer {display:none!important}
  .print-only {display:block!important;margin:15mm;width:68mm;border:2px solid #000;padding:6mm;font-family:Arial,sans-serif}
  .print-logo {font-size:16pt;font-weight:900}.print-serial {font-size:20pt;font-weight:900;line-height:1.15;margin:4mm 0;word-break:break-word}
  .print-note {font-size:11pt;line-height:1.5}
}
