/* ============================================================
   StageForce Inventory — dashboard theme
   ============================================================ */
:root {
  --bg:            #0d0f13;
  --bg-2:          #14161c;
  --panel:         #17181e;
  --panel-2:       #1c1e26;
  --border:        #262832;
  --border-2:      #2f313c;
  --text:          #e9ebf0;
  --text-muted:    #9ca0ad;
  --text-dim:      #6b6f7e;
  --accent:        #7c5cff;
  --accent-2:      #6a48ff;
  --accent-tint:   rgba(124, 92, 255, 0.15);
  --ok:            #22c55e;
  --ok-tint:       rgba(34, 197, 94, 0.14);
  --fail:          #ef4444;
  --fail-tint:     rgba(239, 68, 68, 0.14);
  --sidebar-w:     240px;
  --topbar-h:      56px;
  --radius:        12px;
  --shadow:        0 1px 0 rgba(255,255,255,0.02) inset, 0 10px 30px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.muted    { color: var(--text-muted); }
.dim      { color: var(--text-dim); }
.mono     { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.accent   { color: var(--accent); }

/* ============================================================
   Layout: sidebar + main shell
   ============================================================ */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 12px;
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 20px 8px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
}
.brand-name {
  font-weight: 600; font-size: 15px;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section-label {
  padding: 14px 12px 5px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: var(--accent-tint); color: var(--text);
}
.nav-icon {
  display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px;
  align-items: center; justify-content: center;
}
.nav-icon svg { display: block; width: 18px; height: 18px; }
.nav-label { flex: 1; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.user-tile {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  border: 1px solid var(--border-2);
}
.user-name { font-size: 13px; font-weight: 600; }
.user-sub  { font-size: 11px; color: var(--text-dim); }
.signout-form { margin-top: 10px; }
.signout-button {
  width: 100%; min-height: 38px; padding: 8px 10px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); background: transparent;
  border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-size: 12px; cursor: pointer;
}
.signout-button:hover { color: var(--text); background: var(--panel); border-color: var(--border); }
.signout-icon { width: 20px; font-size: 16px; line-height: 1; }

.app-shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.crumbs { color: var(--text-muted); font-size: 14px; }
.crumb-sep { color: var(--text-dim); margin: 0 8px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.search input {
  width: 280px; height: 34px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--panel-2); }

.main { padding: 28px; max-width: 1400px; width: 100%; min-width: 0; }
.page-title h2 { margin: 0; font-size: 22px; font-weight: 600; }
.main .page-title svg { display: none !important; }
.page-title p  { margin: 4px 0 22px 0; }
.dashboard-title .action-icon { width: 17px; height: 17px; margin-right: 6px; vertical-align: -3px; }

/* ============================================================
   Panels & cards
   ============================================================ */
.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel-flush { padding: 0; overflow-x: auto; overflow-y: hidden; }
.furniture-type-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { color: var(--text-muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 600; margin: 4px 0 4px 0; letter-spacing: -0.5px; }
.stat-sub   { font-size: 12px; }

/* Compact warehouse dashboard */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.dashboard-title {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.dashboard-title p { margin-bottom: 0; }
.dashboard-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.dashboard-metric {
  min-height: 118px; padding: 18px 20px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.dashboard-metric:hover { border-color: var(--accent); background: var(--panel-2); }
.dashboard-metric strong {
  grid-row: 1 / span 2; grid-column: 2;
  font-size: 34px; line-height: 1; font-weight: 650;
}
.metric-label { font-size: 15px; font-weight: 650; }
.metric-note { color: var(--text-muted); font-size: 12px; }
.dashboard-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.dashboard-action {
  min-height: 96px; padding: 18px;
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .12s, background .12s;
}
.dashboard-action:hover { border-color: var(--accent); background: var(--panel-2); }
.dashboard-action-icon { display: none; }
.dashboard-action-copy { display: block; min-width: 0; }
.dashboard-action-copy b, .dashboard-action-copy small { display: block; }
.dashboard-action-copy b { font-size: 14px; }
.dashboard-action-copy small { margin-top: 5px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.dashboard-action .tool-arrow { margin: 1px 0 0 auto; color: var(--text-dim); }
.dashboard-search { margin-bottom: 22px; }
.dashboard-search-field { display: block; max-width: 680px; }
.dashboard-search-results:empty { display: none; }
.dashboard-search-results { margin-top: 14px; }
.dashboard-search-results > .panel:last-child { margin-bottom: 0; }
.dashboard-work-grid {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px;
  align-items: start;
}
.dashboard-panel-head {
  min-height: 70px; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.dashboard-panel-head h3 { margin: 0; font-size: 15px; }
.dashboard-panel-head .muted { font-size: 12px; }
.dashboard-empty { padding: 34px 20px; text-align: center; }
.compact-results th, .compact-results td { padding: 11px 14px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgba(255,255,255,0.025); }
.dashboard-tools { margin-top: 20px; }
.dashboard-tools .panel-head { margin-bottom: 8px; }
.dashboard-tool-list { list-style: none; margin: 0; padding: 0; }
.dashboard-tool-list a {
  display: flex; align-items: center; gap: 14px; padding: 12px 8px;
  border-top: 1px solid var(--border); border-radius: 6px;
}
.dashboard-tool-list a:hover { background: var(--panel-2); }
.dashboard-tool-list b, .dashboard-tool-list small { display: block; }
.dashboard-tool-list small { margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.dashboard-tool-list .tool-arrow { margin-left: auto; color: var(--text-dim); }
.scan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scan-type-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.scan-type-count {
  appearance: none; display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0; width: 100%; padding: 12px 14px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.scan-type-count:hover, .scan-type-count:focus-visible,
.scan-type-count[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-tint);
}
.scan-type-count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scan-type-count .stat-value { margin-bottom: 0; }
.scan-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.scan-dropzone {
  min-height: 120px; padding: 20px; display: flex; flex-direction: column;
  justify-content: center; gap: 6px; text-align: center;
  border: 1px dashed var(--border-2); border-radius: 8px; background: var(--panel-2);
}
.scan-dropzone input { background: transparent; border: 0; padding: 6px; }
.scan-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.scan-filter-controls { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.scan-filter-controls select { width: auto; min-width: 170px; margin: 0; }
.scan-view-toggle { display: flex; gap: 6px; }
.scan-view-toggle button { width: auto; margin: 0; }
.scan-view-toggle button.active { border-color: var(--accent); color: var(--accent); }
.scan-view-toggle { flex-wrap: wrap; }
.scan-export-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 14px; }
.scan-export-actions form { margin: 0; }
.scan-export-actions button { width: auto; margin: 0; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.scan-card {
  overflow: hidden; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2);
}
.scan-card.scan-item-toggle { cursor: pointer; }
.scan-card.scan-item-toggle:hover, .scan-card.scan-item-toggle:focus { border-color: var(--accent); }
.scan-card.scan-item-toggle:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.scan-card-photo {
  height: 140px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); color: var(--text-dim); font-size: 12px;
}
.scan-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.scan-card-body { padding: 12px; }
.scan-card-body h3 { margin: 4px 0 10px; font-size: 14px; }
.scan-card-body p { margin: 4px 0; font-size: 12px; }
.scan-card-details { padding: 0 12px 12px; }
.scan-card-details[hidden], .scan-item-details[hidden] { display: none; }
.scan-card-details h4 { margin: 10px 0 8px; font-size: 12px; }
.scan-item-toggle { cursor: pointer; }
.scan-item-toggle:hover td, .scan-item-toggle:focus td { background: var(--panel-2); }
.scan-item-toggle:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.scan-table-photo { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.scan-multi-photo {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.scan-multi-photo .scan-table-photo { width: 24px; height: 24px; }
.scan-filter { max-width: 380px; }
.scan-table-wrap[hidden], .scan-grid[hidden] { display: none; }
.scan-group-rfids { white-space: normal; overflow-wrap: anywhere; }
.scan-group { cursor: pointer; }
.scan-group:hover td, .scan-group:focus td { background: var(--panel-2); }
.scan-group:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.scan-group-details[hidden] { display: none; }
.scan-group-detail-content {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px;
  padding: 8px;
}
.scan-group-detail-content h3 { margin: 0 0 10px; font-size: 13px; }
.scan-group-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-group-photos img {
  display: block; width: 112px; height: 96px; object-fit: cover;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg-2);
}
.scan-group-items { list-style: none; margin: 0; padding: 0; }
.scan-group-items li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.scan-group-items li .mono { overflow-wrap: anywhere; }
.request-meta { margin-top: 2px; font-size: 11px; }
.return-item-preview { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.return-item-preview img {
  width: 32px; height: 32px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border-2);
}
button.primary.rack-action { width: auto; min-height: 34px; padding: 7px 11px; margin: 0; white-space: nowrap; }
.compact-action { display: inline-block; white-space: nowrap; padding: 7px 10px; }

.two-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.two-col-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}

/* ============================================================
   Forms
   ============================================================ */
.field { display: block; margin-bottom: 14px; }
.field .label {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 6px;
}
select, textarea, input[type=file], input[type=text], input[type=search] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
select { height: 40px; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path fill='%239ca0ad' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input[type=file] { padding: 8px 10px; font-size: 13px; }
select:focus, textarea:focus, input:focus { outline: none; border-color: var(--accent); }

.file-field .label { color: var(--text-dim); }

button.primary {
  width: 100%; padding: 12px 16px; margin-top: 6px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; font-weight: 600; font-size: 14px;
  border: none; border-radius: 8px; cursor: pointer;
  min-height: 44px;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:active { filter: brightness(0.95); }

/* ============================================================
   Browse Racks panel — item list
   ============================================================ */
.browse-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 2px 12px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.move-shown, .item-move {
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.move-shown:hover, .item-move:hover {
  background: var(--accent);
  color: #fff;
}
.item-move { padding: 5px 10px; font-size: 11px; }

.refresh-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.fail-text { color: var(--fail); }
.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-secondary:hover { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.browse-results {
  max-height: 420px; overflow-y: auto;
}
.items {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.item-thumb { width: 54px; height: 54px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--bg); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.item-body { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 4px;
}
.tag-chip {
  padding: 4px 10px; border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-2);
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--text); }
.tag-chip.selected {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}
.tag-chip.readonly {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
}
.tag-chip.readonly:hover { border-color: var(--border); color: var(--text-muted); }
.tag-chip.clickable {
  cursor: pointer;
  color: var(--text-muted);
  border-color: var(--border-2);
}
.tag-chip.clickable:hover {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}
.inv-tag-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  max-height: 140px; overflow-y: auto;
  padding: 4px 0;
}
.item-move:disabled, .move-shown:disabled {
  opacity: 0.45; cursor: not-allowed;
}
.item-move:disabled:hover, .move-shown:disabled:hover {
  background: var(--accent-tint); color: var(--accent);
}
.browse-hint { font-size: 12px; margin: 2px 0 12px 2px; }

/* ============================================================
   Rack grid (4x4 compartment visualization)
   ============================================================ */
.rack-view-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.rack-legend {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
}
.legend-swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  vertical-align: middle; margin: 0 4px 0 8px;
  border: 1px solid var(--border);
}
.legend-swatch.swatch-0 { background: var(--panel-2); }
.legend-swatch.swatch-1 { background: rgba(124,92,255,0.25); border-color: rgba(124,92,255,0.35); }
.legend-swatch.swatch-3 { background: rgba(124,92,255,0.75); border-color: var(--accent); }

.rack-root-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(255, 179, 71, 0.10);
  border: 1px solid rgba(255, 179, 71, 0.35);
  border-radius: 10px;
  font-size: 14px;
}
.rack-root-banner .rrb-body { flex: 1; }

.rack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}
.rack-cell {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  padding: 12px;
  border: 1.5px solid var(--border-2);
  background: var(--panel-2);
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
  transition: transform .08s, border-color .12s, background .12s;
  user-select: none;
}
.rack-cell:hover { transform: translateY(-2px); border-color: var(--accent); }
.rack-cell.selected {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.rack-cell.cell-empty-slot {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
  cursor: default;
  opacity: 0.35;
}
.rack-cell.cell-empty-slot:hover { transform: none; border-color: var(--border); }

/* Fill intensity by count */
.rack-cell.swatch-0 { background: var(--panel-2); }
.rack-cell.swatch-1 { background: rgba(124, 92, 255, 0.14); border-color: rgba(124, 92, 255, 0.3); }
.rack-cell.swatch-2 { background: rgba(124, 92, 255, 0.32); border-color: rgba(124, 92, 255, 0.55); }
.rack-cell.swatch-3 { background: rgba(124, 92, 255, 0.55); border-color: var(--accent); }

.cell-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px; font-weight: 700;
  color: var(--text);
}
.cell-count {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
}
.cell-count-lbl { color: var(--text-dim); font-weight: 400; }
.rack-cell.swatch-2 .cell-count, .rack-cell.swatch-3 .cell-count { color: var(--text); }
.rack-cell.swatch-3 .cell-count-lbl { color: rgba(255,255,255,0.7); }

@media (max-width: 560px) {
  .furniture-type-row { grid-template-columns: 1fr; }
  .rack-grid { gap: 6px; max-width: 100%; }
  .rack-cell { padding: 8px; }
  .cell-name { font-size: 18px; }
  .cell-count { font-size: 11px; }
  .cell-count-lbl { display: none; }
}

/* ============================================================
   Login
   ============================================================ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background: #101116;
}
.login-shell {
  width: min(1040px, 100%);
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  overflow: hidden;
  background: #18191f;
  border: 1px solid #2b2d35;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}
.login-visual {
  position: relative;
  min-height: 640px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #202127 url('/static/login-warehouse.png') center center / cover no-repeat;
  isolation: isolate;
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(8, 9, 13, 0.28);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.login-brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  background: #7657e8;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 12px;
  font-weight: 750;
}
.login-visual-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}
.login-visual-copy strong { font-size: 27px; line-height: 1.2; font-weight: 620; }
.login-visual-copy span { color: rgba(255, 255, 255, 0.78); font-size: 13px; }
.login-content {
  min-width: 0;
  padding: 52px 56px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #18191f;
}
.login-form-wrap { width: 100%; max-width: 390px; margin: auto; }
.login-heading { margin-bottom: 28px; }
.login-kicker {
  display: block;
  margin-bottom: 14px;
  color: #a796f5;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-heading h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 640; }
.login-heading p { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.login-error {
  margin-bottom: 18px;
  padding: 10px 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  font-size: 13px;
}
.login-form { display: flex; flex-direction: column; gap: 17px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field > span:first-child {
  color: #c9cbd3;
  font-size: 12px;
  font-weight: 600;
}
.login-field input[type="text"],
.login-field input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--text);
  background: #202229;
  border: 1px solid #343640;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
}
.login-field input:hover { border-color: #454854; }
.login-field input:focus { outline: none; border-color: #8066ed; box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14); }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 62px !important; }
.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 36px;
  padding: 0 9px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.password-toggle:hover { color: #fff; background: #292b34; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.login-remember input { width: 15px; height: 15px; margin: 0; accent-color: #7657e8; }
.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  color: #fff;
  background: #7657e8;
  border: 1px solid #8c75ee;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.login-submit:hover { background: #8066ed; }
.login-submit:active { background: #694bcf; }
.login-foot {
  margin: 38px 0 0;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 760px) {
  .login-page { padding: 0; display: block; }
  .login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
    border: 0;
    border-radius: 0;
  }
  .login-visual { min-height: 220px; padding: 20px; background-position: center 48%; }
  .login-visual-copy strong { font-size: 21px; }
  .login-visual-copy span { display: none; }
  .login-content { width: 100%; padding: 36px 24px 24px; justify-content: flex-start; }
  .login-form-wrap { max-width: 420px; }
  .login-foot { margin-top: 32px; }
}

@media (max-width: 420px) {
  .login-content { padding-left: 20px; padding-right: 20px; }
  .login-visual { padding-left: 20px; padding-right: 20px; }
}

@media (max-height: 720px) and (min-width: 761px) {
  .login-page { padding: 16px; }
  .login-shell, .login-visual { min-height: 560px; }
  .login-content { padding-top: 34px; padding-bottom: 24px; }
  .login-heading { margin-bottom: 22px; }
}
.item-count {
  min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 8px; background: var(--accent-tint); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}

.empty { padding: 20px 4px; text-align: center; font-size: 13px; }

/* ============================================================
   Activity feed
   ============================================================ */
.activity { list-style: none; padding: 0; margin: 0; }
.activity li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.activity li:last-child { border-bottom: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.act-dot.ok   { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }
.act-dot.fail { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.act-body { flex: 1; }
.act-time { font-size: 12px; }

/* ============================================================
   Pills / banners / results table
   ============================================================ */
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pill-ok      { background: var(--ok-tint);   color: var(--ok); }
.pill-fail    { background: var(--fail-tint); color: var(--fail); }
.pill-neutral { background: var(--panel-2);   color: var(--text-muted); border: 1px solid var(--border); }

.tally-row { display: flex; gap: 8px; margin-top: 8px; margin-bottom: 22px; flex-wrap: wrap; }

.banner {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  font-size: 14px;
}
.banner-ok { background: var(--ok-tint); color: var(--ok); border: 1px solid rgba(34, 197, 94, 0.3); }
.banner-error { background: var(--fail-tint); color: var(--fail); border: 1px solid rgba(239, 68, 68, 0.3); }
.banner-warn { background: rgba(255,175,0,0.08); border: 1px solid rgba(255,175,0,0.3); }
.warehouse-mapping-alert { padding: 0; overflow: hidden; color: var(--text); }
.mapping-alert-head, .mapping-alert-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 16px; padding: 10px 14px;
}
.mapping-alert-head { grid-template-columns: 1fr auto; border-bottom: 1px solid rgba(255,175,0,0.2); }
.mapping-alert-head span, .mapping-alert-row > span:nth-child(2) { color: var(--text-muted); font-size: 12px; }
.mapping-alert-row + .mapping-alert-row { border-top: 1px solid var(--border); }

table.results {
  width: 100%; border-collapse: collapse;
}
table.results th, table.results td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.results th {
  background: var(--panel-2); color: var(--text-muted);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
table.results td.rfid { font-weight: 600; }
.row-fail { background: rgba(239, 68, 68, 0.04); }

a.back { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: 14px; }

.progress {
  width: 100%; height: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s;
}
.btn-link {
  color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap;
}

/* ============================================================
   Destination picker (recent tiles + autocomplete search + chip)
   ============================================================ */
.dest-picker { margin-bottom: 6px; }
.dest-section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin: 0 0 8px 0;
}
.dest-recent {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 6px;
}
.dest-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .12s, background .12s, transform .06s;
}
.dest-tile:hover { border-color: var(--accent); background: var(--accent-tint); }
.dest-tile:active { transform: scale(0.98); }
.tile-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}

/* Rack quick-pick */
.dest-rack-picker { margin-bottom: 4px; }
.rack-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.rack-quick-btn {
  padding: 12px 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.rack-quick-btn:hover { border-color: var(--accent); background: var(--accent-tint); }
.rack-quick-btn.active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
}
.rack-compartments {
  margin: 4px 0 6px 0;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
}
.rc-header { font-size: 13px; margin-bottom: 10px; }
.rc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.rc-cell {
  aspect-ratio: 1;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600; font-size: 16px;
  cursor: pointer;
}
.rc-cell:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.rc-cell-empty { color: var(--text-dim); cursor: default; border-style: dashed; opacity: 0.4; }
.rc-cell-empty:hover { background: var(--panel); border-color: var(--border-2); color: var(--text-dim); }

/* Kind badges (replace emojis in search results) */
.kind-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  margin-right: 8px;
}
.kind-badge.kind-rack     { background: var(--accent-tint); color: var(--accent); }
.kind-badge.kind-listing  { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.kind-badge.kind-staging  { background: rgba(255, 179, 71, 0.15); color: #f0a04b; }

/* ============================================================
   Inventory search page
   ============================================================ */
.inv-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
}

.inv-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  background: var(--bg);
}
.inv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-thumb-lg { width: 84px; height: 84px; }

.inv-rfid-list, .inv-product-list, .inv-loc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.inv-rfid-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.inv-rfid-body { flex: 1; min-width: 0; }
.inv-rfid-line { font-size: 15px; margin-bottom: 2px; }

.inv-product {
  display: flex; gap: 14px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.inv-product-body { flex: 1; min-width: 0; }
.inv-product-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.inv-loc-breakdown {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; color: var(--text-muted);
}
.inv-loc-breakdown b { color: var(--text); }

.inv-loc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.inv-loc-item .btn-link { margin-left: auto; }

/* ============================================================
   View Location: grid of product cards, read-only
   ============================================================ */
.loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.loc-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .12s, transform .06s;
}
.loc-card:hover { border-color: var(--accent); }
.loc-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
}
.loc-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-card-thumb .thumb-empty {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.loc-card-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.loc-card-name {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.loc-card-count { font-size: 12px; }
.loc-card-chips {
  display: flex; flex-wrap: wrap; gap: 3px;
  margin-top: auto;
}
.loc-card-chips .tag-chip { padding: 2px 6px; font-size: 11px; }

/* ============================================================
   Cart: FAB, drawer, toast, add-buttons
   ============================================================ */
.cart-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none; color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
  font-size: 20px;
  transition: transform .12s;
}
.cart-fab:hover { transform: translateY(-2px); }
.cart-fab-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  background: var(--fail); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 92vw;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0,0,0,0.4);
  z-index: 95;
  display: flex; flex-direction: column;
  animation: slideIn 0.18s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.cart-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h3 { margin: 0; font-size: 18px; }
.cart-drawer-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 4px 10px; border-radius: 6px;
}
.cart-drawer-close:hover { background: var(--panel-2); color: var(--text); }
.cart-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
}
.cart-group { margin-bottom: 16px; }
.cart-group-head { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.cart-items { list-style: none; padding: 0; margin: 0; }
.cart-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 4px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px;
}
.cart-item-thumb {
  flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border-2); background: var(--panel);
}
.cart-item-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 9px; text-align: center;
}
.cart-item-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.cart-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-meta { color: var(--text-muted); font-size: 11px; }
.cart-remove {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 14px;
}
.cart-remove:hover { background: var(--fail-tint); color: var(--fail); }
.cart-drawer-foot {
  padding: 16px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
}
.cart-drawer-foot .primary,
.cart-drawer-foot .btn-secondary { padding: 12px 16px; }

.cart-toast {
  position: fixed; top: 20px; right: 24px; z-index: 200;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.cart-toast.toast-ok    { border-color: var(--ok); }
.cart-toast.toast-muted { color: var(--text-muted); }

/* Small "Add to cart" button variant */
.btn-add-cart {
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-add-cart:hover { background: var(--accent); color: #fff; }
.btn-add-cart-big { padding: 8px 16px; font-size: 13px; }

.cart-add-control {
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.cart-qty-select {
  min-width: 64px; max-width: 78px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}

.pager {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 20px;
}
.pager-info { font-size: 13px; }
.pager .btn-secondary { text-decoration: none; }

@media (max-width: 560px) {
  .cart-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .cart-drawer { width: 100vw; max-width: 100vw; }
}

@media (max-width: 560px) {
  .loc-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .loc-card-body { padding: 8px 10px; }
  .loc-card-name { font-size: 13px; }
}

.dest-results {
  margin-top: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  overflow: hidden;
  max-height: 320px; overflow-y: auto;
}
.dest-result {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.dest-result:last-child { border-bottom: 0; }
.dest-result:hover { background: var(--accent-tint); }
.dest-noresult { padding: 14px; font-size: 13px; }

.dest-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-size: 15px;
}
.dest-chip-arrow { color: var(--accent); font-weight: 700; }
.dest-chip-icon { font-size: 16px; }
.dest-chip-label {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dest-chip-clear {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.dest-chip-clear:hover { background: var(--panel-2); color: var(--text); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 460px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-title { margin: 0 0 12px 0; font-size: 18px; }
.modal-body { font-size: 15px; line-height: 1.5; margin: 0 0 20px 0; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.modal-actions .primary,
.modal-actions .btn-secondary {
  width: auto; padding: 10px 20px;
}

/* ============================================================
   Reservations UI (Slice 2+): chip states, quantity stepper,
   pill-warn, three-column diff, scroll list
   ============================================================ */
.chip-available     { background: rgba(124,92,255,0.12); color: #b7a5ff; border-color: rgba(124,92,255,0.35); }
.chip-reserved-mine { background: rgba(124,92,255,0.55); color: #fff;    border-color: rgba(124,92,255,0.7); }
.chip-reserved-other{ background: rgba(255,255,255,0.05); color: #6c6f7a; border-color: rgba(255,255,255,0.08);
                       cursor: not-allowed; text-decoration: line-through; }
.chip-in-use        { background: rgba(80,140,255,0.15); color: #7fb3ff; border-color: rgba(80,140,255,0.35); }
.chip-missing       { background: rgba(255,90,90,0.10); color: #ff9a9a; border-color: rgba(255,90,90,0.55); }

.chip-state-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.pill-warn { background: rgba(255,175,0,0.15); color: #ffcf6c; border: 1px solid rgba(255,175,0,0.4); }

.qty-stepper {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  padding: 4px; background: rgba(255,255,255,0.02);
}
.qty-stepper button {
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--text, #dcd8e6); border-radius: 6px; cursor: pointer; font-size: 16px;
}
.qty-stepper button:hover { background: rgba(255,255,255,0.05); }
.qty-stepper button:disabled { color: var(--text-dim); cursor: not-allowed; opacity: .5; }
.qty-stepper button:disabled:hover { background: transparent; }
.qty-stepper .qty-value {
  width: 40px; text-align: center; background: transparent; border: none;
  color: var(--text, #dcd8e6); font-size: 14px; font-family: inherit;
}
/* Physical staging workflow */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.workflow-steps li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  border-bottom: 2px solid var(--border);
  padding: 8px 0;
}
.workflow-steps li.current { color: var(--text); border-color: var(--accent); }
.workflow-steps li.complete { color: var(--ok); border-color: var(--ok); }
.workflow-number {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.workflow-action,
.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.workflow-action h3,
.next-action h3 { margin: 0 0 4px; font-size: 15px; }
.workflow-action p,
.next-action p { margin: 0; }
.workflow-action form { margin: 0; }
.workflow-buttons { display: flex; align-items: center; gap: 8px; }

@media (max-width: 760px) {
  .workflow-steps { grid-template-columns: 1fr; gap: 0; }
  .workflow-steps li { border-bottom-width: 1px; }
  .workflow-action,
  .next-action { align-items: stretch; flex-direction: column; }
  .workflow-buttons { align-items: stretch; flex-direction: column; }
}

.three-col-diff {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.scroll-list {
  max-height: 320px; overflow: auto; padding: 8px 12px;
}
.scroll-list .row {
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.scroll-list .row:last-child { border-bottom: none; }

@media (max-width: 900px) {
  .three-col-diff { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive: iPad portrait & below
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .panel, .panel-flush { overflow-x: auto; }
  .brand-name, .nav-label, .nav-section-label, .user-name, .user-sub { display: none; }
  .brand { justify-content: center; padding: 4px 0 20px 0; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .user-tile { justify-content: center; }
  .search input { width: 160px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .two-cols { grid-template-columns: 1fr; }
  .dashboard-work-grid { grid-template-columns: 1fr; }
  .dashboard-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-action:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; height: auto; min-height: 56px;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .brand { display: none; }
  .nav {
    flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 4px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav .nav-item {
    flex: 0 0 auto; width: auto; min-width: 60px; min-height: 54px;
    flex-direction: column; justify-content: center; gap: 2px; padding: 4px 6px;
  }
  .nav .nav-icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px; }
  .nav .nav-icon svg { display: block; width: 18px; height: 18px; }
  .nav .nav-label {
    display: block; flex: none; font-size: 9px; line-height: 1.1;
    white-space: nowrap; text-align: center;
  }
  .sidebar-foot { flex: 0 0 auto; padding: 0; margin: 0; border: 0; }
  .sidebar-foot .user-tile { display: none; }
  .signout-form { margin: 0; }
  .signout-button { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .app-shell { margin-left: 0; }
  .main { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .topbar { height: auto; min-height: var(--topbar-h); padding: 10px 14px; }
  .crumbs { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
  .two-col-inner { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-actions { grid-template-columns: 1fr; }
  .dashboard-action:last-child { grid-column: auto; }
  .dashboard-action { min-height: 76px; padding: 14px; }
  .page-title h2 { font-size: 20px; overflow-wrap: anywhere; }
  .page-title p { font-size: 13px; }
  .panel { padding: 16px; }
  .panel-flush { padding: 0; }
  .panel-head, .dashboard-panel-head { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  table.results { min-width: 560px; }
  .panel-flush table.results { min-width: 560px; }
  .scan-table-wrap { max-width: 100%; overflow-x: auto; }
  .scan-group-detail-content { grid-template-columns: 1fr; gap: 16px; }
  .scan-toolbar { align-items: stretch; flex-direction: column; }
  .scan-view-toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scan-view-toggle button { padding: 8px 6px; font-size: 12px; }
  .scan-filter-controls { align-items: stretch; flex-direction: column; }
  .scan-filter-controls select { width: 100%; }
  .scan-export-actions { justify-content: flex-start; }
  .scan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .scan-type-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .scan-type-count { padding: 10px; }
  .scan-type-count .stat-value { font-size: 21px; }
  .scan-input-grid { grid-template-columns: 1fr; }
  .scan-filter { max-width: none; }
  .dashboard-title { align-items: flex-start; flex-direction: column; }
  .dashboard-title > div:last-child { width: 100%; }
  .return-groups th:nth-child(2), .return-groups td:nth-child(2) { display: none; }
  .mapping-alert-head, .mapping-alert-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .mapping-alert-row > span:nth-child(2) { grid-column: 1; }
  .mapping-alert-row > span:last-child { grid-column: 2; grid-row: 1 / span 2; }
  .cart-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .rack-root-banner, .refresh-bar, .browse-header { align-items: stretch; flex-direction: column; }
  .rack-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pager { gap: 8px; flex-wrap: wrap; }
  button.primary, .btn-secondary, .filter-chip, .dest-tile, .rack-quick-btn { min-height: 44px; }
}
