/*
 * Plotercafé Voorraad — the one stylesheet.
 *
 * Tokens and components follow docs/design/STIJLGIDS.md; where docs/design/mockup-afwijkingen.md
 * differs, that file wins (--green is #2A7C4E, fonts are self-hosted).
 * No Bootstrap, no framework, no icon font (CLAUDE.md).
 */

/* ── Fonts (self-hosted IBM Plex, SIL OFL — see fonts/LICENSE.txt) ──────────────────────────── */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Bold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2'); }

/* ── Tokens (STIJLGIDS §2, §4) ──────────────────────────────────────────────────────────────── */
:root {
    --navy: #14213D;
    --bg: #EEF1F5;
    --surface: #FFFFFF;
    --border: #D5DBE5;
    --ink: #14213D;
    --ink-2: #3A4966;
    --ink-3: #5B6B85;
    --ink-4: #8A97AD;
    --ink-on-navy: #AEB8CC;
    --amber: #E9A23B;
    --green: #2A7C4E; /* mockup-afwijkingen §5: 5.13:1 for white text */
    --slate: #5B6B85;
    --r: 6px;
    --r-card: 8px;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ── Base ───────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.4; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--ink); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; }
.eyebrow { font: 500 14px var(--mono); letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.help { font-size: 19px; color: var(--ink-2); line-height: 1.45; }
.link { font-size: 16px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons (STIJLGIDS §4, §5.5) */
.btn { height: 72px; border-radius: var(--r); font-size: 24px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 28px; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-confirm { height: 76px; background: var(--green); color: #fff; }
.btn-secondary { height: 56px; border: 2px solid var(--navy); font-size: 17px; padding: 0 20px; gap: 8px; background: var(--surface); }
.btn-next { background: var(--amber); color: var(--navy); font-weight: 700; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Blazor's own error bar and validation */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--surface); border-top: 4px solid var(--slate); padding: 12px 20px; font-size: 17px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.validation-message { color: var(--ink-2); font-size: 15px; }
.invalid { border-color: var(--slate) !important; }

/* ── Sign-in (BareLayout) ───────────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px 40px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 32px; }
.auth-card .field input { height: 56px; font-size: 20px; }
.notice { border: 2px solid var(--slate); border-radius: var(--r); padding: 12px 16px; font-size: 17px; color: var(--ink-2); background: var(--surface); }
.notice.ok { border-color: var(--green); }

/* PIN pad: large enough for a touch screen (STIJLGIDS §4: at least 56 px, 10 px apart) */
.pin { max-width: 420px; }
.pin-display { display: flex; gap: 10px; justify-content: center; }
.pin-display span { width: 48px; height: 60px; border: 2px solid var(--border); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; }
.pin-display span.filled { border-color: var(--navy); }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { height: 76px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--border); font-size: 34px; font-weight: 700; }
.pin-pad button.small { font-size: 20px; font-weight: 600; color: var(--ink-2); }
.pin-pad button:active { background: var(--amber); border-color: var(--navy); }

/* ── Forms (management) ─────────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=search], .field input:not([type]), .field select, .field textarea {
    font: inherit; font-size: 17px; height: 44px; padding: 0 12px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.field .hint { font-size: 14px; color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

/* ── Management shell (ManageLayout) ────────────────────────────────────────────────────────── */
.manage { min-height: 100vh; display: flex; flex-direction: column; }
.manage-bar { background: var(--navy); color: #fff; padding: 0 24px; display: flex; align-items: center; gap: 6px; min-height: 56px; flex-wrap: wrap; }
.manage-bar .brand { font: 500 13px var(--mono); letter-spacing: .08em; color: var(--ink-on-navy); margin-right: 14px; text-transform: uppercase; }
.manage-bar a, .manage-bar button { color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: var(--r); }
.manage-bar a.active { background: var(--amber); color: var(--navy); }
.manage-bar .spacer { flex: 1; }
.manage-bar form { display: inline; }
.manage-bar .ghost { border: 2px solid rgba(255,255,255,.35); }
.manage-main { flex: 1; padding: 24px 28px 48px; max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.manage-main h1 { font-size: 30px; }
.manage-main h2 { font-size: 21px; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 180px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.b { height: 44px; padding: 0 16px; border-radius: var(--r); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 2px solid var(--navy); background: var(--surface); color: var(--navy); white-space: nowrap; }
.b.primary { background: var(--navy); color: #fff; }
.b.confirm { background: var(--green); border-color: var(--green); color: #fff; }
.b.quiet { border-color: var(--border); }
.b.small { height: 34px; padding: 0 10px; font-size: 14px; }
.b[disabled] { opacity: .45; cursor: default; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; font-size: 16px; }
.table th { text-align: left; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: #F7F9FB; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--ink-3); }
.table a { font-weight: 600; }
.tag { display: inline-block; font: 500 12px var(--mono); letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); color: var(--ink-2); background: var(--bg); white-space: nowrap; }
.tag.ok { border-color: var(--green); color: var(--green); background: var(--surface); }
.tag.off { border-style: dashed; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--border); border-radius: var(--r); padding: 6px 10px; background: var(--surface); font-size: 15px; cursor: pointer; }
.chip.on { border-color: var(--navy); background: #F2F4F8; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days button { min-width: 52px; height: 44px; border: 2px solid var(--border); border-radius: var(--r); font-weight: 600; background: var(--surface); }
.days button.on { background: var(--amber); border-color: var(--navy); }
.zone-head { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

/* ── Barcodes koppelen ──────────────────────────────────────────────────────────────────────── */
.link-card { border: 2px solid var(--navy); padding: 24px 28px; gap: 12px; }
.scan-hint { display: flex; align-items: center; gap: 18px; font-size: 22px; font-weight: 600; padding: 14px 0; }
.scanbox-small { width: 120px; height: 60px; border: 3px solid var(--navy); border-radius: var(--r-card); position: relative; flex: none; background: var(--surface); }
.scanbox-small::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--amber); }

/* ══ Counting flow (docs/design/telflow.html, reference 1024 × 700) ═══════════════════════════ */
.tablet { height: 100vh; height: 100dvh; min-height: 560px; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; }

/* Mission bar (STIJLGIDS §5.1) */
.topbar { background: var(--navy); color: #fff; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex: none; }
.topbar .zone { font: 500 14px var(--mono); letter-spacing: .04em; color: var(--ink-on-navy); flex: none; text-transform: uppercase; }
.topbar .left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.missions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; flex: 1; max-width: 760px; min-width: 0; }
.mission { height: 40px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; padding: 0 8px; min-width: 0; }
.mission span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission svg { flex: none; }
.mission.done { background: var(--green); color: #fff; }
.mission.now { background: var(--amber); color: var(--navy); font-weight: 700; }
.mission.todo { border: 2px dashed rgba(255,255,255,.35); color: var(--ink-on-navy); }
.btn-ghost-light { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 2px solid rgba(255,255,255,.35); border-radius: var(--r); font-size: 16px; color: #fff; flex: none; text-decoration: none; }
.pause-icon { display: flex; gap: 4px; }
.pause-icon span { width: 5px; height: 18px; background: currentColor; border-radius: 1px; }

.tbody { flex: 1; display: flex; min-height: 0; }
.tmain { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Step rail (STIJLGIDS §5.2) */
.rail { width: 200px; padding: 28px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--border); flex: none; }
.step { display: flex; gap: 12px; }
.step .col { display: flex; flex-direction: column; align-items: center; }
.step .dot { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; }
.step .line { width: 3px; height: 56px; background: var(--border); }
.step .txt { padding-top: 8px; }
.step .name { font-size: 20px; font-weight: 700; }
.step .sub { font-size: 14px; color: var(--ink-3); }
.step.todo .dot { border: 3px solid var(--border); color: var(--ink-4); }
.step.todo .name { color: var(--ink-4); }
.step.now .dot { background: var(--amber); color: var(--navy); }
.step.done .dot { background: var(--green); color: #fff; }
.step.done .line { background: var(--green); }
.step.done .sub { color: var(--green); }
.step.skipped .dot { border: 3px solid var(--ink-4); color: var(--ink-3); }
.step.skipped .dot i { width: 16px; height: 3px; background: currentColor; border-radius: 2px; }
.step.skipped .name { color: var(--ink-3); }
.rail .thumb { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.rail .thumb .tname { font-size: 15px; font-weight: 600; }

/* Product strip (STIJLGIDS §5.3) */
.strip { background: var(--surface); border-top: 1px solid var(--border); padding: 12px 28px; display: flex; gap: 8px; align-items: center; flex: none; overflow-x: auto; }
.strip .lbl { font: 500 12px var(--mono); color: var(--ink-3); width: 92px; line-height: 1.3; flex: none; }
.strip .lbl small { display: block; color: var(--ink-4); font: inherit; }
.tile { width: 100px; height: 72px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 18px; position: relative; flex: none; }
.tile.todo { border: 2px solid var(--border); background: var(--surface); overflow: hidden; }
.tile.done { background: var(--green); color: #fff; }
.tile.current { outline: 3px solid var(--amber); outline-offset: 2px; }
.tile.locking { animation: lock .5s ease-out; }
@keyframes lock { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Package visual: a photo, or (for most packages, which have none) name and content, readable
   on its own (mockup-afwijkingen §3). Never an empty frame or a generic icon. */
.visual { width: 100%; height: 100%; border-radius: var(--r); overflow: hidden; background: #F4F6F9; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px; gap: 4px; color: var(--ink); }
.visual img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.visual.has-photo { padding: 0; }
.visual .vname { font-weight: 700; line-height: 1.1; overflow-wrap: break-word; hyphens: auto; max-width: 100%; }
.visual .vsub { color: var(--ink-2); line-height: 1.15; }
.visual.hero .vname { font-size: 40px; } .visual.hero .vsub { font-size: 26px; }
.visual.msg .vname { font-size: 24px; } .visual.msg .vsub { font-size: 18px; }
.visual.rail .vname { font-size: 18px; } .visual.rail .vsub { font-size: 15px; }
.visual.card .vname { font-size: 24px; } .visual.card .vsub { font-size: 18px; }
.visual.small .vname { font-size: 17px; } .visual.small .vsub { font-size: 15px; }
.visual.tile { padding: 4px 5px; gap: 1px; background: transparent; }
.visual.tile .vname { font-size: 13px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.visual.tile .vsub { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.visual.dim { filter: grayscale(.6); opacity: .85; }

/* Text roles */
.h-screen { font-size: 42px; font-weight: 700; line-height: 1.05; }
.h-question { font-size: 38px; font-weight: 700; line-height: 1.1; }
.h-product { font-size: 44px; font-weight: 700; line-height: 1.05; }
.h-card { font-size: 32px; font-weight: 700; line-height: 1.15; }
.mark { background: var(--amber); padding: 0 10px; border-radius: 4px; }

/* Number tiles (STIJLGIDS §5.4) */
.pad { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(84px, 1fr); gap: 10px; flex: 1; min-height: 0; }
.pad.levels { grid-template-columns: repeat(4, 1fr); }
.key { border-radius: var(--r); background: var(--surface); border: 2px solid var(--border); font-size: 38px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-direction: column; line-height: 1; }
.key.more { font-size: 24px; color: var(--ink-2); }
.key.word { font-size: 30px; }
.key.chosen { background: var(--amber); border-color: var(--navy); }
.key.chosen small { font-size: 13px; font-weight: 600; margin-top: 4px; }
.key.preset { border-color: var(--navy); border-width: 3px; }
.more-pad { display: flex; gap: 16px; flex: 1; min-height: 0; }
.more-display { width: 220px; border-radius: var(--r); background: var(--surface); border: 3px solid var(--navy); font-size: 96px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Rule strip: what is a full package */
.rule { display: flex; gap: 12px; }
.rule > div { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); padding: 10px 14px; }
.rule .yes { border-color: var(--green); }
.rule .t { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.rule .yes .t { color: var(--green); }
.rule .no .t { color: var(--ink-3); }
.rule .s { font-size: 17px; color: var(--ink-2); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.card.msg { width: 680px; max-width: 100%; border: 2px solid var(--slate); padding: 28px 32px; display: flex; gap: 26px; align-items: center; text-align: left; }
.card.msg.ok { border-color: var(--green); }
.card.done { width: 600px; max-width: 100%; border: 0; background: var(--green); color: #fff; padding: 26px 30px; display: flex; align-items: center; gap: 22px; text-align: left; }
.frame { border-radius: var(--r); overflow: hidden; flex: none; position: relative; }
.unknown-box { width: 180px; height: 180px; flex: none; border-radius: var(--r); border: 3px dashed var(--ink-4); display: flex; align-items: center; justify-content: center; font-size: 80px; font-weight: 700; color: var(--ink-4); }

.scanbox { width: 340px; height: 170px; border: 3px solid var(--navy); border-radius: var(--r-card); position: relative; display: flex; align-items: center; justify-content: center; background: var(--surface); }
.scanbox::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--amber); }
.toast { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--green); border-radius: var(--r); padding: 10px 18px; font-size: 18px; white-space: nowrap; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 24px; position: relative; min-height: 0; }
.fade { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade, .tile.locking { animation: none; } }

.overlay { position: absolute; inset: 0; background: rgba(20,33,61,.94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; z-index: 50; padding: 24px; }
.overlay .link { color: var(--ink-on-navy); }

/* Shelf done: the bar grows into the whole screen */
.shelfdone { flex: 1; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 32px 44px; gap: 22px; overflow: auto; }
.shelfdone .tiles { display: grid; grid-template-columns: repeat(4, 110px); gap: 10px; align-content: center; }
.shelfdone .tiles div { height: 100px; border-radius: var(--r); background: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; padding: 4px; text-align: center; gap: 2px; }
.shelfdone .tiles div small { font-size: 12px; font-weight: 500; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.shelfdone .tiles div.missing { background: transparent; border: 2px dashed rgba(255,255,255,.35); color: var(--ink-on-navy); }

/* Vandaag tellen */
.today { flex: 1; overflow: auto; padding: 28px 36px; display: flex; flex-direction: column; gap: 18px; }
.today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.today-tile { min-height: 132px; border-radius: var(--r-card); background: var(--surface); border: 2px solid var(--border); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; text-align: left; text-decoration: none; color: var(--ink); }
.today-tile .tname { font-size: 24px; font-weight: 700; line-height: 1.15; }
.today-tile .tstate { font-size: 17px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.today-tile.resume { border: 3px solid var(--amber); }
.today-tile.resume .tstate { color: var(--navy); font-weight: 600; }
.today-tile.done { background: var(--green); border-color: var(--green); color: #fff; }
.today-tile.done .tstate { color: #fff; }
h1:focus { outline: none; }
