:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel2: #eef2f6;
  --ink: #111111;
  --muted: #5b6570;
  --line: #d5dbe3;
  --accent: #00c4e8;
  --accent-ink: #042028;
  --go: #0a63d8;
  --stop: #c45c4a;
  --warn: #e07010;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 16px/1.4 "Chakra Petch", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
.app { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
header {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex: none;
  background: #fff; border-bottom: 1px solid var(--line); z-index: 30;
}
header h1 { font-size: 16px; margin: 0; flex: 1; letter-spacing: .02em; }
header .who { font-size: 13px; color: var(--muted); }
nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 4px; border-bottom: 0; background: #fff; flex: none; z-index: 29; }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.subnav.hidden { display: none; }
.subnav button, nav button.nav-edit { background: var(--panel2); }
#siteSearchBar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; align-items: center; }
#siteSearch { flex: 1; min-width: 160px; }
.photo-find { position: relative; overflow: hidden; margin: 0; }
.photo-find input { position: absolute; inset: 0; opacity: 0; }
.site-hits { width: 100%; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
nav.nav-editing button[data-view] { cursor: grab; }
nav button i[data-tabx] { display: inline-block; margin-left: 6px; font-style: normal; font-weight: 900; }
.tab-add { padding: 8px 12px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.tab-add .row { flex-wrap: wrap; }
.site-hit { display: flex; gap: 8px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 6px; align-items: center; }
.site-hit img, .site-hit .thumb { width: 48px; height: 48px; object-fit: contain; background: #fff; }
.menu-row { align-items: center; gap: 6px; margin: 6px 0; }
.menu-row span { flex: 1; font-weight: 700; }
nav button {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; white-space: nowrap; cursor: pointer; touch-action: manipulation;
}
nav button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
main { padding: 12px; max-width: 980px; width: 100%; margin: 0 auto; flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
#login.gate { height: 100%; overflow: auto; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.card b { display: block; font-size: 22px; }
.card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { margin: 0 0 8px; }
.chip {
  background: var(--panel2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.item.st-out { background: #ff6b5b; color: #1a0808; border-color: #e24a3a; }
.item.st-crit { background: #ff8a3d; color: #1a0c04; border-color: #e07020; }
.item.st-low { background: #ffd24a; color: #1a1408; border-color: #e0b020; }
.item.st-ok { background: #7ed67a; color: #06200a; border-color: #3d8b5a; }
.item.st-spec { background: #9bb0ff; color: #0b1020; border-color: #6b7fd7; }
.item.st-out .meta, .item.st-crit .meta, .item.st-low .meta, .item.st-ok .meta, .item.st-spec .meta { color: inherit; opacity: .85; }
.card.st-out { border-color: #c45c4a; }
.card.st-crit { border-color: #e07040; }
.card.st-low { border-color: #d4a017; }
.banner { margin: 14px 0 8px; padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.banner.out { background: #c45c4a; color: #fff; }
.banner.crit { background: #e07040; color: #1a1008; }
.banner.low { background: #d4a017; color: #1a1408; }
.alert-h { margin: 18px 0 8px; font-size: 15px; }
.search { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); margin: 10px 0; }
.bin-badge {
  min-width: 52px; text-align: center; background: rgba(255,255,255,.9);
  border-radius: 8px; padding: 6px 4px; color: #111;
}
.bin-badge span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.bin-badge b { display: block; font-size: 18px; line-height: 1.1; }
.item {
  display: grid; grid-template-columns: 56px 56px 1fr auto; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px;
}
.sites { display: flex; gap: 6px; }
.site-box {
  min-width: 64px; text-align: center; background: rgba(255,255,255,.75);
  border-radius: 8px; padding: 4px 8px; color: #111;
}
.site-box span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.site-box b { display: block; font-size: 22px; line-height: 1.1; }
.site-box.here { background: #0a63d8; color: #fff; }
.thumb { width: 56px; height: 56px; border-radius: 8px; background: #e6ebf0; object-fit: cover; display: grid; place-items: center; color: var(--muted); font-size: 11px; overflow: hidden; }
.brand-lock { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-lock img { height: 72px; width: auto; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta { font-size: 13px; color: var(--muted); }
.qty { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.qty b { font-size: 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.flab { display: flex; align-items: center; gap: 6px; }
.trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.trio label { margin-top: 0; font-weight: 700; color: var(--ink); }
.tip {
  position: relative; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: #0a63d8;
  font-weight: 700; cursor: pointer; line-height: 20px; padding: 0;
}
.tip-pop {
  display: none; position: absolute; left: 0; top: 26px; z-index: 20;
  width: 220px; background: #111; color: #fff; font-size: 12px; font-weight: 400;
  text-transform: none; letter-spacing: 0; line-height: 1.35;
  padding: 8px 10px; border-radius: 8px; text-align: left;
}
.tip:hover .tip-pop, .tip.open .tip-pop { display: block; }
input, select, textarea {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--ink);
}
.btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px;
  padding: 12px 14px; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: .04em;
  touch-action: manipulation;
}
.btn:disabled { opacity: .55; }
.btn.secondary { background: var(--panel2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--stop); color: white; }
.btn.ok { background: var(--go); color: white; }
.brand-lock {
  display: flex; align-items: center; gap: 10px;
}
.brand-lock img { height: 72px; width: auto; }
header h1 { text-transform: uppercase; letter-spacing: .04em; }
#appBack {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 56px; padding: 4px 8px; line-height: 1; text-transform: none; letter-spacing: 0;
  font-weight: 900; gap: 0;
}
#appBack .back-arrow { font-size: 30px; font-weight: 900; line-height: .9; }
#appBack .back-word { font-size: 11px; font-weight: 800; text-transform: lowercase; margin-top: 2px; }
.stack { display: grid; gap: 8px; margin-top: 10px; }
.hidden { display: none !important; }
.gate {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
}
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #111; display: block; }
.pin-dots i.on { background: #111; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto 8px; }
.pin-pad button {
  height: 68px; border-radius: 50%; font-size: 26px; font-weight: 800;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.stay-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-weight: 700; }
.stay-row input { width: auto; }
.gate .box { width: min(400px, 100%); }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.toast {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; border: 1px solid var(--accent);
  padding: 12px 16px; border-radius: 10px; z-index: 200;
  pointer-events: none; max-width: min(92vw, 420px); text-align: center; font-weight: 700;
}
.totp-key { font-size: 20px; letter-spacing: .08em; word-break: break-all; }
.movement { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.warn { color: var(--warn); }
.okish { color: #7dcea0; }
.photo-picks { display: grid; gap: 8px; margin-bottom: 8px; }
.photo-pick {
  display: flex; gap: 10px; align-items: center; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer;
}
.photo-pick.on { border-color: #00c4e8; box-shadow: 0 0 0 2px #00c4e8; }
.photo-pick-img { width: 56px; height: 56px; border-radius: 8px; background: #e6ebf0; overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; }
.photo-pick-img img { width: 100%; height: 100%; object-fit: cover; }
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 8px; margin-bottom: 12px; }
.guide-art { width: 100%; height: auto; max-height: 180px; background: #f4f6f8; border-radius: 12px; display: block; }
.guide-card h3 { margin: 10px 0 6px; }
.guide-card ol { margin: 0 0 8px; padding-left: 20px; }
.guide-card li { margin: 4px 0; }
.label-stage {
  background: #d7dee6; border-radius: 14px; padding: 16px; overflow: auto; margin-bottom: 24px;
}
.label-page { background: #fff; margin: 0 auto 12px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.label-page .label {
  border: 0; border-radius: 0; overflow: hidden; background: #fff; color: #111;
  display: flex; flex-direction: column; justify-content: center; padding: 4px 6px; box-sizing: border-box;
  width: 100%; height: 100%;
}
.roll-page .label { width: 100%; height: 100%; }
.label.blank { background: transparent; }
.label .lname { font-size: 11px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lmeta, .label .lsku { font-size: 9px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.label.fit-lg .lname { font-size: 16px; }
.label.fit-lg .lmeta, .label.fit-lg .lsku { font-size: 12px; }
.label.fit-sm .lname { font-size: 8px; }
.label.fit-sm .lmeta, .label.fit-sm .lsku { font-size: 7px; }
.label .bc { width: 100%; height: 28px; }
.label.fit-lg .bc { height: 46px; }
@page { size: var(--page-w) var(--page-h); margin: 0; }
@media print {
  header, nav, #login, .page-head, .search, #lresults, #printQueue, .alert-h, #appBack, .toast { display: none !important; }
  #sheet, .label-sheet { display: block !important; background: none; }
  .label-stage { display: block !important; background: none; padding: 0; overflow: visible; }
  main { padding: 0; max-width: none; }
  .label-page { box-shadow: none; margin: 0; transform: none !important; page-break-after: always; break-after: page; }
  .label-page:last-child { page-break-after: auto; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 48px 48px 1fr; }
  .sites { grid-column: 1 / -1; justify-content: flex-end; }
}
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.brand-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 8px; cursor: pointer; text-align: center; color: inherit;
}
.brand-tile img { height: 84px; width: 100%; object-fit: contain; display: block; margin: 0 auto 8px; background: #fff; border-radius: 8px; padding: 6px; }
.brand-fallback { width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 16px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; }
.hat-draw, .scheme-swatch {
  display: block; height: 72px; width: 100%; border-radius: 8px; margin-bottom: 8px;
}
.hat-draw { background: #222 linear-gradient(#333 40%, #111 41% 55%, #444 56%); }
.hat-draw.t-5panel { background: linear-gradient(135deg,#2b2b2b 50%,#777 50%); }
.hat-draw.t-6panel { background: repeating-linear-gradient(90deg,#1f1f1f 0 16px,#555 16px 18px); }
.hat-draw.t-7panel { background: conic-gradient(#222,#666,#222,#888,#222); }
.hat-draw.t-dadhats { background: #c4a574; }
.hat-draw.t-trucker { background: linear-gradient(#222 55%, #d0d0d0 55%); }
.hat-draw.t-flatbill { background: #111; }
.hat-draw.t-beanies { background: #3a3a3a; border-radius: 36px 36px 8px 8px; }
.scheme-swatch.solid { background: #222; }
.scheme-swatch.two-tone { background: linear-gradient(90deg,#111 50%, #c00 50%); }
.scheme-swatch.three-tone { background: linear-gradient(90deg,#111 33%, #fff 33% 66%, #0a63d8 66%); }
.scheme-swatch.camo { background:
  radial-gradient(circle at 20% 30%, #4a5c32 0 18%, transparent 19%),
  radial-gradient(circle at 70% 40%, #2e3b22 0 22%, transparent 23%),
  radial-gradient(circle at 40% 80%, #6b7a45 0 16%, transparent 17%),
  #3d4a2c; }
.scheme-swatch.heather { background: repeating-linear-gradient(45deg,#888 0 2px,#bbb 2px 4px); }
.scheme-swatch.neon { background: linear-gradient(90deg,#ff2bd6,#ffe600,#39ff14); }
.brand-fallback {
  width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 12px;
  background: #0a63d8; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.brand-tile b { display: block; font-size: 13px; }
.brand-tile i { font-style: normal; font-size: 12px; color: var(--muted); }

.supplier-box { margin-top: 6px; text-align: left; }
.supplier-box label { font-size: 11px; color: var(--muted); display: block; }
.supplier-select { width: 100%; font-size: 12px; padding: 4px; }

.thumb { cursor: zoom-in; }
.zoom-box {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6, 18, 32, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; color: #fff;
}
.zoom-box.hidden { display: none; }
.zoom-box img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; background: #fff; }
.zoom-box p { margin: 12px 0 0; text-align: center; font-size: 15px; }
.zoom-close {
  position: absolute; top: 12px; right: 12px;
  background: #fff; color: #062033; border: 0; border-radius: 20px;
  padding: 10px 16px; font-weight: 700; min-height: 44px;
}
.lea-row {
  display: grid !important;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.lea-thumb { width: 100px !important; height: 100px !important; }
.lea-info { min-width: 0; }
.lea-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.lea-sku { word-break: break-word; }
.lea-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.lea-cost input { width: 90px; padding: 6px; }
@media (max-width: 640px) {
  .lea-row { grid-template-columns: 84px minmax(0, 1fr); }
  .lea-row .sites { grid-column: 1 / -1; justify-content: flex-start; }
}
html { scroll-behavior: smooth; }
main { padding: 16px 14px 28px; max-width: 1040px; }
.cards { gap: 10px; }
.card {
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
  border-radius: 14px;
}
nav { gap: 8px; padding: 10px 12px; }
nav button { transition: background .15s ease, border-color .15s ease; }
.item {
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
  transition: transform .12s ease, box-shadow .12s ease;
}
.item:active { transform: scale(.995); }
.item.st-out { background: #fde8e4; color: #3a1210; border-color: #f0b8b0; }
.item.st-crit { background: #fde8d4; color: #3a1c08; border-color: #f0c49a; }
.item.st-low { background: #fbf3d0; color: #3a2e08; border-color: #ead889; }
.item.st-ok { background: #e7f6ea; color: #0c2a14; border-color: #b7dfc0; }
.item.st-spec { background: #e8edfb; color: #10162a; border-color: #c3ceee; }
.lea-row { background: #fff; }
.lea-row.st-ok, .lea-row.st-low, .lea-row.st-crit, .lea-row.st-out {
  background: #fff;
  border-left: 6px solid #3d8b5a;
}
.lea-row.st-low { border-left-color: #d4a017; }
.lea-row.st-crit { border-left-color: #e07040; }
.lea-row.st-out { border-left-color: #c45c4a; }
.chips { gap: 8px; margin: 10px 0 12px; }
.search { width: 100%; margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; background: #fff; }
.page-head { margin: 4px 0 14px; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; }
.label-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.label-copy { min-width: 0; flex: 1; }
.label-title { font-size: 17px; line-height: 1.25; }
.label-hit .addL { flex: 0 0 auto; min-width: 110px; min-height: 44px; }
.queue-card { margin-top: 16px; display: grid; gap: 10px; }
.queue-card .btn { width: 100%; }
.item { padding: 12px; gap: 12px; }
.item > div { min-width: 0; }
@media (max-width: 720px) {
  header { flex-wrap: wrap; }
  .brand-lock img { height: 58px; }
  header h1 { font-size: 15px; }
  .trio { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .item { grid-template-columns: 46px 64px minmax(0, 1fr); }
  .item .sites { grid-column: 1 / -1; justify-content: stretch; }
  .site-box { flex: 1; min-width: 0; }
  .label-hit { align-items: flex-start; }
  .label-sheet { grid-template-columns: 1fr; }
  main { padding: 12px 10px 28px; }
  .supplier-select { font-size: 14px; padding: 8px; }
}
.movement {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.btn { border-radius: 12px; }
.image-banner {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  background: #7A2E24; color: #fff; padding: 10px 12px; flex: none;
}
.image-banner.hidden { display: none; }
.image-banner button { background: #fff; color: #7A2E24; border: 0; border-radius: 8px; padding: 8px 10px; font-weight: 700; }
.image-banner {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  background: #7A2E24; color: #fff; padding: 10px 12px; flex: none;
}
.image-banner.hidden { display: none; }
.image-banner button { background: #fff; color: #7A2E24; border: 0; border-radius: 8px; padding: 8px 10px; font-weight: 700; }
.menu-edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; }
.menu-edit-row input, .menu-edit-row select { width: auto; flex: 1; min-width: 120px; }
.menu-children { margin: 0 0 12px 16px; }
.drag-handle { width: 44px; height: 44px; touch-action: none; font-size: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.menu-edit-row.dragging { opacity: .45; }
