/* ============================================================
   AV Warehouse Manager — "road case meets lighting console"
   Dark charcoal chassis, amber console-lamp accents, LED stock
   meters, mono type for codes. No emojis, just clean line icons.
   ============================================================ */
:root {
  --bg: #0a0c0f;
  --surface: #12151a;
  --surface-2: #191e25;
  --raised: #20262f;
  --border: #242b35;
  --border-lt: #303945;
  --text: #e7ebf0;
  --dim: #8a94a3;
  --amber: #ffb224;
  --amber-soft: rgba(255, 178, 36, 0.14);
  --green: #38e07b;
  --green-soft: rgba(56, 224, 123, 0.13);
  --red: #ff5f56;
  --red-soft: rgba(255, 95, 86, 0.12);
  --cyan: #3dd6f5;
  --magenta: #c65bff;
  --ink: #17110a;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 12px;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(198, 91, 255, 0.05), transparent 60%),
    radial-gradient(900px 420px at 10% -10%, rgba(255, 178, 36, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.grow { flex: 1; }
svg { display: block; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border-lt);
  background: linear-gradient(180deg, var(--raised), var(--surface-2));
  color: var(--text);
  border-radius: 9px;
  padding: 9px 15px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 0.15s, filter 0.15s, box-shadow 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--dim); }
.btn:active { filter: brightness(1.25); }
.btn-primary {
  background: linear-gradient(180deg, #ffc14d, var(--amber));
  border-color: var(--amber);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.25), 0 4px 16px rgba(255, 178, 36, 0.18);
}
.btn-primary:hover { border-color: #ffd07a; box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.45), 0 4px 20px rgba(255, 178, 36, 0.3); }
.btn-danger { background: transparent; border-color: rgba(255, 95, 86, 0.5); color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { border-color: var(--border-lt); }
.btn-wide { width: 100%; }
.btn-close { padding: 7px; color: var(--dim); }
.btn-close svg { width: 18px; height: 18px; }
.input {
  width: 100%;
  background: #0d1014;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 13px;
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #58626f; }
.input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.15);
}
.input.mono { font-family: var(--mono); letter-spacing: 0.06em; }
textarea.input { resize: vertical; }

/* ---------- layout ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  background: rgba(10, 12, 15, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* the light strip — a little RGB fixture across the chassis */
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--magenta) 50%, var(--cyan));
  opacity: 0.65;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon { color: var(--amber); }
.brand-icon svg { width: 21px; height: 21px; }
.brand-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.brand-name b { color: var(--text); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.conn-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
  background: var(--surface);
}
.conn-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.conn-badge.live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.4s ease-in-out infinite; }
.conn-badge.local .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.btn-user { font-size: 13px; color: var(--dim); padding: 7px 11px; }
.btn-user svg { width: 15px; height: 15px; }
.main { padding: 16px; max-width: 1020px; margin: 0 auto; }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(13, 16, 20, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.nav-btn {
  position: relative;
  flex: 1; background: none; border: none; color: #5d6775; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  transition: color 0.15s;
}
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn.active { color: var(--amber); }
.nav-btn.active::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 2px; border-radius: 0 0 3px 3px;
  background: var(--amber);
  box-shadow: 0 2px 10px var(--amber);
}

/* ---------- inventory ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border-lt);
  background: var(--surface);
  color: var(--dim);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.active {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}
.stats-bar {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--dim);
  margin: 4px 2px 14px;
}
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 13px; }
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.item-card:hover { border-color: var(--border-lt); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); transform: translateY(-2px); }
.item-card:active { transform: scale(0.98); }
.item-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.item-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #3a4350;
}
.item-thumb.placeholder svg { width: 40px; height: 40px; }
.item-card-body { padding: 11px 13px 13px; }
.item-name {
  font-weight: 650; font-size: 14px; margin: 0 0 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  color: var(--dim); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* LED stock meter — like a channel meter on a desk */
.meter { display: flex; gap: 2.5px; margin-top: 10px; }
.meter .seg { flex: 1; max-width: 30px; height: 5px; border-radius: 1.5px; background: #232a33; }
.detail-stock .meter .seg { max-width: 44px; height: 7px; }
.meter .seg.on.g { background: var(--green); box-shadow: 0 0 5px rgba(56, 224, 123, 0.55); }
.meter .seg.on.a { background: var(--amber); box-shadow: 0 0 5px rgba(255, 178, 36, 0.55); }
.meter .seg.on.r { background: var(--red); box-shadow: 0 0 5px rgba(255, 95, 86, 0.55); }
.stock-line {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
}
.stock-label.st-in { color: var(--green); }
.stock-label.st-partial { color: var(--amber); }
.stock-label.st-out { color: var(--red); }
.stock-out { color: var(--dim); }

/* list view — denser, phone-friendly */
.view-toggle { flex: 0 0 auto; }
.view-toggle button { padding: 9px 11px; display: flex; align-items: center; }
.view-toggle button svg { width: 17px; height: 17px; }
.item-grid.list-mode { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
}
.item-row:hover { transform: none; }
.item-row .mini {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
  background: var(--surface-2); flex: 0 0 auto;
}
.item-row .mini.placeholder {
  display: flex; align-items: center; justify-content: center; color: #3a4350;
}
.item-row .mini.placeholder svg { width: 22px; height: 22px; }
.item-row .info { min-width: 0; flex: 1; }
.item-row .info b { display: block; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .info span { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.03em; }
.item-row-right {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
}

.empty { text-align: center; padding: 56px 20px; color: var(--dim); }
.empty-icon { display: flex; justify-content: center; margin-bottom: 14px; color: #333c48; }
.empty-icon svg { width: 52px; height: 52px; }

/* ---------- scan ---------- */
.scan-wrap { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; }
.video-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #05070a; aspect-ratio: 3/4; border: 1px solid var(--border);
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
/* corner brackets, camera-viewfinder style */
.scan-reticle {
  position: absolute; inset: 0; margin: auto; width: 62%; aspect-ratio: 1;
  pointer-events: none; opacity: 0.9;
  background:
    linear-gradient(var(--amber), var(--amber)) left 0 top 0 / 26px 3px,
    linear-gradient(var(--amber), var(--amber)) left 0 top 0 / 3px 26px,
    linear-gradient(var(--amber), var(--amber)) right 0 top 0 / 26px 3px,
    linear-gradient(var(--amber), var(--amber)) right 0 top 0 / 3px 26px,
    linear-gradient(var(--amber), var(--amber)) left 0 bottom 0 / 26px 3px,
    linear-gradient(var(--amber), var(--amber)) left 0 bottom 0 / 3px 26px,
    linear-gradient(var(--amber), var(--amber)) right 0 bottom 0 / 26px 3px,
    linear-gradient(var(--amber), var(--amber)) right 0 bottom 0 / 3px 26px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 178, 36, 0.4));
}
.scan-line {
  position: absolute; left: 21%; right: 21%; height: 2px; top: 24%;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 12px var(--amber);
  opacity: 0; pointer-events: none;
}
.video-frame.scanning .scan-line { opacity: 0.9; animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 24%; } 50% { top: 74%; } }
.scan-hint {
  position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(231, 235, 240, 0.85); text-shadow: 0 1px 4px #000;
}
.manual-entry { display: flex; flex-direction: column; gap: 6px; }
.manual-entry .row { gap: 8px; }

/* ---------- shared small controls: copies stepper + code-type toggle ---------- */
.copies {
  display: flex; align-items: center;
  border: 1px solid var(--border-lt); border-radius: 8px;
  background: var(--surface-2); overflow: hidden;
}
.copies button {
  width: 30px; height: 32px; border: none; background: none;
  color: var(--dim); font: 600 15px var(--mono); cursor: pointer;
}
.copies button:hover { color: var(--text); background: var(--raised); }
.copies .cnum { min-width: 28px; text-align: center; font: 600 13px var(--mono); }
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--border-lt); border-radius: 8px; overflow: hidden;
}
.seg-toggle button {
  border: none; background: none; color: var(--dim);
  font: 600 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 11px; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.seg-toggle button + button { border-left: 1px solid var(--border-lt); }
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button.active { background: var(--amber-soft); color: var(--amber); }

/* ---------- labels ---------- */
.label-size { margin: 2px 2px 8px; color: var(--dim); font-size: 13.5px; flex-wrap: wrap; }
.label-hint { margin: 0 2px 14px; }
.radio { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.radio input { accent-color: var(--amber); }
.label-list { display: flex; flex-direction: column; gap: 9px; }
.label-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px; cursor: pointer;
  transition: border-color 0.15s;
}
.label-row:hover { border-color: var(--border-lt); }
.label-row input { width: 17px; height: 17px; accent-color: var(--amber); flex: 0 0 auto; }
.label-row img.mini { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: 0 0 auto; }
.label-row .mini.placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 8px; background: var(--surface-2); color: #3a4350;
}
.label-row .mini.placeholder svg { width: 22px; height: 22px; }
.label-row .info { min-width: 0; flex: 1; }
.label-row .info b { display: block; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-row .info span { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.03em; }
.row-controls { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 560px) {
  .label-row { flex-wrap: wrap; }
  .row-controls { width: 100%; justify-content: flex-end; margin-left: 0; }
}

/* ---------- jobs ---------- */
.job-list { display: flex; flex-direction: column; gap: 10px; max-width: 660px; margin: 0 auto; }
.job-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.job-card:hover { border-color: var(--border-lt); transform: translateY(-1px); }
.job-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.job-card-top b { font-size: 15px; font-weight: 700; }
.job-date { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.04em; }
.job-lines { display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.job-line {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px;
}
.job-line .mini { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.job-line .mini.placeholder { display: flex; align-items: center; justify-content: center; color: #3a4350; background: var(--raised); }
.job-line .mini.placeholder svg { width: 20px; height: 20px; }
.job-line-main { flex: 1; min-width: 0; }
.job-line-main b { display: block; font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line-sub { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 11.5px; }
.job-line-sub .mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; }
.jl-btn {
  width: 22px; height: 22px; border: 1px solid var(--border-lt); border-radius: 6px;
  background: var(--raised); color: var(--dim); font: 600 12px var(--mono);
  cursor: pointer; padding: 0;
}
.jl-btn:hover { color: var(--text); }
.job-line-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.job-line-actions .jl-act { padding: 7px 11px; font-size: 12px; }
.st-in { color: var(--green); }
.st-partial { color: var(--amber); }
@media (max-width: 560px) {
  .job-line { flex-wrap: wrap; }
  .job-line-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- kits ---------- */
.kit-chip {
  display: inline-block; vertical-align: 2px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--cyan); border: 1px solid rgba(61, 214, 245, 0.45); border-radius: 5px;
  padding: 1px 6px; background: rgba(61, 214, 245, 0.1);
}
.kit-toggle-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.kit-toggle-row input { width: 17px; height: 17px; accent-color: var(--amber); flex: 0 0 auto; }
.kit-toggle-text { font-size: 13px; color: var(--dim); }
.kit-editor {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px; margin-bottom: 13px;
}
.kit-contents { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.kit-line { display: flex; align-items: center; gap: 9px; }
.kit-line-name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-remove { padding: 5px; color: var(--dim); }
.kit-remove svg { width: 14px; height: 14px; }
.kit-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; margin-bottom: 14px;
}
.kit-box-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 8px;
}
.kit-box-title svg { width: 14px; height: 14px; }
.kit-box-line { font-size: 13.5px; padding: 2px 0; }
.kit-box-line span { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-right: 4px; }

/* ---------- item picker ---------- */
.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 55vh; overflow-y: auto; }
.picker-row { cursor: pointer; }
.picker-add { color: var(--amber); flex: 0 0 auto; }
.picker-add svg { width: 17px; height: 17px; }

/* ---------- out now ---------- */
.out-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 15px;
}
.out-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 6px;
}
.out-card-head b { font-size: 14.5px; font-weight: 700; }
.out-card-head .mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; }
.out-line {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 2px; cursor: pointer; border-radius: 7px;
}
.out-line:hover { background: var(--surface-2); }
.out-line .mono { font-family: var(--mono); font-size: 12px; color: var(--amber); flex: 0 0 auto; }
.out-line-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- item history ---------- */
.hist { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.hist-title {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 8px;
}
.hist-line { display: flex; gap: 10px; font-size: 13px; padding: 3.5px 0; color: var(--dim); }
.hist-line b { color: var(--text); font-weight: 650; }
.hist-time { font-family: var(--mono); font-size: 11px; flex: 0 0 64px; padding-top: 1px; }

/* ---------- activity ---------- */
.activity-list { display: flex; flex-direction: column; gap: 9px; max-width: 660px; margin: 0 auto; }
.act-row {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
}
.act-icon {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--dim);
}
.act-icon svg { width: 15px; height: 15px; }
.act-icon.out { background: var(--amber-soft); color: var(--amber); }
.act-icon.in { background: var(--green-soft); color: var(--green); }
.act-icon.delete { background: var(--red-soft); color: var(--red); }
.act-text { flex: 1; font-size: 14px; line-height: 1.45; }
.act-text b { color: var(--text); font-weight: 650; }
.act-note { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.act-time { font-family: var(--mono); color: var(--dim); font-size: 10.5px; white-space: nowrap; letter-spacing: 0.04em; padding-top: 2px; }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.6);
}
.modal-card.narrow { max-width: 380px; }
@media (min-width: 640px) {
  .modal { align-items: center; padding: 20px; }
  .modal-card { border-radius: 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.field { display: block; margin-bottom: 13px; }
.field > span {
  display: block;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--dim); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.photo-picker { display: flex; align-items: center; gap: 12px; }
.photo-preview { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-lt); }
.photo-btn { flex: 0 0 auto; }

/* ---------- item detail ---------- */
.detail-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--border); }
.detail-title { margin: 0 0 4px; font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }
.detail-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  color: var(--dim); font-size: 13px; margin-bottom: 12px;
}
.detail-sub .sep { color: #3a4350; }
.detail-sub svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.detail-notes { font-size: 14px; color: var(--dim); margin: 0 0 14px; white-space: pre-wrap; }
.detail-stock {
  background: #0d1014; border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 15px;
}
.detail-stock .nums { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.detail-stock .nums .big { font-family: var(--mono); font-size: 27px; font-weight: 700; line-height: 1; }
.detail-stock .nums .big.zero { color: var(--red); }
.detail-stock .nums .rest { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.qty-stepper { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.qloc { margin-bottom: 10px; font-size: 13.5px; }
.qty-stepper .btn { width: 44px; font-size: 19px; padding: 8px 0; font-family: var(--mono); }
.qty-stepper input { width: 68px; text-align: center; font-family: var(--mono); font-size: 17px; font-weight: 700; }
.inout-row { display: flex; gap: 10px; margin: 14px 0 4px; }
.inout-row .btn { flex: 1; padding: 13px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.btn-out {
  background: linear-gradient(180deg, #ffc14d, var(--amber));
  border-color: var(--amber); color: var(--ink);
  box-shadow: 0 4px 16px rgba(255, 178, 36, 0.18);
}
.btn-in { background: var(--green-soft); border-color: rgba(56, 224, 123, 0.55); color: var(--green); }
.btn-in:hover { border-color: var(--green); }
.detail-qr {
  display: flex; align-items: center; gap: 15px;
  background: #0d1014; border: 1px solid var(--border);
  border-radius: 12px; padding: 13px; margin: 16px 0;
}
.detail-qr img { border-radius: 8px; background: #fff; padding: 4px; flex: 0 0 auto; }
.detail-qr img.qr { width: 110px; height: 110px; }
.detail-qr img.bar { width: 190px; height: 60px; object-fit: contain; }
.detail-qr .code {
  font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--amber);
}
.detail-qr .seg-toggle { margin-top: 9px; }
.detail-footer { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%; transform: translateX(-50%);
  background: #0b0e12; border: 1px solid var(--border-lt); border-left: 3px solid var(--amber);
  color: var(--text);
  padding: 11px 18px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  z-index: 100; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  max-width: 88vw; text-align: center;
}

/* ---------- setup screen ---------- */
.setup-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.setup-card {
  max-width: 460px; background: var(--surface);
  border: 1px solid var(--border-lt); border-radius: 16px; padding: 30px;
}
.setup-card h1 { font-size: 21px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.setup-card ol { padding-left: 20px; color: var(--dim); }
.setup-card li { margin-bottom: 6px; }
.setup-card code { font-family: var(--mono); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; color: var(--amber); }
.setup-card .btn { margin: 10px 0; width: 100%; }
.logo-big { color: var(--amber); }
.logo-big svg { width: 42px; height: 42px; }

/* ---------- workspace gate ---------- */
.gate-section { margin-top: 18px; }
.gate-section h3 {
  margin: 0 0 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber);
}
.gate-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 4px; color: var(--dim);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
}
.gate-divider::before, .gate-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Printing happens from an isolated iframe (see printSheetDoc in app.js),
   so no @media print rules are needed here. */
