/* ═══════════════════════════════════════════════════════════════
   WMS Pick & Pack – Industrial Mobile-First CSS
   Aesthetic: Rugged warehouse terminal · High contrast · Touch-friendly
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
/* ── Dark theme (default) ─────────────────────────────────── */
:root,
html.theme-dark {
  --bg:          #0f1117;
  --bg-surface:  #181c26;
  --bg-card:     #1e2332;
  --bg-card-alt: #242a3a;
  --border:      #2e3548;
  --border-light:#3a4258;

  --text:        #e8ecf4;
  --text-muted:  #7a87a8;
  --text-dim:    #4a5572;

  /* --accent omitted — set via server-injected <style> from branding settings */
  --green:       #22c55e;
  --green-dim:   #166534;
  --red:         #ef4444;
  --red-dim:     #7f1d1d;
  --blue:        #3b82f6;
  --orange:      #f97316;

  --radius:      8px;
  --radius-lg:   14px;
  --font-mono:   'IBM Plex Mono', monospace;
  --font-sans:   'IBM Plex Sans', sans-serif;

  --touch-target: 52px;   /* minimum tap target for gloved hands */
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Top Nav ───────────────────────────────────────────────── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Safe area insets: push content clear of notch/Dynamic Island on iOS PWA.
     Left/right handle landscape orientation on iPhone. */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  padding-bottom: 0;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  background: var(--bg-surface);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
  min-width: 0;          /* allows flex shrink so huge logos can't push nav items off */
  overflow: hidden;
  flex-shrink: 0;        /* but don't compress the brand itself — nav links should wrap instead */
}

.nav-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;      /* truncate very long product names in the nav */
}

.nav-icon { font-size: 22px; }

.nav-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
}

/* ── Page Main ─────────────────────────────────────────────── */
.page-main {
  flex: 1;
  padding: 16px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  min-height: var(--touch-target);
  padding: 0 20px;
  font-size: 15px;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #000; }
.btn-success  { background: var(--green);  color: #000; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); }
.btn-sm       { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs       { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg       { min-height: 60px; font-size: 18px; width: 100%; }

/* ── Pick List Cards ───────────────────────────────────────── */
.picklist-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.picklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.picklist-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border);
  transition: background 0.2s;
}

.picklist-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-alt);
  transform: translateY(-1px);
}

.card-active {
  border-color: var(--accent);
  background: var(--bg-card-alt);
}

.card-active::before { background: var(--accent); }

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
}

.card-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Progress bar */
.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.card-line-preview {
  list-style: none;
  margin-bottom: 12px;
}

.line-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.line-preview-item:last-child { border-bottom: none; }
.line-preview-item.line-complete { opacity: 0.45; text-decoration: line-through; }

.line-item-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 80px;
}

.line-item-desc { flex: 1; color: var(--text); }
.line-item-qty  { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.line-preview-more {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-bin-hint { font-size: 12px; color: var(--text-muted); }

/* ── Pick Page ─────────────────────────────────────────────── */
.pick-page { display: flex; flex-direction: column; gap: 16px; }

.pick-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}

.pick-header-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.pick-header-sep {
  color: var(--text-dim);
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 20px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pick-order-id {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.pick-progress-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Scan Feedback ─────────────────────────────────────────── */
.scan-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}

.scan-feedback.feedback-visible {
  opacity: 1;
  transform: translateY(0);
}

.feedback-ok  { background: color-mix(in srgb, var(--green) 15%, var(--bg-card)); border: 1px solid var(--green); color: var(--green); }
.feedback-err { background: var(--red-dim); border: 1px solid var(--red); color: var(--red); }

.feedback-icon { font-size: 20px; flex-shrink: 0; }

/* ── Stage Card ────────────────────────────────────────────── */
.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.item-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
}

.item-desc {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.qty-scanned { color: var(--green); font-weight: 600; }

/* Stage stepper */
.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}

.step-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

.step-active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  box-shadow: 0 0 12px var(--accent-glow);
}

.step-active .step-label { color: var(--accent); font-weight: 600; }

.step-done .step-num {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.stage-connector {
  height: 2px;
  flex: 1;
  background: var(--border);
  margin-bottom: 20px;
  max-width: 40px;
}

/* ── Barcode Scanner Component ─────────────────────────────── */
.scanner-wrapper {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}

.scanner-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.scan-tab.active {
  color: var(--accent);
  background: var(--bg-card-alt);
  border-bottom: 2px solid var(--accent);
}

.keyboard-scan-area { padding: 16px; }

.scan-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.scan-input-row {
  display: flex;
  gap: 8px;
}

.scan-input {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  padding: 12px 14px;
  height: var(--touch-target);
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.15s;
}

.scan-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.scan-input::placeholder { color: var(--text-dim); font-weight: 400; }

.scan-submit-btn {
  width: var(--touch-target);
  height: var(--touch-target);
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.scan-submit-btn:active { opacity: 0.75; }

/* Camera scanner */
.camera-scan-area { padding: 16px; }

.camera-viewfinder {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  width: 100%;
  height: 260px;          /* explicit px height — aspect-ratio alone is unreliable in Safari */
  min-height: 200px;
}

.scanner-video {
  position: absolute;     /* fill the viewfinder absolutely */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Canvas overlay for native BarcodeDetector bounding box — no CSS animation needed */
.scanner-detect-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;   /* clicks pass through to video */
}

/* ── Lines List ────────────────────────────────────────────── */
.lines-section { margin-top: 4px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lines-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 60px;
}

.line-row:hover   { background: var(--bg-card-alt); }
.line-row-active  { background: var(--bg-card-alt); border-left: 3px solid var(--accent); }

.line-row-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.line-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.line-pending   .line-status-dot { background: var(--text-dim); }
.line-partial   .line-status-dot { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.line-complete  .line-status-dot { background: var(--green);  box-shadow: 0 0 6px var(--green); }
.line-over      .line-status-dot { background: var(--red);    box-shadow: 0 0 6px var(--red); }

.line-row-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.line-row-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue);
}

.line-row-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-row-bin {
  font-size: 11px;
  color: var(--text-muted);
}

.line-row-right {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 12px;
}

.line-qty-scanned {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.line-complete .line-qty-scanned { color: var(--green); }
.line-partial  .line-qty-scanned { color: var(--orange); }

.line-qty-sep   { font-size: 16px; color: var(--text-dim); }
.line-qty-total { font-family: var(--font-mono); font-size: 16px; color: var(--text-muted); }

/* ── Complete Banner ───────────────────────────────────────── */
.complete-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  background: color-mix(in srgb, var(--green) 10%, var(--bg-card));
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  text-align: center;
}

.complete-icon { font-size: 56px; animation: bounce 0.5s ease; }

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

.complete-banner h2 { font-size: 24px; font-weight: 700; color: var(--green); }
.complete-banner p  { font-size: 14px; color: var(--text-muted); }

/* ── Settings Page ─────────────────────────────────────────── */
.settings-section { margin-bottom: 28px; }

.settings-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  margin-bottom: 12px;
}

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.setting-row:last-child { border-bottom: none; }

.setting-row label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.setting-value {
  font-size: 13px;
  color: var(--text);
  text-align: right;
  overflow-wrap: break-word;
  line-height: 1.6;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-warning { background: #78350f; color: var(--accent); }
.badge-success { background: var(--green-dim); color: var(--green); }
.badge-neutral { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 12px;
}

.alert-success { background: color-mix(in srgb, var(--green) 15%, var(--bg-card)); border: 1px solid var(--green); color: var(--text); }
.alert-error   { background: var(--red-dim); border: 1px solid var(--red); color: var(--red); }

/* ── Audit Table ───────────────────────────────────────────── */
.audit-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-mono);
}

.audit-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.audit-ok   td { color: var(--text); }
.audit-fail td { color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--bg-card)); }
.audit-result  { font-size: 16px; }

.audit-time  { color: var(--text-dim); }
.audit-event { font-weight: 600; }
.audit-code  { color: var(--blue); }

/* ── Empty / Loading States ────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon { font-size: 40px; opacity: 0.5; color: var(--text-muted); }
.empty-state p { font-size: 16px; }

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Blazor Error UI ───────────────────────────────────────── */
#blazor-error-ui {
  background: #7f1d1d;
  bottom: 0;
  box-shadow: 0 -1px 0 rgba(0,0,0,.2);
  color: white;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/* ── Utility ───────────────────────────────────────────────── */
.line-complete { opacity: 0.6; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 420px) {
  .page-main { padding: 12px; }
  .pick-order-id { font-size: 14px; }
  .item-desc { font-size: 13px; }
  .stage-bin-badge { min-width: 76px; padding: 8px 10px; }
}

/* Safe area insets for notched/Dynamic Island iPhones in PWA standalone mode */
@supports (padding: env(safe-area-inset-bottom)) {
  .page-main {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-left:   calc(16px + env(safe-area-inset-left));
    padding-right:  calc(16px + env(safe-area-inset-right));
  }
}

/* ═══════════════════════════════════════════════════════════════
   EXTENDED STYLES  – Auth, Admin, Supervisor, Modal, Nav extras
   ═══════════════════════════════════════════════════════════════ */

/* ── Login Page ────────────────────────────────────────────── */
.login-page-root {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  /* amber grid texture */
  background-image:
    linear-gradient(rgba(245,158,11,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,158,11,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

input[type="date"].field-input {
  min-width: 0;
  width: 100%;
  font-size: 13px;
  /* Prevent iOS/Android date picker chrome from overflowing */
  -webkit-appearance: none;
  appearance: none;
}

.field-input {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 12px 14px;
  height: var(--touch-target);
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field-input:disabled { opacity: .5; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
}

.login-btn { margin-top: 4px; }
.login-demo-hint p { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.demo-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Nav extras – connection pill, user dropdown ───────────── */
.nav-center { flex: 1; display: flex; justify-content: center; }

.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.conn-ok  { border-color: var(--green-dim); color: var(--green); }
.conn-err { border-color: var(--red-dim);   color: var(--red);   }
.conn-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.conn-ok  .conn-dot { box-shadow: 0 0 6px var(--green); animation: pulse-green 2s infinite; }
.conn-err .conn-dot { animation: pulse-red 1s infinite; }
@keyframes pulse-green { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes pulse-red   { 0%,100%{opacity:1} 50%{opacity:.3} }

.nav-user-wrap { position: relative; }
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-role-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
}
.role-admin      { background: #7c3aed22; color: #a78bfa; border: 1px solid #7c3aed44; }
.role-supervisor { background: #0369a122; color: #38bdf8; border: 1px solid #0369a144; }
.role-user     { background: #15803d22; color: var(--green); border: 1px solid #15803d44; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 9999;
  overflow: hidden;
}
.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.dropdown-name     { font-weight: 600; font-size: 14px; }
.dropdown-username { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--bg-card-alt); }
.dropdown-logout { color: var(--red); }
/* menu-backdrop removed - dropdown close handled via JS document click listener */

.nav-link-admin { color: #a78bfa !important; }

/* ── Tab Bar ───────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 0 1 auto;
  min-width: max-content;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 40px;
}
.tab-active { background: var(--bg-card-alt); color: var(--accent); }

/* ── Admin Tables ──────────────────────────────────────────── */
.admin-section { margin-bottom: 24px; }
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-inactive td { opacity: .45; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-cell-name { font-weight: 600; font-size: 13px; }
.user-cell-sub  { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.role-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red   { background: var(--red); }

.row-actions { display: flex; gap: 6px; }
.btn-warn { color: var(--orange) !important; border-color: #92400e !important; }
.btn-ok   { color: var(--green)  !important; border-color: var(--green-dim) !important; }

.text-mono { font-family: var(--font-mono); }
.text-sm   { font-size: 12px; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.field-input-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  min-height: 40px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
.field-input-sm:focus { border-color: var(--accent); }
select.field-input-sm option { background: var(--bg-card); }
/* ── Supervisor page ───────────────────────────────────────── */
.sup-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 480px) { .sup-stats { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.assign-grid { display: flex; flex-direction: column; gap: 12px; }
.assign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.assign-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.assign-pl-id { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--accent); display: block; }
.assign-date  { font-size: 12px; color: var(--text-muted); }
.assign-progress { display: flex; align-items: center; gap: 8px; }
.assign-pct { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.assign-lines-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.assign-line-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  color: var(--text-muted);
}
.chip-more { border-style: dashed; }
.assign-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.assign-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.assign-field label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.assign-current { display: flex; gap: 8px; flex-wrap: wrap; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.user-chip  { background: color-mix(in srgb, var(--accent) 15%, var(--bg-card)); color: var(--accent); }
.group-chip { background: color-mix(in srgb, var(--green) 15%, var(--bg-card)); color: var(--text); }

.pickers-list { display: flex; flex-direction: column; gap: 2px; }
.picker-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  gap: 12px;
}
.picker-row-left { display: flex; align-items: center; gap: 10px; }
.picker-info { display: flex; flex-direction: column; gap: 2px; }
.picker-name { font-weight: 600; font-size: 14px; }
.picker-sub  { font-size: 12px; color: var(--text-muted); }
.picker-row-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.picker-assigned { display: flex; gap: 6px; flex-wrap: wrap; }
.assigned-badge {
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.picker-idle { font-size: 12px; color: var(--text-dim); }

/* ── Connection cards (admin) ──────────────────────────────── */
.conn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.conn-card-active { border-color: var(--accent); }
.conn-card-name { font-weight: 700; font-size: 15px; }
.conn-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.badge-error  { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }

/* ── Group cards ───────────────────────────────────────────── */
.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.group-name { font-weight: 700; font-size: 15px; }
.group-desc { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.group-members { margin-top: 10px; }
.member-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  padding: 3px 10px;
  color: var(--text-muted);
}

/* ── System info (admin) ───────────────────────────────────── */
.sys-card h3 { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

/* ── Misc utilities ────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
/* ── Admin connection status banner ────────────────────────── */
.conn-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}
.banner-ok  { background: color-mix(in srgb, var(--green) 15%, var(--bg-card)); border-color: var(--green); color: var(--text); }
.banner-err { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ── Connection profile cards (admin) ──────────────────────── */
.conn-profiles { display: flex; flex-direction: column; gap: 10px; }
.conn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .15s;
}
.conn-card-active { border-color: var(--accent); }
.conn-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.conn-card-name  { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.conn-card-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.conn-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
/* ── Groups grid (admin) ───────────────────────────────────── */
.groups-grid { display: flex; flex-direction: column; gap: 10px; }
.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group-whs  { font-size: 12px; color: var(--text-muted); }
.group-members { display: flex; flex-wrap: wrap; gap: 6px; }
.group-actions { display: flex; gap: 6px; margin-top: 4px; }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* ── field-checkbox ────────────────────────────────────────── */
.field-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}
.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.field-checkbox label { font-size: 14px; color: var(--text); cursor: pointer; }

/* ── modal-lg ──────────────────────────────────────────────── */
.modal-lg { max-width: 540px; }

/* ── misc spacing tokens ───────────────────────────────────── */
.mt-12 { margin-top: 12px; }
.ml-2  { margin-left: 6px; }

/* ── code inline ───────────────────────────────────────────── */
code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  color: var(--accent);
}

/* ── Pick page: scanned qty overlay on line rows ───────────── */
.line-partial  .line-qty-scanned { color: var(--orange); }
.line-complete .line-qty-scanned { color: var(--green);  }

/* ── Pick list card extras ─────────────────────────────────── */
.card-assigned-to {
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 4px;
}
.card-unassigned {
  font-size: 12px;
  color: var(--orange);
  margin-bottom: 4px;
}
.empty-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── Scanner engine badge ──────────────────────────────────── */
/* ── Scan error box ────────────────────────────────────────── */
/* ── Scan target card (Pick page) ──────────────────────────── */
.stage-steps {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.scan-target-card {
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-target-item { border-color: var(--blue); }

.scan-target-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scan-target-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .02em;
}

.scan-target-item .scan-target-value { color: var(--blue); }

.scan-target-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.scan-target-qty {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.qty-done { color: var(--green); }

.btn-simulate {
  margin-top: 8px;
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.btn-simulate:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Qty controls ──────────────────────────────────────────── */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
}
.qty-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-minus:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.qty-display {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
/* When qty-display is an input — matches span styling exactly */
input.qty-display {
  border: none;
  background: transparent;
  outline: none;
  width: 60px;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  -moz-appearance: textfield;
}
input.qty-display::-webkit-outer-spin-button,
input.qty-display::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-max {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}
.qty-sep { color: var(--text-dim); margin: 0 1px; font-size: 20px; }
/* Small − button in line rows */
.qty-minus-sm {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-right: 6px;
}
.qty-minus-sm:hover { border-color: var(--red); color: var(--red); }

/* ── Line actions row ──────────────────────────────────────── */
.line-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.btn-short-pick {
  background: transparent;
  border: 1px dashed #92400e;
  border-radius: var(--radius);
  color: var(--orange);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-short-pick:hover { background: color-mix(in srgb, var(--orange) 20%, var(--bg-card)); }

/* ── Short pick styles ─────────────────────────────────────── */
.line-short .line-status-dot { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.qty-short  { color: var(--orange) !important; }
.short-tag  {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: #78350f;
  color: var(--orange);
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 4px;
  letter-spacing: .04em;
}
.short-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--orange);
  margin-left: 6px;
}
.complete-short-note {
  font-size: 13px;
  color: var(--orange);
  margin: 4px 0 8px;
}
.short-summary {
  background: var(--bg);
  border: 1px solid #92400e;
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.short-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}
.short-row span:first-child { font-family: var(--font-mono); color: var(--text-muted); min-width: 90px; }
.short-row span:last-child   { margin-left: auto; }
.short-qty { font-family: var(--font-mono); font-weight: 700; color: var(--orange); }

/* ── Save indicator ────────────────────────────────────────── */
.save-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  padding: 2px 0 4px;
}

/* ── Inline save indicator in header ───────────────────────── */
.save-indicator-inline {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* ── Unified scanner (no mode tabs) ───────────────────────── */
.camera-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.btn-start-camera {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 28px 16px;
  background: var(--bg);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.btn-start-camera:hover,
.btn-start-camera:focus {
  border-color: var(--accent);
  background: var(--bg-card-alt);
}

.start-camera-icon { font-size: 36px; }
.start-camera-text { font-size: 16px; font-weight: 700; color: var(--text); }
.start-camera-sub  { font-size: 12px; color: var(--text-muted); }

/* Stop camera button overlaid on viewfinder */
.camera-stop-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  transition: background .15s;
}
.camera-stop-btn:hover { background: rgba(0,0,0,0.8); }

/* SVG countdown ring */
.countdown-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);   /* start arc from top */
  pointer-events: none;
}
.countdown-track {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 3;
}
.countdown-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.9s linear;
}

/* Seconds number in the centre */
.countdown-seconds {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  z-index: 1;
  color: #fff;
  user-select: none;
}

/* Divider between camera and manual input */
.scanner-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-dim);
  font-size: 11px;
}
.scanner-divider::before,
.scanner-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Camera starting state ─────────────────────────────────── */
.camera-starting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Item image button & modal ─────────────────────────────── */
.scan-target-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.btn-item-image {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}

.btn-item-image:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-image {
  max-width: 520px;
}

.modal-image .modal-body {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Mock reset button ─────────────────────────────────────── */
.btn-mock-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 10px;
  background: transparent;
  border: 1px dashed var(--orange);
  border-radius: 20px;
  color: var(--orange);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-mock-reset:hover:not(:disabled) { background: rgba(249,115,22,.1); }
.btn-mock-reset:disabled,
.btn-mock-reset.resetting { opacity: .6; cursor: not-allowed; }

.reset-confirm {
  margin-left: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--green);
}

/* ── Pick list card status pills ───────────────────────────── */
.card-status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.pill-complete { background: color-mix(in srgb, var(--green) 15%, var(--bg-card)); color: var(--green); }
.pill-partial  { background: #78350f; color: var(--orange); }
.pill-pending  { background: var(--bg); color: var(--text-dim); border: 1px solid var(--border); }

/* ── Line preview dots ─────────────────────────────────────── */
.line-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-complete { background: var(--green); }
.dot-partial  { background: var(--orange); }
.dot-pending  { background: var(--text-dim); }

.line-partial-preview { opacity: 0.8; }

.qty-picked { color: var(--orange); font-weight: 700; }
.qty-sep    { color: var(--text-dim); margin: 0 1px; }

/* ── Lookup page ───────────────────────────────────────────── */
.lookup-page { display: flex; flex-direction: column; gap: 16px; }

.lookup-mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

.lookup-mode-btn {
  flex: 1;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 40px;
}
.lookup-mode-btn.mode-active {
  background: var(--bg-card-alt);
  color: var(--accent);
}

.lookup-scanner { /* scanner sits right below the toggle */ }

/* Result card */
.lookup-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lookup-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.lookup-result-title { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.lookup-item-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
}

.lookup-item-desc {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.lookup-bin-badge {
  display: inline-block;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  padding: 1px 6px;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.lookup-bin-code-large {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.lookup-bin-whs-label {
  font-size: 12px;
  color: var(--text-muted);
}

.lookup-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px 8px;
}

.lookup-empty-bins {
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

/* Bin rows (item → bins) */
.lookup-bins-list { display: flex; flex-direction: column; }

.lookup-bin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.lookup-bin-row .lookup-bin-code {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex: 1;
}

.lookup-bin-row .lookup-bin-whs {
  font-size: 12px;
  color: var(--text-muted);
}

.lookup-bin-qty {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.lookup-bin-qty strong { color: var(--green); }

/* Item rows (bin → items) */
.lookup-items-list { display: flex; flex-direction: column; }

.lookup-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  min-height: 64px;
}

.lookup-item-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.lookup-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
}

.lookup-item-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg);
  flex-shrink: 0;
}

.lookup-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lookup-item-desc-sm {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-item-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lookup-item-qty {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

/* ── Lookup banner button on index ─────────────────────────── */
.btn-lookup-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
  margin-bottom: 4px;
}

.btn-lookup-banner:hover {
  border-color: var(--accent);
  background: var(--bg-card-alt);
}

.lookup-banner-icon { font-size: 20px; flex-shrink: 0; }

.lookup-banner-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lookup-banner-arrow {
  font-size: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Stock count banner on index ───────────────────────────── */
.btn-stockcount-banner {
  border-color: var(--orange);
  background: rgba(249,115,22,.06);
}
.btn-stockcount-banner:hover { background: rgba(249,115,22,.14); border-color: var(--orange); }

.sc-banner-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--orange);
  margin-top: 1px;
}

/* ── Locked pick list card ─────────────────────────────────── */
.card-locked {
  opacity: .55;
  cursor: not-allowed !important;
  position: relative;
}

.card-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15,17,23,.7);
  border-radius: var(--radius-lg);
  z-index: 2;
  backdrop-filter: blur(2px);
}

.card-lock-icon { font-size: 28px; }

.card-lock-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Stock count list page ─────────────────────────────────── */
.sc-list { display: flex; flex-direction: column; gap: 12px; }

.sc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s;
}
.sc-card:hover { border-color: var(--accent); }
.sc-card-open  { border-color: var(--orange); }

.sc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-docnum {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  display: block;
}

.sc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.sc-warehouses { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.sc-whs-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 10px;
  color: var(--text-muted);
}

.sc-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sc-card-lines {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Active count page ─────────────────────────────────────── */
.sc-count-page { display: flex; flex-direction: column; gap: 14px; }

.sc-count-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.sc-count-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-count-progress-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.sc-current-bin {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sc-qty-entry {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-qty-label {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.badge-warning {
  background: rgba(249,115,22,.15);
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 20px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ── Stock count submit note (pickers) ─────────────────────── */
.sc-submit-picker-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text);
}

/* ── Settings page ─────────────────────────────────────────── */
.settings-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Light theme ───────────────────────────────────────────── */
html.theme-light {
  --bg:          #f0f2f7;
  --bg-surface:  #e4e8f0;
  --bg-card:     #ffffff;
  --bg-card-alt: #f8f9fc;
  --border:      #d0d7e3;
  --border-light:#bcc5d6;

  --text:        #111827;
  --text-muted:  #4b5563;
  --text-dim:    #9ca3af;

  /* accent intentionally omitted — set via server-injected <style> from branding settings */
  --green:       #16a34a;
  --green-dim:   #bbf7d0;
  --red:         #dc2626;
  --red-dim:     #fee2e2;
  --blue:        #2563eb;
  --orange:      #ea580c;

  color-scheme: light;
}

/* Light theme overrides for elements that use hardcoded dark colours */
html.theme-light .top-nav        { background: #fff; border-bottom: 1px solid var(--border); }
html.theme-light .page-main      { background: var(--bg); }
html.theme-light .scan-input     { background: #fff; color: var(--text); }
html.theme-light .field-input    { background: #fff; color: var(--text); }
html.theme-light .modal          { background: #fff; }
html.theme-light .modal-header   { background: var(--bg-card-alt); }
html.theme-light .card-lock-overlay { background: rgba(240,242,247,.85); }
html.theme-light .login-card     { background: #fff; }
html.theme-light .tab-btn        { background: var(--bg-card-alt); }
html.theme-light .tab-btn.tab-active { background: #fff; }
html.theme-light .sc-card        { background: #fff; }
html.theme-light .lookup-result  { background: #fff; }

/* ── Theme toggle in Settings ──────────────────────────────── */
.theme-picker {
  display: flex;
  gap: 10px;
}

.theme-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg);
}

.theme-option:hover          { border-color: var(--accent); }
.theme-option.theme-selected { border-color: var(--accent); background: var(--bg-card-alt); }

.theme-preview {
  width: 100%;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
}

.theme-preview-dark  { background: #0f1117; }
.theme-preview-light { background: #f0f2f7; }

.tp-bar {
  height: 6px;
  border-radius: 3px;
}

.theme-preview-dark  .tp-bar-1 { background: #2e3548; width: 60%; }
.theme-preview-dark  .tp-bar-2 { background: #f59e0b; width: 40%; }
.theme-preview-dark  .tp-bar-3 { background: #2e3548; width: 75%; }
.theme-preview-light .tp-bar-1 { background: #d0d7e3; width: 60%; }
.theme-preview-light .tp-bar-2 { background: #d97706; width: 40%; }
.theme-preview-light .tp-bar-3 { background: #d0d7e3; width: 75%; }

.theme-option-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Accent colour picker ──────────────────────────────────── */
.accent-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accent-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.accent-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}

.accent-swatch:hover          { transform: scale(1.15); }
.accent-swatch.swatch-selected { border-color: var(--text); transform: scale(1.1); }

input[type="color"].accent-custom {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 50%;
  padding: 2px;
  background: none;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   Uses the same CSS variable system as the main app so theming
   works automatically — no hardcoded colours.
   ═══════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  background-image:
    linear-gradient(rgba(var(--accent-rgb, 245,158,11),.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb, 245,158,11),.04) 1px, transparent 1px);
  background-size: 40px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 28px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}

html.theme-light .login-card {
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.login-brand-icon  { font-size: 48px; display: block; margin: 0 auto 12px; }
.login-brand-title { font-family: 'Courier New', monospace; font-size: 24px; font-weight: 700; color: var(--accent); display: block; }
.login-brand-sub   { font-size: 13px; color: var(--text-muted); margin-top: 4px; display: block; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label {
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.login-field input {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-size: 14px;
  padding: 11px 14px;
}

html.theme-light .login-error { color: #991b1b; }

.login-btn-submit {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  height: 52px;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: opacity .15s;
}
.login-btn-submit:active { opacity: .8; }

/* ── Hamburger button — always in DOM, hidden on desktop ────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

.nav-burger.burger-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.burger-open span:nth-child(2) { opacity: 0; }
.nav-burger.burger-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive breakpoint ─────────────────────────────────── */
/* Nav breaks at ~860px — hide links and show burger below that */
@media (max-width: 860px) {

  /* Show the burger */
  .nav-burger { display: flex; }

  /* Hide the inline nav links */
  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    background: var(--bg-surface);
    border-top: 2px solid var(--accent);
    padding: 8px 0 32px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.nav-links-open { display: flex; }

  /* Full-width tappable links */
  .nav-link {
    padding: 13px 20px;
    font-size: 15px;
    border-radius: 0;
    width: 100%;
    color: var(--text);
  }

  .nav-link:hover,
  .nav-link:active { background: var(--bg-card-alt); }

  /* User section at bottom of menu */
  .nav-user-wrap {
    padding: 12px 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }

  .nav-user-btn { width: 100%; justify-content: flex-start; gap: 10px; }

  .user-dropdown {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
    border: 1px solid var(--border);
  }

  /* Hide centre status on very small screens to give burger room */
  @media (max-width: 400px) {
    .conn-label { display: none; }
    .btn-mock-reset { display: none; }
  }
}

/* ── Login remember me ─────────────────────────────────────── */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Security settings ─────────────────────────────────────── */
.recovery-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.recovery-code {
  display: block;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .08em;
  text-align: center;
  color: var(--text);
}

.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 12px;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-danger:hover { background: var(--red); color: #fff; }

/* ── Print queue ───────────────────────────────────────────── */
.print-job-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-lg);
}

.print-job-card.pending  { border-left-color: var(--accent); }
.print-job-card.printing { border-left-color: var(--blue); }
.print-job-card.done     { border-left-color: var(--green); opacity: .75; }
.print-job-card.failed   { border-left-color: var(--red); }

.print-job-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.print-job-status-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

.print-job-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.print-job-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.print-job-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.print-job-actions { flex-shrink: 0; }

.btn-print-small {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}

.btn-print-small:hover { border-color: var(--accent); color: var(--accent); }

/* ── MFA page icon (FA replacement for large emoji headers) ── */
.mfa-page-icon {
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--accent);
  text-align: center;
}

/* ── FA Icon Picker ────────────────────────────────────────── */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.icon-picker-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  transition: border-color .1s, color .1s, background .1s;
}

.icon-picker-btn:hover { border-color: var(--border-light); color: var(--text); background: var(--bg-card-alt); }
.icon-picker-btn.icon-selected { border-color: var(--accent); color: var(--accent); background: var(--bg-card-alt); }

/* ── Nav logo when using FA icon ───────────────────────────── */
.nav-logo-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Login brand FA icon ───────────────────────────────────── */
.login-fa-icon {
  font-size: 40px !important;
  color: var(--accent);
  display: block;
  text-align: center;
  margin-bottom: 12px;
}

/* ── Audit log user filter button ──────────────────────────── */
.audit-user-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-style: dotted;
}
.audit-user-link:hover { text-decoration-style: solid; }
.audit-user-active { font-weight: 700; text-decoration-style: solid; }

/* ── Pagination bar ─────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   LABEL EDITOR
═══════════════════════════════════════════════════════════════ */

.label-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
}

.label-editor-shell {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  overflow: hidden;
}

/* Header */
.label-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

/* Body layout */
.label-editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Left tools panel */
.label-editor-tools {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  overflow-y: auto;
  background: var(--bg);
}

.tools-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  margin-bottom: 3px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background .1s, color .1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-btn:hover       { background: var(--bg-card-alt); color: var(--text); }
.tool-btn-active      { background: var(--bg-card-alt); border-color: var(--accent); color: var(--accent); }
.tool-btn-danger      { border-color: var(--red); color: var(--red); }
.tool-btn-danger:hover{ background: rgba(239,68,68,.1); }

/* Canvas area */
.label-editor-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  background: var(--bg);
}

.label-canvas-wrapper {
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
}

.label-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  cursor: default;
  /* Scale canvas to fit while keeping proportions */
  width: auto;
  height: auto;
}

/* Right properties panel */
.label-editor-props {
  width: 200px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 12px 10px;
  overflow-y: auto;
  background: var(--bg);
}

.prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.prop-row label {
  width: 36px;
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.prop-input {
  width: 60px !important;
  font-size: 12px !important;
  padding: 4px 6px !important;
  text-align: right;
}
.prop-unit {
  font-size: 11px;
  color: var(--text-dim);
}

.style-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background .1s, border-color .1s;
}
.style-btn:hover  { background: var(--bg-card-alt); color: var(--text); }
.style-active     { background: var(--bg-card-alt); border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════
   PACK SESSION
════════════════════════════════════════════════════ */

.pack-complete-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 24px;
  background: color-mix(in srgb, var(--green) 10%, var(--bg-card));
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 4px;
}

.pack-complete-icon {
  font-size: 48px;
  color: var(--green);
  animation: bounce 0.5s ease;
}

.pack-complete-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.pack-complete-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.pack-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  overflow: hidden;
}

.pack-step.step-open {
  border-color: var(--accent);
}

.pack-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.pack-step-header:hover { background: var(--bg-card-alt); }

.pack-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
}

.pack-step-num.step-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pack-step-num.step-done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.pack-step-title {
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.pack-step-sub {
  flex: 1;
  font-size: 12px;
  color: var(--text-dim);
}

.pack-step-chevron {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.pack-step-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

/* ── Pack line rows ─────────────────────────────── */

.pack-line-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.pack-line-row:last-child { border-bottom: none; }

.pack-line-info {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pack-line-qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.pack-line-shortage {
  width: 100%;
}

/* ── Pack box cards ─────────────────────────────── */

.pack-box-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.pack-box-card:hover { border-color: var(--accent); }
.pack-box-card.box-active { border-color: var(--accent); background: var(--bg-card); }

.pack-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pack-box-title {
  font-weight: 700;
  font-size: 14px;
}

.pack-box-line-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.pack-box-line-row:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════════
   HOME PAGE
════════════════════════════════════════════════════ */

.nav-mobile-only   { display: none; }
.nav-desktop-only  { display: flex; }

@media (max-width: 860px) {
  .nav-mobile-only  { display: block; width: 100%; }
  .nav-desktop-only { display: none !important; }
}

.nav-mobile-only .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 0;
  font-size: 15px;
  color: var(--text);
  box-sizing: border-box;
}

.nav-mobile-only .nav-link:hover,
.nav-mobile-only .nav-link:active {
  background: var(--bg-card-alt);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  padding: 12px 20px 4px;
}

.nav-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

.nav-mobile-divider {
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

.nav-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: inherit;
  color: var(--text);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link-logout {
  color: var(--red) !important;
}

.order-header-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 600px) {
  .order-header-grid { grid-template-columns: repeat(2, 1fr); }
}

.order-lines-mobile  { display: none; }
.order-lines-desktop { display: block; }
@media (max-width: 600px) {
  .order-lines-mobile  { display: block; }
  .order-lines-desktop { display: none; }
}

.home-section-sublabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  padding: 10px 2px 4px;
}

.home-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.home-suggestion {
  border-left: 3px solid var(--accent);
}

/* Tile grid — 1 col mobile, 2 col tablet+ */
.home-tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 560px) {
  .home-tile-grid { grid-template-columns: 1fr 1fr; }
}

.home-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.home-tile:hover {
  border-color: var(--accent);
  background: var(--bg-card-alt);
}

.home-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.home-tile-body {
  flex: 1;
  min-width: 0;
}

.home-tile-title {
  font-size: 15px;
  font-weight: 600;
}

.home-tile-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tile-arrow {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Home link banner ─────────────────────────────────────── */
.home-link-banner { margin-bottom: 12px; }
.home-link-banner .lookup-banner-text { color: var(--text-muted); font-weight: 500; }
