/* ==========================================================================
   BIN-ID APP — Mobile-First Low-Light Industrial Storage UI
   Engineered for high legibility in dimly lit Garages & Basements
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-base: #070b12;
  --bg-surface: #111827;
  --bg-elevated: #1b2538;
  --bg-input: #0b111e;
  --border-subtle: #2c3a52;
  --border-strong: #475b7c;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Industrial high-visibility storage tote yellow + cyan accent palette */
  --accent: #facc15;
  --accent-hover: #fde047;
  --accent-ink: #090d16;

  --cyan: #38bdf8;
  --cyan-bg: rgba(56, 189, 248, 0.14);
  --emerald: #34d399;
  --emerald-bg: rgba(52, 211, 153, 0.15);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.16);
  --amber-bg: rgba(250, 204, 21, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.55);

  accent-color: var(--accent);
}

/* Ultra High-Contrast Low-Light Boost Mode for Pitch-Black Basements/Garages */
html[data-contrast="max"] {
  --bg-base: #000000;
  --bg-surface: #0a0e17;
  --bg-elevated: #131b2e;
  --bg-input: #000000;
  --border-subtle: #64748b;
  --border-strong: #facc15;
  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-muted: #cbd5e1;
  --accent: #fde047;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hide print sheet during normal screen use */
#print-mount {
  display: none;
}

/* ==========================================================================
   MODAL DIALOGS (Modern Web Guidance Compliant)
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(94vw, 540px);
  max-height: 90dvh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(2, 6, 15, 0.82);
  backdrop-filter: blur(4px);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.dialog-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

.dialog-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dialog-body {
  padding: 20px;
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.btn-close {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

/* ==========================================================================
   AUTH / LOGIN SCREEN
   ========================================================================== */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #17223b 0%, var(--bg-base) 70%);
}

.auth-screen[hidden],
.app-shell[hidden],
.view-section[hidden],
[hidden] {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-kicker {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.brand-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.demo-credentials-box {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.demo-credentials-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.demo-credentials-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   FORMS, INPUTS & BUTTONS (Large Touch Targets for Low-Light Mobile Use)
   ========================================================================== */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .field-row-2 {
    grid-template-columns: 1fr;
  }
}

label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  font-size: 0.96rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-lg {
  min-height: 52px;
  font-size: 1.02rem;
  padding: 12px 20px;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-accent {
  background: var(--cyan);
  color: #04131f;
  border-color: var(--cyan);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

.btn-danger {
  background: var(--danger-bg);
  color: #fca5a5;
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover,
.btn-ghost[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--amber-bg);
}

.alert-banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #fecaca;
}

/* ==========================================================================
   APP SHELL, HEADER & GLOBAL SEARCH BAR
   ========================================================================== */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 84px; /* Space for mobile bottom nav */
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 17, 30, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border-subtle);
  padding: 12px 16px;
}

.header-top-row {
  max-width: 1160px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  display: block;
  line-height: 1.1;
}

.app-location-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.global-search-bar {
  max-width: 1160px;
  margin: 0 auto;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--accent);
  pointer-events: none;
}

#global-search-input {
  padding-left: 44px;
  padding-right: 44px;
  min-height: 48px;
  font-size: 1rem;
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

/* ==========================================================================
   MAIN CONTENT & TOTES DASHBOARD
   ========================================================================== */
.app-main {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}

.action-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .action-hero-row {
    grid-template-columns: 1fr;
  }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
}

.chip.active {
  background: var(--amber-bg);
  color: var(--accent);
  border-color: var(--accent);
}

.totes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.tote-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.tote-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tote-id-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.tote-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge-garage {
  background: var(--cyan-bg);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-basement {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.badge-size {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tote-qr-thumb {
  width: 74px;
  height: 74px;
  background: #ffffff;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid var(--border-strong);
}

.tote-qr-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tote-notes {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tote-items-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.tote-items-preview-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.preview-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.93rem;
  gap: 8px;
}

.preview-item-name {
  font-weight: 700;
  color: var(--text-primary);
}

.preview-item-meta {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.tote-card-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: auto;
}

/* ==========================================================================
   POST-SCAN 3-BUTTON MENU (Add Item, Remove Item, View Contents)
   ========================================================================== */
.scan-verified-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.scanned-tote-meta {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.scan-menu-prompt {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.scan-three-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-action-btn {
  width: 100%;
  min-height: 68px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
}

.scan-action-btn:hover,
.scan-action-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.scan-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  flex-shrink: 0;
}

.scan-action-add .scan-action-icon {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald);
}

.scan-action-remove .scan-action-icon {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.scan-action-view .scan-action-icon {
  background: var(--amber-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.scan-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-action-text strong {
  font-size: 1.12rem;
  font-weight: 900;
}

.scan-action-text small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   CAMERA SCANNER VIEW
   ========================================================================== */
.scanner-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.camera-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  margin: 16px auto;
  background: #000000;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-reticle {
  position: absolute;
   width: 62%;
  height: 62%;
  pointer-events: none;
}

.reticle-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
}

.reticle-corner.tl { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; }
.reticle-corner.tr { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; }
.reticle-corner.bl { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; }
.reticle-corner.br { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; }

.reticle-laser {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.camera-status-overlay {
  position: absolute;
  inset: auto 12px 12px 12px;
  background: rgba(7, 11, 18, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.scanner-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.file-btn-label {
  margin: 0;
}

.scanner-fallback-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
}

.inline-lookup-form {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

@media (max-width: 520px) {
  .inline-lookup-form {
    flex-direction: column;
  }
}

.quick-scan-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ==========================================================================
   REMOVE ITEM & VIEW CONTENTS LISTS
   ========================================================================== */
.remove-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.remove-item-row {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.remove-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contents-summary-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.contents-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.contents-item-row {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.initial-items-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-input);
}

.initial-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.initial-item-row {
  display: grid;
  grid-template-columns: 1fr 90px 140px auto;
  gap: 8px;
  margin-bottom: 8px;
}

@media (max-width: 520px) {
  .initial-item-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   SEARCH RESULTS & USERS VIEW
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.subsection-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
}

.search-results-grid,
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.search-hit-card,
.user-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.current-user-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

/* ==========================================================================
   BOTTOM NAVIGATION (Mobile-First Ergonomics)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(11, 17, 30, 0.98);
  border-top: 2px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px env(safe-area-inset-bottom, 6px);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-tab.active {
  color: var(--accent);
  background: var(--amber-bg);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 88px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   QR CODE LABEL PREVIEW & STANDARD LABEL SIZE PRINT FORMATTING
   ========================================================================== */
.label-preview-stage {
  background: #05080f;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}

.label-preview-caption {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.label-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Shared Physical Label Box (Used both in Preview and @media print) */
.qr-print-label {
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  overflow: hidden;
}

.qr-print-label .label-qr-box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-print-label .label-qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-print-label .label-info-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.qr-print-label .label-tote-id {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
  color: #000000;
  line-height: 1.05;
  margin: 0;
}

.qr-print-label .label-meta-line {
  font-weight: 800;
  text-transform: uppercase;
  color: #000000;
  margin: 2px 0;
}

.qr-print-label .label-items-list {
  margin: 4px 0 0;
  padding-left: 14px;
  font-size: 9pt;
  line-height: 1.2;
  color: #111111;
}

/* Preset 1: 2" x 4" Standard Bin / Shipping Label (4in wide x 2in tall) */
.qr-print-label.size-2x4 {
  width: 4in;
  height: 2in;
  padding: 0.14in;
  gap: 0.16in;
  align-items: center;
}
.qr-print-label.size-2x4 .label-qr-box {
  width: 1.65in;
  height: 1.65in;
}
.qr-print-label.size-2x4 .label-tote-id {
  font-size: 20pt;
}
.qr-print-label.size-2x4 .label-meta-line {
  font-size: 10.5pt;
}

/* Preset 2: 2.25" x 1.25" Dymo Thermal Label */
.qr-print-label.size-2\.25x1\.25 {
  width: 2.25in;
  height: 1.25in;
  padding: 0.08in;
  gap: 0.1in;
  align-items: center;
}
.qr-print-label.size-2\.25x1\.25 .label-qr-box {
  width: 1.05in;
  height: 1.05in;
}
.qr-print-label.size-2\.25x1\.25 .label-tote-id {
  font-size: 12pt;
}
.qr-print-label.size-2\.25x1\.25 .label-meta-line {
  font-size: 8pt;
}

/* Preset 3: 1" x 2.625" Avery 5160 Address Label */
.qr-print-label.size-1x2\.625 {
  width: 2.625in;
  height: 1in;
  padding: 0.06in 0.1in;
  gap: 0.1in;
  align-items: center;
}
.qr-print-label.size-1x2\.625 .label-qr-box {
  width: 0.84in;
  height: 0.84in;
}
.qr-print-label.size-1x2\.625 .label-tote-id {
  font-size: 12pt;
}
.qr-print-label.size-1x2\.625 .label-meta-line {
  font-size: 7.5pt;
}

/* Preset 4: 4" x 6" Large Tote Placard */
.qr-print-label.size-4x6 {
  width: 4in;
  height: 6in;
  padding: 0.25in;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.18in;
}
.qr-print-label.size-4x6 .label-qr-box {
  width: 2.8in;
  height: 2.8in;
}
.qr-print-label.size-4x6 .label-tote-id {
  font-size: 28pt;
}
.qr-print-label.size-4x6 .label-meta-line {
  font-size: 14pt;
}
.qr-print-label.size-4x6 .label-items-list {
  text-align: left;
  font-size: 11pt;
}

/* Print Media Rules */
@media print {
  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #auth-screen,
  #app-shell,
  dialog,
  .toast-container {
    display: none !important;
  }

  #print-mount {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .qr-print-label {
    border: 1.5pt solid #000000 !important;
    page-break-inside: avoid;
  }
}
