/* ============================================================
   VOORRAADPORTAAL — Design System
   Mood: light warm-grey canvas · anthracite nav · bosgroen accent
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #eef0ec;
  --surface:   #ffffff;
  --surface-2: #f6f7f4;
  --surface-3: #eceee9;

  /* Ink */
  --ink:   #1a221d;
  --ink-2: #46514a;
  --ink-3: #7c867e;
  --ink-4: #a7b0a8;

  /* Lines */
  --line:   #e1e5df;
  --line-2: #d3d8d1;

  /* Brand — bosgroen */
  --green:       #2f6b4f;
  --green-deep:  #234f3b;
  --green-bright:#34835f;
  --green-soft:  #e6f0ea;
  --green-tint:  #f0f6f2;

  /* Anthracite — dark nav surfaces */
  --anthracite:    #20271f;
  --anthracite-2:  #2a322a;
  --anthracite-3:  #39433a;
  --on-anthracite: #e7ebe6;
  --on-anthracite-2:#9aa69c;

  /* Status */
  --warn:      #b67e1e;
  --warn-soft: #f6ecd6;
  --warn-line: #ecd9ab;

  --danger:      #b0432c;
  --danger-soft: #f6e2db;
  --danger-line: #ecc5b8;

  --ok:      #2f6b4f;
  --ok-soft: #e6f0ea;

  --info:      #4a5f86;
  --info-soft: #e7ecf5;

  --private:      #6a5a86;
  --private-soft: #ece6f3;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(26,34,29,.05), 0 1px 1px rgba(26,34,29,.04);
  --sh-2: 0 2px 8px rgba(26,34,29,.06), 0 1px 2px rgba(26,34,29,.05);
  --sh-3: 0 8px 28px rgba(26,34,29,.12), 0 2px 6px rgba(26,34,29,.06);
  --sh-up:0 -4px 20px rgba(26,34,29,.07);

  /* Type */
  --font: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;

  --tap: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--green-soft); }

/* scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c9cfc7; border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- type helpers ---------- */
.t-display { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.t-h1 { font-size: 23px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.t-h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.t-h3 { font-size: 15px; font-weight: 600; }
.t-body { font-size: 15px; font-weight: 400; }
.t-sm { font-size: 13.5px; }
.t-xs { font-size: 12px; }
.t-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   APP SHELL  (mobile-first)
   ============================================================ */
.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 16px;
  background: var(--anthracite);
  color: var(--on-anthracite);
}
.topbar .brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.topbar .logo { width: 30px; height: 30px; flex: none; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn { color: var(--on-anthracite); }

.main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
}
.page-pad { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }

/* bottom nav (mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-up);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 600;
  padding: 4px 2px; border-radius: var(--r-sm); min-height: var(--tap);
}
.bottomnav button.active { color: var(--green); }
.bottomnav .scan-fab {
  flex: none; width: 60px;
}
.bottomnav .scan-fab .fab {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; box-shadow: 0 6px 16px rgba(47,107,79,.4);
  border: 4px solid var(--surface);
}
.bottomnav .scan-fab span { color: var(--green); }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--tap); padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  background: var(--surface-3); color: var(--ink);
  border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(47,107,79,.28); }
.btn.primary:hover { background: var(--green-bright); }
.btn.dark { background: var(--anthracite); color: var(--on-anthracite); }
.btn.outline { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.outline:hover { border-color: var(--green); color: var(--green); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn.block { display: flex; width: 100%; }
.btn.icon-only { width: var(--tap); padding: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-md);
  color: var(--ink-2); transition: background .15s ease;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.on-dark:hover { background: var(--anthracite-3); }

/* pill / badge */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; line-height: 1;
  background: var(--surface-3); color: var(--ink-2);
}
.pill svg { width: 13px; height: 13px; }
.pill.ok      { background: var(--ok-soft);     color: var(--ok); }
.pill.warn    { background: var(--warn-soft);   color: var(--warn); }
.pill.danger  { background: var(--danger-soft); color: var(--danger); }
.pill.info    { background: var(--info-soft);   color: var(--info); }
.pill.private { background: var(--private-soft);color: var(--private); }
.pill.green   { background: var(--green-soft);  color: var(--green-deep); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }

/* stepper */
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); overflow: hidden;
}
.stepper button {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  color: var(--green); font-size: 20px;
}
.stepper button:hover { background: var(--green-tint); }
.stepper button:disabled { color: var(--ink-4); }
.stepper .val { min-width: 46px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.stepper.lg button { width: 58px; height: 58px; font-size: 26px; }
.stepper.lg .val { min-width: 64px; font-size: 22px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 90px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c867e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  height: var(--tap); padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); color: var(--ink-3);
}
.search-bar input { flex: 1; border: none; background: none; outline: none; color: var(--ink); height: 100%; }

/* segmented */
.segmented {
  display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 4px; gap: 2px;
}
.segmented button {
  height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; color: var(--ink-3);
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--green);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

/* product thumb */
.thumb {
  border-radius: var(--r-md); flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-4);
}
.thumb.sq { width: 52px; height: 52px; }
.thumb.lg { width: 96px; height: 96px; border-radius: var(--r-lg); }

/* section header */
.section-head { display: flex; align-items: center; gap: 10px; margin: 26px 2px 12px; }
.section-head .t-label { margin: 0; }
.section-head .line { flex: 1; height: 1px; background: var(--line); }
.section-head .count { color: var(--ink-4); font-size: 12px; font-weight: 600; }

/* list row */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.row + .row { margin-top: 8px; }
.row.pressable { transition: border-color .12s, box-shadow .12s; }
.row.pressable:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.row .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tiles (dashboard quick actions) */
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; min-height: 104px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  text-align: left; transition: transform .1s, box-shadow .15s, border-color .15s;
}
.tile:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.tile:active { transform: scale(.98); }
.tile .tile-ic {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--green-tint); color: var(--green);
}
.tile .tile-title { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.tile .tile-sub { font-size: 12px; color: var(--ink-3); }
.tile .badge-num {
  position: absolute; top: 12px; right: 12px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--green);
}
.tile.alert .tile-ic { background: var(--danger-soft); color: var(--danger); }
.tile.alert .badge-num { background: var(--danger); }
.tile.warn .tile-ic { background: var(--warn-soft); color: var(--warn); }
.tile.warn .badge-num { background: var(--warn); }

/* stat number */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 44px 20px; text-align: center; color: var(--ink-3);
}
.empty .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--ink-4); }

/* sheet / modal */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20,26,21,.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-3);
  max-height: 92vh; overflow: auto;
  animation: slideup .26s cubic-bezier(.22,1,.36,1);
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet .handle { width: 40px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 10px auto 4px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px 8px; }
.sheet-head .grow { flex: 1; }
.sheet-body { padding: 4px 18px 22px; }

/* divider */
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* key-value list */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); font-size: 13.5px; }
.kv .v { font-weight: 600; text-align: right; }

/* progress (stock vs min) */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }

@media (prefers-reduced-motion: no-preference) {
  .mascot-bob { animation: mascotBob 3.2s ease-in-out infinite; transform-origin: center bottom; }
}
@keyframes mascotBob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }

/* dashboard — calm hero + actions */
.hero-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, var(--green-soft), var(--green-tint));
  border: 1px solid #d8e6dd; border-radius: var(--r-xl);
  padding: 18px 20px; margin-bottom: 14px; overflow: hidden;
}
.attn-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 20px;
  box-shadow: var(--sh-1); transition: box-shadow .15s, border-color .15s;
}
button.attn-card:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.attn-card.ok { background: var(--green-tint); border-color: #d8e6dd; padding: 12px 16px; }
.attn-card .attn-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); display: flex; align-items: center; justify-content: center; flex: none; }

.qa-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 16px 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.qa:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.qa:active { transform: scale(.96); }
.qa-ic { position: relative; width: 48px; height: 48px; border-radius: 14px; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; }
.qa-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.qa-label { font-size: 13px; font-weight: 600; }

/* grid/list view toggle */
.viewtoggle { display: inline-flex; background: var(--surface-3); border-radius: var(--r-md); padding: 3px; gap: 2px; flex: none; }
.viewtoggle button { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.viewtoggle button.active { background: var(--surface); color: var(--green); box-shadow: var(--sh-1); }

/* product grid cards */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .pgrid { grid-template-columns: repeat(4, 1fr); } }
.pcard {
  display: flex; flex-direction: column; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1);
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.pcard:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.pcard:active { transform: scale(.985); }
.pcard-img { position: relative; aspect-ratio: 1.45 / 1; background: var(--surface-2); }
.pcard-flag { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.9); color: var(--private); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-1); }
.pcard-body { padding: 11px 12px 13px; }

/* ===== puzzle verification (mens-check) ===== */
.puz { user-select: none; -webkit-user-select: none; touch-action: none; }
.puz-stage {
  position: relative; width: 100%; height: 168px; border-radius: var(--r-md);
  overflow: hidden; border: 1px solid var(--line-2);
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,.10), transparent 42%),
    linear-gradient(135deg, #2f6b4f 0%, #234f3b 60%, #1c3f2e 100%);
}
.puz-deco { position: absolute; color: rgba(255,255,255,.10); }
.puz-gap {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 13px;
  background: rgba(10,20,14,.42);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4);
  border: 1px dashed rgba(255,255,255,.45);
}
.puz-piece {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(160deg, #f6f7f4, #e2e8e2);
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  color: var(--green); z-index: 2;
}
.puz-piece.ok { background: linear-gradient(160deg, #e6f0ea, #cfe6d8); color: var(--green-deep); }
.puz-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; background: rgba(28,63,46,.86); color: #fff; z-index: 5;
  animation: fade .25s ease;
}
.puz-track {
  position: relative; height: 52px; margin-top: 12px;
  border-radius: var(--r-pill); background: var(--surface-3);
  border: 1px solid var(--line-2); display: flex; align-items: center;
}
.puz-track.ok { background: var(--green-soft); border-color: var(--green); }
.puz-track.fail { animation: shake .4s; }
.puz-hint { position: absolute; left: 64px; right: 18px; color: var(--ink-3); font-size: 13.5px; font-weight: 600; pointer-events: none; }
.puz-handle {
  position: absolute; left: 3px; top: 3px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(47,107,79,.45); cursor: grab; touch-action: none;
}
.puz-handle:active { cursor: grabbing; }
.puz-handle.ok { background: var(--green-bright); }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }

/* fade-in for screen transitions — never animate opacity on the container
   (a paused/throttled frame must still be fully visible) */
@media (prefers-reduced-motion: no-preference) {
  .screen-enter { animation: screenIn .3s cubic-bezier(.22,1,.36,1); }
}
@keyframes screenIn { from { transform: translateY(8px); } }

.fab-stack { position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 35; }
.fab-stack .fab-main {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(47,107,79,.4);
}

/* desktop table (hidden mobile) */
.table-wrap { display: none; }

/* house switcher button */
.house-switch {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 12px; border-radius: var(--r-pill);
  background: var(--anthracite-2); color: var(--on-anthracite);
  font-weight: 600; font-size: 14px; max-width: 200px;
}
.house-switch .h-ic { color: var(--green-bright); display: flex; }

/* login */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch;
  background: var(--anthracite);
}
.auth .auth-art {
  display: none;
}
.auth .auth-form-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: var(--bg);
}
.auth .auth-card { width: 100%; max-width: 400px; }

/* ============================================================
   DESKTOP  (>= 900px)
   ============================================================ */
@media (min-width: 900px) {
  body { font-size: 15px; }

  .app {
    flex-direction: row;
    min-height: 100vh; min-height: 100dvh;
  }

  /* sidebar */
  .sidebar {
    display: flex; flex-direction: column;
    width: 264px; flex: none;
    background: var(--anthracite); color: var(--on-anthracite);
    height: 100vh; height: 100dvh; position: sticky; top: 0;
    padding: 18px 14px;
  }
  .sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
  .sidebar .brand .logo { width: 32px; height: 32px; }
  .sidebar .nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
  .sidebar .nav-group .grp-label { padding: 14px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-anthracite-2); }
  .sidebar .nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 0 12px; height: 42px; border-radius: var(--r-md);
    color: var(--on-anthracite-2); font-weight: 600; font-size: 14px;
    transition: background .14s, color .14s;
  }
  .sidebar .nav-item svg { width: 19px; height: 19px; flex: none; }
  .sidebar .nav-item:hover { background: var(--anthracite-2); color: var(--on-anthracite); }
  .sidebar .nav-item.active { background: var(--green); color: #fff; }
  .sidebar .nav-item .tag {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
    background: var(--anthracite-3); color: var(--on-anthracite); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .sidebar .nav-item.active .tag { background: rgba(255,255,255,.22); }
  .sidebar .nav-item.alert .tag { background: var(--danger); color: #fff; }
  .sidebar .sb-foot { margin-top: auto; }
  .sidebar .sb-user {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md);
    background: var(--anthracite-2);
  }
  .sidebar .sb-user .grow { flex: 1; min-width: 0; }

  /* main column */
  .app > .col {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    height: 100vh; height: 100dvh; overflow: hidden;
  }
  .topbar {
    background: var(--surface); color: var(--ink);
    border-bottom: 1px solid var(--line); height: 64px; padding: 0 28px;
    position: relative;
  }
  .topbar .brand-mark.mobile-only { display: none; }
  .topbar .icon-btn { color: var(--ink-2); }
  .topbar .desk-search { flex: 1; max-width: 440px; }
  .topbar .house-switch { background: var(--surface-3); color: var(--ink); }

  .scroller { flex: 1; overflow: auto; }
  .main {
    max-width: 1140px; margin: 0 auto; padding: 26px 28px 60px;
  }
  .page-pad { padding: 26px 28px 60px; max-width: 1140px; margin: 0 auto; }

  .bottomnav { display: none; }
  .fab-stack { display: none; }

  .tile-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .tile { min-height: 120px; }

  /* show real tables, hide mobile card list */
  .table-wrap { display: block; }
  .mobile-cards { display: none; }

  .auth .auth-art {
    display: flex; flex-direction: column; justify-content: space-between;
    flex: 1; padding: 48px; color: var(--on-anthracite);
  }
  .auth .auth-form-wrap { flex: none; width: 520px; }

  /* two-column detail layouts handled below at a wider breakpoint */
}

@media (min-width: 900px) {
  .desktop-hidden { display: none !important; }
}
@media (max-width: 899px) {
  .mobile-hidden { display: none !important; }
}

/* detail layouts: stack until there is room for a real second column */
.split, .split-wide { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1180px) {
  .split { display: grid; grid-template-columns: 1fr 344px; gap: 24px; align-items: start; }
  .split-wide { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
}

/* table */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  position: sticky; top: 0;
}
table.data tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.data tbody tr { transition: background .12s; cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
.table-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }

/* toast */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(108px + env(safe-area-inset-bottom)); z-index: 90; display: flex; justify-content: center; pointer-events: none; }
@media (min-width: 900px){ .toast-wrap { bottom: 28px; } }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--anthracite); color: var(--on-anthracite);
  padding: 12px 18px; border-radius: var(--r-pill); box-shadow: var(--sh-3);
  font-size: 14px; font-weight: 500; max-width: 90%;
  animation: toastIn .24s cubic-bezier(.22,1,.36,1);
}
.toast .tk { color: var(--green-bright); display: flex; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } }

/* scan viewfinder */
.scan-view {
  position: relative; aspect-ratio: 3/4; max-height: 60vh; width: 100%;
  background: radial-gradient(120% 120% at 50% 30%, #2c3a30 0%, #161d18 100%);
  border-radius: var(--r-xl); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.scan-frame { width: 74%; aspect-ratio: 1.5/1; border-radius: 16px; position: relative; }
.scan-frame::before, .scan-frame::after,
.scan-frame > i::before, .scan-frame > i::after {
  content: ''; position: absolute; width: 30px; height: 30px; border: 3px solid #fff; border-radius: 4px;
}
.scan-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-frame > i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-frame > i::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-laser { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--green-bright); box-shadow: 0 0 12px 2px rgba(52,131,95,.8); animation: laser 2.4s ease-in-out infinite; }
@keyframes laser { 0%,100% { top: 18%; } 50% { top: 82%; } }

/* utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.col-flex { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.full { width: 100%; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.clickable { cursor: pointer; }
