/* Bean & Bench stock and orders (pilot-08). Mobile first; tokens on :root, dark below. */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --ink: #16202a; --muted: #4e5a65;
  --brand: #2f4b8a; --brand-ink: #ffffff; --accent: #8a4b0a; --accent-soft: #fbeedd;
  --line: #d8d4ca; --ok: #1d6b3a; --err: #a4231b; --focus: #8a4b0a;
  --critical: #a4231b; --high: #b5520b; --medium: #7a6408; --low: #4e5a65;
  --radius: 14px; --gutter: 16px; --field: #807a70; /* field and chip edges: at least 3:1 on the page and on panels */ color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161d; --surface: #18222c; --ink: #eef2f5; --muted: #a8b5c0;
    --brand: #8fb0ff; --brand-ink: #0d1626; --accent: #f0b35a; --accent-soft: #3a2a14;
    --line: #2d3b47; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a;
    --critical: #ff8a80; --high: #ffb169; --medium: #e6cf6a; --low: #a8b5c0; --field: #8a94a0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10161d; --surface: #18222c; --ink: #eef2f5; --muted: #a8b5c0;
  --brand: #8fb0ff; --brand-ink: #0d1626; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2d3b47; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a;
  --critical: #ff8a80; --high: #ffb169; --medium: #e6cf6a; --low: #a8b5c0; --field: #8a94a0; color-scheme: dark;
}
* { box-sizing: border-box; }
p, ul, ol, dl { margin: 0 0 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }
.demo-bar { margin: 0; padding: 8px var(--gutter); background: var(--accent-soft); font-size: 16px; text-align: center; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px var(--gutter); max-width: 960px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; min-height: 44px; min-width: 44px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo-bg { fill: var(--brand); } .logo-mark { stroke: var(--brand-ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tools { display: flex; gap: 8px; }
.chip { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
main { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 24px 0; }
h1 { font-size: clamp(30px, 7vw, 46px); line-height: 1.12; margin: 8px 0 16px; }
h2 { font-size: clamp(22px, 5vw, 30px); margin: 0 0 12px; }
h3 { margin: 0 0 8px; font-size: 18px; }
.kicker { color: var(--accent); font-weight: 700; margin: 0; }
.lead { font-size: 19px; color: var(--muted); max-width: 40em; }
.price { font-size: 22px; font-weight: 800; margin: 12px 0; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.facts li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.grid { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card p { margin: 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gutter); margin: 12px 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, textarea, select { width: 100%; min-height: 48px; padding: 12px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
input[disabled] { opacity: .55; }
textarea { min-height: 120px; }
/* one height for every single-line field, so neighbours share a centre line; a button never touches the field above it */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 48px; padding-top: 8px; padding-bottom: 8px; }
input[type="checkbox"], input[type="radio"] { margin: 0; padding: 0; }
select + .btn, input + .btn, textarea + .btn { margin-top: 12px; }
input[type=file] { padding: 12px; }
.hint { color: var(--muted); font-size: 16px; margin: 8px 0 0; max-width: 68ch; }
label.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; margin-top: 16px; }
label.check input { width: 24px; min-height: 24px; height: 24px; flex: none; margin: 2px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.msg { min-height: 1.5em; font-weight: 600; margin: 12px 0 0; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 2px; font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { padding-left: 32px; position: relative; color: var(--muted); }
.steps li::before { content: "○"; position: absolute; left: 6px; }
.steps li.done { color: var(--ink); } .steps li.done::before { content: "●"; color: var(--ok); }
.clock { font-size: 20px; font-weight: 700; margin: 4px 0; }
.clock.late { color: var(--err); } .clock.paused { color: var(--accent); }
.sev { display: inline-block; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; border: 2px solid; }
.sev-critical { color: var(--critical); } .sev-high { color: var(--high); } .sev-medium { color: var(--medium); } .sev-low { color: var(--low); }
.finding { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; background: var(--surface); }
.finding.critical { border-left-color: var(--critical); } .finding.high { border-left-color: var(--high); }
.finding.medium { border-left-color: var(--medium); } .finding.low { border-left-color: var(--low); }
.finding h3 { font-size: 17px; margin: 8px 0; }
.finding p { margin: 4px 0; } .finding .k { font-weight: 700; }
.finding.dropped { opacity: .55; }
ol.first { padding-left: 24px; } ol.first li { margin: 4px 0; font-weight: 600; }
.summary p { margin: 4px 0; }
.choice { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.choice label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; min-height: 44px; }
.choice input { width: 22px; min-height: 22px; height: 22px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
pre.file { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
.hidden { display: none !important; }
.foot { max-width: 960px; margin: 0 auto; padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 16px; }
.foot p { margin: 0 0 4px; } .sig { font-style: italic; }
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
  .panel { padding: 28px; }
  .two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
}
/* Pilot 04: quotes */
.stats { margin: 8px 0 16px; grid-template-columns: 1fr 1fr; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 15px; margin: 0; }
.kpi-val { font-size: 24px; font-weight: 800; margin: 2px 0 0; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
table.totals { max-width: 420px; margin: 12px 0 0 auto; }
table.totals th { font-weight: 500; } table.totals td { text-align: right; font-variant-numeric: tabular-nums; }
table.totals tr.grand th, table.totals tr.grand td { font-weight: 800; font-size: 19px; border-top: 2px solid var(--ink); }
table.list td { font-variant-numeric: tabular-nums; }
.qline { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; background: var(--bg); }
.qline label { margin: 8px 0 0; font-size: 14px; } .qline label:first-child { grid-column: 1 / -1; }
.qline .qtot { margin: 8px 0 0; font-weight: 700; align-self: center; font-variant-numeric: tabular-nums; }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.linkbtn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 15px; padding: 8px 12px; min-height: 44px; cursor: pointer; text-align: left; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .qline { grid-template-columns: 3fr 1.3fr 0.8fr 0.9fr 1fr 1fr auto; align-items: end; }
  .qline label:first-child { grid-column: auto; }
}
@media print { .demo-bar, .top, #answer, .foot { display: none; } }
#q-lines td:nth-child(n+2), #q-lines th:nth-child(n+2) { white-space: nowrap; text-align: right; }
/* pilot-08: stock, orders, POs */
.tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; background: var(--bg); }
.tabs a { white-space: nowrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.late-t { color: var(--err); font-weight: 700; } .ok-t { color: var(--ok); }
td.num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
tr.low td:first-child { border-left: 4px solid var(--err); }
ul.plain { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 8px; overflow-wrap: anywhere; }
.req { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: 12px; padding: 12px 16px; margin: 0 0 12px; }
.req h3 { margin: 0 0 4px; font-size: 18px; } .req.st-fulfilled { border-left-color: var(--ok); } .req.st-cancelled { border-left-color: var(--line); opacity: .8; }
.po { margin: 0 0 12px; } .po h3 { margin: 0 0 4px; }
.oline { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.oline input { width: 5em; min-height: 44px; } .oline label { margin: 0; display: flex; gap: 8px; align-items: center; }
@media (max-width: 480px) { #pl th:nth-child(5), #pl td:nth-child(5) { display: none; } }

/* ---- Back office (shared by the three rebuilt pilots) ---- */
[hidden] { display: none !important; }
/* back-office menu: always one line; it scrolls sideways when the screen is narrower than the menu */
.admin-nav { max-width: 1040px; margin: 0 auto 8px; padding: 4px var(--gutter); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.admin-nav a { flex: none; white-space: nowrap; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.admin-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tools .chip { padding: 0 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 14px; color: var(--muted); }
td.detail { overflow-wrap: anywhere; max-width: 40ch; font-size: 14px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-bottom: 12px; }
.filters label { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.check input { width: 24px; height: 24px; min-height: 0; margin: 0; }
.check label { margin: 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.pager { justify-content: space-between; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn.danger { border-color: var(--err); color: var(--err); }
.panel.danger { border-color: var(--err); }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.notice { background: var(--accent-soft); color: var(--ink); padding: 12px 12px; border-radius: 10px; border-left: 4px solid var(--accent); margin: 12px 0; }
.msg.ok:not(:empty)::before { content: "✓ "; }
.msg.err:not(:empty)::before { content: "! "; }
.facts-list { display: grid; gap: 12px; margin: 12px 0; }
.facts-list div { display: grid; gap: 2px; }
.facts-list dt { font-weight: 700; }
.facts-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.neg { color: var(--err); font-weight: 700; }
.pos { color: var(--ok); font-weight: 700; }
.two { display: grid; gap: 0 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
.plain { list-style: none; padding: 0; margin: 0; }
.links li { margin: 8px 0; }
.links a { display: inline-block; min-height: 44px; line-height: 44px; }
fieldset.cat-edit { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px 12px; margin: 12px 0; }
fieldset.cat-edit legend { font-size: 16px; padding: 0 4px; }
h1, h2, h3, td, th, dd, p, li { overflow-wrap: anywhere; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }

/* pilot-08 v2: dashboard, customer catalogue, count sheet */
.stats3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .stats3 { grid-template-columns: repeat(3, 1fr); } }
.catalogue { gap: 12px; }
.item { display: grid; grid-template-columns: 1fr 6.5em; gap: 12px; align-items: end; }
.item h3 { margin: 0 0 4px; }
.item .qty label { margin: 0 0 4px; font-size: 15px; }
.av { margin-top: 8px !important; }
.av-out { color: var(--err) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.privacy { margin: 16px 0 0; color: var(--ink); }
.privacy summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.privacy p { color: var(--muted); }
.count-in { width: 6.5em; min-height: 44px; }
.count-table td { vertical-align: middle; }
tr.flag td { background: var(--accent-soft); }
.flag-text { font-weight: 700; font-size: 14px; }
.h3, .req h2 { font-size: 18px; margin: 0 0 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.code { overflow-wrap: anywhere; }
@media (max-width: 380px) { .item { grid-template-columns: 1fr; } }

/* 320 px: nothing may push the page wider than the screen. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input, select, textarea { min-width: 0; max-width: 100%; }
.range > *, .filters > *, .two > *, .hours > * { min-width: 0; }
.top { flex-wrap: wrap; gap: 8px; }
.tools { flex-wrap: wrap; }
.chip { white-space: nowrap; }
.btn { white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Count sheet on a phone: one product per block, labels shown next to each value. */
@media (max-width: 559px) {
  table.count-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.count-table, table.count-table tbody { display: block; }
  table.count-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.count-table td { display: block; border: 0; padding: 0; }
  table.count-table td:first-child, table.count-table td:last-child { grid-column: 1 / -1; }
  table.count-table td:first-child { font-weight: 600; }
  table.count-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 14px; }
}
/* ---- round 2 (12.11.2026): no jumps, phone header ---- */
/* everything under the page heading is held in place, invisible, until the first data is drawn (public/js/ui.js) */
html.adm-loading main > :not(h1) { visibility: hidden; }
html.adm-loading .foot { visibility: hidden; }
label.check { min-height: 44px; align-items: center; }
/* running text stops at a readable line length; a fold's summary is a 44 px target; code-like text is never under 14 px */
main p { max-width: 68ch; }
summary { padding: 12px 0; cursor: pointer; }
.mono { font-size: 1em; }
/* pager on a phone: the count on its own line, Previous and Next side by side under it */
@media (max-width: 480px) { .pager { display: grid; grid-template-columns: 1fr 1fr; } .pager > :not(button):not(a) { grid-column: 1 / -1; grid-row: 1; text-align: center; } }
/* shop: while the catalogue is loading (the loading line is showing, without an error) the sections below it and the footer wait in place */
main:has(#load-msg:not([hidden]):not(.err)) > section, main:has(#load-msg:not([hidden]):not(.err)) ~ .foot { visibility: hidden; }
/* a tick box with its words is one 44 px target */
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { display: flex; align-items: center; gap: 8px; min-height: 44px; }
/* a tick box's words are part of its 44 px target; fields side by side align on the field, not on a wrapped label */
.check label { display: flex; align-items: center; min-height: 44px; flex: 1; }
.two { align-items: end; }
/* a form's button never sits flush under the row of fields above it */
form > .btn:not(:first-child), form > p > .btn:only-child { margin-top: 12px; }
/* back office: header, menu, page and footer share one width, so the menu starts on the same left edge as the logo and the page (the menu was 80 px wider than the rest) */
body:has(> .admin-nav) > .top, body:has(> .admin-nav) > main, body:has(> .admin-nav) > .foot { max-width: 1040px; }
