@charset "utf-8";
/* Warehouse Station — design system from the ui-ux-pro-max skill
   (.claude/skills/ui-ux-pro-max): Minimalism & Swiss style, industrial slate
   with stock green, dense dashboard spacing. Colour is used only to say what
   happened (go / hold / stop); everything else stays neutral. */
:root {
  --floor: #F8FAFC;        /* background */
  --paper: #FFFFFF;        /* card */
  --ink: #0F172A;          /* foreground, top bar */
  --ink-2: #475569;        /* muted foreground */
  --line: #E2E8F0;         /* card borders */
  --control: #64748B;      /* form control borders (3:1 on white) */
  --primary: #334155;      --primary-hover: #1E293B;
  --accent: #059669;       /* active navigation, focus of attention */
  --go: #047857;   --go-tint: #ECFDF5;
  --hold: #B45309; --hold-tint: #FFFBEB;
  --stop: #DC2626; --stop-tint: #FEF2F2;
  --tape: #FFCB05;
  --font: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .18);
  --ease: 180ms ease;
  --bar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--floor); color: var(--ink); font: 400 16px/1.55 var(--font); font-feature-settings: "tnum"; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a, button, label, summary, [role="button"] { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; min-height: var(--bar-h); padding: 0 20px; background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.bar__brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; font-weight: 600; white-space: nowrap; }
.bar__brand svg { color: var(--accent); }
.bar__out { color: #fff; background: transparent; text-decoration: none; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius); font-size: 15px; transition: background var(--ease), border-color var(--ease); }
.bar__out:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.bar__end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }

/* Navigation between pages: one tab per page the account can open. */
.nav { display: flex; align-items: stretch; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.nav::-webkit-scrollbar { display: none; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: #CBD5E1; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; transition: color var(--ease), background var(--ease); }
.nav__link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav__link[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.nav__link[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.nav__link svg { flex: none; opacity: .9; }
.nav__sep { width: 1px; margin: 16px 6px; background: rgba(255,255,255,.18); flex: none; }
@media (max-width: 2047px) and (min-width: 901px) {
  .bar { gap: 12px; }
  /* a long navigation (the manager): the brand keeps its icon, the name is read by screen readers only */
  .nav-many .bar__brand span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav__link { padding: 0 8px; gap: 5px; font-size: 14px; }
  .nav__sep { margin-inline: 3px; }
  /* ... and the account link keeps its icon (its name is in the title), so every page stays in view */
  .nav-many .nav { gap: 0; }
  .nav-many .nav__link { padding: 0 4px; gap: 4px; font-size: 13.5px; }
  .nav-many .nav__sep { margin-inline: 2px; }
  .nav-many .bar__name, .nav-many .bar__role { display: none; }
  .nav-many .bar__end { gap: 8px; }
  .nav-many .chip__when { display: none; }
}
.bar__who { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; white-space: nowrap; border-radius: var(--radius); color: #fff; text-decoration: none; opacity: .9; transition: background var(--ease), opacity var(--ease); }
.bar__who:hover { background: rgba(255,255,255,.1); opacity: 1; }
.bar__who svg { flex: none; }
.bar__role { opacity: .75; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; line-height: 1.5; white-space: nowrap; }
.chip--dry { background: var(--tape); color: #000; font-weight: 500; }
.chip--off { background: var(--stop); color: #fff; }
a.chip--off { text-decoration: none; font-weight: 600; white-space: nowrap; }
a.chip--off:hover { filter: brightness(.9); }
.chip--ver { background: rgba(255,255,255,.14); color: #fff; font-size: 12px; }

/* Shown whenever the scanner would be typing into nothing. */
.hazard { position: sticky; top: var(--bar-h); z-index: 19; display: flex; justify-content: center; padding: 10px; cursor: pointer;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 16px, #000 16px 32px); }
.hazard span { background: var(--tape); color: #000; font-weight: 700; padding: 6px 16px; border-radius: var(--radius); font-size: 18px; }

/* ------------------------------------------------------------ station layout */
.desk { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 20px; padding: 20px; max-width: 1600px; margin: 0 auto; align-items: start; }
.desk__main { display: grid; gap: 16px; min-width: 0; }
.desk__side { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 980px) { .desk { grid-template-columns: 1fr; } }

.scanrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
@media (max-width: 640px) { .scanrow { grid-template-columns: 1fr; } }
.scan { display: grid; gap: 6px; }
.scan__label { font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 12px; }
.scan__queue { color: var(--hold); font-weight: 600; }
.scan__queue.is-off { color: var(--stop); }
.scan__others { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--hold); border-radius: var(--radius); background: var(--hold-tint); color: var(--hold); font-size: 14px; font-weight: 600; }
.scan__kbd { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; margin-inline-start: auto; padding: 0 10px; border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.scan__kbd.is-on { border-color: var(--accent); color: var(--go); background: var(--go-tint); }
.scan__input { width: 100%; height: 66px; padding: 0 18px; font: 600 30px/1 "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, monospace; letter-spacing: .04em; direction: ltr; text-align: center;
  background: var(--paper); color: var(--ink); border: 2px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow var(--ease), border-color var(--ease); }
.scan__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(5, 150, 105, .2); }
.scan__input::placeholder { color: #94A3B8; font-family: var(--font); font-weight: 400; letter-spacing: 0; font-size: 22px; }
body.is-idle .scan__input { border-style: dashed; }

.tally { display: flex; gap: 10px; }
.tally__item { min-width: 118px; padding: 8px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; align-content: center; }
.tally__item b { font-size: 34px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally__item span { font-size: 13px; color: var(--ink-2); }
.tally__item--stop b { color: var(--stop); }
.tally__item--go b { color: var(--go); }
.tally__item--hold b { color: var(--hold); }

/* ------------------------------------------------------------ the label: last scan */
.label { background: var(--paper); border: 3px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto auto; min-height: 360px; overflow: hidden; }
.label__band { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--primary); color: #fff; font-size: 24px; font-weight: 600; transition: background var(--ease); }
.label__time { font-size: 16px; font-weight: 400; opacity: .9; }
.label__content { display: flex; align-items: center; padding: 18px 24px; font-size: clamp(38px, 4.6vw, 74px); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.label__content.is-long { font-size: clamp(28px, 3.1vw, 48px); }
.label__meta { display: grid; grid-template-columns: auto auto minmax(0, 1fr); margin: 0; border-top: 2px dashed var(--line); }
.label__meta > div { padding: 12px 20px; border-inline-start: 1.5px solid var(--line); min-width: 0; }
.label__meta > div:first-child { border-inline-start: 0; }
.label__meta dt { font-size: 13px; color: var(--ink-2); }
.label__meta dd { margin: 0; font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.label__meta dd.is-text { font-size: 17px; font-weight: 500; }
.label__note { padding: 10px 20px; font-size: 17px; font-weight: 600; background: var(--hold-tint); color: var(--hold); }
.label[data-state="idle"] .label__content { color: var(--ink-2); font-weight: 400; font-size: clamp(28px, 3vw, 40px); }
.label[data-state="go"] { border-color: var(--go); }
.label[data-state="go"] .label__band { background: var(--go); }
.label[data-state="hold"] { border-color: var(--hold); }
.label[data-state="hold"] .label__band { background: var(--hold); }
.label[data-state="stop"] { border-color: var(--stop); }
.label[data-state="stop"] .label__band { background: var(--stop); }
.label[data-state="stop"] .label__content { color: var(--stop); }
.label.flash .label__band { animation: flash .55s ease-out; }
@keyframes flash { from { filter: brightness(1.45); } to { filter: none; } }
@media (max-width: 640px) { .label__meta { grid-template-columns: 1fr 1fr; } .label__meta > div:last-child { grid-column: 1 / -1; border-inline-start: 0; border-top: 1.5px solid var(--line); } }

/* ------------------------------------------------------------ lists */
.ledger { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.desk__side > .ledger:only-child, .ledger--tall { position: sticky; top: calc(var(--bar-h) + 20px); max-height: calc(100vh - var(--bar-h) - 40px); }
.ledger__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1.5px solid var(--line); }
.ledger__head h2 { font-size: 18px; font-weight: 600; }
.ledger__head h2 .num { color: var(--ink-2); font-weight: 500; }
.ledger__filter { width: 170px; height: 40px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); transition: border-color var(--ease), box-shadow var(--ease); }
.ledger__filter:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51, 65, 85, .18); }
.ledger__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.ledger__list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ledger__list li:last-child { border-bottom: 0; }
.row__code { font-weight: 700; font-family: var(--mono); }
.row__no { color: var(--ink-2); font-size: 14px; align-self: center; justify-self: end; }
.row__what { grid-column: 1 / -1; font-size: 16px; }
.row__where { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__note { grid-column: 1 / -1; color: var(--hold); font-size: 13px; font-weight: 600; }
.ledger__list li.is-gone { animation: gone .4s ease-in forwards; background: var(--go-tint); }
.ledger__list li.is-hit { background: var(--go-tint); }
.ledger__list--stop li { background: var(--stop-tint); }
.ledger__list--hold li { background: var(--hold-tint); }
@keyframes gone { to { opacity: 0; transform: translateX(-14px); } }
.ledger__list li.ledger__empty, .ledger__empty { display: block; padding: 28px 16px; color: var(--ink-2); text-align: center; }

.files { display: grid; gap: 10px; padding: 12px 16px; border-bottom: 1.5px solid var(--line); }
.file { display: grid; gap: 4px; font-size: 13px; }
.file__top { display: flex; justify-content: space-between; gap: 8px; }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__bar { height: 6px; background: var(--floor); border-radius: 3px; overflow: hidden; }
.file__bar i { display: block; height: 100%; background: var(--go); }

.recent { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.recent h2 { font-size: 16px; font-weight: 600; padding: 10px 16px; border-bottom: 1.5px solid var(--line); }
.recent ol { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.recent li { display: grid; grid-template-columns: 10px 48px minmax(0, auto) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.recent li > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* a long code never widens the page (task 31) */
.recent li:last-child { border-bottom: 0; }
.recent .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.recent .when { color: var(--ink-2); font-size: 13px; }
.recent .by { color: var(--ink-2); font-size: 13px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dot--go { background: var(--go); } .dot--hold { background: var(--hold); } .dot--stop { background: var(--stop); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 2px solid var(--hold); background: var(--hold-tint); color: var(--hold); border-radius: var(--radius); font-weight: 600; }

/* ------------------------------------------------------------ buttons & dialogs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--control); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform 80ms ease; }
.btn:hover { background: #F1F5F9; border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--solid:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dlg { display: grid; gap: 14px; padding: 22px; }
.dlg h2 { font-size: 22px; }
.dlg p { color: var(--ink-2); }
.dlg__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dlg__error { color: var(--stop); min-height: 1.4em; font-weight: 600; }
.pin-input { height: 66px; font: 600 34px/1 var(--mono); text-align: center; letter-spacing: .5em; direction: ltr; border: 2px solid var(--primary); border-radius: var(--radius); width: 100%; }
.pin-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(5, 150, 105, .2); }
.sumgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sumgrid > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.sumgrid b { display: block; font-size: 32px; line-height: 1.2; }
.sumgrid .is-go b { color: var(--go); } .sumgrid .is-stop b { color: var(--stop); } .sumgrid .is-hold b { color: var(--hold); }
.dlg h3 { font-size: 17px; margin: 4px 0 8px; }
.sumlist { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sumlist li { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.sumlist li:last-child { border-bottom: 0; }
.sumlist--stop { border-color: var(--stop); }

/* ------------------------------------------------------------ home */
.home { max-width: 1200px; margin: 0 auto; padding: 32px 20px 48px; display: grid; gap: 24px; }
.home__lead { font-size: 18px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr; } }
.tile { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-height: 280px; padding: 24px; background: var(--paper);
  border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease); }
.tile:hover { border-top-color: var(--accent); box-shadow: 0 6px 18px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.tile__head { display: flex; align-items: center; gap: 14px; }
.tile__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: #F1F5F9; color: var(--primary); }
.tile h2 { font-size: 28px; font-weight: 700; }
.tile p { color: var(--ink-2); }
.tile__count { align-self: end; font-size: 60px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile__count small { display: block; margin-top: 8px; font-size: 16px; font-weight: 400; color: var(--ink-2); }
.tile__foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 15px; color: var(--ink-2); }
.tile__foot svg { flex: none; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 440px); place-content: center; padding: 16px; }
.login__card { width: 100%; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login__head { background: var(--ink); color: #fff; padding: 20px 22px; border-bottom: 3px solid var(--accent); }
.login__head h1 { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.login__head h1 svg { color: var(--accent); }
.login__head p { opacity: .8; font-size: 15px; }
.login__body { padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field span { font-size: 14px; color: var(--ink-2); }
.field input, .field select { width: 100%; min-width: 0; height: 50px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius); font-size: 18px; background: var(--paper); transition: border-color var(--ease), box-shadow var(--ease); }
.field input:focus, .field select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(51, 65, 85, .18); }
.field input[aria-invalid="true"] { border-color: var(--stop); }
.field select:disabled { background: var(--floor); color: var(--ink-2); }
.field__hint { font-size: 13px; color: var(--ink-2); }
.field__err { font-style: normal; font-size: 14px; font-weight: 600; color: var(--stop); }
.field__err:empty { display: none; }
.sfield__differs { font-size: 13px; font-weight: 600; color: var(--hold); }
input.ltr { direction: ltr; text-align: right; }

/* ------------------------------------------------------------ admin */
.admin { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin__col { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 1040px) { .admin { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; scroll-margin-top: calc(var(--bar-h) + 12px); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: 18px; font-weight: 600; }
.panel__body { padding: 16px 18px; display: grid; gap: 14px; }
.panel__scroll { max-height: 460px; overflow: auto; }
.drop { display: grid; place-items: center; gap: 6px; min-height: 150px; padding: 18px; border: 2px dashed var(--control); border-radius: var(--radius); background: var(--floor); text-align: center; cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.drop:hover { border-color: var(--primary); background: #F1F5F9; }
.drop strong { font-size: 20px; }
.drop span { color: var(--ink-2); font-size: 14px; }
.drop.is-over { border-color: var(--accent); background: var(--go-tint); }
.drop.is-busy { opacity: .6; pointer-events: none; }
.drop .drop__limit { font-size: 13px; color: var(--ink-2); }
.result { white-space: pre-line; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--go); border-inline-start-width: 4px; background: var(--go-tint); }
.result--hold { border-color: var(--hold); background: var(--hold-tint); }
.result--stop { border-color: var(--stop); background: var(--stop-tint); color: var(--stop); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.stat b { display: block; font-size: 30px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }
.stat--stop b { color: var(--stop); }
.stat--hold b { color: var(--hold); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: start; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { color: var(--ink-2); font-weight: 600; font-size: 13px; background: var(--floor); position: sticky; top: 0; }
table.grid tbody tr { transition: background var(--ease); }
table.grid tbody tr:hover { background: #F8FAFC; }
table.grid td.err { color: var(--stop); font-size: 13px; max-width: 280px; overflow-wrap: anywhere; }
table.grid tr.is-failed { background: var(--stop-tint); }
table.grid tbody tr.is-failed:hover { background: var(--stop-tint); }
table.grid td.body { max-width: 260px; overflow-wrap: anywhere; white-space: pre-line; }
.obx-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.obx-file { display: inline-flex; vertical-align: -2px; margin-inline-end: 4px; color: var(--ink-2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--sent { background: var(--go-tint); color: var(--go); }
.badge--pending { background: #E2E8F0; color: var(--ink); }
.badge--failed { background: var(--stop-tint); color: var(--stop); }
.badge--skipped { background: #EDF0F3; color: var(--ink-2); }
.badge--missing { background: var(--stop-tint); color: var(--stop); }
.badge--extra { background: var(--hold-tint); color: var(--hold); }
.dest { display: grid; gap: 8px; }
.dest div { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.dest .badge { min-width: 64px; text-align: center; }
.dest .num { white-space: nowrap; }
.muted { color: var(--ink-2); font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel--stop { border-color: var(--stop); border-inline-start-width: 4px; }
.locks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lock { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor); }
.lock__text { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.lock__text b { font-size: 15px; }
.lock__text .muted { font-size: 13px; overflow-wrap: anywhere; }
.lock .btn { margin-inline-start: auto; flex: none; min-height: 44px; }

/* ------------------------------------------------------------ products */
.products { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 20px; }
.products__lead { color: var(--ink-2); }
.addrow { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 12px; align-items: end; }
.addrow:has(.addrow__cost[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
.addrow .btn { min-height: 50px; }
@media (max-width: 640px) { .addrow, .addrow:has(.addrow__cost[hidden]) { grid-template-columns: 1fr; } }
.form-msg { min-height: 1.5em; font-weight: 600; white-space: pre-line; }
.form-msg--go { color: var(--go); }
.form-msg--stop { color: var(--stop); }
td.pname { font-weight: 600; font-size: 15px; }
.pnote { font-weight: 400; font-size: 13px; margin-top: 4px; max-width: 520px; }
tr.is-builtin { background: var(--floor); }
.costform { display: flex; gap: 6px; align-items: center; }
.costform__input { width: 110px; height: 36px; padding: 0 10px; border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); font-size: 16px; }
.costform__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51, 65, 85, .18); }

/* ------------------------------------------------------------ account and users */
.account { max-width: 640px; margin: 0 auto; padding: 20px; display: grid; gap: 20px; }
.facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.num { text-align: right; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }
.users { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 20px; }
.users__lead { color: var(--ink-2); }
.userrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 170px auto; gap: 12px; align-items: start; }
.userrow .btn { min-height: 50px; margin-top: 28px; }
@media (max-width: 760px) { .userrow { grid-template-columns: 1fr; } .userrow .btn { margin-top: 0; } }
.users__msg { padding: 10px 18px 0; }
.users__msg:empty { display: none; }
.utable td { vertical-align: middle; }
.utable .uname b { font-size: 15px; }
.utable .uname .num { text-align: right; }
.utable .uacts .actions { gap: 6px; justify-content: flex-end; }
.utable tr.is-off td { color: var(--ink-2); }
.btn--stop { color: var(--stop); border-color: var(--stop); }
.btn--stop:hover { background: var(--stop-tint); border-color: var(--stop); }
.secret { display: grid; gap: 4px; padding: 14px 16px; border: 2px dashed var(--control); border-radius: var(--radius); background: var(--floor); text-align: center; }
.secret__user { color: var(--ink-2); font-size: 15px; }
.secret__value { font: 600 30px/1.3 var(--mono); letter-spacing: .08em; direction: ltr; user-select: all; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .utable thead { display: none; }
  .utable, .utable tbody, .utable tr, .utable td { display: block; }
  .utable tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.grid.utable td { padding: 2px 0; border: 0; }
  .utable td[data-label] { display: flex; gap: 10px; align-items: baseline; }
  .utable td[data-label]::before { content: attr(data-label); flex: none; min-width: 72px; color: var(--ink-2); font-size: 13px; }
  .utable td[data-label] .muted { display: inline; margin-inline-start: 6px; }
  .utable .uacts { padding-top: 10px; }
  .utable .uacts .actions { justify-content: flex-start; }
  .utable .btn--small { min-height: 44px; }
  .obx-acts .btn--small { min-height: 44px; }
}

/* ------------------------------------------------------------ settings */
.settings { max-width: 1100px; margin: 0 auto; padding: 20px 20px 96px; display: grid; gap: 16px; }
.settings__lead { color: var(--ink-2); }
#sections { display: grid; gap: 16px; }
.sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
@media (max-width: 860px) { .sgrid { grid-template-columns: 1fr; } }
.sfield { display: grid; gap: 6px; align-content: start; padding-inline-start: 10px; border-inline-start: 3px solid transparent; transition: border-color var(--ease); }
.sfield--wide { grid-column: 1 / -1; }
.sfield.is-changed { border-inline-start-color: var(--accent); }
.sfield.is-bad { border-inline-start-color: var(--stop); }
.sfield__label { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sfield__control { display: grid; gap: 6px; }
.sfield__control input, .sfield__control select, .sfield__control textarea { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--control);
  border-radius: var(--radius); background: var(--paper); font-size: 16px; transition: border-color var(--ease), box-shadow var(--ease); }
.sfield__control textarea { height: auto; padding: 8px 12px; resize: vertical; font-family: var(--mono); }
.sfield__control input:focus, .sfield__control select:focus, .sfield__control textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(51, 65, 85, .18); }
.sfield.is-bad .sfield__control input, .sfield.is-bad .sfield__control textarea { border-color: var(--stop); }
.sfield__control .ltr { direction: ltr; text-align: right; }
.sfield__control .ltr:placeholder-shown { direction: rtl; }
.sfield__control input[type="checkbox"] { width: 20px; height: 20px; padding: 0; }
.sfield__clear { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; color: var(--stop); cursor: pointer; }
.sfield__value { min-height: 24px; font-size: 15px; overflow-wrap: anywhere; }
.sfield__value.num { text-align: right; }
.sfield__state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.sfield__test { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sfield__test .btn { min-height: 40px; }
.testres { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.testres .ok { color: var(--go); }
.testres .bad { color: var(--stop); }
.summary-out { flex: 1 1 100%; display: grid; gap: 8px; }
.summary-out:empty { display: none; }
.summary-text { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor);
  font: 400 14px/1.7 var(--font); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.chats { display: grid; gap: 8px; }
.chatlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.chatlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chatlist li:last-child { border-bottom: 0; }
.chatlist__title { font-weight: 600; overflow-wrap: anywhere; }
.chatlist code { font-family: var(--mono); font-weight: 600; }
@media (max-width: 640px) { .chatlist li { grid-template-columns: minmax(0, 1fr) auto; } .chatlist code { grid-column: 1; } }
.savebar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.savebar .form-msg { flex: 1 1 200px; min-height: 0; }
.savebar .actions { margin-inline-start: auto; }
#dirtyCount { font-weight: 600; }
#dirtyCount:empty { display: none; }

/* ------------------------------------------------------------ operations log */
.audit { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.seg { display: inline-flex; justify-self: start; padding: 4px; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.seg__btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; transition: background var(--ease), color var(--ease); }
.seg__btn:hover { background: var(--floor); color: var(--ink); }
.seg__btn[aria-selected="true"] { background: var(--primary); color: #fff; }
.filters { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr) auto; align-items: end; }
.filters .field input, .filters .field select { height: 44px; font-size: 16px; }
.filters__actions { display: flex; gap: 8px; }
.filters__msg { grid-column: 1 / -1; }
.filters__msg:empty { display: none; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters__q, .filters__actions { grid-column: 1 / -1; } }
.audit__scroll { max-height: none; }
.audit__more { display: flex; justify-content: center; padding: 12px; }
.audit__more:has(> [hidden]) { display: none; }
.audit__note { text-align: center; }
.atable td { vertical-align: top; }
.atable td.when { white-space: nowrap; color: var(--ink-2); }
.atable td.sum { min-width: 260px; overflow-wrap: anywhere; }
.atable td.tog { text-align: end; }
.atable tr.detail td { background: var(--floor); }
.atable tbody tr.detail:hover { background: var(--floor); }
.atable .code { font-family: var(--mono); font-weight: 600; }
.act { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #E2E8F0; color: var(--ink); }
.act--auth, .act--security { background: var(--hold-tint); color: var(--hold); }
.act--users { background: #EEF2FF; color: #3730A3; }
.act--exports { background: var(--stop-tint); color: var(--stop); }
.act--cancel { background: var(--hold-tint); color: var(--hold); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; margin: 0; }
.kv dt { font-size: 12px; color: var(--ink-2); }
.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.linkish { padding: 0; border: 0; background: none; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.linkish:hover { color: var(--ink); }
@media (max-width: 640px) {
  .seg { justify-self: stretch; }
  .seg__btn { flex: 1; padding: 0 10px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .atable thead { display: none; }
  .atable, .atable tbody, .atable tr, .atable td { display: block; }
  .atable tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.grid.atable td { padding: 2px 0; border: 0; }
  .atable td[data-label] { display: flex; gap: 10px; align-items: baseline; }
  .atable td[data-label]::before { content: attr(data-label); flex: none; min-width: 64px; color: var(--ink-2); font-size: 13px; }
  .atable td.sum { min-width: 0; padding-top: 4px; }
  .atable td.tog { text-align: start; padding-top: 6px; }
  .atable td.tog .btn { min-height: 44px; }
  .atable tr.detail { padding: 10px 14px; }
  .atable tr.detail[hidden] { display: none; }
  .linkish { min-height: 44px; }
}

/* ------------------------------------------------------------ statement upload (two kinds) */
.halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .halves { grid-template-columns: 1fr; } }
.half { display: grid; gap: 8px; align-content: start; min-width: 0; }
.drop--half { min-height: 150px; }
.drop__icon { color: var(--primary); }
.drop--half strong { font-size: 19px; }
.staged { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.staged li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 14px; }
.staged__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.staged__del { flex: none; border: 0; background: transparent; color: var(--stop); font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: var(--radius); min-height: 32px; }
.staged__del:hover { background: var(--stop-tint); }
.stage { display: grid; gap: 12px; }
.rounds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rounds:empty { display: none; }
.round { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor); }
.round__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.round__head .badge { margin-inline-start: auto; }
.round__files { margin: 0; padding-inline-start: 18px; font-size: 14px; }
.round__files > li { margin-bottom: 4px; }
.warnbox { margin-top: 6px; border: 1px solid var(--hold); border-inline-start-width: 4px; border-radius: var(--radius); background: var(--hold-tint); }
.warnbox summary { min-height: 44px; padding: 10px 12px; color: var(--hold); font-weight: 600; cursor: pointer; }
.warnbox summary::marker { color: var(--hold); }
.warnbox__body { max-height: 320px; overflow: auto; background: var(--paper); border-top: 1px solid var(--hold); border-radius: 0 0 var(--radius) var(--radius); }
.warnbox table.grid td { font-size: 13px; overflow-wrap: break-word; }
.warnbox table.grid td.num, .warnbox table.grid td.kind { white-space: nowrap; }
@media (max-width: 640px) { .warnbox table.grid th.kind, .warnbox table.grid td.kind { display: none; } .warnbox table.grid th, .warnbox table.grid td { padding: 6px 8px; } }
.warnbox tr.is-info td { color: var(--ink-2); }
.warnbox tr.is-warn td { color: var(--hold); font-weight: 600; }
.warnbox tr.is-warn { background: var(--hold-tint); }
.warnbox .muted { padding: 8px 12px; }
.round .err { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.ask { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--accent); border-inline-start-width: 4px; border-radius: var(--radius); background: var(--go-tint); }
.ask strong { font-size: 18px; }

/* ------------------------------------------------------------ jard (reconciliation) */
.jard { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 20px; }
.jard__lead { color: var(--ink-2); }
.jard__steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1040px) { .jard__steps { grid-template-columns: 1fr; } }
.step__no { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-end: 10px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; vertical-align: middle; }
.stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats--3, .stats--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat--go b { color: var(--go); }
.drop--small { min-height: 96px; padding: 14px; }
.drop--small strong { font-size: 17px; }
.flist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); max-height: 220px; overflow: auto; }
.flist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.flist li:last-child { border-bottom: 0; }
.flist li.flist__empty { display: block; padding: 14px; color: var(--ink-2); text-align: center; }
.flist__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist__meta { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.flist__del { border: 0; background: transparent; color: var(--stop); cursor: pointer; padding: 4px 8px; border-radius: var(--radius); font-size: 13px; font-weight: 600; }
.flist__del:hover { background: var(--stop-tint); }
.flist li.is-bad { background: var(--stop-tint); }
.flist__bad { grid-column: 1 / -1; color: var(--stop); font-size: 13px; font-weight: 600; white-space: normal; }
@media (max-width: 640px) { .flist li { grid-template-columns: minmax(0, 1fr) auto; } .flist__meta { grid-column: 1 / -1; grid-row: 2; } }
.tgbox { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor); }
.tgbox__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tgbox__login { display: grid; gap: 8px; }
.tgbox__row { display: flex; gap: 8px; flex-wrap: wrap; }
.tgbox__input { flex: 1 1 180px; height: 44px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); direction: ltr; }
.tgbox__input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(51, 65, 85, .18); }
.tgbox .dlg__error:empty { display: none; }
.btn--big { min-height: 60px; font-size: 20px; }
.ready { display: grid; gap: 8px; }
.ready div { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ready .badge { min-width: 64px; text-align: center; }
.report { display: grid; gap: 16px; }
.report h3 { font-size: 17px; font-weight: 600; }
.report .panel__scroll { border: 1px solid var(--line); border-radius: var(--radius); }
.report__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notes { margin: 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 14px; }
.notes:empty { display: none; }
.pick { height: 40px; padding: 0 10px; border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); }
.rate { display: inline-block; width: 70px; height: 6px; margin-inline-end: 8px; background: var(--floor); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.rate i { display: block; height: 100%; background: var(--go); }
table.grid tr.is-total td { font-weight: 700; background: var(--floor); }

/* ------------------------------------------------------------ cancelling mistakes */
.btn--danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn--danger:hover { background: #B91C1C; border-color: #B91C1C; }
dialog.reasondlg { width: min(520px, calc(100vw - 32px)); }
.reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.reasons legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.reasons__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.reasons__btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.reasons .field input { height: 48px; font-size: 16px; }
.dlg__what { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor); overflow-wrap: anywhere; }
.dlg__what b.num { font: 600 20px/1.3 var(--mono); }
.dlg__list { margin: 0; padding-inline-start: 20px; font-size: 14px; display: grid; gap: 2px; }
.undo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--paper); border: 1px dashed var(--control); border-radius: var(--radius); }
.undo__btn { min-height: 48px; border-color: var(--hold); color: var(--hold); }
.undo__btn:hover { background: var(--hold-tint); border-color: var(--hold); }
.undo__left { font-weight: 700; min-width: 3.2em; text-align: center; }
.undo__what { flex: 1 1 200px; min-width: 0; color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent li.is-undone b, .recent li.is-undone .what { text-decoration: line-through; text-decoration-color: rgba(15, 23, 42, .45); }
.undone { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--hold-tint); color: var(--hold); font-size: 12px; font-weight: 700; text-decoration: none; }
.recent li.is-undone .undone { text-decoration: none; }
.recent li.is-undone .dot { background: var(--hold); }
.round__cancel { margin-inline-start: auto; }
.oactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.oactions__kind { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
/* one waybill again (admin page) */
.reprint { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 12px; }
.reprint__field input { font-family: var(--mono); direction: ltr; text-align: right; }
.reprint__go { min-height: 50px; }
.reprint__kind, .reprint__msg { grid-column: 1 / -1; }
.reprint__kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--hold); font-weight: 600; }
.reprint__kind[hidden] { display: none; }
.reprint__msg:empty { display: none; }
@media (max-width: 640px) { .reprint { grid-template-columns: 1fr; } .reprint__go { width: 100%; } }

/* ------------------------------------------------------------ orders: search and history */
.orders { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.osearch { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 12px; }
.osearch__field input { height: 56px; font-size: 20px; }
.osearch__go { min-height: 56px; padding: 0 24px; }
.osearch__hint, .osearch__msg { grid-column: 1 / -1; }
.osearch__msg:empty { display: none; }
.otable__scroll { max-height: none; }
.otable td { vertical-align: top; }
.otable .code { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--ink); text-underline-offset: 3px; }
.otable td.c-who { min-width: 180px; overflow-wrap: anywhere; }
.otable td.c-who .muted { font-size: 13px; }
.otable tbody tr[data-id] { cursor: pointer; }
.otable td .num { white-space: nowrap; }
.opad { padding: 12px 18px; }
a.olink { display: inline-flex; align-items: center; min-height: 32px; color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
a.olink:hover { color: var(--ink); }
.odetail { display: grid; gap: 16px; }
.odetail__back { display: flex; }
.ohead__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ohead__no { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ohead__no .code { font: 600 26px/1.2 var(--mono); overflow-wrap: anywhere; }
.ohead__state .badge { font-size: 14px; padding: 4px 12px; }
.ofacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
.ofacts .wide { grid-column: span 2; }
.ofacts dt { font-size: 13px; color: var(--ink-2); }
.ofacts dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ofacts dd .muted { font-weight: 400; }
.ofacts a.num { color: var(--primary); text-underline-offset: 3px; }
.odetail .form-msg:empty { display: none; }
.ogrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "items log" "jard log" "claims log" "flags log" "raw log"; gap: 16px; align-items: start; }
.ogrid__items { grid-area: items; } .ogrid__jard { grid-area: jard; } .ogrid__claims { grid-area: claims; } .ogrid__flags { grid-area: flags; } .ogrid__log { grid-area: log; } .ogrid__raw { grid-area: raw; }
.ogrid { grid-template-rows: auto auto auto auto 1fr; }
.oclaims { list-style: none; margin: 0; padding: 0; }
.oclaims li { display: grid; gap: 2px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.oclaims li.is-old { border-inline-start: 4px solid var(--stop); }
.oclaims__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.oclaims__meta { color: var(--ink-2); }
.oclaims__meta .num { white-space: nowrap; }
.oclaims__note { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.oclaims__go { justify-items: start; }
.ojard { gap: 10px; }
.ojard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ojard__top .badge { font-size: 14px; padding: 4px 12px; }
.ofacts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ofacts--3 .wide3 { grid-column: 1 / -1; }
.ojard__seen { font-size: 14px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ojard .num { white-space: nowrap; }
.ogrid > .panel { min-width: 0; }
.oflags { list-style: none; margin: 0; padding: 0; }
.oflags li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.oflags li:last-child { border-bottom: 0; }
.oflags__kind { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.oflags__msg { overflow-wrap: anywhere; }
.oflags li.is-warn { background: var(--hold-tint); }
.oflags li.is-warn .oflags__msg { color: var(--hold); font-weight: 600; }
.oflags li .muted { font-size: 12px; white-space: nowrap; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 12px; padding-bottom: 18px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; inset-inline-start: 8px; top: 20px; bottom: 2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl__dot { width: 14px; height: 14px; margin: 5px 2px 0; border-radius: 50%; background: var(--paper); border: 3px solid var(--control); }
.tl__dot--go { border-color: var(--go); background: var(--go); }
.tl__dot--hold { border-color: var(--hold); background: var(--hold-tint); }
.tl__dot--stop { border-color: var(--stop); background: var(--stop); }
.tl__body { display: grid; gap: 2px; min-width: 0; }
.tl__top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.tl__what { font-size: 15px; }
.tl__when { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tl__who { font-size: 14px; }
.tl__detail { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; }
.tl__link { justify-self: start; display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; font-weight: 600; color: var(--primary); text-underline-offset: 3px; }
.oraw summary { min-height: 48px; padding: 12px 18px; font-weight: 600; }
.oraw__body { max-height: 420px; overflow: auto; border-top: 1px solid var(--line); }
.oraw th[scope="row"] { position: static; width: 34%; background: var(--floor); font-weight: 600; overflow-wrap: anywhere; }
.oraw td { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .ofacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ogrid { grid-template-columns: 1fr; grid-template-areas: "items" "jard" "claims" "flags" "log" "raw"; grid-template-rows: none; }
}
@media (max-width: 640px) {
  .osearch { grid-template-columns: 1fr; }
  .osearch__go { width: 100%; }
  .ofacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ofacts .wide { grid-column: 1 / -1; }
  .ofacts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ohead__no .code { font-size: 22px; }
  /* results as cards: number and state, then who, phone and price, address, order number and upload time */
  .otable thead { display: none; }
  .otable, .otable tbody { display: block; }
  .otable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line);
    grid-template-areas: "no state" "who who" "phone price" "addr addr" "code up"; }
  table.grid.otable td { display: block; padding: 0; border: 0; min-width: 0; }
  .otable td.c-no { grid-area: no; } .otable td.c-state { grid-area: state; align-self: center; }
  .otable td.c-who { grid-area: who; } .otable td.c-phone { grid-area: phone; } .otable td.c-price { grid-area: price; text-align: end; }
  .otable td.c-addr { grid-area: addr; color: var(--ink-2); } .otable td.c-code { grid-area: code; } .otable td.c-up { grid-area: up; text-align: end; }
  .otable td.c-code, .otable td.c-up { font-size: 13px; color: var(--ink-2); }
  .otable td[data-label]::before { content: attr(data-label) " "; color: var(--ink-2); font-size: 13px; }
  .otable td[data-label]:has(> .num:empty) { visibility: hidden; }
  .otable .code { display: inline-flex; align-items: center; min-height: 44px; font-size: 17px; }
  .oflags li { grid-template-columns: auto minmax(0, 1fr); }
  .oflags li > .muted { grid-column: 2; }
}

/* ---------- claims against the delivery company (/claims) ---------- */
.claims { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.claims__lead { color: var(--ink-2); }
.ctabs { flex-wrap: wrap; }
.ctab { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 52px; line-height: 1.35; white-space: nowrap; }
.ctab__n { font-weight: 500; }
.ctab__sum { font-size: 12px; font-weight: 500; opacity: .85; }
.ctab__sum:empty { display: none; }
.cfilters { grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; align-items: end; }
.cfilters .field input, .cfilters .field select { height: 44px; font-size: 16px; }
.cfilters__msg { grid-column: 1 / -1; }
.cfilters__msg:empty { display: none; }
.cbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.cbar__all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.cbar__all input, .ctable input[type="checkbox"], .check input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.cbar__count { font-size: 14px; font-weight: 600; }
.cbar__count:empty { display: none; }
.cbar__export { margin-inline-start: auto; }
.cmsg { padding: 0 18px; }
.cmsg:empty { display: none; }
.cmsg:not(:empty) { padding: 10px 18px 0; }
.ctable__scroll { max-height: none; }
.ctable td { vertical-align: top; }
.ctable th.c-sel, .ctable td.c-sel { width: 44px; padding-inline-end: 0; }
.ctable td.c-sel input { margin: 2px 0 0; }
.ctable .code { font-family: var(--mono); font-weight: 600; color: var(--primary); text-underline-offset: 3px; }
.ctable td.c-amount b { font-size: 16px; }
.ctable td.c-facts { font-size: 13px; min-width: 200px; }
.ctable td.c-facts .num, .ctable td.c-age .num { white-space: nowrap; }
.ctable td.c-note { max-width: 260px; overflow-wrap: anywhere; font-size: 13px; }
.ctable td.c-act { text-align: end; }
.ctable td .muted { font-size: 12px; }
.ctable tr.is-old td:first-child { box-shadow: inset -4px 0 0 var(--stop); }
.cage { font-weight: 600; white-space: nowrap; }
.cage.is-old { color: var(--stop); }
.cmore { padding: 10px 18px; }
.claims__note { font-size: 13px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 10px; cursor: pointer; }
.check input { flex: none; margin: 2px 0 0; }
dialog.claimdlg { width: min(560px, calc(100vw - 32px)); }
.claimdlg .dlg__what { font-size: 14px; gap: 4px; }
.claimdlg .dlg__what .num { white-space: nowrap; }
.cdedit { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
.cdedit .field input { height: 46px; font-size: 16px; }
.cdedit .btn { grid-column: 1 / -1; justify-self: start; }
.cdedit__hint { grid-column: 1 / -1; }
.cdacts { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.cdreason { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cdreason .field input { height: 48px; font-size: 16px; }
@media (max-width: 900px) { .cfilters { grid-template-columns: 1fr 1fr; } .cfilters .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .claims { padding: 12px; }
  .ctabs { display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; }
  .ctab { padding: 0 8px; }
  .cfilters { grid-template-columns: 1fr; }
  .cbar { padding: 8px 14px; }
  .cbar__export { margin-inline-start: 0; }
  .cdedit { grid-template-columns: 1fr; }
  /* rows as cards: number, kind and amount, then the customer, the statement, age and note */
  .ctable thead { display: none; }
  .ctable, .ctable tbody { display: block; }
  .ctable tr { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
    grid-template-areas: "sel no amount" ". kind kind" ". who who" ". facts facts" ". note note" ". age act"; }
  table.grid.ctable td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; }
  .ctable td.c-sel { grid-area: sel; width: auto; } .ctable td.c-no { grid-area: no; } .ctable td.c-amount { grid-area: amount; text-align: end; }
  .ctable td.c-kind { grid-area: kind; font-weight: 600; } .ctable td.c-who { grid-area: who; }
  .ctable td.c-facts { grid-area: facts; } .ctable td.c-age { grid-area: age; align-self: center; }
  .ctable td.c-act { grid-area: act; } .ctable td.c-note { grid-area: note; }
  .ctable td.c-note:empty, .ctable td.c-facts:empty { display: none; }
  .ctable .code { display: inline-flex; align-items: center; min-height: 44px; font-size: 17px; }
  .ctable td.c-act .btn { min-height: 44px; }
  .ctable tr.cempty { display: block; }
  .ctable tr.is-old { box-shadow: inset -4px 0 0 var(--stop); }
  .ctable tr.is-old td:first-child { box-shadow: none; }
}

/* ---------- profit report (/profit, manager) ---------- */
.profit { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.prun { color: var(--ink-2); font-size: 14px; }
.prun--old { padding: 10px 14px; border: 1px solid var(--hold); border-inline-start-width: 4px; border-radius: var(--radius); background: var(--hold-tint); color: var(--hold); font-weight: 600; }
.prun a { color: inherit; text-underline-offset: 3px; }
.pfilters { gap: 12px; }
.pseg { flex-wrap: wrap; }
.pseg .seg__btn[aria-pressed="true"] { background: var(--primary); color: #fff; }
.pfilters__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.pfilters .field input, .pfilters .field select { height: 44px; font-size: 16px; }
.pfilters__actions { display: flex; gap: 8px; }
.pfilters__msg:empty { display: none; }
.stat b span { font-size: inherit; color: inherit; }
.stat b .pneg { color: var(--stop); }
.stat b small { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pcounts { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pcount { padding: 4px 10px; border-radius: 999px; background: var(--floor); border: 1px solid var(--line); font-size: 13px; }
.pcount .num { font-weight: 700; }
.pcount--delivered { background: var(--go-tint); border-color: transparent; color: var(--go); }
.pcount--company_returned { background: var(--stop-tint); border-color: transparent; color: var(--stop); }
.pcount--partial, .pcount--pending, .pcount--none { background: var(--hold-tint); border-color: transparent; color: var(--hold); }
.ppending .num { white-space: nowrap; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ptable__scroll { max-height: 520px; }
table.grid.ptable td, table.grid.ptable th { white-space: nowrap; padding: 8px 10px; }
table.grid.ptable th { white-space: normal; }
table.grid.ptable td:first-child { white-space: normal; min-width: 110px; }
table.grid.ptable td.pweek { white-space: nowrap; }
.ptable .code { font-family: var(--mono); font-weight: 600; color: var(--primary); text-underline-offset: 3px; }
.pneg { color: var(--stop); }
.pnote { padding: 10px 18px 14px; font-size: 13px; }
.pnocost { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pnocost li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--floor); }
@media (max-width: 1100px) { .pgrid { grid-template-columns: 1fr; } .pfilters__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pfilters__actions { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .profit { padding: 12px; }
  .pseg { display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; }
  .pseg .seg__btn { padding: 0 8px; }
  .pfilters__row { grid-template-columns: 1fr 1fr; }
  .pfilters__actions .btn { flex: 1; }
  .stat b { font-size: 24px; }
}

/* ---------- stock (/stock) ---------- */
.stock { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.stock__on { display: grid; gap: 16px; }
.scount { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.scount .field input { height: 44px; font-size: 17px; }
.stock__head { flex-wrap: wrap; }
.sfilter { padding: 10px 18px 0; }
.smsg { padding: 0 18px; }
.smsg:empty { display: none; }
.smsg:not(:empty) { padding: 10px 18px 0; }
.stable__scroll { max-height: none; }
.stable td { vertical-align: middle; }
.stable td.c-bal b { font-size: 17px; }
.stable td.c-act .actions { gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.stable tr.is-low td:first-child { box-shadow: inset -4px 0 0 var(--hold); }
.stable tr.is-negative td:first-child { box-shadow: inset -4px 0 0 var(--stop); }
.stable .linkish { text-align: start; }
.sday { font-size: 22px !important; }
.stock__help { font-size: 13px; }
.dlg__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg .field input, .dlg .field select { height: 46px; font-size: 16px; }
.ctdiff { min-height: 1.5em; font-weight: 700; }
/* goods out without a waybill (task 32) */
.ilines { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; }
.ilines legend { padding: 0 6px; font-weight: 600; }
.ilines ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.iline { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.iline .field input, .iline .field select { height: 44px; font-size: 16px; }
.iline .field span { font-size: 13px; }
.iline__bal { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); margin-top: -4px; }
.iline__bal.is-neg { color: var(--stop); font-weight: 600; }
.iline__del { min-height: 44px; }
.itotal { min-height: 1.5em; font-weight: 600; }
.itable td { vertical-align: top; }
.itable .ilist { margin: 0; padding: 0; list-style: none; }
.itable tr.is-cancelled td { color: var(--ink-2); }
.itable tr.is-cancelled .ilist { text-decoration: line-through; }
.ctdiff.is-neg { color: var(--stop); }
.ctdiff.is-pos { color: var(--go); }
.mvhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mvlist { max-height: min(60vh, 520px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.mvtable td.when, .mvtable td .num { white-space: nowrap; }
.mvtable td.note { max-width: 220px; overflow-wrap: anywhere; }
.mvtable .code { font-family: var(--mono); font-weight: 600; color: var(--primary); }
.ppos { color: var(--go); }
@media (max-width: 640px) {
  .stock { padding: 12px; }
  .dlg__pair { grid-template-columns: 1fr; }
  .iline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .iline .iline__product { grid-column: 1 / -1; }
  /* balances as cards: name and state, the numbers, then the buttons */
  .stable thead { display: none; }
  .stable, .stable tbody { display: block; }
  .stable tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
    grid-template-areas: "name name state" "bal out ret" "min count count" "act act act"; }
  table.grid.stable td { display: block; padding: 0; border: 0; min-width: 0; }
  .stable td.c-name { grid-area: name; font-weight: 600; } .stable td.c-state { grid-area: state; text-align: end; }
  .stable td.c-bal { grid-area: bal; } .stable td.c-out { grid-area: out; } .stable td.c-ret { grid-area: ret; }
  .stable td.c-min { grid-area: min; } .stable td.c-count { grid-area: count; } .stable td.c-act { grid-area: act; padding-top: 6px; }
  .stable td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: 12px; }
  .stable td.c-act .actions { justify-content: flex-start; }
  .stable td.c-act .btn { min-height: 44px; flex: 1; }
  .stable tr.is-low { box-shadow: inset -4px 0 0 var(--hold); } .stable tr.is-negative { box-shadow: inset -4px 0 0 var(--stop); }
  .stable tr.is-low td:first-child, .stable tr.is-negative td:first-child { box-shadow: none; }
  .stable .linkish { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .label.flash .label__band, .ledger__list li.is-gone { animation: none; }
  *, *::before, *::after { transition-duration: 0ms !important; }
  .tile:hover { transform: none; }
}
.err { color: var(--stop); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; gap: 0 12px; padding: 6px 12px 0; }
  .bar__brand { min-height: 44px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -12px; padding: 0 8px; border-top: 1px solid rgba(255,255,255,.1); }
  .nav__link { min-height: 46px; padding: 0 12px; font-size: 14px; }
  .nav__sep { margin: 12px 4px; }
  /* Two rows do not fit as a sticky header: the bar scrolls away, the scan warning stays. */
  .bar { position: static; }
  .hazard { top: 0; }
}
@media (max-width: 640px) {
  .bar { gap: 0 12px; padding: 6px 12px 0; }
  .bar__end { gap: 8px; }
  .bar__who { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 8px; }
  .bar__name, .bar__role { display: none; }
  .chip { font-size: 12px; }
  .hazard { top: 0; }
  .desk, .home, .admin, .jard, .products, .account, .users, .audit, .orders { padding: 12px; }
  .settings { padding: 12px 12px 96px; }
  .tally { flex-wrap: wrap; }
  .tally__item { flex: 1 1 100px; min-width: 0; }
}

/* Late orders panel on the admin page (task 18) */
.late__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.late__card { position: relative; display: grid; align-content: start; gap: 2px; min-height: 44px; padding: 10px 12px; padding-inline-end: 38px; text-align: start; font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.late__card:hover { border-color: var(--control); }
.late__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.late__card b { font-size: 30px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.late__card > span:not(.late__chev) { font-size: 13px; color: var(--ink-2); }
.late__card.is-hold b { color: var(--hold); }
.late__card[aria-expanded="true"] { border-color: var(--primary); background: var(--floor); box-shadow: inset 0 -3px 0 var(--primary); }
.late__chev { position: absolute; inset-inline-end: 12px; top: 14px; display: inline-flex; color: var(--ink-2); transition: transform var(--ease); }
.late__card[aria-expanded="true"] .late__chev { transform: rotate(180deg); }
.late__list { display: grid; gap: 8px; }
.late__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.late__list .panel__scroll { border: 1px solid var(--line); border-radius: var(--radius); }
.late__table td.late__at, .late__table td.late__age { white-space: nowrap; }
@media (max-width: 640px) {
  /* phones: one card per order (number and age, then customer, time and statement) */
  .late__card b { font-size: 26px; }
  table.grid.late__table thead { display: none; }
  table.grid.late__table, table.grid.late__table tbody { display: block; }
  table.grid.late__table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.grid.late__table tr:last-child { border-bottom: 0; }
  table.grid.late__table td { padding: 0; border: 0; }
  table.grid.late__table td[colspan], table.grid.late__table td.late__name, table.grid.late__table td.late__at, table.grid.late__table td.late__st { grid-column: 1 / -1; }
  table.grid.late__table td.late__age { grid-column: 2; grid-row: 1; font-weight: 600; color: var(--hold); }
  table.grid.late__table td.late__at, table.grid.late__table td.late__st { font-size: 13px; color: var(--ink-2); }
  table.grid.late__table td.late__st br { display: none; }
  table.grid.late__table td.late__st .muted::before { content: " · "; }
  table.grid.late__table td[data-label]::before { content: attr(data-label) " "; }
}

/* ---------- indicators (/dashboard, task 19) ---------- */
.dash { max-width: 1440px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.dash__content { display: grid; gap: 16px; }
.dfilters__row { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.dfilters__row input:disabled { background: var(--floor); color: var(--ink-2); }
.dpatterns { position: absolute; width: 0; height: 0; overflow: hidden; }
.pat--hold-tint { fill: var(--hold-tint); } .pat--hold { fill: var(--hold); }
.pat--stop { fill: var(--stop); } .pat--stop-line { stroke: var(--stop-tint); stroke-width: 1.2; }
.pat--wait { fill: #E2E8F0; } .pat--wait-dot { fill: var(--control); }
.stat .dsub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.stat .dsub a { color: inherit; text-underline-offset: 3px; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dchart { gap: 10px; }
.dsvg { width: 100%; min-height: 40px; }
.dchart__svg { display: block; font-family: var(--font); direction: rtl; }
.dchart__svg text { font-variant-numeric: tabular-nums; }
.dtick { font-size: 11px; fill: var(--ink-2); }
.dtick--axis { font-weight: 600; }
.dval { font-size: 12px; font-weight: 600; fill: var(--ink); }
.dlabel { font-size: 13px; fill: var(--ink); }
.dsmall { font-size: 10.5px; fill: var(--ink-2); }
.daxis { stroke: var(--control); stroke-width: 1; }
.dgridline { stroke: var(--line); stroke-width: 1; }
.dbar { fill: #CBD5E1; }
.dbar:hover { fill: #94A3B8; }
.dline { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.dline--go { stroke: var(--go); }
.dline--stop { stroke: var(--stop); }
.dline--dash { stroke-dasharray: 6 4; }
.ddot { fill: var(--paper); stroke-width: 2.2; }
.ddot.dline--go { stroke: var(--go); } .ddot.dline--stop { stroke: var(--stop); stroke-dasharray: none; }
.dseg { stroke: var(--paper); stroke-width: 1; }
.dseg--delivered { fill: var(--go); }
.dseg--partial { fill: url(#pat-partial); }
.dseg--returned { fill: url(#pat-returned); }
.dseg--waiting { fill: url(#pat-waiting); }
.drow.is-small { opacity: .45; }
.dlegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.dlegend li { display: inline-flex; align-items: center; gap: 6px; }
.dlegend svg { flex: none; overflow: visible; }
.dlegend--parts { padding: 0 2px; }
.dnote { font-size: 13px; }
.dnote:empty { display: none; }
.dtable__scroll { max-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); }
table.grid.dtable td, table.grid.dtable th { white-space: nowrap; padding: 7px 10px; }
table.grid.dtable th { white-space: normal; }
table.grid.dtable td:first-child { white-space: normal; min-width: 110px; }
table.grid.dtable td.dweek { white-space: nowrap; }
table.grid.dtable tr.is-small td { color: var(--ink-2); }
table.grid.dtable tr.is-group td { background: var(--floor); }
.dempty .panel__body { justify-items: center; text-align: center; padding: 40px 18px; }
.dempty__icon { color: var(--ink-2); }
.dempty h2 { font-size: 20px; }
.dempty p { max-width: 520px; color: var(--ink-2); }
@media (max-width: 1100px) { .dgrid { grid-template-columns: 1fr; } .dfilters__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .dash { padding: 12px; }
  .dfilters__row { grid-template-columns: 1fr 1fr; }
  .dlegend { gap: 4px 12px; font-size: 12px; }
}

/* ---------- phones and the installed app (PWA) ---------- */
/* The status bar of the installed app is drawn over the page (black-translucent): keep it dark like the
   top bar, and keep the bar's content clear of the notch and the rounded corners. */
html { -webkit-tap-highlight-color: transparent; }
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: env(safe-area-inset-top, 0px); background: var(--ink); z-index: 40; pointer-events: none; }
.bar { padding-top: env(safe-area-inset-top, 0px); padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  min-height: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); }
@media (max-width: 900px) {
  .bar { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .hazard { top: env(safe-area-inset-top, 0px); }
}
/* Taps: no 300 ms wait or double-tap zoom on controls, a visible press on touch screens, no text
   selection when a button is held. */
a, button, label, summary, select, [role="button"] { touch-action: manipulation; }
.btn, .seg__btn, .nav__link, .bar__out, .bar__who, .bar__install, .bar__back, .tile, .chip, .late__card { -webkit-user-select: none; user-select: none; }
@media (hover: none) {
  .btn:active:not(:disabled), .seg__btn:active, .bar__out:active, .bar__install:active, .bar__back:active, .late__card:active { filter: brightness(.92); transform: translateY(1px); }
  .nav__link:active, .bar__who:active { background: rgba(255,255,255,.12); }
}
/* Dialogs stay inside the screen above the on-screen keyboard and scroll inside. */
dialog { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow: auto; overscroll-behavior: contain; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
.bar__install { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--accent); border-radius: var(--radius); background: transparent; color: #fff; font-size: 15px; white-space: nowrap; transition: background var(--ease); }
.bar__install:hover { background: rgba(5, 150, 105, .25); }
.bar__install svg { flex: none; color: #34D399; }
.bar__back { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-inline-start: -10px; border: 0; border-radius: var(--radius); background: transparent; color: #fff; }
.netstrip { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); z-index: 19; padding: 8px 16px; background: var(--hold-tint); color: var(--hold); border-bottom: 1px solid var(--hold); font-size: 14px; font-weight: 600; text-align: center; }
@media (max-width: 900px) { .netstrip { top: env(safe-area-inset-top, 0px); } }
@media (max-width: 640px) { .bar__install span { display: none; } .bar__install { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 8px; } }
.appsteps { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.offline { max-width: 560px; margin: 40px auto; padding: 0 16px; }
.offline__body { justify-items: center; text-align: center; padding: 36px 22px; }
.offline__body h1 { font-size: 22px; }
.offline__body p { max-width: 440px; }
.offline__icon { color: var(--ink-2); }

