/* DBR ERP — three DBR looks from the redesign brief: Light (default), Clean (graphite), Wrap (fleet livery).
   Light: light grey + black text, yellow = main action, green = add/save, orange = drafts & active filters. */
:root, :root[data-theme="light"] {
  --bg: #ECEDEA; --surface: #FFFFFF; --surface-2: #F6F6F3; --line: #E1E2DE; --line-strong: #C7C9C3;
  --ink: #111214; --ink-2: #2B2D31; --ink-3: #686C73;
  --yellow: #FFC414; --yellow-hover: #F2B600; --on-yellow: #0B0B0C;
  --orange: #C25E00; --orange-soft: #FCEBD9;
  --green: #157F3B; --green-hover: #0F6B30;
  --top: #FFFFFF; --top-ink: #111214;
  --focus: #1D4ED8;
  --ok: #157F3B; --ok-bg: #E3F4E8; --warn: #A34F00; --warn-bg: #FDEBD7;
  --bad: #B42318; --bad-bg: #FDE7E5; --info: #1E4FA8; --info-bg: #E2EBFA;
  --muted-bg: #EFEFEC; --bar: #E0A800;
  --radius: 6px; --h-control: 36px; --row: 44px;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 28px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.12);
  --font-body: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Inter", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
  --head-case: none; --head-track: -0.02em;
  color-scheme: light;
}
:root[data-theme="clean"] {
  --bg: #111214; --surface: #1A1B1E; --surface-2: #202227; --line: #2C2F34; --line-strong: #41454C;
  --ink: #F3F3F1; --ink-2: #D4D6D9; --ink-3: #A3A8B0;
  --orange: #FFC414; --orange-soft: #2E2608; --green: #FFC414; --green-hover: #F2B600;
  --top: #16171A; --top-ink: #F3F3F1; --focus: #FFE066;
  --ok: #7EE2A0; --ok-bg: #12301E; --warn: #FFD27A; --warn-bg: #33270C; --bad: #FF9A90; --bad-bg: #3A1614; --info: #9CC0FF; --info-bg: #142540;
  --muted-bg: #26282D; --bar: #FFC414;
  color-scheme: dark;
}
:root[data-theme="wrap"] {
  --bg: #0B0B0C; --surface: #16171A; --surface-2: #202227; --line: #2E3136; --line-strong: #464A51;
  --ink: #F3F3F1; --ink-2: #D9DBDE; --ink-3: #A3A8B0;
  --orange: #FFC414; --orange-soft: #2E2608; --green: #FFC414; --green-hover: #FFD447;
  --top: #111214; --top-ink: #F3F3F1; --focus: #FFE066;
  --ok: #7EE2A0; --ok-bg: #12301E; --warn: #FFD27A; --warn-bg: #33270C; --bad: #FF9A90; --bad-bg: #3A1614; --info: #9CC0FF; --info-bg: #142540;
  --muted-bg: #26282D; --bar: #FFC414; --radius: 0px;
  --font-head: "Russo One", "Arial Black", Impact, sans-serif; --head-case: uppercase; --head-track: .02em;
  --tread: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23555a62'/%3E%3Cstop offset='1' stop-color='%231a1b1e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Crect x='2.5' y='5' width='9' height='3' rx='1.5' transform='rotate(45 7 6.5)'/%3E%3Crect x='15.5' y='5' width='9' height='3' rx='1.5' transform='rotate(-45 20 6.5)'/%3E%3Crect x='2.5' y='18' width='9' height='3' rx='1.5' transform='rotate(-45 7 19.5)'/%3E%3Crect x='15.5' y='18' width='9' height='3' rx='1.5' transform='rotate(45 20 19.5)'/%3E%3C/g%3E%3C/svg%3E");
  --brushed: repeating-linear-gradient(90deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),linear-gradient(180deg,#FFE066 0%,#FFC414 44%,#E9A300 60%,#FFCB2E 100%);
  --hazard: repeating-linear-gradient(-45deg,#FFC414 0 12px,#0B0B0C 12px 24px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--fs); line-height: 1.45; min-height: 100vh; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--orange); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 13px; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--top); color: var(--top-ink); box-shadow: inset 0 -2px 0 var(--yellow); }
:root[data-theme="wrap"] .topbar { background: linear-gradient(90deg,rgba(11,11,12,.15),rgba(11,11,12,.92) 55%), var(--tread), #111214; background-size: auto, 26px 26px, auto; box-shadow: inset 0 -3px 0 var(--yellow); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo .mark { font: 900 20px/1 "Russo One", "Arial Black", Impact, sans-serif; letter-spacing: .04em; color: var(--yellow); background: #0B0B0C; padding: 8px 12px 7px; border-radius: 3px; font-style: italic; }
.logo img { height: 44px; width: auto; display: block; border-radius: 5px; }
.logo .erp { font: 700 10px/1 var(--font-body); background: var(--yellow); color: var(--on-yellow); padding: 3px 5px; border-radius: 3px; align-self: flex-start; margin-top: 6px; letter-spacing: .05em; }
.divider { width: 1px; height: 28px; background: var(--line); }
.apps-btn { background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; }
.crumbs { font-weight: 600; font-size: var(--fs); }
.topbar .spacer { flex: 1; }
.org { font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.org::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3BB273; }
.org .tag { border: 1px solid var(--line-strong); font-size: 10px; padding: 1px 4px; border-radius: 3px; color: var(--ink-3); }
.topbar select { height: 34px; font-size: var(--fs-sm); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--on-yellow); font-weight: 700; display: grid; place-items: center; flex: none; }
:root[data-theme="wrap"] .avatar { border-radius: 0; background: var(--brushed); clip-path: polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%); }

/* Theme switch (pill radio group) */
.theme-switch { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.theme-switch button { height: 28px; border: 0; border-radius: 999px; background: transparent; padding: 0 12px; font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }
.theme-switch button[aria-checked="true"] { background: var(--yellow); color: var(--on-yellow); }

/* App launcher */
.launcher { position: fixed; inset: 64px 0 0 0; z-index: 45; background: rgba(15,16,18,.35); display: flex; justify-content: center; align-items: flex-start; padding-top: 12px; }
.launcher .sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow: auto; padding: 18px; }
:root[data-theme="wrap"] .launcher .sheet { border-radius: 0; }

/* ---------- Page ---------- */
.content { max-width: 1520px; margin: 0 auto; padding: 22px 24px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { font: 700 var(--fs-xl)/1.1 var(--font-head); letter-spacing: var(--head-track); text-transform: var(--head-case); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); font-size: var(--fs); max-width: 90ch; }
.page-head p a { color: var(--ink-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
:root[data-theme="wrap"] .page-head h1 { display: inline-block; color: var(--on-yellow); background: var(--brushed); padding: 8px 34px 7px 14px; clip-path: polygon(0 0,100% 0,calc(100% - 16px) 100%,0 100%); font-weight: 400; font-size: 24px; }
:root[data-theme="wrap"] .page-head h1 .chip { vertical-align: middle; }
:root[data-theme="wrap"] .page-head h1 .mono { font-family: inherit; font-size: inherit; }

/* ---------- Controls ---------- */
button, .btn { height: var(--h-control); padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 var(--fs)/1 var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
button:hover { border-color: var(--ink-3); background: var(--surface-2); }
button.primary { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); font-weight: 700; }
button.primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }
/* green = add & save */
button[data-hotkey="n"], button[data-save], button[data-act="save"], button[data-a="save"], #rp, #adj { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
button[data-hotkey="n"]:hover, button[data-save]:hover, button[data-act="save"]:hover, button[data-a="save"]:hover { background: var(--green-hover); border-color: var(--green-hover); }
:root[data-theme="clean"] button[data-hotkey="n"], :root[data-theme="clean"] button[data-save], :root[data-theme="clean"] button[data-act="save"], :root[data-theme="clean"] button[data-a="save"],
:root[data-theme="wrap"] button[data-hotkey="n"], :root[data-theme="wrap"] button[data-save], :root[data-theme="wrap"] button[data-act="save"], :root[data-theme="wrap"] button[data-a="save"] { color: var(--on-yellow); }
:root[data-theme="wrap"] button.primary, :root[data-theme="wrap"] button[data-hotkey="n"] { background: var(--brushed); border: 0; text-transform: uppercase; letter-spacing: .06em; font-family: "Chakra Petch", var(--font-body); clip-path: polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%); }
button.danger { color: var(--bad); border-color: currentColor; background: transparent; }
button.ghost { border-color: transparent; background: transparent; }
button.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
button:disabled { opacity: .45; cursor: not-allowed; }
kbd { font: 600 10px/1 var(--font-body); border: 1px solid currentColor; border-radius: 3px; padding: 2px 4px; opacity: .6; }
input, select, textarea { height: var(--h-control); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0 10px; font: 400 var(--fs) var(--font-body); background: var(--surface); color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,196,20,.35); }
textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input[type=checkbox] { height: 16px; width: 16px; accent-color: var(--yellow); }
input:disabled, select:disabled, textarea:disabled { background: var(--muted-bg); color: var(--ink-3); }
.invalid { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
.field-err { color: var(--bad); font-size: var(--fs-xs); margin-top: 3px; font-weight: 600; }

/* ---------- Panels & cards ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.panel > header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font: 700 var(--fs-md)/1.2 var(--font-head); letter-spacing: var(--head-track); text-transform: var(--head-case); margin: 0; }
:root[data-theme="wrap"] .panel > header h2 { font-size: 14px; font-weight: 400; }
.panel > header .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.panel .body { padding: 14px 16px; }
:root[data-theme="wrap"] .panel, :root[data-theme="wrap"] .kpi, :root[data-theme="wrap"] .tile { border-radius: 0; position: relative; clip-path: polygon(0 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%); }
:root[data-theme="wrap"] .kpi::before, :root[data-theme="wrap"] .tile::before, :root[data-theme="wrap"] .panel::before { content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px; background: var(--yellow); clip-path: polygon(0 0,100% 0,0 100%); z-index: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--yellow); color: inherit; }
.kpi .label { font-size: var(--fs); color: var(--ink-2); }
.kpi .value { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 6px 0 4px; letter-spacing: -0.01em; }
.kpi .sub { font-size: var(--fs-sm); color: var(--ink-3); }
/* Summary cards that act as filters (e.g. Scale Tickets): click to filter, click again to show all. */
button.kpi-filter { font: inherit; text-align: left; height: auto; width: 100%; cursor: pointer; white-space: normal; transition: border-color .12s, background .12s, box-shadow .12s; }
button.kpi-filter:hover { border-color: var(--yellow); }
button.kpi-filter.on { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); box-shadow: 0 0 0 3px rgba(255,196,20,.35); }
button.kpi-filter.on .label, button.kpi-filter.on .sub { color: var(--on-yellow); }
.filter-note { margin: -6px 0 12px; font-size: var(--fs-sm); color: var(--ink-2); }
.filter-note button.link { border: 0; background: none; padding: 0 4px; height: auto; color: inherit; text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; cursor: pointer; font: inherit; font-weight: 600; }
/* Scale ticket screen */
.backlink { display: inline-block; margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; }
.page-head h1.tk-title { text-transform: uppercase; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sup-row { display: flex; gap: 8px; align-items: center; }
.sup-row input { flex: 1; min-width: 0; }
.sup-row button { flex: none; }
table.data.lines input.combo { width: 100%; }
.numbox { text-align: right; font-variant-numeric: tabular-nums; }
.wcell, .dcell { display: flex; gap: 6px; align-items: center; }
td.strong { font-weight: 700; }
.formula { flex: 1; min-width: 220px; font-size: 12.5px; line-height: 1.6; }
.warn-ico { color: var(--warn); margin-right: 2px; }
.combo-list { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; max-width: 520px; }
.combo-item { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.combo-item:last-child { border-bottom: 0; }
.combo-item small { display: block; color: var(--ink-3); font-size: 11.5px; }
.combo-item.on, .combo-item:hover { background: var(--orange-soft); }
.combo-empty { padding: 10px; color: var(--ink-3); font-size: var(--fs-sm); }
.modal footer .btn-yes, button.btn-yes { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; min-width: 90px; }
.modal footer .btn-no, button.btn-no { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 700; min-width: 90px; }
button.btn-yes:hover, button.btn-no:hover { filter: brightness(1.08); }
.overlay.bigmodal .modal.big { width: min(980px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.overlay.bigmodal .modal.big header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.overlay.bigmodal .modal.big header .x { margin-left: auto; }
.overlay.bigmodal .modal.big .mbody { overflow: auto; flex: 1; padding: 16px 18px; }
.overlay.bigmodal .modal.big fieldset.group { background: var(--surface); }
.toolbar input.flt-combo { width: 280px; max-width: 100%; }
.tkno { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 15px; font-weight: 800; letter-spacing: .01em; }

/* Workspace */
.hello { display: flex; align-items: center; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.hello h1 { font: 700 34px/1.1 var(--font-head); letter-spacing: -0.03em; margin: 0; text-transform: var(--head-case); }
:root[data-theme="wrap"] .hello { background: linear-gradient(90deg,rgba(11,11,12,.2),rgba(11,11,12,.9) 60%), var(--tread); background-size: auto, 26px 26px; padding: 22px 20px; box-shadow: inset 0 -3px 0 var(--yellow); }
:root[data-theme="wrap"] .hello h1 { font-weight: 400; letter-spacing: .01em; }
.hello .actions { margin-left: auto; }
.hello .big { height: 44px; padding: 0 20px; font-size: 15px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin: 14px 0 14px; }
.seg button { height: 36px; border: 0; background: transparent; color: var(--ink-2); font-weight: 500; }
.seg button[aria-selected="true"] { background: var(--orange); color: #fff; font-weight: 700; }
:root[data-theme="clean"] .seg button[aria-selected="true"], :root[data-theme="wrap"] .seg button[aria-selected="true"] { color: var(--on-yellow); }
:root[data-theme="wrap"] .seg button { text-transform: uppercase; font-family: "Chakra Petch", var(--font-body); letter-spacing: .06em; font-size: 12.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 12px; min-height: 104px; position: relative; }
.tile:hover { border-color: var(--yellow); color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.tile .ico { width: 38px; height: 38px; border-radius: 6px; background: var(--yellow); color: var(--on-yellow); display: grid; place-items: center; }
:root[data-theme="wrap"] .tile .ico { border-radius: 0; background: var(--brushed); }
.tile .ico svg { width: 20px; height: 20px; }
.tile b { font-weight: 700; font-size: 15px; }
:root[data-theme="wrap"] .tile b { text-transform: uppercase; font-family: "Chakra Petch", var(--font-body); letter-spacing: .06em; font-size: 13px; }
.tile .count { position: absolute; top: 14px; right: 14px; font-size: var(--fs-xs); font-weight: 700; background: var(--orange-soft); color: var(--orange); padding: 2px 7px; border-radius: 10px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.side-list li:last-child { border-bottom: 0; }
.side-list .ico { width: 30px; height: 30px; border-radius: 5px; background: var(--yellow); color: var(--on-yellow); display: grid; place-items: center; flex: none; }
.side-list .ico svg { width: 16px; height: 16px; }
.side-list small { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Toolbar & tables ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input[type=search] { width: 280px; }
.toolbar .count { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs); }
table.data th { text-align: left; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 0 10px; height: 40px; white-space: nowrap; position: sticky; top: 0; z-index: 1; user-select: none; }
:root[data-theme="wrap"] table.data th { box-shadow: inset 0 -2px 0 var(--yellow); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; font-family: "Chakra Petch", var(--font-body); }
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { font-size: 10px; color: var(--orange); }
table.data td { border-bottom: 1px solid var(--line); padding: 0 10px; height: var(--row); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); height: 42px; }
table.data td.wrap { white-space: normal; }
.empty { padding: 32px !important; text-align: center; color: var(--ink-3); white-space: normal !important; }
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: var(--fs-sm); color: var(--ink-3); border-top: 1px solid var(--line); }
.pager .spacer { flex: 1; }

/* Status chips — dot + text, never colour alone */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 700; background: var(--muted-bg); color: var(--ink-2); line-height: 1.5; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--orange-soft); color: var(--orange); } /* drafts / open work = orange */
:root[data-theme="wrap"] .chip { border-radius: 0; clip-path: polygon(5px 0,100% 0,calc(100% - 5px) 100%,0 100%); padding: 2px 12px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field label .req { color: var(--bad); }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 26px; }
fieldset.group { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin: 0 0 14px; }
fieldset.group legend { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ink-3); padding: 0 6px; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--ink-3); font-size: var(--fs-sm); }
dl.kv dd { margin: 0; }

/* ---------- Drawer, modal, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,16,18,.45); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); width: min(680px, 100vw); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.wide { width: min(1040px, 100vw); }
.drawer > header { display: flex; align-items: center; gap: 8px; padding: 14px 20px; background: var(--surface); border-bottom: 2px solid var(--yellow); }
.drawer > header h2 { margin: 0; font: 700 var(--fs-lg)/1.2 var(--font-head); letter-spacing: var(--head-track); text-transform: var(--head-case); }
.drawer > header .x { margin-left: auto; }
.drawer .dbody { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer .dbody > .schema-form, .drawer .dbody > .form-grid { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.drawer .dbody fieldset.group { background: var(--surface); }
.drawer > footer { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.drawer > footer .spacer { flex: 1; }
.overlay.center { justify-content: center; align-items: center; }
.modal { background: var(--surface); border-radius: 10px; width: min(480px, 94vw); box-shadow: var(--shadow); border-top: 4px solid var(--yellow); }
.modal header { padding: 16px 18px 0; font: 700 18px var(--font-head); text-transform: var(--head-case); }
.modal .mbody { padding: 10px 18px 16px; color: var(--ink-2); }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111214; color: #F3F3F1; padding: 12px 16px; border-radius: 6px; box-shadow: var(--shadow); max-width: 400px; border-left: 4px solid var(--yellow); font-weight: 500; }
.toast.bad { border-left-color: #F04438; }

/* ---------- Charts (single series, labelled) ---------- */
.bars { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: 8px 12px; align-items: center; font-size: var(--fs-sm); }
.bars .track { height: 14px; background: var(--muted-bg); border-radius: 0 4px 4px 0; }
.bars .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.cols { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; border-bottom: 1px solid var(--line-strong); }
.cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.cols .col .c { width: 64%; max-width: 48px; background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .col:hover .c { filter: brightness(.9); }
.cols .col .v { font-size: var(--fs-xs); color: var(--ink-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.cols-x { display: flex; gap: 10px; }
.cols-x span { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); padding-top: 6px; }

/* ---------- Ticket entry ---------- */
.lines input, .lines select { height: 32px; width: 100%; }
.lines td { padding: 0 5px; }
.totals { margin-left: auto; width: 330px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--yellow); font-weight: 700; font-size: var(--fs-md); margin-top: 6px; padding-top: 8px; }
.callout { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-sm); margin-bottom: 12px; }
.callout.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.callout.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.callout.info { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; }
.tabs button.on { background: var(--orange); border-color: var(--orange); color: #fff; }
:root[data-theme="clean"] .tabs button.on, :root[data-theme="wrap"] .tabs button.on { color: var(--on-yellow); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 6px 0 8px 16px; border-left: 2px solid var(--line); position: relative; font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }

/* ---------- Materials catalogue: family bays → category panels → subcategory groups → item tags ---------- */
#mtree { display: flex; flex-direction: column; gap: 26px; }
.mfam-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--yellow); border-radius: 8px; }
.mfam-head h2 { margin: 0; font: 700 22px/1.1 var(--font-head); letter-spacing: var(--head-track); text-transform: var(--head-case); }
:root[data-theme="wrap"] .mfam-head { border: 0; border-radius: 0; background: linear-gradient(90deg,rgba(11,11,12,0),rgba(11,11,12,.85) 62%), var(--tread), #111214; background-size: auto, 26px 26px, auto; box-shadow: inset 0 -3px 0 var(--yellow); }
:root[data-theme="wrap"] .mfam-head h2 { background: var(--brushed); color: var(--on-yellow); padding: 5px 26px 4px 12px; clip-path: polygon(0 0,100% 0,calc(100% - 14px) 100%,0 100%); font-weight: 400; }
.cnt { font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 12px; align-items: start; }
.mcat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 12px; min-width: 0; }
:root[data-theme="wrap"] .mcat { border-radius: 0; position: relative; clip-path: polygon(0 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%); }
:root[data-theme="wrap"] .mcat::before { content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px; background: var(--yellow); clip-path: polygon(0 0,100% 0,0 100%); }
.mcat-head { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mcat-head h3 { margin: 0; font: 700 16px/1.2 var(--font-head); text-transform: var(--head-case); }
.msubs { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.msub-head { display: flex; align-items: center; gap: 6px; }
.msub-head h4 { margin: 0; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.msub-head .cnt { background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 11px; padding: 0 6px; border-radius: 8px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.mchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 3px 3px 8px; font-size: 13px; cursor: pointer; min-width: 0; }
.mchip:hover, .mchip:focus-visible { border-color: var(--yellow); background: var(--surface); }
.mchip .hole { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink-3); flex: none; }
.mchip .price { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mchip.inactive { opacity: .5; text-decoration: line-through; }
.mchip.match { border-color: var(--orange); }
:root[data-theme="wrap"] .mchip { border-radius: 0; clip-path: polygon(0 0,calc(100% - 7px) 0,100% 7px,100% 100%,0 100%); }
.chip-menu { height: 22px; padding: 0 6px; border: 0; background: transparent; color: var(--ink-3); font-size: 15px; line-height: 1; }
.chip-menu:hover { color: var(--orange); background: transparent; }
.dots { font-size: 16px; padding: 0 8px; }
.add-item { height: 28px; width: 11em; font-size: 12.5px; border-style: dashed; background: transparent; }
.add-line { margin-top: 10px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.add-line:hover { color: var(--orange); background: transparent; }
mark { background: var(--yellow); color: var(--on-yellow); padding: 0 1px; border-radius: 2px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow: auto; }
.menu-list button { justify-content: flex-start; border: 0; height: 40px; background: transparent; font-weight: 600; }
.menu-list button:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--yellow); }
.menu-list .danger-item { color: var(--bad); }

.foot { text-align: center; color: var(--ink-3); font-size: var(--fs-xs); padding: 20px 0 30px; letter-spacing: .06em; }
:root[data-theme="wrap"] .foot { margin-top: 20px; padding-top: 26px; background: linear-gradient(var(--hazard)) top / 100% 7px no-repeat; text-transform: uppercase; font-family: "Chakra Petch", var(--font-body); }

/* ---------- Printable documents (always black on white) ---------- */
.doc { background: #fff; color: #000; width: 794px; max-width: 100%; margin: 0 auto; padding: 36px 40px; font: 12px/1.45 Arial, Helvetica, sans-serif; border: 1px solid var(--line); }
.doc h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: .5px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc th, .doc td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
.doc th { background: #eee; }
.doc .r { text-align: right; }
.doc .row { display: flex; justify-content: space-between; gap: 24px; }
.doc .box { border: 1px solid #999; padding: 8px 10px; flex: 1; }
.doc .small { font-size: 10px; color: #333; }
@media print {
  body * { visibility: hidden; }
  .doc, .doc * { visibility: visible; }
  .doc { position: absolute; left: 0; top: 0; border: none; width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .g-main-side, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .org, .divider, .crumbs, #userSel, .theme-switch { display: none; }
  .content { padding: 16px 16px 50px; }
  .g2, .form-grid { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
  .totals { width: 100%; }
  .hello h1 { font-size: 26px; }
}

/* v2 core: zebra rows, navigation layouts */
table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.data tbody tr:hover td { background: var(--surface-2); }
.appnav { display: none; }
body[data-nav="tabs"] .appnav { display: flex; gap: 2px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 16px; position: sticky; top: 0; z-index: 5; }
body[data-nav="tabs"] .appnav a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 600; }
body[data-nav="tabs"] .appnav a.on { color: var(--ink); border-bottom-color: var(--yellow); }
body[data-nav="side"] .appnav { display: flex; flex-direction: column; position: fixed; left: 0; top: 64px; bottom: 0; width: 200px; background: var(--surface); border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; z-index: 5; }
body[data-nav="side"] .appnav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
body[data-nav="side"] .appnav a.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--yellow); }
body[data-nav="side"] .content, body[data-nav="side"] .foot { margin-left: 200px; }
.appnav .ico svg { width: 16px; height: 16px; }
@media (max-width: 800px) { body[data-nav="side"] .appnav { position: static; width: auto; flex-direction: row; overflow-x: auto; } body[data-nav="side"] .content, body[data-nav="side"] .foot { margin-left: 0; } }
/* v2 workspace */
.tile { position: relative; }
.tile .ws-star { position: absolute; top: 4px; left: 4px; border: 0; background: transparent; padding: 2px 4px; font-size: 15px; line-height: 1; color: var(--ink-3); cursor: pointer; min-height: 0; }
.tile .ws-star.on { color: #d4a000; }
.tile .ws-star:hover, .tile .ws-star:focus-visible { color: #d4a000; }
.tile.ws-drag { cursor: grab; }
.tile.dragging { opacity: .45; }
.tile.drag-over { outline: 2px dashed var(--ink-3); outline-offset: 2px; }
.ws-kpi-head { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.ws-mini { padding: 2px 6px; min-height: 0; font-size: 12px; margin-left: auto; flex: none; }
.side-list li.ws-read { opacity: .55; }
.ws-kpi-opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line, #ddd); border-radius: var(--radius, 6px); cursor: pointer; }

/* Tick-box row selection + bulk action bar (RCTIs & Payments) */
table.data th.sel-cell, table.data td.sel-cell { width: 40px; padding: 0 0 0 14px; cursor: pointer; text-overflow: clip; }
table.data td.sel-cell input, table.data th.sel-cell input { width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }
table.data tbody tr.selected td { background: var(--warn-bg); }
.selbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 16px; background: var(--warn-bg); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.selbar[hidden] { display: none; }
.selbar .muted { margin-right: 6px; }
.selbar [data-selclear] { margin-left: auto; }
.toast.warn { border-left-color: #F79009; }
.opt-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; cursor: pointer; }
p.small { font-size: var(--fs-sm); }

/* Packing list: pod entry row (Shipments) */
.pod-entry { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 4px; }
.pod-entry .field { margin: 0; width: 130px; }
.pod-entry .pod-net { height: 38px; display: flex; align-items: center; font-weight: 700; font-size: 16px; }

/* Segmented choice (packing list: IBC pod / loose item / packaging) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface); padding: 6px 14px; min-height: 0; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--yellow); color: #111; font-weight: 600; }
.pod-entry .f-desc { display: none; }
.pod-entry[data-kind="loose"] .f-pod, .pod-entry[data-kind="packaging"] .f-pod, .pod-entry[data-kind="packaging"] .f-mat { display: none; }
.pod-entry[data-kind="packaging"] .f-desc { display: block; }

/* Inventory: total stock per family (first screen) */
.fam-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.fam-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-align: left; min-height: 0; cursor: pointer; }
.fam-tile span { font-size: var(--fs); color: var(--ink-2); }
.fam-tile b { font-size: 22px; }
.fam-tile:hover { border-color: var(--yellow); }
.fam-tile.on { border: 2px solid var(--yellow); background: var(--warn-bg); }

/* Number column headings line up with their numbers (right-aligned) */
table.data th.num { text-align: right; }
.fam-tile { height: auto; white-space: normal; font-weight: 400; }

/* Inventory: family bubbles (Matt's mock-up 03/11/2026) — coloured outline + name, total weight inside */
.fam-pick header h2 { letter-spacing: .06em; }
.fam-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 16px; }
.fam-bubble { --fc: #888; height: auto; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; white-space: normal;
  border: 2px solid var(--fc); border-radius: 12px; background: color-mix(in srgb, var(--fc) 7%, var(--surface)); cursor: pointer; transition: transform .1s, box-shadow .1s, background .1s; }
.fam-bubble:hover, .fam-bubble:focus-visible { background: color-mix(in srgb, var(--fc) 15%, var(--surface)); box-shadow: 0 4px 14px color-mix(in srgb, var(--fc) 30%, transparent); transform: translateY(-1px); }
.fam-bubble .fb-name { color: var(--fc); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 17px; }
.fam-bubble .fb-kg { color: var(--ink); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fam-bubble .fb-sub { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 400; }
.fam-head { --fc: #888; display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 10px 16px; border: 2px solid var(--fc); border-radius: 12px; background: color-mix(in srgb, var(--fc) 7%, var(--surface)); }
.fam-head h2 { margin: 0; color: var(--fc); text-transform: uppercase; letter-spacing: .08em; font-size: 18px; }
.fam-head .fb-kg { margin-left: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Inventory bubbles: drag to reorder */
.fam-bubble[draggable="true"] { cursor: grab; }
.fam-bubble.dragging { opacity: .45; }
.fam-bubble.drag-over { outline: 3px dashed var(--fc); outline-offset: 3px; }
/* Inventory: ranked "what we hold the most of" chart (owner 04/11/2026) */
.rank-chart { margin-top: 14px; }
.rank-chart header h2 { letter-spacing: .06em; }
.rc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px 0; font-size: var(--fs-sm); color: var(--ink-2); }
.rc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rc-rows { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 12px; }
.rc-row { display: grid; grid-template-columns: 28px minmax(140px, 320px) 1fr 110px; align-items: center; gap: 12px; height: auto; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; font-weight: 400; text-align: left; white-space: normal; }
.rc-row:hover, .rc-row:focus-visible { background: var(--surface-2); border: 0; }
.rc-rank { color: var(--ink-3); font-size: var(--fs-sm); text-align: right; font-variant-numeric: tabular-nums; }
.rc-label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.rc-label b { color: var(--ink); font-size: var(--fs); }
.rc-note { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-label small, .rc-val small { color: var(--ink-3); font-size: var(--fs-xs); }
.rc-track { height: 18px; display: flex; align-items: center; }
.rc-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: filter .15s; }
.rc-row:hover .rc-bar { filter: brightness(1.12); }
.rc-row.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink-2); }
.sale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 16px; }
.sale-card { height: auto; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); white-space: normal; font-weight: 400; text-align: center; transition: box-shadow .15s, transform .15s, border-color .15s; }
.sale-card:hover, .sale-card:focus-visible { border-color: var(--yellow); box-shadow: var(--shadow); transform: translateY(-1px); background: var(--surface); }
.sale-art { margin-bottom: 6px; max-width: 100%; } .sale-art svg { max-width: 100%; height: auto; }
.sale-buyer { font-weight: 700; font-size: var(--fs-md); color: var(--ink); }
.sale-kg { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 2px; }
.sale-meta { font-size: var(--fs-sm); color: var(--ink-3); }
.sale-open { margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--yellow); }
.sale-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sale-choice button { height: auto; min-height: 76px; flex-direction: column; justify-content: center; gap: 4px; font-size: var(--fs-md); white-space: normal; }
.sale-choice small { font-weight: 400; font-size: var(--fs-sm); opacity: .8; }
.kpi.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpi.clickable:hover, .kpi.clickable:focus-visible { border-color: var(--yellow); box-shadow: var(--shadow); }
.kpi.clickable.on { border: 2px solid var(--yellow); }
.rc-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rc-val b { color: var(--ink); font-size: var(--fs); }
@media (max-width: 640px) { .rc-row { grid-template-columns: 20px 100px 1fr 70px; gap: 8px; } }

/* Inventory: view switch + master stock list (grouped family › category › subcategory) */
.tabs .view-toggle { margin-left: auto; }
table.master-list tr.ml-h td { font-weight: 700; background: color-mix(in srgb, var(--fc) 9%, var(--surface)); }
table.master-list tr.ml-h0 td { color: var(--fc); letter-spacing: .06em; font-size: 15px; border-top: 2px solid var(--fc); }
table.master-list tr.ml-h0 td:first-child { border-left: 5px solid var(--fc); }
table.master-list tr.ml-h1 td:first-child { padding-left: 26px; }
table.master-list tr.ml-h2 td { font-weight: 600; background: var(--surface-2); }
table.master-list tr.ml-h2 td:first-child { padding-left: 44px; }
table.master-list tr.ml-item td:first-child { padding-left: 64px; }
table.master-list tr.ml-item { cursor: pointer; }

/* Inventory: "Go to a material" search + highlight of the line found */
.tabs .inv-search { margin-left: auto; width: 300px; max-width: 100%; }
.tabs .inv-search + .view-toggle { margin-left: 0; }
@keyframes rowflash { 0%, 60% { background: var(--warn-bg); box-shadow: inset 4px 0 0 var(--yellow); } 100% { background: transparent; box-shadow: inset 4px 0 0 var(--yellow); } }
table.data tbody tr.flash td { animation: rowflash 2.6s ease-out forwards; font-weight: 600; }

/* Materials hub (owner 04/11/2026): same bubbles as Inventory, then item cards */
.fam-bubble.add-bubble { border-style: dashed; --fc: var(--ink-3); background: transparent; min-height: 120px; }
.fam-bubble.add-bubble .fb-name { font-size: 14px; }
.mat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 16px; }
.mat-card { --fc: #888; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1.5px solid color-mix(in srgb, var(--fc) 55%, var(--line)); border-left: 6px solid var(--fc); border-radius: 10px; background: var(--surface); cursor: pointer; min-width: 0; }
.mat-card:hover, .mat-card:focus-visible { background: color-mix(in srgb, var(--fc) 8%, var(--surface)); box-shadow: 0 3px 10px color-mix(in srgb, var(--fc) 25%, transparent); }
.mat-card.inactive { opacity: .55; }
.mat-card .mc-top { display: flex; align-items: flex-start; gap: 6px; }
.mat-card .mc-name { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mat-card .mc-path { font-size: 11px; color: var(--fc); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mat-card .mc-code { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono, monospace); overflow-wrap: anywhere; }
.mat-card .mc-prices { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.mat-card .mc-stock { font-size: var(--fs-sm); color: var(--ink-3); }
.mat-card.add-card { border-style: dashed; border-left-width: 1.5px; cursor: default; justify-content: center; background: transparent; }
.mat-card.add-card input { width: 100%; }

/* Sorting: black DBR skips, one per mixed material in stock (owner 04/11/2026) */
.skips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 16px; }
.skip { height: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; white-space: normal; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: transform .1s, box-shadow .1s, border-color .1s; }
.skip:hover:not(:disabled), .skip:focus-visible { border-color: #F5B800; box-shadow: 0 4px 14px rgba(245, 184, 0, .3); transform: translateY(-2px); }
.skip:disabled { cursor: default; }
.skip .sk-bin { width: 180px; height: auto; margin-bottom: 6px; }
.skip .sk-name { font-weight: 700; font-size: 16px; color: var(--ink); text-align: center; }
.skip .sk-kg { margin-top: 6px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.skip .sk-path { font-size: 11px; color: var(--ink-3); text-align: center; }

/* Owner 04/11/2026: no up/down spinner arrows on number boxes anywhere (numbers are typed or read from the scale). */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Sorting batch (owner 04/11/2026): the mix being sorted at the top, outputs as coloured cards with a kg box */
.sort-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sort-head .sk-bin { width: 96px; height: auto; flex: none; }
.sort-head .sh-main { flex: 1; min-width: 220px; }
.sort-head .sh-eyebrow { font-size: 11px; letter-spacing: .1em; font-weight: 700; color: var(--ink-3); }
.sort-head h3 { margin: 2px 0 6px; font-size: 20px; }
.sort-head .sh-kg { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sort-head .sh-kg input { width: 130px; font-size: 16px; font-weight: 700; }
.sort-head .sh-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.sort-head .sh-meta .field { margin: 0; min-width: 150px; }
.out-card { cursor: default; }
.out-card.chosen { background: color-mix(in srgb, var(--fc) 12%, var(--surface)); box-shadow: 0 0 0 2px var(--fc) inset; }
.out-card .oc-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.out-card .oc-row input { width: 110px; flex: 1; min-width: 0; }

/* Shipments (owner 04/11/2026): container weight bar, material picker button, documents, loading photos */
.wbar { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 12px; overflow: visible; }
.wbar .wfill { height: 100%; border-radius: 6px; background: var(--ok, #157F3B); }
.wbar.orange .wfill { background: var(--st-orange); }
.wbar.red .wfill { background: var(--bad, #B42318); }
.wbar i { position: absolute; top: -3px; bottom: -3px; border-left: 2px dashed #D97706; }
.wbar i.max { border-left-color: var(--bad, #B42318); }
.wlab { font-size: var(--fs-sm); margin-top: 6px; font-weight: 600; color: var(--ok, #157F3B); }
.wlab.orange { color: var(--st-orange); }
.wlab.red { color: var(--bad, #B42318); }
.matpick { width: 100%; height: auto; min-height: 38px; justify-content: flex-start; text-align: left; white-space: normal; }
.docrow { display: flex; gap: 8px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.pcam { cursor: pointer; white-space: nowrap; font-size: 15px; }
.psteps { display: grid; gap: 6px; }
.pstep { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.pstep.done { border-color: color-mix(in srgb, var(--ok, #157F3B) 45%, var(--line)); background: color-mix(in srgb, var(--ok, #157F3B) 5%, var(--surface)); }
.pst-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.pst-i { width: 18px; text-align: center; color: var(--ok, #157F3B); font-weight: 700; }
.pst-l { flex: 1; }
.pst-add { cursor: pointer; border: 1px solid var(--line-strong, #C7C9C3); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.pst-t { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px 26px; }
.pthumb { width: 56px; height: 56px; padding: 0; border-radius: 6px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }

/* Shipment summary tiles (owner 04/11/2026: easier to read) */
.sumtiles { display: grid; gap: 10px; }
.st { border: 1.5px solid var(--line); border-left: 6px solid var(--ink-3); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.st-l { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.st-v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0; }
.st-s { font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px; }
.st-parcels { border-left-color: var(--st-parcels); background: color-mix(in srgb, var(--st-parcels) 8%, var(--surface)); }
.st-parcels .st-v { color: var(--st-parcels); }
.st-net { border-left-color: var(--st-net); background: color-mix(in srgb, var(--st-net) 8%, var(--surface)); }
.st-net .st-v { color: var(--st-net); }
.st-w.green { border-left-color: var(--ok, #157F3B); background: color-mix(in srgb, var(--ok, #157F3B) 6%, var(--surface)); }
.st-w.green .st-v { color: var(--ok, #157F3B); }
.st-w.orange { border-left-color: var(--st-orange); background: color-mix(in srgb, var(--st-orange) 10%, var(--surface)); }
.st-w.orange .st-v { color: var(--st-orange); }
.st-w.red { border-left-color: var(--bad, #B42318); background: color-mix(in srgb, var(--bad, #B42318) 8%, var(--surface)); }
.st-w.red .st-v { color: var(--bad, #B42318); }
.st-w .wbar { margin-top: 10px; }
.st-cont { border-left-color: var(--ink-2); }
.st-row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); padding: 2px 0; }
.st-row.big { font-size: 16px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; }

/* Summary tile colours per theme (owner 04/11/2026: purple and blue were not visible on the dark Clean theme) */
:root, :root[data-theme="light"] { --st-parcels: #6D28D9; --st-net: #1E4FA8; --st-orange: #B45309; }
:root[data-theme="clean"], :root[data-theme="wrap"] { --st-parcels: #C4B5FD; --st-net: #93C5FD; --st-orange: #FBBF24; }

/* Summary, wide and easier to read (owner 04/11/2026): a strip of tiles above the packing list, bigger white labels */
.sumtiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.st { padding: 14px 16px; border-left-width: 8px; }
.st-l { font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.st-v { font-size: 32px; margin: 4px 0 6px; }
.st-s { font-size: 14px; color: var(--ink-2); }
.st-s .chip { font-size: 13px; padding: 3px 9px; }
.st-row { font-size: 15px; color: var(--ink); padding: 4px 0; }
.st-row.big { font-size: 20px; font-weight: 700; }

/* Shipment summary in the right-hand column (owner 04/11/2026): theme colours, only the parcel labels coloured,
   net weight yellow, total with container white, kg figures in Bahnschrift (Windows' squared number font). */
.sumtiles { grid-template-columns: 1fr; gap: 10px; }
.st { padding: 12px 14px; }
.st-v { font-family: "Bahnschrift", "DIN Alternate", "Barlow Condensed", var(--font-head, system-ui); font-weight: 600; font-size: 30px; letter-spacing: .01em; }
.st-parcels { border-left-color: var(--line-strong); background: var(--surface); }
.st-parcels .st-v { color: var(--ink); }
.st-net { border-left-color: var(--yellow, #FFC414); background: color-mix(in srgb, var(--yellow, #FFC414) 7%, var(--surface)); }
.st-net .st-v { color: var(--st-yellow); }
.st-cont { border-left-color: var(--ink); background: var(--surface); }
.st-cont .st-v { color: var(--ink); }
:root, :root[data-theme="light"] { --st-yellow: #A16207; }
:root[data-theme="clean"], :root[data-theme="wrap"] { --st-yellow: #FFC414; }
/* Folding panels */
.panel.fold > header { cursor: pointer; user-select: none; }
.panel.fold .fold-i { display: inline-block; transition: transform .15s; margin-right: 4px; }
.panel.fold:not(.folded) .fold-i { transform: rotate(90deg); }
.panel.fold.folded > .body { display: none; }

/* Owner 04/11/2026: Parcels inside and Net weight loaded: label in yellow, figure in white, no yellow highlight. */
.st-parcels .st-l, .st-net .st-l { color: var(--st-yellow); }
.st-parcels .st-v, .st-net .st-v { color: var(--ink); }
.st-net { border-left-color: var(--line-strong); background: var(--surface); }

/* Phones and tablets (owner 04/11/2026: the operator will build the packing list and take the photos on a phone or tablet) */
.g-main-side > * { min-width: 0; }
@media (max-width: 860px) {
  .panel > header { flex-wrap: wrap; row-gap: 4px; }
  .panel > header > span.muted, .panel > header > .chip { white-space: normal; }
  .page-head .actions { flex-wrap: wrap; }
  .pod-entry { flex-wrap: wrap; }
  .pod-entry input, .pod-entry select, .pod-entry .matpick, #shf input, #shf select { min-height: 48px; font-size: 16px; }
  .pod-entry #pdgo { width: 100%; height: 52px; font-size: 17px; }
}
@media (max-width: 640px) {
  .panel > header > span.muted { margin-left: 0 !important; flex-basis: 100%; }
  .page-head .actions > * { flex: 1 1 45%; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .seg button { min-height: 44px; white-space: normal; }
  .pod-entry .field { flex: 1 1 45%; min-width: 0 !important; }
  .pod-entry .field:has(.matpick), .pod-entry .field:has(#pdd) { flex-basis: 100%; }
  .pod-entry input { width: 100% !important; }
  /* Packing list: one card per parcel */
  .pl-table thead { display: none; }
  .pl-table, .pl-table tbody, .pl-table tfoot { display: block; }
  .pl-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; grid-template-areas: "no no ph x" "mat mat mat mat" "tot tare net net"; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .pl-table td { border: 0 !important; padding: 0 !important; text-align: left !important; }
  .pl-table .c-no { grid-area: no; } .pl-table .c-mat { grid-area: mat; } .pl-table .c-tot { grid-area: tot; } .pl-table .c-tare { grid-area: tare; } .pl-table .c-net { grid-area: net; }
  .pl-table .c-ph { grid-area: ph; justify-self: end; font-size: 20px; } .pl-table .c-x { grid-area: x; justify-self: end; }
  .pl-table .c-x button { min-width: 40px; min-height: 40px; }
  .pl-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
  .pl-table tr:has(td.empty) { display: block; }
  .pl-table tfoot tr { font-weight: 700; }
  .pstep .pst-add { padding: 8px 12px; }
}
@media (max-width: 640px) {
  /* the material field has inline sizing, so the phone layout must override it */
  .pod-entry .field { flex: 1 1 45% !important; }
  .pod-entry .field:has(.matpick), .pod-entry .field:has(#pdd) { flex: 1 1 100% !important; }
}

/* Shipments round 2 (owner 10/11/2026): two-line cells, Done checklist, deposits, calendar */
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.donelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.donelist li { display: flex; align-items: center; gap: 8px; }
.dn-i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); color: var(--ink-3); font-size: 12px; font-weight: 700; flex: none; }
.dn-i.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.deprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.deprow button { margin-left: auto; }
.depform { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.depform input { width: 130px; }
.depform .field:has(#depRef) input { width: 100%; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-h { padding: 6px 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.cal-d { min-height: 104px; padding: 4px 6px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.empty { background: var(--surface-2); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--yellow); }
.cal-n { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.cal-e { display: block; width: 100%; text-align: left; font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 4px; border: 0; border-left: 4px solid; cursor: pointer; height: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.cal-e span { display: block; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.cal-e.drop { background: var(--info-bg); border-color: var(--info); }
.cal-e.pick { background: var(--ok-bg); border-color: var(--ok); }
.cal-e.etd { background: var(--warn-bg); border-color: var(--warn); }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-legend .cal-e { width: auto; cursor: default; }
@media (max-width: 640px) { .cal-d { min-height: 64px; } .cal-e span { display: none; } }

/* Owner 10/11/2026: second Loading complete button under the packing list total */
.pl-done { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); }
.pl-done button { min-height: 44px; padding: 0 22px; font-size: var(--fs-md); }

/* Owner 10/11/2026: saved shipment details shrink to a compact summary; the packing list gets the room */
.shd-save { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-top: 1px solid var(--line); flex-wrap: wrap; }
.shd-save .muted { font-size: var(--fs-sm); }
.shd-compact > .body { padding-top: 10px; padding-bottom: 12px; }
.shd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 0; }
.shd-grid dt { font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.shd-grid dd { margin: 2px 0 0; font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shd-grid dd input { height: 30px; width: 100%; font-size: var(--fs-sm); border-color: var(--warn); }

/* Owner 10/11/2026: "Loading complete" pop-up = overall view of the container */
.modal.big.cmp-modal { width: min(1060px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.cmp-modal .mbody { overflow: auto; }
.cmp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.cmp-t { border: 1px solid var(--line); border-left: 5px solid var(--ink-3); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); }
.cmp-t.green { border-left-color: var(--ok); } .cmp-t.orange { border-left-color: var(--warn); } .cmp-t.red { border-left-color: var(--bad); }
.cmp-l { font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cmp-v { font: 700 26px/1.2 Bahnschrift, var(--font-head); margin-top: 2px; }
.cmp-s { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }
.cmp-ids { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cmp-ids > div { flex: 1; min-width: 220px; display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--ink); color: var(--surface); }
.cmp-ids span { font-size: var(--fs-xs); letter-spacing: .08em; opacity: .7; font-weight: 700; }
.cmp-ids b { font-size: 22px; letter-spacing: .04em; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.cmp-cols h3, .cmp-h { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 0 0 6px; }
.cmp-h { margin-top: 14px; }
.cmp-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; }
.cmp-dl > div { display: contents; }
.cmp-dl dt { color: var(--ink-3); font-size: var(--fs-sm); }
.cmp-dl dd { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.cmp-mats { width: 100%; }
.cmp-mats td, .cmp-mats th { padding-top: 6px; padding-bottom: 6px; }
.cmp-mats tfoot td { font-weight: 700; }
@media (max-width: 700px) { .cmp-cols { grid-template-columns: 1fr; } }
.cmp-mats tbody td, .cmp-mats tfoot td, .cmp-mats thead th { height: 30px; padding-top: 3px; padding-bottom: 3px; font-size: var(--fs-sm); }

/* Owner 10/11/2026: overview pop-up made easier to read: coloured tiles, cards, materials as a 2-column grid with share bars */
.cmp-modal .mbody { padding: 18px 22px; background: var(--surface-2); }
.cmp-tiles { gap: 12px; }
.cmp-t { background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line); border-top: 5px solid var(--ink-3); border-radius: 10px; padding: 12px 16px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.cmp-t.parcels { border-top-color: #7C3AED; } .cmp-t.net { border-top-color: var(--yellow); } .cmp-t.gross { border-top-color: var(--ink); }
.cmp-t.inside.green { border-top-color: var(--ok); } .cmp-t.inside.orange { border-top-color: #E07A00; } .cmp-t.inside.red { border-top-color: var(--bad); }
.cmp-t.inside.orange .cmp-v { color: #C25E00; } .cmp-t.inside.red .cmp-v { color: var(--bad); }
.cmp-v { font-size: 30px; }
.cmp-ids { margin-top: 12px; gap: 12px; }
.cmp-ids > div { border-radius: 10px; padding: 12px 18px; }
.cmp-ids b { font-size: 24px; }
.cmp-cols { gap: 12px; margin-top: 12px; }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.cmp-cols h3, .cmp-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 700; margin: 0 0 10px; }
.cmp-h { margin: 16px 0 10px; }
.cmp-h-sum { margin-left: auto; font-weight: 500; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.cmp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.cmp-dot.buyer { background: #2563EB; } .cmp-dot.ship { background: var(--yellow); } .cmp-dot.mats { background: #7C3AED; }
.cmp-dl { gap: 6px 16px; }
.cmp-dl dt { font-size: var(--fs-sm); }
.cmp-dl dd { font-size: var(--fs); }
.cmp-matgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.cmp-mat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cmp-mat-top { display: flex; align-items: baseline; gap: 10px; }
.cmp-mat-n { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-mat-n small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.cmp-mat-kg { font: 700 18px Bahnschrift, var(--font-head); white-space: nowrap; }
.cmp-mat-bar { height: 6px; border-radius: 3px; background: var(--muted-bg); margin: 8px 0 5px; overflow: hidden; }
.cmp-mat-bar i { display: block; height: 100%; background: #7C3AED; border-radius: 3px; }
.cmp-mat-sub { font-size: var(--fs-xs); color: var(--ink-3); }
@media (max-width: 700px) { .cmp-matgrid { grid-template-columns: 1fr; } }

/* Owner 10/11/2026: What's inside = one card per parcel, drawn as an IBC pod with its number */
.cmp-pods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cmp-pod { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 8px; display: flex; flex-direction: column; min-width: 0; }
.cmp-pod .ibc { width: 100%; max-width: 120px; height: auto; align-self: center; }
.ibc-tank { fill: #F3F4F1; stroke: none; } .ibc-cap { fill: #9AA0A6; }
.ibc-cage { stroke: #9AA0A6; stroke-width: 2.5; fill: none; } .ibc-frame { fill: none; stroke: #5F6368; stroke-width: 3; }
.ibc-pallet { fill: #8B5E34; } .ibc-badge { fill: #157F3B; } .ibc-no { fill: #fff; font: 700 22px Bahnschrift, 'Segoe UI', sans-serif; }
.cmp-pod-box { height: 70px; border: 3px dashed var(--line-strong); border-radius: 8px; display: grid; place-items: center; background: var(--warn-bg); }
.cmp-pod-box span { font: 700 22px Bahnschrift, var(--font-head); color: var(--warn); }
.cmp-pod-tag { margin-top: 6px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ok); }
.cmp-pod:not(.pod) .cmp-pod-tag { color: var(--warn); }
.cmp-pod-m { font-weight: 600; font-size: var(--fs-sm); line-height: 1.25; margin: 2px 0 6px; min-height: 2.5em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cmp-pod-m small { display: block; font-weight: 500; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.cmp-pod-w { display: flex; justify-content: space-between; font-size: var(--fs-sm); border-top: 1px solid var(--line); padding-top: 4px; margin-top: auto; }
.cmp-pod-w + .cmp-pod-w { margin-top: 0; }
.cmp-pod-w span { color: var(--ink-3); } .cmp-pod-w.net b { color: var(--ok); }
@media (max-width: 900px) { .cmp-pods { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cmp-pods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Audit 10/11/2026: readable buttons in the dark themes (Clean / Wrap) — white text on the light green/red/yellow was ~2:1 */
:root[data-theme="clean"] #rp, :root[data-theme="clean"] #adj, :root[data-theme="wrap"] #rp, :root[data-theme="wrap"] #adj { color: var(--on-yellow); }
:root[data-theme="clean"] button.btn-yes, :root[data-theme="clean"] button.btn-no, :root[data-theme="wrap"] button.btn-yes, :root[data-theme="wrap"] button.btn-no,
:root[data-theme="clean"] .dn-i.ok, :root[data-theme="wrap"] .dn-i.ok { color: #111214; }
/* Tabs layout: the app tabs sit under the 64 px top bar instead of sliding beneath it */
body[data-nav="tabs"] .appnav { top: 64px; }

/* Owner 12/11/2026: invoice payment due dates on the calendar */
.cal-e.due { background: var(--bad-bg, #fde8e8); border-color: var(--bad, #c0392b); }
.cal-e.due.paid { opacity: .55; }

/* Owner 12/11/2026: date picker (datePopField) */
.dp-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; height: var(--h-control); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; }
.dp-caret { color: var(--ink-3); }
.dp-note { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; }
.dp-pop { position: absolute; z-index: 60; margin-top: 4px; width: 330px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.field { position: relative; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dp-chip { height: auto; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
.dp-chip.on, .dp-chip:hover { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head button { display: inline-flex; align-items: center; justify-content: center; height: 32px; width: 36px; padding: 0; font-size: 20px; line-height: 1; border-radius: 6px; background: transparent; border: 1px solid var(--line); color: var(--ink); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-h { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; padding: 2px 0; }
.dp-d { height: 36px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 6px; font-weight: 500; }
.dp-d.wkend { color: var(--ink-3); }
.dp-d:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.dp-d.today { border-color: var(--ink-3); }
.dp-d.base { box-shadow: inset 0 -3px 0 var(--info); }
.dp-d.on { background: var(--yellow); color: var(--on-yellow); font-weight: 800; border-color: var(--yellow); }
.dp-d:disabled { opacity: .3; cursor: not-allowed; }
.dp-foot { display: flex; gap: 12px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 8px; }
.dp-foot .sm { margin-left: auto; }
.dp-key { display: inline-block; width: 12px; height: 10px; vertical-align: middle; border-radius: 2px; }
.dp-key.base { box-shadow: inset 0 -3px 0 var(--info); background: var(--surface-2); }
.dp-key.today { border: 1px solid var(--ink-3); }

/* Owner 12/11/2026: Calendar app: more kinds, and the key hides / shows a kind */
.cal-e.rcti { background: var(--orange-soft, #fdebd9); border-color: var(--orange, #e07b24); }
.cal-e.job { background: var(--muted-bg, #eee); border-color: var(--ink-2); }
.cal-e.fleet { background: var(--surface-2); border-color: var(--ink-3); }
.cal-e.paid { opacity: .55; }
.cal-legend button.cal-e { cursor: pointer; height: auto; }
.cal-legend .cal-e.off { opacity: .35; text-decoration: line-through; }

/* Owner 12/11/2026: entries typed into the calendar */
.cal-e.note { background: #fff6cc; border-color: var(--yellow); }
.cal-d.addable { cursor: copy; }
.cal-d.addable:hover { background: var(--surface-2); }

/* Owner 12/11/2026: sign-in screen and Settings › Users & permissions */
.signin { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
body.locked > header, body.locked > nav, body.locked > main, body.locked > footer { visibility: hidden; }
.signin-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.signin-box h1 { margin: 8px 0 0; } .signin-box p { margin: 0 0 12px; }
.signin-box label { font-weight: 600; margin-top: 6px; } .signin-box button { margin-top: 12px; height: 44px; }
.signin-logo { align-self: flex-start; background: #111; color: var(--yellow); font-weight: 900; font-size: 22px; letter-spacing: .08em; padding: 6px 12px; border-radius: 6px; }
.signin-err { color: var(--bad); min-height: 1.2em; margin: 4px 0 0 !important; font-size: var(--fs-sm); }
.up-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; background: var(--surface); }
.up-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.up-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.up-grid fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 0; }
.up-grid legend { font-weight: 700; font-size: var(--fs-sm); padding: 0 4px; }
.up-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); padding: 3px 0; }
.up-grid input[type=checkbox] { width: auto; margin-top: 2px; }

/* Owner 12/11/2026: To-do */
.td-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.td-add #tqT { flex: 1 1 280px; height: 42px; font-size: 15px; }
.td-add select { width: auto; } .td-due { width: 210px; position: relative; } .td-urg { display: flex; gap: 6px; align-items: center; }
.td-row { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.td-row.urgent { border-left: 4px solid var(--bad); }
.td-tick { width: 22px !important; height: 22px; flex: none; cursor: pointer; }
.td-main { flex: 1; text-align: left; background: none; border: 0; height: auto; padding: 0; color: var(--ink); cursor: pointer; white-space: normal; }
.td-main:hover b { text-decoration: underline; }
.td-meta { font-size: var(--fs-sm); text-align: right; }
.td-row.done .td-main b { text-decoration: line-through; color: var(--ink-3); }
.td-done summary { cursor: pointer; margin-top: 12px; color: var(--ink-3); font-weight: 600; }
.cal-e.todo { background: var(--ok-bg); border-color: var(--green, var(--ok)); }
@media (max-width: 640px) { .td-row { flex-wrap: wrap; } .td-meta { width: 100%; text-align: left; padding-left: 32px; } }
#meBtn[hidden], #userSel[hidden] { display: none !important; }
