/* ───────────────────────────────────────────────────────────────────────────
   W.R. Long — Shop Floor Workflow App
   Shared design system. Neutral industrial canvas with the primary accent
   swapped to #003478 navy.
   Zapier orange (#ff4f00) is retained ONLY as the sparing priority/alert accent,
   honoring the brief's "blue dominant, orange accent, industrial" direction.
─────────────────────────────────────────────────────────────────────────── */

:root {
  /* Neutral application palette */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-warm: #f1f5f9;
  --fg: #111827;
  --fg-2: #374151;
  --muted: #6b7280;
  --border: #d1d5db;
  --border-soft: #e5e7eb;

  /* THE SWAP: accent orange → navy. Navy is now dominant/primary. */
  --accent: #003478;
  --accent-on: #ffffff;
  --accent-hover: color-mix(in oklab, var(--accent), black 10%);
  --accent-active: color-mix(in oklab, var(--accent), black 18%);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 30%, transparent);

  /* secondary accent — orange, reserved for PRIORITY / HOLD / alert only */
  --hot: #ff4f00;
  --hot-soft: color-mix(in oklab, var(--hot) 14%, transparent);

  --success: #15803d;
  --success-soft: color-mix(in oklab, var(--success) 14%, transparent);
  --warn: #d97706;
  --warn-soft: color-mix(in oklab, var(--warn) 16%, transparent);
  --danger: #dc2626;

  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-pill: 9999px;

  --ring: 0 0 0 1px var(--border);
  --raised: 0 12px 32px rgba(15, 23, 42, 0.10);
  --raised-lg: 0 20px 60px rgba(0, 32, 80, 0.16);
  --focus: 0 0 0 4px color-mix(in oklab, var(--accent) 26%, transparent);

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; width: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.order-page {
  --font-display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Montserrat", system-ui, sans-serif;
  --font-mono: "Roboto Condensed", "Arial Narrow", sans-serif;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

:where(a, button, [role="button"], [tabindex="0"]) {
  -webkit-tap-highlight-color: color-mix(in oklab, var(--accent) 18%, transparent);
  touch-action: manipulation;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.muted { color: var(--muted); }

/* ── full-screen station frame (1080 × 1920 shop-floor touchscreen) ─────── */
.floor {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: block;
  padding: 0;
  background: var(--surface);
}
.station {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ── appbar + station badge ────────────────────────────────────────────── */
.appbar {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 80px;
  padding: 14px clamp(20px, 3vw, 40px);
  background: var(--accent);
  color: var(--accent-on);
}
.appbar.appbar-lg { padding: 16px 24px; }
.header-avatar {
  width: 48px;
  height: 48px;
  flex: none;
  object-fit: cover;
  object-position: center top;
  border: 1px solid color-mix(in oklab, var(--surface) 72%, transparent);
  border-radius: 0;
  background: var(--surface);
}
.header-user { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.appbar .header-avatar { border-color: color-mix(in oklab, var(--surface) 72%, transparent); }
.station-badge {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent);
  border-radius: 14px;
  font-family: var(--font-mono); font-weight: 700; font-size: 26px;
  box-shadow: inset 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.appbar .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.appbar .who b { font-size: 15px; }
.appbar .who span { font-size: 12px; opacity: 0.82; font-family: var(--font-mono); }
.appbar .spacer { margin-left: auto; }
.appbar .clock { font-family: var(--font-mono); font-size: 14px; opacity: 0.9; }
.switch-btn {
  background: color-mix(in oklab, white 16%, transparent);
  color: var(--accent-on);
  border: 1px solid color-mix(in oklab, white 28%, transparent);
  border-radius: var(--radius-pill);
  min-height: 48px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.switch-btn:hover { background: color-mix(in oklab, white 26%, transparent); }

/* mini completion strip inside appbar */
.appbar-stat { text-align: right; line-height: 1.05; }
.appbar-stat b { font-family: var(--font-mono); font-size: 22px; }
.appbar-stat span { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }

/* ── scan bar ──────────────────────────────────────────────────────────── */
.scan {
  padding: 20px clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}
.scan label { display:block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.scan-field { display: flex; gap: 10px; }
.scan-input {
  flex: 1; min-width: 0;
  padding: 16px 16px;
  border: 2px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 20px; letter-spacing: 0.04em;
  color: var(--fg);
}
.scan-input::placeholder { color: color-mix(in oklab, var(--muted) 70%, transparent); }
.scan-input:focus { outline: none; box-shadow: var(--focus); border-color: var(--accent); }

/* ── body scroll area ──────────────────────────────────────────────────── */
.screen-body { flex: 1; width: 100%; overflow-y: auto; padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 28px; }
.lane-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.lane-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.lane-head .count {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 9px; border-radius: var(--radius-pill);
}
.lane-head.is-active h2 { color: var(--accent); }
.lane-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.lane-head.is-ready .dot { background: var(--muted); }

/* ── unit card (a work unit / order in a queue) ────────────────────────── */
.unit {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .05s var(--ease);
}
.unit:hover { border-color: var(--accent-line); box-shadow: var(--raised); }
.unit:active { background: var(--accent-soft); transform: translateY(1px); }
.unit:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.unit.is-next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--raised); }
.unit.is-active { background: color-mix(in oklab, var(--accent) 5%, var(--surface)); border-color: var(--accent-line); }
.unit .ord { font-family: var(--font-mono); font-weight: 700; font-size: 18px; }
.unit .cust { color: var(--fg-2); font-size: 14px; }
.unit .part { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.unit .chips { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.unit .qty { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* batch group wrapper */
.batch {
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 12px 12px 2px;
  margin-bottom: 14px;
  background: color-mix(in oklab, var(--accent) 3.5%, var(--surface));
}
.batch-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.batch-head .pn { font-family: var(--font-mono); }
.batch .unit { margin-bottom: 10px; }

/* ── chips (status + facets) ───────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip-new      { background: var(--border-soft); color: var(--fg-2); border-color: var(--border); }
.chip-progress { background: var(--accent-soft); color: var(--accent); }
.chip-hold     { background: var(--hot-soft); color: var(--hot); }
.chip-ready    { background: var(--success-soft); color: var(--success); }
.chip-priority { background: var(--hot); color: #fff; }
.chip-freight  { background: var(--warn-soft); color: var(--warn); }
.chip-pn { background: transparent; border-color: var(--border); color: var(--muted); font-family: var(--font-mono); }
.chip-wait { background: transparent; border-color: var(--border); color: var(--fg-2); font-family: var(--font-mono); }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  font-weight: 600; font-size: 15px; transition: background .15s var(--ease), border-color .15s var(--ease), transform .05s var(--ease);
}
.btn:hover { border-color: var(--fg-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-hot { background: var(--hot); color: #fff; border-color: var(--hot); }
.btn-hot:hover { background: color-mix(in oklab, var(--hot), black 10%); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--border-soft); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, var(--border)); background: transparent; }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 8%, transparent); }
.btn-block { width: 100%; }
/* big shop-floor touch target */
.btn-xl { padding: 22px 24px; font-size: 22px; border-radius: var(--radius-lg); min-height: 72px; }
.btn-xl svg { width: 26px; height: 26px; }
.btn-lg { padding: 16px 20px; font-size: 17px; min-height: 56px; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: auto; }

/* ── primary action footer (sticky at station base) ────────────────────── */
.action-bar {
  padding: 18px clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex; gap: 12px;
}

/* ── generic card / panel ──────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.panel-head h3 { font-size: 16px; }
.panel-body { padding: 20px; }
.panel-head .spacer { margin-left: auto; }

/* ── order page ────────────────────────────────────────────────────────── */
.ord-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 980px) { .ord-grid { grid-template-columns: 1fr; } }
.ord-header {
  background: var(--accent); color: var(--accent-on);
  border-radius: var(--radius-lg); padding: 22px 24px;
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start;
}
.ord-header .onum { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: 0.01em; }
.ord-header .cust { font-size: 17px; opacity: 0.92; margin-top: 2px; }
.ord-header .meta-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-size: 13px; }
.ord-header .meta-row .k { opacity: 0.7; display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.ord-header .meta-row .v { font-weight: 600; font-size: 15px; }

.li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); align-items: center; }
.li:first-child { border-top: 0; }
.li .seq { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.li .pn { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.li .desc { font-size: 13px; color: var(--muted); }
.li .q { font-family: var(--font-mono); font-weight: 700; font-size: 17px; }
.li .q small { color: var(--muted); font-weight: 500; }

/* manual action buttons grid on order page */
.manual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* PDF / instructions viewer placeholder */
.pdf {
  position: relative; aspect-ratio: 8.5 / 11; width: 100%;
  background:
    repeating-linear-gradient(0deg, transparent 0 26px, var(--border-soft) 26px 27px),
    var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden;
}
.pdf .pdf-tag { position: absolute; top: 12px; left: 12px; }
.pdf .pdf-body { padding: 44px 28px 28px; }
.pdf .pdf-h { height: 18px; width: 60%; background: var(--fg-soft, color-mix(in oklab, var(--fg) 12%, transparent)); border-radius: 4px; margin-bottom: 18px; }
.pdf .pdf-l { height: 9px; background: var(--border); border-radius: 4px; margin-bottom: 11px; }
.pdf .quad {
  position: absolute; right: 16px; bottom: 16px; width: 44%; height: 30%;
  border: 2px dashed var(--accent); border-radius: 8px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent); text-align: center; padding: 6px;
}
.pdf-tools { display: flex; gap: 8px; align-items: center; padding: 10px 0 0; }

/* The attached build sheet is the order screen's primary work surface. */
.order-station { height: 100vh; height: 100dvh; min-height: 0; }
.order-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(340px, 27vw, 430px) minmax(0, 1fr);
  background: var(--border-soft);
}
.pdf-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; grid-column: 2; grid-row: 1; }
.pdf-toolbar {
  min-height: 64px;
  padding: 10px clamp(16px, 2vw, 28px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pdf-toolbar .pdf-title { min-width: 0; }
.pdf-toolbar .pdf-title b { display: block; font-size: 15px; }
.pdf-toolbar .pdf-title span { display: block; font: 12px var(--font-mono); color: var(--muted); }
.pdf-toolbar .spacer { margin-left: auto; }
.pdf-zoom { display: inline-flex; align-items: center; border: 1px solid var(--border); }
.pdf-zoom .btn { min-width: 48px; min-height: 46px; padding: 10px 14px; border-width: 0 0 0 1px; }
.pdf-zoom .btn:first-child { border-left: 0; }
.pdf-zoom output { min-width: 58px; padding-inline: 10px; text-align: center; font: 600 14px var(--font-mono); color: var(--fg-2); }
.pdf-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: clamp(16px, 2vw, 28px);
  background: var(--border-soft);
}
.pdf-page {
  display: block;
  width: min(100%, 1180px);
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
}
.order-details {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.order-details .ord-header { border-radius: var(--radius-md); padding: 18px; }
.order-details .ord-header .onum { font-size: 24px; }
.order-details .panel-body { padding: 16px; }
.order-details > .panel { border-width: 1px 0 0; background: transparent; }
.order-details > .panel .panel-head { padding-inline: 0; }
.order-details > .panel .panel-body { padding-inline: 0; }
.order-details .lane-head { margin-bottom: 10px; }
.order-details .lane-head h2 { font: 700 18px/1.1 var(--font-display); letter-spacing: -0.01em; }
.order-details .manual-grid { gap: 8px; }
.order-details .manual-grid .btn { min-height: 60px; padding: 10px; font-size: 12px; line-height: 1.25; }
.order-details .manual-grid .btn svg { width: 20px; height: 20px; flex: none; }
.order-main.details-closed { grid-template-columns: 1fr; }
.order-main.details-closed .pdf-workspace { grid-column: 1; }
.order-main.details-closed .order-details { display: none; }

/* ── touch-only sign in ───────────────────────────────────────────────── */
.login-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 5vw, 64px);
  background: var(--bg);
}
.login-pane { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.login-pane h1 { font-size: clamp(34px, 4.4vw, 56px); max-width: 16ch; }
.user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-option {
  min-height: 112px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.user-option:hover, .user-option.sel { border-color: var(--accent); background: var(--accent-soft); }
.user-option .avatar-photo { width: 72px; height: 72px; flex: none; object-fit: cover; object-position: center top; border: 1px solid var(--border); border-radius: 0; background: var(--surface-warm); }
.user-option b { display: block; font-size: 18px; }
.user-option span:last-child { color: var(--muted); font-size: 13px; }
.station-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.station-option { min-height: 68px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-weight: 700; text-align: left; }
.station-option.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pin-panel { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.pin-display { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 16px; margin: 12px 0 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.pin-dot { width: 14px; height: 14px; border: 2px solid var(--accent); border-radius: 50%; }
.pin-dot.filled { background: var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key { min-height: 70px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font: 700 26px var(--font-mono); }
.pin-key:active { background: var(--accent-soft); transform: translateY(1px); }
.pin-key.utility { font-size: 15px; color: var(--fg-2); }
.login-actions { display: flex; gap: 12px; margin-top: auto; }
.login-actions .btn { min-height: 68px; }

/* scan timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li .node { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline li.skip .node { border-color: var(--muted); }
.timeline li.hold .node { border-color: var(--hot); }
.timeline .tl-row { display: flex; justify-content: space-between; gap: 12px; }
.timeline .tl-what { font-weight: 600; font-size: 14px; }
.timeline .tl-who { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.timeline .tl-when { font-size: 12px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }

/* ── weight / box capture (S4) ─────────────────────────────────────────── */
.scale-readout {
  display: flex; align-items: baseline; gap: 8px; justify-content: center;
  padding: 18px; background: #0d1b2e; color: #fff;
  border-radius: var(--radius-md); font-family: var(--font-mono);
}
.scale-readout .big { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; color: #7cc4ff; }
.scale-readout .u { font-size: 18px; opacity: 0.7; }
.box-pick { display: flex; flex-direction: column; gap: 8px; }
.box-opt {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  cursor: pointer;
}
.box-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.box-opt.done { opacity: 0.6; }
.box-opt .bx { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.box-opt .pn { font-family: var(--font-mono); font-weight: 600; }
.box-opt .st { margin-left: auto; font-size: 12px; font-family: var(--font-mono); }

/* ── toasts ────────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 60; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--raised); }
.toast .ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; }
.toast.ok .ico { background: var(--success-soft); color: var(--success); }
.toast.err .ico { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-body b { font-size: 14px; }
.toast .t-body p { font-size: 12px; color: var(--muted); }
.toast .retry { font-size: 12px; font-weight: 700; color: var(--accent); border: 0; background: transparent; padding: 2px 0; }

/* ── modal ─────────────────────────────────────────────────────────────── */
.modal-scrim {
  position: fixed; inset: 0; background: color-mix(in oklab, #0d1b2e 55%, transparent);
  display: grid; place-items: center; padding: 20px; z-index: 70;
}
.modal { width: min(460px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--raised-lg); overflow: hidden; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--fg); font: inherit; font-size: 15px;
}
.input:focus, .textarea:focus, .select:focus { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.textarea { min-height: 92px; resize: vertical; }
.char-count { font-size: 11px; color: var(--muted); font-family: var(--font-mono); text-align: right; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reason-chip { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 13px; font-weight: 600; text-align: center; }
.reason-chip:hover { border-color: var(--accent); }
.reason-chip.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.reason-chip:active { transform: translateY(1px); }

/* ═══ DESKTOP LANDSCAPE (manager + completion) ═══════════════════════════ */
.desk { min-height: 100vh; display: flex; flex-direction: column; }
.desk-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: var(--accent); color: var(--accent-on);
  position: sticky; top: 0; z-index: 20;
}
.desk-bar .brand { display: flex; align-items: center; gap: 12px; }
.desk-bar .brand .mark { width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--accent); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 800; font-size: 15px; }
.desk-bar .brand b { font-size: 16px; letter-spacing: -0.01em; }
.desk-bar .brand span { font-size: 11px; opacity: 0.8; font-family: var(--font-mono); display: block; }
.desk-tabs { display: flex; gap: 4px; margin-left: 18px; }
.desk-tabs a { padding: 8px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; opacity: 0.85; }
.desk-tabs a:hover { background: color-mix(in oklab, white 14%, transparent); opacity: 1; }
.desk-tabs a.on { background: #fff; color: var(--accent); opacity: 1; }
.desk-main { flex: 1; padding: 24px 28px; width: 100%; margin: 0; }

/* bottleneck strip */
.bottleneck { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 920px) { .bottleneck { grid-template-columns: repeat(2, 1fr); } }
.bn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px;
}
.bn .lbl { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bn .val { font-family: var(--font-mono); font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.bn .sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.bn.hot { border-color: var(--hot); }
.bn.hot .val { color: var(--hot); }
.bn.hold-bn .val { color: var(--hot); }

/* manager schedule table */
.sched { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.sched th { text-align: left; padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); font-weight: 600; }
.sched td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sched tr:last-child td { border-bottom: 0; }
.sched tr:hover td { background: color-mix(in oklab, var(--accent) 3%, transparent); }
.sched tbody tr { cursor: pointer; }
.sched tbody tr:active td { background: var(--accent-soft); }
.sched tbody tr:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sched .grab { cursor: grab; color: var(--muted); user-select: none; width: 18px; }
.sched tr.pinned td { background: color-mix(in oklab, var(--hot) 6%, transparent); }
.sched .ordc { font-family: var(--font-mono); font-weight: 700; }
.sched .pos { font-family: var(--font-mono); color: var(--muted); width: 30px; }
.station-pip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 600; }
.station-pip .p { width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.station-pip.s-hold .p { background: var(--hot-soft); color: var(--hot); }
.wait-bar { height: 6px; border-radius: 3px; background: var(--border); position: relative; overflow: hidden; min-width: 70px; }
.wait-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.wait-bar.warn > i { background: var(--warn); }
.wait-bar.hot > i { background: var(--hot); }

/* completion (wall display) */
.wall { min-height: 100vh; display: flex; flex-direction: column; background: #0d1b2e; color: #fff; }
.wall-head { padding: 28px 40px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.wall-head .mark { width: 44px; height: 44px; border-radius: 10px; background: #fff; color: var(--accent); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 800; }
.wall-head h1 { font-size: 22px; }
.wall-head .clock { margin-left: auto; font-family: var(--font-mono); font-size: 18px; opacity: 0.7; }
.wall-main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.08); }
@media (max-width: 820px) { .wall-main { grid-template-columns: 1fr; } }
.wall-cell { background: #0d1b2e; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.wall-cell .k { font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; font-family: var(--font-mono); }
.wall-cell .big { font-family: var(--font-mono); font-size: clamp(80px, 16vw, 200px); font-weight: 800; line-height: 0.9; letter-spacing: -0.03em; color: #7cc4ff; }
.wall-cell .delta { font-family: var(--font-mono); font-size: 18px; margin-top: 12px; }
.wall-cell .delta.up { color: #5ee0a0; }
.wall-cell .delta.down { color: var(--hot); }
.wall-foot { padding: 22px 40px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 36px; flex-wrap: wrap; }
.wall-foot .item { font-family: var(--font-mono); }
.wall-foot .item b { font-size: 28px; display: block; }
.wall-foot .item span { font-size: 12px; opacity: 0.6; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── launcher (index) ──────────────────────────────────────────────────── */
.launch { width: 100%; margin: 0; padding: clamp(40px, 5vw, 72px) clamp(24px, 4vw, 64px) 80px; }
.launch-hero { margin-bottom: 44px; }
.launch-hero .mark { width: 56px; height: 56px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 800; font-size: 20px; margin-bottom: 22px; }
.launch-hero h1 { font-size: clamp(32px, 5vw, 48px); }
.launch-hero p { font-size: 18px; color: var(--fg-2); max-width: 62ch; margin-top: 14px; }
.flow-note { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.flow-note .step { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); }
.flow-note .step .n { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.flow-note .arr { color: var(--muted); }
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.screen-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.screen-card:hover { border-color: var(--accent); box-shadow: var(--raised); transform: translateY(-2px); }
.screen-card:active { background: var(--accent-soft); transform: translateY(0); }
.screen-card:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.screen-card .id { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; }
.screen-card h3 { font-size: 18px; }
.screen-card p { font-size: 14px; color: var(--muted); flex: 1; }
.screen-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.screen-card .device { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

@media (max-width: 820px) {
  .login-main { grid-template-columns: 1fr; overflow-y: auto; }
  .order-main { grid-template-columns: 1fr; position: relative; }
  .pdf-workspace { grid-column: 1; }
  .order-details { position: absolute; inset: 0 auto 0 0; width: min(420px, 92vw); z-index: 15; box-shadow: var(--raised-lg); }
  .order-main.details-closed .order-details { display: none; }
}

@media (max-width: 1180px) {
  .pdf-toolbar { flex-wrap: wrap; }
  .pdf-toolbar .pdf-title { flex: 1 1 50%; }
  .pdf-toolbar .spacer { display: none; }
  .pdf-zoom { order: 3; }
}

@media (max-width: 560px) {
  .appbar { min-height: 68px; padding-inline: 14px; }
  .screen-body, .scan, .action-bar { padding-inline: 16px; }
  .user-grid { grid-template-columns: 1fr; }
  .login-main { padding: 24px 16px; }
  .desk-bar { flex-wrap: wrap; }
}

/* utility */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.gap-sm { gap: 8px; }
.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
hr.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.center { text-align: center; }

/* Industrial W.R. Long posture: square all surfaces; buttons remain rounded. */
*:not(button):not(.btn):not(.switch-btn) { border-radius: 0 !important; }
