/* ============================================================
   AgroWorld Scan — web interface · LICHT ("MyDockly-strak") rebuild
   Volledige UI-herbouw op verzoek (20-07): licht, professioneel
   SaaS-uiterlijk zoals het MyDockly-portaal, met de zwart/rode
   Agro World-merkidentiteit in header, sidebar en primaire acties.
   Single source of truth = de tokens hieronder; componenten mappen
   op tokens — losse hexes alleen voor bewuste one-offs (on-colour
   wit, de zwarte merkvlakken). --brand is merk + PRIMAIRE ACTIE;
   fouten/alerts gebruiken --error/--warn (nooit merkrood).
   Alle selector-contracten van app.js/camera.js/auth.js zijn 1:1
   behouden — dit bestand is de enige wijziging (backend ongemoeid).
   ============================================================ */
:root {
  /* ---- design tokens (canoniek) ---- */
  --bg: #F3F5F8;             /* app-achtergrond */
  --bg2: #FFFFFF;            /* invoervelden / verdiepte vlakken */
  --surface: #FFFFFF;        /* kaarten */
  --surface2: #EEF1F5;       /* chips, inzetvlakken */
  --line: #E3E8EF;           /* randen */
  --line-soft: #EDF1F6;
  --text-c: #101828;         /* primaire tekst */
  --dim: #475467;            /* secundaire tekst (AA op --bg) */
  --faint: #667085;          /* tertiaire tekst */
  --brand: #E30613;          /* MERK + PRIMAIRE ACTIE — nergens anders */
  --brand-press: #B70510;
  --brand-ink: #0B0B0D;      /* merk-zwart (header, sidebar, FAB-contrast) */
  --frozen: #0284C7;         /* status: vries / koud */
  --chilled: #16A34A;        /* status: OK / binnen marge / vers */
  --warn: #B45309;           /* status: let op (donker genoeg op lichte tint) */
  --error: #DC2626;          /* scan-/validatiefout — niet merkrood */
  --scankey: #B45309;        /* TC22 hardware-trigger */
  --r: 14px;

  /* ---- legacy component-aliassen op de lichte tokens ----
     Behouden zodat bestaande componentregels meebewegen zonder rename.
     Nieuwe code gebruikt de canonieke namen hierboven. */
  --brand-black: var(--brand-ink);
  --brand-black-deep: #000000;
  --brand-red: var(--brand);
  --brand-red-deep: var(--brand-press);
  --brand-red-tint: rgba(227, 6, 19, .08);
  --brand-white: #FFFFFF;

  --gray-50: #F8FAFC;
  --gray-100: #EEF1F5;
  --gray-200: #E3E8EF;
  --gray-300: #D0D8E2;
  --gray-400: #98A2B3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-900: #101828;

  --success: var(--chilled);
  --info: #4F46E5;
  --warning: var(--warn);
  --danger: var(--error);

  /* Warehouse-heatmap: sequentiële vulschaal laag→vol. */
  --heat-low: #BBF7D0;
  --heat-mid: #FDE68A;
  --heat-high: #FCA5A5;
  --heat-full: var(--brand);

  /* Zachte statustinten (badges, ankers) — MyDockly-stijl. */
  --tint-ok: #ECFDF3;
  --tint-info: #EEF2FF;
  --tint-warn: #FFFAEB;
  --tint-danger: #FEF3F2;
  --tint-frozen: #F0F9FF;

  --page-bg: var(--bg);
  --card-bg: var(--surface);
  --border: var(--line);
  --text: var(--text-c);
  --text-2: var(--dim);
  --text-3: var(--faint);

  --nav-active: var(--brand);
  --nav-inactive: #7A8699;

  --radius: var(--r);
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 12px 28px rgba(16, 24, 40, .14);
  --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  background: #E7EBF1;
  background-image: radial-gradient(circle at 20% 0%, #F2D7D9 0%, #E7EBF1 55%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---- Device frame ---- */
.device {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 932px;
  background: var(--page-bg);
  position: relative;
  overflow: hidden;
  display: flex;
}

@media (min-width: 480px) {
  body { padding: 24px; }
  .device {
    height: calc(100vh - 48px);
    border-radius: 38px;
    box-shadow: 0 0 0 10px #14161B, 0 30px 70px rgba(16, 24, 40, .35);
    border: 1px solid #2A2E37;
  }
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ---- Brand header — merk-zwart met rode regel (truck-livery) ---- */
.brand-header {
  background: var(--brand-ink);
  flex: 0 0 auto;
}
.brand-header.dark { background: #000000; }
.brand-img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 12px auto 10px;
  padding: 0 20px;
  object-fit: contain;
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px 11px;
}
.brand-word {
  font-weight: 800;
  font-size: 21px;
  letter-spacing: .5px;
  color: #FFFFFF;
}
.brand-word-accent { color: var(--brand-red); }
.brand-arrow {
  width: 30px;
  height: 18px;
  fill: none;
  stroke: var(--brand-red);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-tagline {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #FFB4B9;
  padding: 0 20px 10px;
  margin-top: -6px;
}
.brand-tagline:empty { display: none; }
.brand-rule { height: 3px; background: var(--brand-red); }

/* ---- Screen scroll area ---- */
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 24px;
}
.screen::-webkit-scrollbar { width: 0; }

/* ---- Common building blocks ---- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--brand-red);
  margin: 0 0 2px;
  text-transform: uppercase;
}
.headline {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 0;
  color: var(--text);
}
.subhead { font-size: 13px; color: var(--text-2); margin: 2px 0 0; }

.row-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--brand-red);
  font-size: 20px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Depot toggle / segmented control — lichte rail, actieve witte pil. */
.segment {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}
.segment button {
  flex: 1;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.segment button.active {
  background: var(--card-bg);
  color: var(--brand-red);
  box-shadow: var(--shadow-sm);
}

/* Greeting */
.greet-eyebrow { font-size: 12px; color: var(--text-3); margin: 0; }
.greet-name { font-size: 24px; font-weight: 800; margin: 2px 0 0; letter-spacing: -.4px; }

/* Action tiles */
.actions { display: grid; gap: 12px; margin: 18px 0 8px; }
.action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font);
  color: var(--text);
  transition: transform .12s, box-shadow .12s;
}
.action:active { transform: scale(.985); }
.action.primary {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-deep) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(227, 6, 19, .28);
}
.action .a-ic {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
  background: var(--brand-red-tint);
  color: var(--brand-red);
}
.action.primary .a-ic { background: rgba(255,255,255,.18); color: #fff; }
.action .a-txt { flex: 1; min-width: 0; }
.action .a-title { display: block; font-weight: 700; font-size: 15px; }
.action .a-sub { display: block; font-size: 12px; opacity: .72; margin-top: 1px; }
.action .a-chev { font-size: 20px; opacity: .45; }
.action.primary .a-chev { opacity: .85; }

/* KPI stat grid */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 8px 0; }
.stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat .s-val { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat .s-lbl { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat .s-delta { font-size: 11px; font-weight: 700; margin-top: 6px; }
.s-delta.up { color: var(--success); }
.s-delta.down { color: var(--danger); }

/* Section heading inside screen */
.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}
.sec-title h3 { font-size: 15px; font-weight: 700; margin: 0; }
.sec-title a { font-size: 13px; color: var(--brand-red); font-weight: 600; cursor: pointer; }

/* List items */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.li-avatar {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface2);
  color: var(--text-c);
  font-weight: 800; font-size: 13px;
  flex: 0 0 auto;
}
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta { text-align: right; flex: 0 0 auto; }
.li-time { font-size: 12px; color: var(--text-3); }

/* Status badges — zachte tinten met leesbare statuskleur (MyDockly-stijl). */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
  margin-top: 4px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: #067647; background: var(--tint-ok); }
.badge.info { color: var(--info); background: var(--tint-info); }
.badge.warn { color: var(--warn); background: var(--tint-warn); }
.badge.danger { color: var(--error); background: var(--tint-danger); }
.badge.neutral { color: var(--dim); background: var(--surface2); }

/* Bottom-sheet overlays (taalkeuze, "over") — licht paneel, token-gedreven. */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 9999; animation: sheet-fade .16s ease; }
.sheet { background: var(--surface); width: 100%; max-width: 440px; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; overflow: hidden; box-shadow: var(--shadow-md); animation: sheet-up .2s ease; }
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .sheet-backdrop, .sheet { animation: none; } }
.sheet-title { padding: 16px 16px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--dim); text-transform: uppercase; }
.sheet-opt { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 16px; border: 0; background: transparent; font-family: var(--font); font-size: 16px; font-weight: 500; color: var(--text); cursor: pointer; }
.sheet-opt.active { background: var(--surface2); font-weight: 700; }
.sheet-opt .check { color: var(--brand); font-weight: 800; }
.sheet-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.sheet-row span { color: var(--dim); }
.sheet-row b { color: var(--text); font-weight: 700; }
.sheet-close { width: 100%; padding: 15px 16px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--brand); cursor: pointer; }
.sheet-safe { height: max(8px, env(safe-area-inset-bottom)); }

/* Search box */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--gray-400); stroke-width: 2; flex: 0 0 auto; }
.search input {
  border: 0; outline: 0; flex: 1; height: 46px;
  font-family: var(--font); font-size: 14px; background: transparent; color: var(--text);
}
.search input::placeholder { color: var(--faint); }

/* Filter chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  min-height: 44px; /* toegankelijk tap-doel (met handschoenen op de TC22) */
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  white-space: nowrap;
}
.chip.active { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }

/* ---- Scan screen ---- */
.scan-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 6px; }
.scan-toggle { width: 100%; max-width: 320px; }
.scan-frame {
  position: relative;
  width: 248px; height: 248px;
  border-radius: 24px;
  background:
    repeating-linear-gradient(45deg, #FFFFFF, #FFFFFF 10px, #F6F8FB 10px, #F6F8FB 20px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  margin-top: 4px;
}
.scan-corner { position: absolute; width: 36px; height: 36px; border: 4px solid var(--brand-red); }
.scan-corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.scan-corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.scan-corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scan-corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scan-frame.captured .scan-corner { border-color: var(--success); }
.scan-laser {
  position: absolute; left: 18px; right: 18px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
  border-radius: 3px;
  animation: laser 2.4s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(227, 6, 19, .45);
}
@keyframes laser { 0%,100% { top: 28px; } 50% { top: 216px; } }
.qr { width: 150px; height: 150px; image-rendering: pixelated; opacity: .92; }
.scan-hint { font-size: 13px; color: var(--text-2); text-align: center; max-width: 280px; }
.scan-btn {
  width: 100%; max-width: 320px;
  border: 0; border-radius: 14px; height: 54px;
  background: var(--brand-red); color: #fff;
  font-weight: 700; font-size: 15px; font-family: var(--font);
  cursor: pointer; box-shadow: 0 8px 20px rgba(227, 6, 19, .28);
}
.scan-btn.captured { background: var(--success); box-shadow: 0 8px 20px rgba(22, 163, 74, .28); }
.manual-field {
  display: flex; gap: 8px; width: 100%; max-width: 320px;
}
.manual-field input {
  flex: 1; height: 50px; border: 1px solid var(--gray-300); border-radius: 12px;
  padding: 0 14px; font-family: var(--font); font-size: 15px; outline: 0;
  background: var(--bg2); color: var(--text-c);
}
.manual-field input::placeholder { color: var(--faint); }
.manual-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(227, 6, 19, .12); }
.manual-field button {
  width: 50px; border: 0; border-radius: 12px; background: var(--brand);
  color: #fff; font-size: 22px; cursor: pointer;
}
/* Tekst-variant ("Opslaan") — breder dan de pijl-knop en met leesbare tekst. */
.manual-field button.btn-save-manual {
  width: auto; min-width: 96px; padding: 0 18px; height: 50px;
  font-size: 15px; font-weight: 700;
}

/* ---- Scan workflow ---- */
.sys-chip {
  align-self: center;
  font-size: 12px; font-weight: 700; color: var(--brand-red);
  background: var(--brand-red-tint); border-radius: 999px;
  padding: 5px 12px;
}
.sys-chip b { font-weight: 800; }
.sys-chip.queue { color: var(--warn); background: var(--tint-warn); margin-left: 8px; }
.wf-session {
  width: 100%; max-width: 340px;
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.wf-session b { font-size: 15px; }
.wf-session a { margin-left: auto; color: var(--brand-red); font-weight: 600; font-size: 13px; cursor: pointer; }
.wf-entry {
  width: 100%; max-width: 340px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.wf-entry-title { font-weight: 800; font-size: 16px; }
.wf-entry-sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.wf-entry .manual-field { max-width: none; }
.wf-step {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; color: var(--text);
}
.wf-step-n { color: var(--success); font-weight: 800; }

/* Storage In/Out: het vastgezette locatie-anker boven de labellijst. */
.loc-anchor {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--frozen); border-radius: 14px;
  background: linear-gradient(180deg, var(--tint-frozen), transparent 80%), var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.loc-anchor .la-ic { font-size: 20px; flex: 0 0 auto; }
.loc-anchor .la-body { flex: 1; min-width: 0; }
.loc-anchor .la-code { font-size: 18px; font-weight: 700; color: var(--text); }
.loc-anchor .la-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.loc-anchor .la-new {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-family: var(--font); font-weight: 700; font-size: 12.5px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.loc-anchor .la-new:hover { border-color: var(--frozen); }
.wf-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 340px; }
.wf-chip {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 11px;
}
.wf-chip.on { color: #067647; background: var(--tint-ok); border-color: rgba(22, 163, 74, .35); }
.wf-opt { font-size: 11px; font-weight: 600; color: var(--text-3); }

/* ---- Locaties depot card ---- */
.depot-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.depot-badge {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand-ink); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  flex: 0 0 auto;
}
.zone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.zone {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.zone .z-code { font-weight: 800; font-size: 16px; color: var(--brand-red); }
.zone .z-name { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.zone .z-count { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Warehouse map */
.map { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 4px; }
.map i {
  aspect-ratio: 1; border-radius: 4px; background: var(--gray-200);
}
.map i.f-low { background: var(--heat-low); }
.map i.f-mid { background: var(--heat-mid); }
.map i.f-high { background: var(--heat-high); }
.map i.f-full { background: var(--heat-full); }

/* Plattegrond: locatieregister per zone, vers- en vrieskant apart. */
.pg-section { margin-bottom: 18px; }
.pg-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.pg-sec-title { font-size: 15px; font-weight: 800; color: var(--text); }
.pg-sec-count { font-size: 12px; color: var(--text-3); }
.pg-sec-count b { color: var(--text); }
/* Zones onder elkaar (één kolom): leesbaar op de handheld-scanner. */
.pg-zones { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pg-zone {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.pg-zone.cold { border-color: color-mix(in srgb, var(--frozen) 40%, var(--border)); }
.pg-zone.open { grid-column: 1 / -1; }
.pg-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pg-code { font-size: 16px; font-weight: 800; color: var(--text); }
.pg-zone.cold .pg-code { color: var(--frozen); }
.pg-count { font-size: 11px; color: var(--text-3); }
.pg-count b { color: var(--text); }
.pg-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.pg-grid i { aspect-ratio: 1; border-radius: 2px; background: var(--gray-200); }
.pg-grid i.on { background: var(--chilled); }
.pg-grid i.on-cold { background: var(--frozen); }
.pg-rack { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.pg-rack-lbl { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--text-3); padding-top: 7px; min-width: 38px; font-variant-numeric: tabular-nums; }
.pg-detail { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pg-rack .pg-detail { margin-top: 0; }
.pg-chip {
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 5px 7px; border-radius: 6px; border: 1px solid var(--border);
  color: var(--text-2); background: var(--surface);
}
.pg-chip.on { background: color-mix(in srgb, var(--chilled) 16%, #fff); border-color: var(--chilled); color: var(--text); }
.pg-chip.on-cold { background: color-mix(in srgb, var(--frozen) 14%, #fff); border-color: var(--frozen); color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* Klikbare locatie-chip → opent het scan-logboek van die locatie. */
.pg-chip[role="button"] { cursor: pointer; }
.pg-chip[role="button"]:hover { border-color: var(--brand); color: var(--text); }
/* Rack-grid in de vaste vakvolgorde (START linksonder). */
.pg-rack-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-x: auto; }
.pg-rackgrid { display: grid; gap: 4px; width: max-content; align-items: stretch; }
.pg-rackgrid .pg-chip { text-align: center; }
.pg-cell-gap { border: 1px dashed var(--border); border-radius: 6px; opacity: .6; min-height: 26px; }
.pg-colax { font-size: 10px; font-weight: 700; color: var(--text-3); text-align: center; padding-top: 1px; }

/* ---- logboek per locatie (groepering + plattegrond-drilldown) ---- */
.log-loc-group { margin-bottom: 14px; }
.log-loc-head {
  display: flex; align-items: baseline; justify-content: space-between; width: 100%;
  gap: 10px; padding: 8px 4px; margin-bottom: 2px; background: transparent;
  border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left;
}
.log-loc-head[data-loc-history]:hover .ll-code { color: var(--brand); }
.ll-code { font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ll-count { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.loc-hist-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.loc-hist-bar .lh-title { display: flex; align-items: baseline; gap: 8px; }
.loc-hist-bar .lh-title .mono { font-size: 15px; font-weight: 800; color: var(--text); }
.loc-hist-bar .lh-tz { font-size: 11px; color: var(--text-3); }
.btn-back {
  font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.btn-back:hover { border-color: var(--brand); color: var(--text); }

/* ---- Meer / profile ---- */
.profile {
  display: flex; align-items: center; gap: 14px; padding: 18px;
}
.profile .p-av {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--brand-red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  flex: 0 0 auto;
}
.profile .p-name { font-weight: 800; font-size: 17px; }
.profile .p-role { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.profile .p-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--success); font-weight: 600; margin-top: 5px; }
.profile .p-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
/* Offline: schakel naar de waarschuwingskleur. */
.profile .p-status.off { color: var(--warning); }
.profile .p-status.off i { background: var(--warning); }

.menu { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  border-top: 1px solid var(--line-soft);
  background: var(--card-bg);
}
.menu-item:first-child { border-top: 0; }
.menu-item .m-ic {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 18px;
  background: var(--surface2); color: var(--text-c);
}
.menu-item .m-label { flex: 1; font-weight: 600; font-size: 14px; }
.menu-item .m-val { font-size: 13px; color: var(--text-3); }
.menu-item .m-chev { color: var(--gray-400); font-size: 18px; }

.logout {
  margin-top: 18px; width: 100%; height: 50px;
  border: 1px solid var(--error); background: transparent; color: var(--error);
  border-radius: 14px; font-weight: 700; font-size: 15px; font-family: var(--font); cursor: pointer;
}
.version { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* Toggle switch */
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--gray-300); border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm);
}
/* Toggle ON = enabled → groen (kleurregel: --brand alleen merk/primaire actie). */
.switch input:checked + .track { background: var(--chilled); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ---- Charts (KPI) ---- */
.chart-card { padding: 16px; }
.chart-card h4 { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.chart-card .c-sub { font-size: 12px; color: var(--text-3); margin: 0 0 12px; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.donut-legend span { display: inline-flex; align-items: center; gap: 8px; }
.donut-legend b { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend em { color: var(--text-3); font-style: normal; margin-left: auto; padding-left: 12px; }

/* ---- Tab bar — wit, rode actieve tab, rode scan-FAB ---- */
.tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 3px rgba(16, 24, 40, .05);
}
.tab {
  flex: 1;
  border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px;
  color: var(--nav-inactive);
  font-family: var(--font); font-size: 10.5px; font-weight: 600;
  cursor: pointer;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--nav-active); }
.tab.scan-tab .tab-scan {
  width: 50px; height: 50px; margin-top: -16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-deep));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(227, 6, 19, .35);
}
.tab.scan-tab.active .tab-scan { box-shadow: 0 8px 20px rgba(227, 6, 19, .5); }
.tab.scan-tab svg { stroke: #fff; }

/* ---- Source pill (Ritten live/mock) ---- */
.src-pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface2); color: var(--text-3);
}
.src-pill.live { color: #067647; background: var(--tint-ok); }
.src-pill.loading { color: var(--info); background: var(--tint-info); }

/* ---- Detail screens (trip / order) ---- */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-back {
  width: 40px; height: 40px; flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--card-bg);
  border-radius: 11px; cursor: pointer; color: var(--text);
  display: grid; place-items: center;
}
.detail-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.detail-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* Secondary-screen header: terugknop in tekstkleur (navigatie, geen actie). */
.rh-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn.rh-back { color: var(--text); flex: 0 0 auto; }
/* Depot cards zonder detailscherm: geen klik-affordance. */
.depot-card.static { cursor: default; }
.depot-card.static:hover { border-color: var(--border); transform: none; box-shadow: var(--shadow-sm); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.kv:first-child { border-top: 0; }
.kv span { color: var(--text-3); }
.kv b { font-weight: 700; text-align: right; word-break: break-word; }
.mono { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }

.timeline { position: relative; padding-left: 6px; }
.tl-item { display: flex; gap: 12px; padding: 4px 0 14px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand-red); flex: 0 0 auto; margin-top: 4px; z-index: 1; box-shadow: 0 0 0 3px var(--brand-red-tint); }
.tl-body { flex: 1; min-width: 0; }

.hint-note {
  font-size: 13px; color: var(--text-2); background: var(--surface2);
  border: 1px dashed var(--gray-300); border-radius: 12px; padding: 14px; line-height: 1.5;
}

.spinner-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; color: var(--text-3); font-size: 13px; }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--gray-200); border-top-color: var(--brand-red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty { text-align: center; color: var(--text-3); padding: 40px 20px; font-size: 14px; }

/* Toast — donkere chip op de lichte UI (leesbaar boven elke content). */
.toast-host {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none;
}
.toast {
  background: var(--gray-900); color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toast-in .2s ease, toast-out .2s ease 2.2s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* Fade between screens */
.screen.fade { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ============================================================
   Sidebar (alleen zichtbaar op de desktop-website)
   ============================================================ */
.sidebar { display: none; }

/* Polish: subtiele interactie-feedback voor beide layouts */
.list-item, .action, .depot-card, .zone, .menu-item { transition: transform .12s, box-shadow .12s, border-color .12s; }
.list-item:hover, .depot-card:hover, .zone:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
button:focus-visible, a:focus-visible, .tab:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Accessibility floor: reduced-motion doodt laser/spinner/toast/fade-animaties. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   DESKTOP WEBSITE  (≥ 980px) — donkere merksidebar, licht werkvlak
   ============================================================ */
@media (min-width: 980px) {
  body { padding: 0; background: var(--bg); align-items: stretch; justify-content: flex-start; }

  .device {
    max-width: none; width: 100vw; height: 100vh; max-height: none;
    border-radius: 0; box-shadow: none; border: 0;
    flex-direction: row;
  }

  /* Sidebar — merk-zwart (truck-livery), rode actieve items */
  .sidebar {
    display: flex; flex-direction: column;
    width: 270px; flex: 0 0 270px; height: 100vh;
    background: linear-gradient(180deg, #000 0%, #101014 100%);
    color: #fff; padding: 18px 14px; gap: 6px;
    border-right: 1px solid #1C1C20;
  }
  .sb-brand { padding: 8px 10px 18px; border-bottom: 1px solid #1C1C20; margin-bottom: 10px; }
  .sb-logo-img { width: 100%; max-width: 190px; height: auto; display: block; }
  .sb-wordmark { font-weight: 800; font-size: 20px; letter-spacing: .5px; color: #fff; }
  .sb-wordmark span { color: var(--brand-red); }

  .sb-nav { display: flex; flex-direction: column; gap: 2px; }
  .sb-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border: 0; border-radius: 11px;
    background: transparent; color: #C9C9CF; cursor: pointer;
    font-family: var(--font); font-size: 14px; font-weight: 600; text-align: left; width: 100%;
  }
  .sb-item svg { width: 20px; height: 20px; flex: 0 0 auto; opacity: .9; }
  .sb-item:hover { background: #161619; color: #fff; }
  .sb-item.active { background: var(--brand-red); color: #fff; box-shadow: 0 6px 16px rgba(227,6,19,.35); }
  .sb-item.active svg { opacity: 1; }

  .sb-depots { display: flex; gap: 6px; margin: 14px 6px 6px; }
  .sb-depot {
    flex: 1; padding: 9px 0; border-radius: 9px; cursor: pointer;
    border: 1px solid #26262B; background: #131316; color: #C9C9CF;
    font-family: var(--font); font-weight: 700; font-size: 12px;
  }
  .sb-depot.active { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }

  .sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid #1C1C20; }
  .sb-user {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 9px 10px; border: 0; border-radius: 11px; cursor: pointer;
    background: transparent; color: #fff; font-family: var(--font); text-align: left;
  }
  .sb-user:hover, .sb-user.active { background: #161619; }
  .sb-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
  .sb-user-txt { display: flex; flex-direction: column; min-width: 0; }
  .sb-user-txt b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-user-txt i { font-style: normal; font-size: 11.5px; color: #8A8A92; }
  .sb-admin {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px;
    border-radius: 11px; color: #C9C9CF; text-decoration: none; font-size: 13.5px; font-weight: 600;
  }
  .sb-admin svg { width: 18px; height: 18px; }
  .sb-admin:hover { background: #161619; color: #fff; }

  /* Main column */
  .app { flex: 1 1 auto; min-width: 0; background: var(--bg); }
  .brand-header { display: none; }
  .tabbar { display: none; }

  .screen {
    align-self: center; width: 100%; max-width: 1120px;
    padding: 34px 44px 56px;
  }

  /* Bredere reflow van de mobiele schermen */
  .headline { font-size: 30px; }
  .greet-name { font-size: 30px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .actions { grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
  .action { flex-direction: column; align-items: flex-start; gap: 16px; min-height: 132px; }
  .action .a-chev { display: none; }
  /* Depotwissel zit in de sidebar op desktop — verberg de in-page variant */
  .screen .segment[data-seg="depot"] { display: none; }

  .sec-title { margin-top: 28px; }

  /* KPI: trend full width, donut + bar naast elkaar */
  .kpi-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Detailschermen op comfortabele maat */
  .timeline, .kv { max-width: 720px; }

  /* Toast rechtsonder op desktop */
  .toast-host { left: auto; right: 28px; transform: none; bottom: 28px; }
}

/* ============================================================
   Login gate (Supabase auth) — merk-zwart doek, witte kaart
   ============================================================ */
.auth-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, #000 0%, #17171C 100%);
  overflow-y: auto;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 30px 24px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: auth-pop .22s ease;
}
@keyframes auth-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo-img { max-width: 180px; height: auto; }
.auth-wordmark { font-weight: 800; font-size: 24px; letter-spacing: .5px; color: var(--text-c); }
.auth-wordmark span { color: var(--brand); }
.auth-card h1 { font-size: 21px; font-weight: 800; margin: 0 0 4px; text-align: center; color: var(--text-c); }
.auth-sub { font-size: 13.5px; color: var(--dim); text-align: center; margin: 0 0 18px; line-height: 1.4; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.auth-card input {
  width: 100%; box-sizing: border-box; padding: 14px 16px;
  border: 1.5px solid var(--gray-300); border-radius: 13px;
  font-family: var(--font); font-size: 16px; background: var(--bg2); color: var(--text-c);
}
.auth-card input::placeholder { color: var(--faint); }
.auth-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(227, 6, 19, .12); }
.auth-btn {
  margin-top: 4px; padding: 14px; border: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(180deg, var(--brand), var(--brand-press));
  color: #fff; font-family: var(--font); font-weight: 700; font-size: 16px;
}
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-link {
  display: block; margin: 16px auto 0; padding: 6px; border: 0; background: none; cursor: pointer;
  color: var(--brand); font-family: var(--font); font-size: 14px; font-weight: 600;
}
.auth-error {
  background: var(--tint-danger); color: #B42318; border: 1px solid rgba(220, 38, 38, .35);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600;
}
.auth-note {
  background: var(--tint-ok); color: #067647; border: 1px solid rgba(22, 163, 74, .35);
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
.auth-spin { text-align: center; color: var(--dim); padding: 18px; font-size: 14px; }

/* ── Native shell (MAUI WebView) only ──────────────────────────────────────
   html.aw-shell: geen tekstselectie/callout/overscroll-glow/tap-highlight.
   Inputs blijven selecteerbaar. */
html.aw-shell, html.aw-shell body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html.aw-shell input,
html.aw-shell textarea,
html.aw-shell [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* ── v2 server-driven weergave-instellingen (ui.theme / ui.density) ─────
   Hoog contrast op de lichte basis: teksten naar vol zwart, randen zwaarder. */
body.aw-high-contrast {
  --dim: #1D2939;
  --faint: #344054;
  --line: #98A2B3;
}
body.aw-high-contrast .badge,
body.aw-high-contrast .sys-chip,
body.aw-high-contrast .segment button {
  border: 1px solid rgba(16, 24, 40, 0.55);
}
body.aw-high-contrast .li-sub,
body.aw-high-contrast .wf-entry-sub,
body.aw-high-contrast .z-name {
  color: #1D2939;
}
body.aw-compact { --pad-scale: 0.75; }
body.aw-ruim   { --pad-scale: 1.25; }
body.aw-compact .list > *, body.aw-compact .depot-card { padding-top: 8px; padding-bottom: 8px; }
body.aw-ruim .list > *, body.aw-ruim .depot-card { padding-top: 18px; padding-bottom: 18px; }
body.aw-ruim .scan-btn, body.aw-ruim .segment button { min-height: 56px; }

/* ============================================================
   Voorraad: werklijst, vindkaart, detail-acties, MyDockly-tabel
   ============================================================ */
/* F2: THT-werklijstkaart ("Vandaag checken") — tikbaar filter. */
.vrd-due {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--tint-warn); border: 1px solid #FEC84B; border-radius: 13px;
  padding: 11px 14px; margin: 0 0 10px; font-family: var(--font);
}
.vrd-due .vd-title { font-weight: 800; font-size: 13px; color: var(--text); }
.vrd-due .vd-sub { flex-basis: 100%; font-size: 11.5px; color: var(--warn); }
.vrd-due.on { background: var(--surface2); border-color: var(--gray-300); }
/* F1: uitgelichte vindkaart bij een exacte label-/referentietreffer. */
.vrd-found {
  background: var(--tint-ok); border: 1px solid rgba(22, 163, 74, .45);
  border-radius: 13px; padding: 12px 14px; margin: 0 0 10px; cursor: pointer;
}
.vrd-found .c-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.vrd-found .vf-loc { font-weight: 800; font-size: 15px; margin-top: 2px; }
/* F3: actieknoppen in de detail-sheet (navigatie naar de scanflow). */
.vrd-actions { display: flex; gap: 8px; padding: 12px 16px 4px; }
.va-btn {
  flex: 1; border-radius: 12px; padding: 13px 0; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: 14px;
  border: 1.5px solid var(--brand); background: transparent; color: var(--brand);
}
.va-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
/* Desktop: volledige MyDockly-tabel. */
.vrd-tabwrap { overflow-x: auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.vrd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vrd-table th {
  text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); background: var(--gray-50); padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.vrd-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.vrd-table tbody tr { cursor: pointer; }
.vrd-table tbody tr:hover { background: var(--gray-50); }
.vrd-table tr:last-child td { border-bottom: 0; }
.vrd-table .badge { margin-top: 0; }
/* F5: vrije-plekken-sheet — chipsraster per zone. */
.fs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.fs-chips .pg-chip { min-height: 40px; display: inline-flex; align-items: center; cursor: pointer; }
/* F6: wachtrijchip is nu een echte knop. */
button.sys-chip { border: 0; cursor: pointer; font-family: var(--font); }

/* ── Tablet (700–979 px): bredere kolom + voorraadkaarten in 2 kolommen ── */
@media (min-width: 700px) and (max-width: 979px) {
  .device { max-width: 760px; border-radius: 26px; }
  .vrd-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .actions { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   Camerascanner (js/camera.js) — overlay + knoppen
   ============================================================ */
/* Secundaire scanknop: outline-variant onder de rode primaire. */
.scan-btn.cam {
  background: var(--card-bg); color: var(--brand-red);
  border: 1.5px solid var(--brand-red); box-shadow: var(--shadow-sm);
}
.cam-overlay {
  position: fixed; inset: 0; z-index: 1200; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.cam-video { width: 100%; height: 100%; object-fit: cover; }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(rgba(0, 0, 0, .65), transparent);
}
.cam-title { color: #fff; font-weight: 700; font-size: 15px; }
.cam-close {
  border: 0; border-radius: 12px; width: 44px; height: 44px;
  background: rgba(255, 255, 255, .18); color: #fff;
  font-size: 18px; cursor: pointer;
}
.cam-aim {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(72vw, 340px); height: min(72vw, 340px);
  border: 2px solid rgba(255, 255, 255, .85); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
  pointer-events: none; transition: border-color .15s ease;
}
/* Groene flits bij een geslaagde decode — de overlay blijft open (batch). */
.cam-overlay.cam-hit .cam-aim { border-color: var(--chilled); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35), 0 0 22px var(--chilled); }
.cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.cam-hint { margin: 0; color: #fff; font-size: 13px; text-align: center; opacity: .9; }
.cam-controls { display: flex; align-items: center; gap: 12px; }
.cam-torch {
  border: 0; border-radius: 999px; width: 52px; height: 52px;
  background: rgba(255, 255, 255, .18); font-size: 22px; cursor: pointer;
}
.cam-torch.on { background: rgba(255, 255, 255, .85); }
/* Zoomkeuze (1×/2×/3×): pillengroep naast de zaklamp; actieve stand wit. */
.cam-zoom {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(255, 255, 255, .14); border-radius: 999px;
}
.cam-zoom[hidden] { display: none; }
.cam-zoom button {
  border: 0; border-radius: 999px; min-width: 46px; height: 44px;
  background: transparent; color: #fff;
  font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer;
}
.cam-zoom button.on { background: rgba(255, 255, 255, .9); color: #101828; }
