/* ==========================================================================
   Agni Solar Workshop Control — design system

   The Agni Solar palette, taken from the logo: a very pale blue ground, white
   cards floating on it, and one amber-to-orange-to-red gradient carried
   through every primary action, ring and hero panel — the same sun as the
   wordmark. Stat tiles take soft warm tints so a wall of numbers reads as
   distinct blocks rather than one grey sheet.
   ========================================================================== */

:root {
  /* The ground stays a very pale blue, so the orange reads clearly on it. */
  --bg: #eceffa;
  --bg-2: #e2e7f6;
  --surface: #ffffff;
  --hi: #ffffff;
  --lo: #c6cee6;
  --ink: #2b1d14;
  --ink-2: #6b5446;
  --ink-3: #a08b7c;
  --line: rgba(110, 60, 20, .11);

  /* Agni orange, from the logo: the brand, and anything you can press. */
  --accent: #ec5f1a;
  --accent-2: #f9a12e;
  --accent-soft: rgba(236, 95, 26, .11);
  --grad: linear-gradient(135deg, #f9a12e 0%, #f2681c 52%, #e5481b 100%);
  --grad-soft: linear-gradient(135deg, rgba(249,161,46,.14), rgba(229,72,27,.12));

  /* Amber is the one "do the next thing" colour. */
  --lime: #f6b93b;
  --lime-2: #edaa25;
  --lime-ink: #3f2c05;
  --grad-amber: linear-gradient(135deg, #fbc860 0%, #f0a32a 100%);

  --alert: #ef7a3d;
  --alert-soft: rgba(239, 122, 61, .14);
  --navy: #4a2a17;

  --good: #17a97e;
  --good-soft: rgba(23, 169, 126, .13);
  --warn: #d9a017;
  --warn-soft: rgba(217, 160, 23, .16);
  --bad: #e0525f;
  --bad-soft: rgba(224, 82, 95, .13);
  --info: #c2560f;
  --info-soft: rgba(194, 86, 15, .12);

  /* Warm tints for stat tiles. The old names are kept so no screen changes. */
  --t-lilac: #fdeee3;
  --t-sky: #fff6dc;
  --t-peach: #fff1e4;
  --t-pink: #ffe9ef;
  --t-mint: #e2f7ef;

  --r-s: 12px;
  --r-m: 16px;
  --r-l: 22px;
  --r-xl: 30px;

  --up: 0 1px 2px rgba(80, 40, 10, .05), 0 10px 26px rgba(80, 40, 10, .08);
  --up-sm: 0 1px 2px rgba(80, 40, 10, .05), 0 4px 10px rgba(80, 40, 10, .07);
  --up-lg: 0 3px 8px rgba(80, 40, 10, .07), 0 24px 50px rgba(80, 40, 10, .13);
  --in: inset 0 0 0 1px var(--line), inset 0 1px 2px rgba(80, 40, 10, .05);
  --in-sm: inset 0 0 0 1px var(--line);
  --hair: inset 0 0 0 1px rgba(110, 60, 20, .06);
  --glow: 0 3px 8px rgba(242, 104, 28, .28), 0 12px 28px rgba(229, 72, 27, .22);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Sora", "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --nav-w: 250px;
}

[data-theme="dark"] {
  --bg: #1c1612;
  --bg-2: #18130f;
  --surface: #261e18;
  --hi: #33281f;
  --lo: #0f0b08;
  --ink: #f5ece4;
  --ink-2: #c9b6a6;
  --ink-3: #9a8676;
  --line: rgba(240, 200, 170, .13);

  --accent: #ff8a3d;
  --accent-2: #ffb347;
  --accent-soft: rgba(255, 138, 61, .18);
  --grad: linear-gradient(135deg, #ffb347 0%, #ff7a2f 52%, #f0582a 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,179,71,.2), rgba(240,88,42,.18));

  --lime: #f7c65c;
  --lime-2: #eeb43c;
  --lime-ink: #291c02;
  --alert: #f7935c;
  --alert-soft: rgba(247, 147, 92, .18);
  --navy: #ffcfa8;

  --good: #35c79b;
  --good-soft: rgba(53, 199, 155, .17);
  --warn: #e6b643;
  --warn-soft: rgba(230, 182, 67, .18);
  --bad: #ff7b86;
  --bad-soft: rgba(255, 123, 134, .17);
  --info: #f0a04b;
  --info-soft: rgba(240, 160, 75, .17);

  --t-lilac: #33251b;
  --t-sky: #332a17;
  --t-peach: #33281c;
  --t-pink: #331f2b;
  --t-mint: #17322a;

  --up: 0 1px 2px rgba(0, 0, 0, .32), 0 10px 26px rgba(0, 0, 0, .38);
  --up-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 11px rgba(0, 0, 0, .3);
  --up-lg: 0 3px 9px rgba(0, 0, 0, .36), 0 26px 54px rgba(0, 0, 0, .48);
  --in: inset 0 0 0 1px var(--line), inset 0 1px 3px rgba(0, 0, 0, .3);
  --in-sm: inset 0 0 0 1px var(--line);
  --hair: inset 0 0 0 1px rgba(240, 200, 170, .08);
  --glow: 0 3px 8px rgba(255, 122, 47, .3), 0 12px 28px rgba(240, 88, 42, .24);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; font-weight: 600; }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 40px;
  background: var(--surface); box-shadow: var(--up-sm);
  display: grid; place-items: center;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-name span { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .04em; }
/* The Agni Solar wordmark, with the screen's name in small type beneath it. */
.brand-logo { flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; }
.brand-logo img { display: block; width: 100%; max-width: 190px; height: auto; }
.brand-logo span { font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em;
                   text-transform: uppercase; padding-left: 2px; }
.login-card .brand-logo { align-items: center; }
.login-card .brand-logo img { max-width: 220px; }
@media (max-width: 820px) {
  .sidebar .brand-logo { flex: none; padding-bottom: 6px; }
  .sidebar .brand-logo img { width: 130px; }
}

.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10px; letter-spacing: .12em; color: var(--ink-3);
  padding: 12px 12px 5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 13px; border-radius: var(--r-s);
  color: var(--ink-2); font-weight: 500; font-size: 13.4px;
  transition: color .16s, box-shadow .16s, background .16s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .8; }
.nav-item { border-radius: 999px; }
.nav-item:hover { color: var(--ink); background: rgba(120, 60, 20, .06); }
.nav-item.active {
  color: #fff; background: var(--grad); font-weight: 600;
  box-shadow: 0 2px 8px rgba(242, 104, 28, .32);
}
.nav-item.active:hover { filter: brightness(1.05); }
.nav-item.active .nav-count { background: rgba(255, 255, 255, .22); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: 11px; font-family: var(--mono);
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 7px; border-radius: 20px;
}

.main { flex: 1; min-width: 0; padding: 20px 26px 44px; }

/* ----------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.topbar h1 { flex: 0 0 auto; }
.topbar .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.who {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 8px 7px 16px; border-radius: 999px;
  box-shadow: var(--up-sm), var(--hair); background: var(--surface);
}
.who-meta { text-align: right; line-height: 1.2; }
.who-name { font-weight: 600; font-size: 13px; }
.who-role { font-size: 10.5px; color: var(--accent); font-weight: 600; letter-spacing: .05em; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  box-shadow: var(--up-sm); background: var(--bg-2);
}
.avatar-xs { width: 28px; height: 28px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 22px; }
.avatar.ph, .avatar-lg.ph {
  display: grid; place-items: center; font-family: var(--display);
  font-weight: 700; color: var(--accent); font-size: 13px;
}
.avatar-lg.ph { font-size: 22px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--up), var(--hair);
  padding: 20px 22px;
}
.card.tight { padding: 15px 17px; }
.card.flat { background: var(--bg-2); box-shadow: var(--in-sm); }
.card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 15px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.card-note { color: var(--ink-3); font-size: 12px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: span 4; }

/* ------------------------------------------------------------------- stat */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; }
.stat .v { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.stat .v small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat .d { font-size: 11.5px; color: var(--ink-2); }
.stat-ico {
  width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center;
  background: var(--bg-2);
}
.stat-ico svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink); font: 600 13px var(--sans);
  box-shadow: var(--up-sm), var(--hair);
  transition: box-shadow .15s, transform .15s, color .15s, background .15s;
}
.btn:hover { box-shadow: var(--up), var(--hair); transform: translateY(-1px); }
.btn:active, .btn.on { box-shadow: var(--in-sm); transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-accent { color: var(--accent); }
.btn-good { color: var(--good); }
.btn-bad { color: var(--bad); }

.btn-solid {
  background: var(--grad); color: #fff; box-shadow: var(--glow);
  background-size: 140% 140%; background-position: 0% 50%;
  transition: background-position .3s, box-shadow .2s, transform .15s;
}
.btn-solid:hover { background-position: 100% 50%; box-shadow: var(--glow), 0 6px 16px rgba(242,104,28,.22); }
.btn-solid:active { box-shadow: inset 0 2px 6px rgba(0,0,0,.24); transform: translateY(0); }

/* The one citrus button: reserved for the step that moves work forward. */
.btn-lime {
  background: var(--grad-amber); color: var(--lime-ink);
  box-shadow: 0 2px 6px rgba(240, 163, 42, .32), 0 10px 24px rgba(240, 163, 42, .24);
}
.btn-lime:hover { filter: brightness(1.04); }
.btn-lime:active { box-shadow: inset 0 2px 5px rgba(0,0,0,.16); }

.btn-lg { padding: 15px 28px; font-size: 15px; }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 50%; }
.btn-icon { padding: 9px; border-radius: 11px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: var(--in-sm); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.field .hint { font-size: 11px; color: var(--ink-3); padding-left: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=email], input[type=search], select, textarea {
  width: 100%; padding: 11px 15px; border: 0; border-radius: var(--r-m);
  background: var(--bg-2); color: var(--ink);
  font: 500 13.5px var(--sans); box-shadow: var(--in-sm);
  transition: box-shadow .16s, background .16s;
}
input:focus, select:focus, textarea:focus {
  outline: none; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input::placeholder { color: var(--ink-3); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a97ad' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea { min-height: 76px; resize: vertical; }
input[type=file] { padding: 9px; font-size: 12px; }
.scan-input {
  font: 600 20px var(--mono) !important; letter-spacing: .1em;
  padding: 16px 20px !important; border-radius: 16px !important;
  text-transform: uppercase;
}
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; min-width: 150px; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .track {
  width: 50px; height: 27px; border-radius: 999px; background: var(--bg-2);
  box-shadow: var(--in-sm);
  position: relative; transition: background .2s;
}
.toggle .thumb {
  position: absolute; top: 3.5px; left: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--up-sm);
  transition: transform .2s, background .2s;
}
.toggle input:checked + .track { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.toggle input:checked + .track .thumb { transform: translateX(22px); background: var(--accent); }
.toggle .lbl { font-size: 13px; font-weight: 500; }

/* segmented control */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-2);
       box-shadow: var(--in-sm); gap: 3px; flex-wrap: wrap; }
.seg a, .seg button {
  padding: 7px 15px; border-radius: 999px; font: 600 12px var(--sans);
  color: var(--ink-2); border: 0; background: transparent; cursor: pointer;
}
.seg a.active, .seg button.active {
  color: #fff; background: var(--grad); box-shadow: 0 2px 8px rgba(242, 104, 28, .3);
}

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.mute { background: var(--bg-2); color: var(--ink-3); }
.badge.lime { background: var(--lime); color: var(--lime-ink); }
.badge.alert { background: var(--alert-soft); color: var(--alert); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pulse { animation: pulse 1.9s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-m); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .07em; color: var(--ink-3);
  font-weight: 700; padding: 9px 12px; white-space: nowrap;
}
table.tbl td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:hover td { background: rgba(255,255,255,.35); }
[data-theme="dark"] table.tbl tbody tr:hover td { background: rgba(255,255,255,.03); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--mono); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }

/* -------------------------------------------------------------- progress */
.bar { height: 9px; border-radius: 10px; background: var(--bg-2);
       box-shadow: var(--in-sm); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 10px; background: var(--grad); transition: width .5s; }
.bar > i.good { background: var(--good); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }

.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val {
  position: absolute; font-family: var(--display); font-weight: 700;
  font-size: 20px; letter-spacing: -.02em;
}
.ring .ring-val small { display: block; font-size: 9.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; text-align: center; }

/* --------------------------------------------------------------- station */
.station-console { max-width: 1180px; margin: 0 auto; }
.console-head {
  display: flex; align-items: center; gap: 18px; padding: 18px 24px;
  border-radius: var(--r-l); box-shadow: var(--up); margin-bottom: 18px;
  background: var(--surface); flex-wrap: wrap;
}
.console-head .code {
  font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em;
}
.step-rail { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.step {
  flex: 1 1 120px; padding: 11px 14px; border-radius: var(--r-m);
  box-shadow: var(--up-sm); font-size: 12px; color: var(--ink-3);
}
.step b { display: block; font-family: var(--display); font-size: 13px; color: var(--ink-2); }
.step.done { box-shadow: var(--in-sm); color: var(--good); }
.step.done b { color: var(--good); }
.step.now { box-shadow: var(--up); color: var(--accent); }
.step.now b { color: var(--accent); }

.bom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 9px; }
.bom-cell {
  padding: 10px 12px; border-radius: 13px; box-shadow: var(--up-sm);
  display: flex; flex-direction: column; gap: 3px; font-size: 11.5px;
  transition: box-shadow .2s, color .2s;
}
.bom-cell .pn { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.bom-cell .nm { color: var(--ink-3); font-size: 10.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-cell .qt { margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: 12px; }
.bom-cell.hit { box-shadow: var(--in-sm); color: var(--good); }
.bom-cell.hit .pn { color: var(--good); }
.bom-row { display: flex; align-items: center; gap: 8px; }

.weigh {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--display); font-size: 42px; font-weight: 700; letter-spacing: -.03em;
}
.weigh small { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.scale-pad { padding: 18px 22px; border-radius: var(--r-l); box-shadow: var(--in); }

/* -------------------------------------------------------------- messages */
.flash-wrap { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.flash {
  padding: 13px 17px; border-radius: var(--r-m); box-shadow: var(--up-lg);
  background: var(--surface); font-size: 13px; font-weight: 500;
  display: flex; gap: 10px; align-items: flex-start;
  animation: slide-in .28s cubic-bezier(.2,.8,.3,1);
  border-left: 4px solid var(--info);
}
.flash.error { border-left-color: var(--bad); }
.flash.success { border-left-color: var(--good); }
.flash.warn { border-left-color: var(--warn); }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px) } to { opacity: 1; transform: none } }

.callout {
  padding: 14px 18px; border-radius: var(--r-m); box-shadow: var(--in);
  display: flex; gap: 12px; align-items: flex-start; font-size: 13px;
}
.callout .ttl { font-weight: 700; display: block; margin-bottom: 2px; }
.callout.bad { color: var(--bad); }
.callout.good { color: var(--good); }
.callout.warn { color: var(--warn); }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(40,24,12,.42); backdrop-filter: blur(3px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-back.open { display: grid; }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-xl); box-shadow: var(--up-lg);
  padding: 26px 28px;
  animation: pop .22s cubic-bezier(.2,.9,.3,1);
}
@keyframes pop { from { transform: scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 38px 36px; border-radius: var(--r-xl); box-shadow: var(--up-lg); background: var(--surface); }
.login-card .brand { justify-content: center; padding-bottom: 22px; }

/* --------------------------------------------------------------- people */
.person {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px;
  border-radius: var(--r-m); box-shadow: var(--up-sm);
}
/* Name on its own line, designation beneath it, so a long designation never
   wraps back around the name. */
.person .meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.person .nm { font-weight: 600; line-height: 1.25; }
.person .dg {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-branch { margin-left: 26px; padding-left: 18px; border-left: 2px dashed var(--line); }

/* --------------------------------------------------------------- utility */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 7px; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.muted { color: var(--ink-3); }
.small { font-size: 11.5px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hide { display: none !important; }
.scroll-y { max-height: 380px; overflow-y: auto; }
.barcode-box { background: #fff; border-radius: 12px; padding: 10px; display: inline-block; box-shadow: var(--in-sm); }

@media (max-width: 1100px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row;
             overflow-x: auto; align-items: center; padding: 12px; gap: 8px; }
  .sidebar .nav-label { display: none; }
  .nav-group { flex-direction: row; }
  .nav-item { white-space: nowrap; }
  .main { padding: 16px; }
  .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; }
  .span2, .span3, .span4 { grid-column: span 1; }
}

@media print {
  .sidebar, .topbar, .btn, .flash-wrap { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------ poka-yoke */
.modal.wide { width: min(920px, 100%); }

.pk-group {
  font: 700 11px/1 "Sora", sans-serif; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); padding: 18px 4px 9px; position: sticky; top: 0;
  background: var(--bg); z-index: 2;
}
.pk-group:first-child { padding-top: 4px; }

.pk-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: start;
  padding: 13px 15px; margin-bottom: 8px; border-radius: var(--r-md);
  box-shadow: var(--up-sm); background: var(--surface); cursor: pointer;
  transition: box-shadow .16s ease, opacity .16s ease;
}
.pk-row:hover { box-shadow: var(--up); }
.pk-row.off { box-shadow: var(--in-sm); opacity: .58; }
.pk-row.is-core { border-left: 3px solid var(--accent); }
.pk-row.is-core.off { border-left-color: var(--bad); }

.pk-row input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.pk-row .tick {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  box-shadow: var(--in-sm); color: transparent; margin-top: 1px; flex: none;
  transition: background .16s ease, color .16s ease;
}
.pk-row input:checked ~ .tick { background: var(--accent); color: #fff; box-shadow: var(--up-sm); }

.pk-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pk-text b { font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pk-text .pk-stops { color: var(--good); display: flex; align-items: center; gap: 5px; }
.pk-row.off .pk-text .pk-stops { color: var(--bad); }

.pk-action { flex: none; }
.pk-action.seg { padding: 3px; }
.pk-action.seg label {
  padding: 4px 9px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 7px; cursor: pointer; color: var(--muted);
}
.pk-action.seg label.active { box-shadow: var(--in-sm); color: var(--text); font-weight: 700; }
.pk-action.seg input { position: absolute; opacity: 0; pointer-events: none; }
.pk-row.off .pk-action { opacity: .4; pointer-events: none; }

.pk-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-rule-line { display: flex; gap: 9px; align-items: baseline; padding: 5px 0; font-size: 12.5px; }
.pk-rule-line .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

@media (max-width: 720px) {
  .pk-row { grid-template-columns: 24px 1fr; }
  .pk-action { grid-column: 2; margin-top: 6px; }
}

/* ============================================================== andon ==== */
/* The pace strip that sits at the top of every station console. It is sized
   so an operator can read it standing at the bench and a supervisor can read
   it walking past the aisle. */

.andon-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 20px; margin-bottom: 16px;
  border-radius: var(--r-lg); box-shadow: var(--up);
  background: var(--bg); border-left: 6px solid var(--tone);
  font-size: 15px; line-height: 1.45;
}
.andon-banner .andon-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--tone);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 22%, transparent);
  flex: none;
}
.andon-banner .andon-label {
  font-family: var(--font-display); font-size: 17px; letter-spacing: -.01em;
  color: var(--tone); white-space: nowrap;
}
.andon-banner .andon-msg { flex: 1 1 320px; color: var(--ink); }
.andon-banner .andon-clock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-3); white-space: nowrap;
}
.andon-banner.tone-great { --tone: var(--good); }
.andon-banner.tone-good  { --tone: var(--good); }
.andon-banner.tone-ok    { --tone: var(--warn); }
.andon-banner.tone-warn  { --tone: var(--alert); }
.andon-banner.tone-idle  { --tone: var(--ink-3); }
.andon-banner.tone-bad {
  --tone: var(--bad);
  animation: andon-pulse 2.4s ease-in-out infinite;
}
.andon-banner.tone-bad .andon-dot { animation: andon-blink 1.1s steps(2) infinite; }
@keyframes andon-pulse {
  0%, 100% { box-shadow: var(--up); }
  50% { box-shadow: var(--up), 0 0 0 3px color-mix(in srgb, var(--bad) 26%, transparent); }
}
@keyframes andon-blink { 50% { opacity: .25; } }

/* --- the face and the figures beside it --- */
.andon { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }

.andon-face { flex: none; text-align: center; }
.andon-face svg {
  /* Roughly a tenth of the screen, whatever the screen. */
  width: clamp(170px, 34vmin, 400px);
  height: clamp(170px, 34vmin, 400px);
  display: block;
  filter: drop-shadow(0 10px 22px rgba(60, 30, 10, .16));
}
.andon-caption {
  margin-top: 6px; font-size: 13px; color: var(--ink-3);
}
.andon-caption b { font-family: var(--font-display); font-size: 19px; color: var(--ink); }

.face-track { stroke: var(--line); }
.face-arc { stroke: var(--tone, var(--accent)); transition: stroke-dashoffset .8s ease, stroke .5s; }
.face-disc { transition: fill .5s ease; }
.face-ink { stroke: var(--face-ink); transition: d .7s ease; }
.face-ink-fill { fill: var(--face-ink); transition: ry .7s ease; }
.face-sweat { fill: var(--info); opacity: .85; animation: sweat-drop 2.6s ease-in-out infinite; }
.face-sweat.hide { display: none; }
@keyframes sweat-drop {
  0%, 60% { transform: translateY(0); opacity: .85; }
  85% { transform: translateY(9px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
#face-group { transition: transform .8s ease; }

/* Face colours per tone. Kept warm and readable rather than traffic-light
   harsh, so a station that is behind is legible without being alarming. */
#andon-svg { --face-hi: #ffe9a8; --face-lo: #f7c948; --face-ink: #5b4708; --tone: var(--warn); }
#andon-svg.face-great, #andon-svg.face-good { --face-hi: #d6f5c8; --face-lo: #7ed26a; --face-ink: #1e4d17; --tone: var(--good); }
#andon-svg.face-ok    { --face-hi: #ffe9a8; --face-lo: #f7c948; --face-ink: #5b4708; --tone: var(--warn); }
#andon-svg.face-warn  { --face-hi: #ffd9b0; --face-lo: #f79a48; --face-ink: #5e3105; --tone: var(--alert); }
#andon-svg.face-bad   { --face-hi: #ffc9c2; --face-lo: #ef6a5c; --face-ink: #5e1710; --tone: var(--bad); }
#andon-svg.face-idle  { --face-hi: #efe9e2; --face-lo: #d6cabd; --face-ink: #6b5f55; --tone: var(--ink-3); }

/* --- the numbers --- */
.andon-figures {
  flex: 1 1 380px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px;
}
.andon-figures .fig { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.andon-figures .fig.wide { grid-column: 1 / -1; }
.andon-figures .k {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3);
}
.andon-figures .v {
  font-family: var(--font-display); font-size: clamp(30px, 4.4vmin, 52px);
  font-weight: 700; line-height: 1; letter-spacing: -.02em;
}
.andon-figures .v.accent { color: var(--accent); }
.andon-figures .d { font-size: 12px; color: var(--ink-3); line-height: 1.5; }

.pace-track {
  position: relative; height: 15px; border-radius: 99px;
  box-shadow: var(--in-sm); background: var(--bg); margin: 7px 0 5px;
}
.pace-track.slim { height: 10px; }
.pace-fill {
  height: 100%; border-radius: 99px; background: var(--tone, var(--accent));
  transition: width .8s ease, background .5s;
}
.pace-fill.line { background: var(--info); }
.pace-marker {
  position: absolute; top: -5px; bottom: -5px; width: 3px; border-radius: 2px;
  background: var(--ink); opacity: .6; transition: left .8s ease;
}
.pace-marker span {
  position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.andon .line-row { padding-top: 10px; border-top: 1px solid var(--line); }

/* Tone drives the arc and the bar together. */
.andon:has(#andon-svg.face-great), .andon:has(#andon-svg.face-good) { --tone: var(--good); }
.andon:has(#andon-svg.face-ok)   { --tone: var(--warn); }
.andon:has(#andon-svg.face-warn) { --tone: var(--alert); }
.andon:has(#andon-svg.face-bad)  { --tone: var(--bad); }

@media (max-width: 860px) {
  .andon { gap: 16px; justify-content: center; }
  .andon-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .andon-banner { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .andon-banner.tone-bad, .andon-banner.tone-bad .andon-dot, .face-sweat { animation: none; }
}
@media print { .andon-banner, .andon { display: none; } }

/* ========================================================== BOM structure == */
.bom-list { display: grid; gap: 14px; }
.bom-main { padding: 0; overflow: hidden; }

.bom-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 34px minmax(180px, 2.1fr) 96px 110px minmax(150px, 1.3fr) 96px auto;
  padding: 14px 18px;
}
.bom-row.head { border-bottom: 1px solid transparent; }
.bom-main:has(.bom-kids:not(.collapsed)) .bom-row.head { border-bottom-color: var(--line); }

.bom-toggle {
  width: 30px; height: 30px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--bg); box-shadow: var(--up-sm); color: var(--ink-2);
  display: grid; place-items: center; transition: transform .2s, box-shadow .2s;
}
.bom-toggle:active { box-shadow: var(--in-sm); }
.bom-toggle[aria-expanded="true"] svg { transform: rotate(90deg); transition: transform .2s; }
.leaf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }

.bom-id b { font-size: 15px; letter-spacing: -.01em; }
.bom-qty { display: flex; flex-direction: column; gap: 1px; }
.bom-qty .k {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.bom-qty b { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.bom-qty b.accent { color: var(--accent); }
.bom-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.bom-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.bom-acts form { display: inline; }

.bom-kids { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.bom-kids.collapsed { display: none; }
.bom-row.kid { padding: 11px 18px; position: relative; }
.bom-row.kid + .bom-row.kid { border-top: 1px solid var(--line); }
.kid-tick {
  width: 14px; height: 14px; margin-left: 9px;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line);
  border-bottom-left-radius: 5px;
}
.bom-row.kid .bom-id b { font-size: 13.5px; }
.bom-row.kid .bom-qty b { font-size: 17px; }

/* --- the code chip and its preview --- */
.code-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 7px; border: 0; cursor: pointer; border-radius: 10px;
  background: #fff; box-shadow: var(--up-sm); transition: box-shadow .18s, transform .18s;
}
.code-chip:hover { transform: translateY(-1px); box-shadow: var(--up); }
.code-chip:active { box-shadow: var(--in-sm); transform: none; }
.code-chip img { height: 30px; width: auto; max-width: 84px; display: block; }
.code-chip span {
  font-size: 9px; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase;
}

.code-preview {
  margin-top: 8px; padding: 14px; border-radius: var(--r);
  box-shadow: var(--in-sm); background: #fff; text-align: center;
  min-height: 82px; display: grid; place-items: center; gap: 5px;
}
.code-preview img { max-width: 100%; height: auto; max-height: 96px; }
.code-preview .muted { color: var(--ink-3); }

.code-zoom {
  padding: 22px; background: #fff; border-radius: var(--r-lg);
  box-shadow: var(--in); display: grid; place-items: center; margin-bottom: 12px;
}
.code-zoom img { max-width: 100%; height: auto; }

.seg label { cursor: pointer; }
.seg label.active { box-shadow: var(--in-sm); color: var(--accent); font-weight: 600; }

@media (max-width: 1080px) {
  .bom-row {
    grid-template-columns: 30px 1fr auto;
    grid-template-areas: "tog id code" "tog qty acts" "tog flags flags";
    row-gap: 9px;
  }
  .bom-row > .bom-id { grid-area: id; }
  .bom-row > .bom-code { grid-area: code; }
  .bom-row > .bom-flags { grid-area: flags; }
  .bom-row > .bom-acts { grid-area: acts; }
  .bom-row > .bom-qty { display: inline-flex; margin-right: 18px; }
}

/* =========================================================== storage ====== */
.storage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; }
/* The twin sits in a two-column grid beside a tall side panel. Left to itself
   a grid item stretches to the row height, which made the canvas over 1700px
   tall and pushed the drawing below the fold. It is given its own height and
   told not to stretch. */
.twin-card {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  align-self: start;
}
.twin-card .card-head { padding: 16px 18px 12px; }
.twin-side { display: grid; gap: 16px; align-content: start; }

.twin-wrap {
  position: relative; background: var(--bg);
  height: clamp(460px, 62vh, 760px);
}
.twin-wrap canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.twin-wrap canvas:active { cursor: grabbing; }

.twin-tip {
  position: absolute; pointer-events: none; z-index: 4;
  background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 9px;
  font-size: 11.5px; line-height: 1.5; box-shadow: 0 8px 20px rgba(60,30,10,.28);
  display: flex; flex-direction: column; max-width: 220px;
}
.twin-tip b { font-family: ui-monospace, monospace; font-size: 12px; }
.twin-tip span { opacity: .78; }
.twin-tip.hide { display: none; }

.twin-legend {
  position: absolute; left: 14px; bottom: 14px; max-width: 50%; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: var(--up-sm); font-size: 11px; color: var(--ink-3);
  backdrop-filter: blur(6px);
}
.twin-legend .ttl { font-weight: 700; color: var(--ink-2); }
.twin-legend span { display: inline-flex; align-items: center; gap: 4px; }
.twin-legend i {
  width: 11px; height: 11px; border-radius: 3px; display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(90,50,20,.14);
}
.twin-help {
  position: absolute; right: 14px; bottom: 14px; max-width: 46%; text-align: right;
  padding: 8px 12px; border-radius: 12px; line-height: 1.5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: var(--up-sm); backdrop-filter: blur(6px);
}
@media (max-width: 1000px) { .twin-help { display: none; } }

/* --- sidebar results --- */
.found-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.found-head b { font-family: ui-monospace, monospace; font-size: 15px; display: block; margin-top: 4px; }
.place-list { display: grid; gap: 7px; }
.place {
  display: grid; grid-template-columns: auto 1fr auto; gap: 3px 10px; align-items: center;
  width: 100%; text-align: left; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: var(--r); background: var(--bg);
  box-shadow: var(--up-sm); transition: box-shadow .18s, transform .18s;
}
.place:hover { transform: translateY(-1px); box-shadow: var(--up); }
.place:active { box-shadow: var(--in-sm); transform: none; }
.pl-rack { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent); }
.pl-where { font-size: 12px; color: var(--ink-2); }
.pl-qty {
  grid-row: 1 / 3; font-family: var(--font-display); font-size: 21px; color: var(--ink);
}
.pl-code, .pl-part { grid-column: 1 / 3; font-size: 10.5px; color: var(--ink-3); }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 10px; }
.mini-stats .k {
  display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3);
}
.mini-stats b { font-size: 13.5px; }

/* --- flat rack elevation --- */
.rack-elev {
  background: var(--bg); border-radius: var(--r); box-shadow: var(--in-sm);
  padding: 10px; display: grid; gap: 5px;
}
.elev-level {
  display: grid; grid-template-columns: 26px repeat(var(--bays), 1fr); gap: 4px;
  align-items: stretch;
}
.elev-tag {
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: var(--ink-3); background: var(--bg); border-radius: 6px; box-shadow: var(--up-sm);
}
.elev-bin {
  min-height: 44px; border-radius: 7px; padding: 4px 5px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 9.5px; line-height: 1.3; transition: transform .15s, box-shadow .15s;
  box-shadow: inset 0 0 0 1px rgba(90,50,20,.1);
}
.elev-bin:hover { transform: translateY(-1px); box-shadow: var(--up-sm); }
.elev-bin.f0 { background: #f3eee8; color: #a99686; }
.elev-bin.f1 { background: #d3ecc9; color: #2f5726; }
.elev-bin.f2 { background: #f8e5ac; color: #6a5312; }
.elev-bin.f3 { background: #f6c19c; color: #6d3a12; }
.elev-bin.f4 { background: #f1a49b; color: #6d1f16; }
.elev-part { font-family: ui-monospace, monospace; font-weight: 700; font-size: 9px; }
.elev-qty { font-weight: 700; font-size: 11px; align-self: flex-end; }
.elev-floor {
  margin-top: 4px; padding-top: 6px; border-top: 2px solid var(--ink-3);
  font-size: 10px; color: var(--ink-3); text-align: center;
}

/* --- fit calculator --- */
.fit-out {
  padding: 12px 14px; border-radius: var(--r); box-shadow: var(--in-sm);
  background: var(--bg); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.fit-n { font-family: var(--font-display); font-size: 40px; color: var(--accent); line-height: 1; }
.fit-out span { flex: 1 1 180px; line-height: 1.55; }

/* --- rack designer --- */
.rk-preview {
  display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: center;
  padding: 14px; border-radius: var(--r); box-shadow: var(--in-sm);
  background: var(--bg); margin-bottom: 14px;
}
.rk-prev-draw { background: #fff; border-radius: 10px; padding: 8px; }
.rk-prev-facts { display: grid; gap: 5px; font-size: 12.5px; line-height: 1.6; }
.rk-prev-facts .ttl {
  font-family: var(--font-display); font-size: 14px; color: var(--accent);
}
.rk-prev-facts b { font-family: ui-monospace, monospace; }

.dim-row { display: flex; align-items: center; gap: 8px; }
.dim-row input { flex: 1; min-width: 0; }
.dim-row span { color: var(--ink-3); font-size: 13px; }

.rack-row { cursor: pointer; }
.rack-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }

@media (max-width: 1180px) {
  .storage-grid { grid-template-columns: 1fr; }
  .twin-wrap { height: clamp(380px, 52vh, 560px); }
  .rk-preview { grid-template-columns: 1fr; }
}

/* The username sits at the right of each row on the sign-in picker, so an
   operator can see which account a face belongs to before choosing it. */
.person .uname {
  margin-left: auto; font-size: 11.5px; color: var(--ink-3);
  padding: 3px 9px; border-radius: 99px; box-shadow: var(--in-sm); white-space: nowrap;
}

/* ========================================================== floor plan ==== */
.floor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.floor-card { padding-bottom: 10px; }
.floor-stage {
  overflow: auto; border-radius: var(--r-lg); box-shadow: var(--in);
  background: var(--bg); padding: 10px; max-height: 68vh;
}
.floor-stage svg { width: 100%; height: auto; display: block; transition: width .2s ease; }

.shed { fill: var(--bg); }
.room { cursor: pointer; }
.room:hover rect { fill-opacity: .13; }
/* Font sizes are in millimetres, because the whole plan is drawn at true
   scale. A 40 m shed rendered about 700 px wide means roughly 60 mm per
   pixel, so these look tiny as numbers and read correctly on screen. */
.room-name {
  font-family: var(--font-display); font-size: 700px; font-weight: 700;
  letter-spacing: -10px;
}
.room-sub { font-size: 600px; fill: var(--ink-3); }

.unit { cursor: pointer; }
.unit-body { transition: filter .18s; }
.unit:hover .unit-body { filter: brightness(1.08); }
.unit-body.bench { fill: var(--surface); stroke: var(--ink-3); stroke-width: 22; }
.station.busy .unit-body.bench { stroke: var(--good); stroke-width: 42; }
.unit-code {
  font-family: var(--font-mono, monospace); font-size: 560px; font-weight: 700; fill: var(--ink);
}
.bench-code { font-size: 490px; }
.unit-qty { font-size: 470px; fill: var(--ink-3); }

.crew-dot { fill: var(--good); stroke: #fff; stroke-width: 60; }
.crew-ini { font-size: 380px; font-weight: 700; fill: #fff; }
.wip-dot { fill: var(--alert); opacity: .92; }
.wip-n { font-size: 360px; font-weight: 700; fill: #fff; }
.hold-dot { fill: var(--bad); }

#plan.hide-people .crew, #plan.hide-people .crew-dot { display: none; }
#plan.hide-stock .stock-label { display: none; }

.unit.draggable { cursor: grab; }
.unit.dragging { cursor: grabbing; opacity: .75; }
.unit.dragging .unit-body { filter: drop-shadow(0 8px 18px rgba(0,0,0,.28)); }

.legend {
  display: flex; flex-wrap: wrap; gap: 16px; padding: 11px 4px 2px;
  font-size: 12px; color: var(--ink-3);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw, .room-row .sw {
  width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none;
}
.legend .crew-sw { background: var(--good); border-radius: 50%; }

.floor-panel { max-height: 78vh; overflow: auto; }
.room-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; cursor: pointer; background: transparent; padding: 9px 4px;
  border-top: 1px solid var(--line); color: inherit; font: inherit;
}
.room-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: 8px; }
.room-row .meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.panel-row {
  display: flex; gap: 10px; justify-content: space-between; align-items: flex-start;
  padding: 10px 2px; border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .floor-wrap { grid-template-columns: 1fr; }
  .floor-panel { max-height: none; }
}
@media print { .floor-panel, .legend { display: none; } .floor-stage { box-shadow: none; } }

/* Action buttons on each row of the org chart, revealed on hover so the
   structure stays readable but is always one click from being changed. */
.org-node { position: relative; }
.org-node.is-me { box-shadow: var(--in-sm); }
.org-acts {
  display: flex; gap: 4px; align-items: center; margin-left: 8px;
  opacity: 0; transition: opacity .15s;
}
.org-acts form { display: inline; }
.org-node:hover .org-acts, .org-node:focus-within .org-acts { opacity: 1; }
@media (hover: none) { .org-acts { opacity: 1; } }

/* ======================================================= access rights ==== */
.perm-tbl .perm-col { text-align: center; min-width: 108px; }
.perm-group td {
  background: var(--bg-2); font: 600 11px var(--sans); text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3); padding: 8px 12px !important;
}
.perm-cell { padding: 6px !important; }
.perm-cell.is-changed { background: var(--accent-soft); }

.perm-box {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; cursor: pointer; background: var(--bg-2);
  box-shadow: var(--in-sm); transition: background .14s, box-shadow .14s;
}
.perm-box input { position: absolute; opacity: 0; width: 0; height: 0; }
.perm-box .tick { display: grid; place-items: center; color: transparent; }
.perm-box:has(input:checked) {
  background: var(--grad); box-shadow: 0 2px 8px rgba(242, 104, 28, .3);
}
.perm-box:has(input:checked) .tick { color: #fff; }
.perm-box:hover:not(.locked) { box-shadow: var(--up-sm); }
.perm-box.locked { cursor: not-allowed; opacity: .45; }
.perm-box.locked:has(input:checked) { background: var(--ink-3); box-shadow: none; }

/* ==================================================== tinted stat tiles ==== */
/* Straight off the reference boards: a row of figures reads far faster when
   each tile carries its own soft tint than when they are five white squares. */
.card.tint-lilac { background: var(--t-lilac); }
.card.tint-sky   { background: var(--t-sky); }
.card.tint-peach { background: var(--t-peach); }
.card.tint-pink  { background: var(--t-pink); }
.card.tint-mint  { background: var(--t-mint); }
.card[class*="tint-"] { box-shadow: var(--up-sm), var(--hair); }

.stat-ico { background: rgba(255, 255, 255, .68); }
[data-theme="dark"] .stat-ico { background: rgba(255, 255, 255, .07); }

/* ---------------------------------------------------------- hero panel ---- */
/* The one gradient card on a screen: the headline figure with its ring, as on
   the "Weekly Performance" panels in the references. */
.card-hero {
  background: var(--grad); color: #fff; border-radius: var(--r-l);
  padding: 22px 24px; box-shadow: var(--glow); position: relative; overflow: hidden;
}
.card-hero::after {
  content: ""; position: absolute; inset: auto -60px -110px auto;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .09); pointer-events: none;
}
.card-hero h2, .card-hero h3 { color: #fff; }
.card-hero .card-note, .card-hero .muted, .card-hero .small.muted { color: rgba(255,255,255,.72); }
.card-hero .stat .k { color: rgba(255, 255, 255, .78); }
.card-hero .stat .v, .card-hero b { color: #fff; }
.card-hero .bar { background: rgba(255, 255, 255, .22); box-shadow: none; }
.card-hero .bar i { background: #fff; }
.card-hero .ring .ring-val small { color: rgba(255, 255, 255, .82); }
.card-hero .ring .ring-val { color: #fff; }
.card-hero .ring-track { stroke: rgba(255, 255, 255, .26); }
.card-hero .ring-val-arc { stroke: #fff; }
.card-hero .ring-val { color: #fff; }
.card-hero .ring-label, .card-hero .ring-num { fill: #fff; }
.card-hero a { color: #fff; text-decoration: underline; }

.hero-rows { display: grid; gap: 9px; margin-top: 14px; position: relative; z-index: 1; }
.hero-rows .row { font-size: 12.5px; }

/* ------------------------------------------------------- the 3D view ------ */
#stage-3d { display: block; }
#stage-3d.hide { display: none; }
#iso { width: 100%; height: auto; display: block; }
.iso-unit { cursor: pointer; }
.iso-unit:hover polygon { filter: brightness(1.1); }
.iso-room {
  font-family: var(--display); font-size: 760px; font-weight: 700;
  fill: var(--ink); letter-spacing: -12px;
}
.iso-room-sub { font-size: 500px; fill: var(--ink-3); }
.iso-code {
  font-family: var(--mono); font-size: 520px; font-weight: 700; fill: var(--ink);
}
.iso-sub { font-size: 440px; fill: var(--ink-3); }
.iso-ini { font-size: 260px; font-weight: 700; fill: #fff; }

/* Text on the isometric drawing sits over boxes, so it carries a white halo
   rather than relying on the fill colour underneath it. */
#iso text {
  paint-order: stroke fill;
  stroke: var(--surface); stroke-width: 90px; stroke-linejoin: round;
}
#iso .iso-ini { stroke-width: 0; }

/* ================================================= packages and pouches ==== */
.pouch {
  border-radius: var(--r-m); background: var(--bg-2); padding: 11px 13px;
  margin-top: 10px; box-shadow: var(--in-sm);
}
.pouch.loose { background: var(--t-peach); }
[data-theme="dark"] .pouch.loose { background: var(--t-peach); }

.pack-line {
  display: flex; align-items: center; gap: 10px; padding: 7px 2px;
  border-top: 1px solid var(--line);
}
.pack-line:first-of-type { border-top: 0; }
.pack-line .meta { flex: 1; min-width: 0; }
.pack-line.done { opacity: .58; }
.pack-line.done .mono { text-decoration: line-through; }

.part-thumb {
  width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none;
  background: var(--surface); box-shadow: var(--up-sm);
}
.part-thumb.empty {
  display: grid; place-items: center; color: var(--ink-3); box-shadow: var(--in-sm);
}

.pkg-tile { display: block; color: inherit; text-decoration: none; }
.pkg-tile.is-open { box-shadow: var(--up), inset 0 0 0 2px var(--accent); }
.pkg-tile.is-done { background: var(--t-mint); }

/* The three-package check at the vehicle. */
.set-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.set-slot {
  border-radius: var(--r-m); padding: 13px; text-align: center;
  background: var(--bg-2); box-shadow: var(--in-sm);
}
.set-slot.filled { background: var(--t-mint); box-shadow: var(--up-sm); }
.set-slot.missing { background: var(--bad-soft); box-shadow: inset 0 0 0 1.5px var(--bad); }
.set-slot .no { font: 700 20px var(--display); }
.set-slot .code { font: 600 11px var(--mono); word-break: break-all; }

.pkg-photo {
  width: 100%; border-radius: var(--r-m); box-shadow: var(--up-sm); display: block;
}
