@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(/vendor/heebo/heebo-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(/vendor/heebo/heebo-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 700; font-display: swap; src: url(/vendor/heebo/heebo-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 800; font-display: swap; src: url(/vendor/heebo/heebo-hebrew-800-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(/vendor/heebo/heebo-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(/vendor/heebo/heebo-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Heebo'; font-weight: 700; font-display: swap; src: url(/vendor/heebo/heebo-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Heebo'; font-weight: 800; font-display: swap; src: url(/vendor/heebo/heebo-latin-800-normal.woff2) format('woff2'); }

:root {
  --bg: #0E120F; --surface: #171D18; --surface2: #202821; --border: #2C362D;
  --text: #E9EEE6; --muted: #A1AC9F; --soft-text: #C9D2C6;
  --accent: #BCD65C; --on-accent: #121608;
  --warn: #F2B06A; --warn-bg: #2E2214; --ok: #8FD07A; --ok-bg: #16261A;
  --danger: #FF8E80; --danger-bg: #331917;
  --r: 14px; --r-sm: 10px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Heebo', system-ui, sans-serif; font-size: 16px; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 20px 16px 24px; padding-top: max(20px, env(safe-area-inset-top)); }
.page.with-nav { padding-bottom: 96px; }
.page.with-footer { padding-bottom: 110px; }

.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.topbar .sub { font-size: 13px; color: var(--muted); }
.topbar .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }

.h2 { margin: 0; font-size: 16px; font-weight: 700; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.card { padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.list { display: flex; flex-direction: column; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--border); }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: var(--text); text-decoration: none; background: none; border: 0; width: 100%; text-align: right; cursor: pointer; }
.item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .t { font-size: 15px; font-weight: 700; }
.item .s { font-size: 13px; color: var(--muted); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 999px; background: var(--surface2); font-size: 14px; font-weight: 700; }
.avatar.big { width: 60px; height: 60px; font-size: 20px; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface2); color: var(--soft-text); white-space: nowrap; }
.badge.cmd { background: var(--accent); color: var(--on-accent); }
.badge.lead { background: #2E3A1F; color: #D6E89A; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 18px; }
.btn.danger { background: var(--danger-bg); border-color: #5A2A24; color: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.dashed { background: transparent; border-style: dashed; border-width: 1.5px; color: var(--accent); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.hero { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-accent); text-align: right; cursor: pointer; text-decoration: none; }
.hero .ic { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--r-sm); background: rgba(18,22,8,.14); }
.hero .t { font-size: 22px; font-weight: 800; }
.hero .s { font-size: 14px; font-weight: 500; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 82px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); text-decoration: none; font-size: 14px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--ok-bg); color: var(--ok); }
.platoon-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); border-top-width: 4px; color: var(--text); text-decoration: none; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 52px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 17px; font-weight: 500; }
textarea.input { padding: 12px 14px; min-height: 110px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.input::placeholder { color: #7F8A7E; }
.input.pno { font-family: var(--mono); font-size: 20px; letter-spacing: 3px; direction: ltr; text-align: right; }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.chip[aria-checked="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.filter.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--surface2); }
.seg button { height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 700; }
.info { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface2); font-size: 13px; color: var(--soft-text); }

.stepper { display: flex; align-items: center; border-radius: var(--r-sm); background: var(--surface2); }
.stepper button { width: 38px; height: 44px; border: 0; background: transparent; font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper input { width: 64px; height: 44px; border: 0; background: transparent; text-align: center; font-family: var(--mono); font-size: 16px; font-weight: 600; }
.stepper input:focus { outline: none; }

.sigbox { position: relative; height: 140px; border-radius: var(--r); border: 1.5px dashed var(--border); background: var(--surface); touch-action: none; }
.sigbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sigbox .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6E796D; font-size: 15px; pointer-events: none; }

.footer { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; padding: 12px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 10px; z-index: 5; }
.footer .btn { flex: 1; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; display: flex; justify-content: space-around; padding: 8px 8px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); z-index: 5; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding-top: 4px; font-size: 12px; font-weight: 500; text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

.progress { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--accent); }
.stat { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: var(--r-sm); }
.stat b { font-family: var(--mono); font-size: 18px; }
.stat span { font-size: 12px; font-weight: 700; }

.empty { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 100px; max-width: 448px; margin: 0 auto; padding: 14px 16px; border-radius: var(--r); background: var(--text); color: var(--bg); font-weight: 700; font-size: 15px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.err { background: var(--danger); color: #1A0805; }
.toast.ok { background: var(--accent); color: var(--on-accent); }

.qrbox { padding: 16px; border-radius: 12px; background: #fff; width: 250px; height: 250px; }
.qrbox svg { width: 100%; height: 100%; display: block; }
.viewfinder { position: relative; width: 260px; height: 260px; margin: 0 auto; border-radius: 20px; background: var(--surface); }
.viewfinder i { position: absolute; width: 40px; height: 40px; border: 0 solid var(--accent); }
.viewfinder i:nth-child(1) { top: 14px; right: 14px; border-top-width: 4px; border-right-width: 4px; border-radius: 0 10px 0 0; }
.viewfinder i:nth-child(2) { top: 14px; left: 14px; border-top-width: 4px; border-left-width: 4px; border-radius: 10px 0 0 0; }
.viewfinder i:nth-child(3) { bottom: 14px; right: 14px; border-bottom-width: 4px; border-right-width: 4px; border-radius: 0 0 10px 0; }
.viewfinder i:nth-child(4) { bottom: 14px; left: 14px; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 10px; }

/* scanner overlay */
.scanner { position: fixed; inset: 0; z-index: 40; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.scanner .bar { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--surface); }
.scanner .top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); background: linear-gradient(rgba(0,0,0,.6), transparent); z-index: 2; }
.scanner .last { font-size: 14px; font-weight: 700; min-height: 20px; }

/* modal sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; border-top: 1px solid var(--border); padding: 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* print labels */
.labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.label-card { background: #fff; color: #000; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; break-inside: avoid; }
.label-card svg { width: 100%; max-width: 120px; height: auto; }
.label-card b { font-family: var(--mono); font-size: 14px; }
.label-card span { font-size: 11px; }
@media print {
  html, body { background: #fff; }
  .no-print { display: none !important; }
  #app { max-width: none; }
  .page { padding: 0; }
  .labels { grid-template-columns: repeat(4, 1fr); gap: 4mm; }
  .label-card { border: 0.3mm solid #999; border-radius: 2mm; }
}
