/* =============================================================================
   TikTok Auction Command Center
   Scoped with .acc-* prefix. Reuses existing tokens (--bg, --surface, --ink,
   --accent, etc.) and shares .dash-kpi-*, .skv-*, .data-table, .card, .drawer-*
   where possible. Only auction-specific patterns live here.
============================================================================= */

/* One-shot Turbo Stream event target. Hidden — the appended partial's
   Stimulus controller positions the toast via `position: fixed` and pulses
   the picker via a class toggle; nothing visible needs to live here. */
.acc-event-stream { display: none; }

/* Brief amber halo on the Current Auction Item picker when an auction is won. */
@keyframes acc-ci-pulse-anim {
  0%   { box-shadow: 0 0 0 0    rgba(217, 119, 6, 0.55); }
  60%  { box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);    }
  100% { box-shadow: 0 0 0 0    rgba(217, 119, 6, 0);    }
}
.acc-ci-trigger.acc-ci-pulse {
  animation: acc-ci-pulse-anim 1.6s ease-out;
}

/* Affirmative variant of .flash-notice for the auction-won toast. */
.acc-toast-affirm {
  background: var(--green-tint);
  border-left: 4px solid var(--green);
  color: #14532d;
  font-weight: 600;
}

/* ──────── Page header ──────── */
.acc-page { padding-top: 16px; padding-bottom: 60px; }
.acc-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.acc-ph h1 { margin: 4px 0 4px; }
.acc-ph-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.acc-ph-sub { font-size: 12px; color: var(--muted); }
.acc-ph-actions { display: flex; gap: 8px; align-items: center; }

/* ──────── Buttons (size variants not in design system) ──────── */
.acc-btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 6px 10px; border-radius: var(--radius-sm, 6px);
}
.acc-btn-xs {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 4px 8px; border-radius: 4px;
}
.acc-btn-start {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; padding: 9px 16px;
  border-radius: var(--radius-sm, 8px);
}
.acc-btn-end {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; padding: 9px 16px; color: #fff;
  background: var(--red); border: 1px solid var(--red); border-radius: var(--radius-sm, 8px); cursor: pointer;
}
.acc-btn-end:hover { background: #b91c1c; border-color: #b91c1c; }
.acc-btn-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 rgba(220,38,38,0.6); animation: accPulse 1.8s infinite;
}
.acc-btn-dot--white { background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
@keyframes accPulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.acc-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; background: transparent;
  border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer;
}
.acc-icon-btn:hover { background: var(--surface-alt); color: var(--ink); }
.acc-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; color: var(--muted);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 4px;
}
.acc-link-btn:hover { color: var(--ink); background: var(--surface-alt); }
.acc-inline-form { display: inline; margin: 0; }

/* ──────── KPI strip overrides ──────── */
.acc-kpi-strip {
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 1px; background: var(--border-light, #f0eeea);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius, 12px); overflow: hidden;
}
.acc-kpi-strip .dash-kpi-card { border: none; border-radius: 0; }
.acc-kpi-hero { padding: 18px 24px; }
.acc-kpi-hero .skv-hero-value { font-size: 32px; line-height: 1; margin-top: 4px; color: var(--ink); }
.acc-kpi-icon { display: inline-block; margin-right: 4px; vertical-align: -2px; }
.acc-icon-green { color: var(--green); }
.acc-icon-blue { color: var(--blue); }
.acc-icon-purple { color: var(--purple); }
.acc-icon-amber { color: var(--amber); }
/* Chained selector beats the shared `.dash-kpi-value` which would otherwise impose 22px/700. */
.dash-kpi-card .dash-kpi-value.acc-kpi-text {
  font-size: 12px; font-weight: 600; line-height: 1.35;
  color: #4a4a4a; letter-spacing: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}

/* ──────── Control bar (compact, single row) ──────── */
.acc-control-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin: 12px 0;
  position: sticky; top: 72px; z-index: 20;
}
.acc-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.acc-start-form { display: inline; margin: 0; }

.acc-btn-end-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; color: var(--red);
  background: transparent; border: 1px solid var(--red); border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.acc-btn-end-sm:hover { background: rgba(220,38,38,0.06); }

.acc-live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: rgba(22,163,74,0.1);
  color: var(--green); font-size: 12px; font-weight: 600;
}
.acc-live-pill b { font-weight: 700; }

/* Current-item group */
.acc-ci-group {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto; min-width: 0;
}
.acc-ci-uplabel {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--light); white-space: nowrap;
}
.acc-ci-wrap { flex: 1 1 auto; min-width: 240px; }
.acc-kbd-hint { font-size: 11px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.acc-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font: 600 10px/1 var(--font-mono);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface);
  color: var(--muted);
}
.acc-kbd--hint { margin-left: auto; border-color: var(--border-light, #f0eeea); color: var(--light); }
.acc-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--surface-alt); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer;
}
.acc-toggle:hover { border-color: var(--border-hover, #d4d2cd); }
.acc-toggle.is-on {
  background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.4); color: var(--green);
}
.acc-toggle-state { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.acc-divider { width: 1px; height: 24px; background: var(--border); }
.acc-conn { display: inline-flex; align-items: center; gap: 6px; }
.acc-conn-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(22,163,74,0.5); animation: accPulse 2s infinite;
}
.acc-conn--degraded .acc-conn-dot { background: var(--amber); animation: none; }
.acc-conn--offline  .acc-conn-dot { background: var(--red);   animation: none; }

/* ──────── Current auction item picker trigger (compact inline) ──────── */
.acc-ci-trigger {
  position: relative; width: 100%; text-align: left;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px); cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.acc-ci-trigger:hover { border-color: var(--border-hover, #d4d2cd); }
.acc-ci-trigger.is-warn { background: rgba(217,119,6,0.04); border-color: rgba(217,119,6,0.35); }
.acc-ci-trigger.is-oos  { background: rgba(220,38,38,0.05); border-color: rgba(220,38,38,0.4); }
/* Empty state — strong call to action. Amber tint, dashed border, pulsing
   halo. Clearly signals "this must be set" rather than "optional chrome". */
.acc-ci-trigger.is-empty {
  background: #fffbeb; /* amber tint bg */
  border: 2px dashed var(--amber);
  padding: 10px 14px;
  animation: acc-ci-empty-pulse 2.2s ease-in-out infinite;
}
.acc-ci-trigger.is-empty:hover {
  background: #fef3c7;
  border-color: var(--amber);
}
@keyframes acc-ci-empty-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
}
.acc-ci-main {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; min-height: 18px;
}
.acc-ci-product {
  font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.2;
  max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-ci-stock {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  color: var(--green); margin-left: auto;
}
.acc-ci-trigger.is-warn .acc-ci-stock { color: var(--amber); }
.acc-ci-trigger.is-oos  .acc-ci-stock { color: var(--red); }
.acc-ci-sub { font-size: 12px; font-weight: 700; letter-spacing: -0.1px; }
.acc-ci-chev { position: absolute; top: 12px; right: 10px; color: var(--muted); }
.acc-ci-empty {
  display: flex; align-items: center; gap: 10px;
}
.acc-ci-empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--amber); color: #fff; flex: 0 0 auto;
}
.acc-ci-empty-text { display: flex; flex-direction: column; gap: 1px; }
.acc-ci-empty-title {
  font-size: 14px; font-weight: 700; color: #92400e;
  letter-spacing: -0.1px;
}
.acc-ci-empty-sub {
  font-size: 11px; color: #78350f; opacity: 0.85;
}
.acc-ci-empty-sub .acc-kbd,
.acc-ci-empty-manual .acc-kbd {
  background: #fff; border: 1px solid #fde68a; color: #92400e;
  font-size: 10px; padding: 0 5px; border-radius: 3px; font-weight: 700;
  font-family: var(--font-mono);
}

/* Barcode scan input — primary empty-state CTA. Auto-focused so a handheld
   scanner can drive the next-item handoff without mouse/keyboard. */
.acc-ci-scan-input {
  width: 100%;
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
}
.acc-ci-scan-input::placeholder {
  color: #a8a29e;
  font-family: var(--font-sans, inherit);
  letter-spacing: 0;
}
.acc-ci-scan-input:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}

.acc-ci-empty-error {
  font-size: 11px;
  min-height: 14px;
  color: var(--red);
  margin-top: 4px;
}
.acc-ci-empty-error:empty { min-height: 0; margin-top: 0; }

.acc-ci-empty-manual {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309; /* amber-700 — readable on the amber-tinted empty-state bg */
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-start;
}
.acc-ci-empty-manual:hover { color: #78350f; }

/* ──────── Live pill + timer ──────── */
.acc-live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(22,163,74,0.1); color: var(--green); font-size: 11px; font-weight: 700;
}
.acc-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(22,163,74,0.5); animation: accPulse 1.6s infinite;
}

/* ──────── Variant chips ──────── */
.acc-variant-chip {
  display: inline-flex; align-items: center; padding: 3px 9px;
  font-size: 11px; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px;
}
.acc-variant-chip--sm { padding: 2px 7px; font-size: 10px; }

.acc-sku-chip {
  display: inline-block; padding: 2px 6px; font-size: 11px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 4px;
}

/* ──────── Live Orders card (single pane) ──────── */
.acc-table-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.acc-table-header-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.acc-pane-actions { display: flex; gap: 6px; }

.acc-table-pane { display: flex; flex-direction: column; margin: 14px 0; max-height: 75vh; }
.acc-table-wrap { overflow: auto; flex: 1 1 auto; position: relative; }
/* The shared `.data-table.sticky-header` rule hard-codes top: 49px (page-level).
   Our scroll container is `.acc-table-wrap`, so sticky needs to be pinned to 0. */
.acc-table-pane .data-table.sticky-header thead th {
  top: 0;
  background: var(--surface-alt);
  z-index: 2;
}
.acc-table-row { cursor: pointer; }

/* Newly-arrived rows hold a sustained tint + solid green left bar for 8s,
   then fade out over 2s. Styles land on the <td>s, not the <tr>: the table
   uses border-collapse: collapse, which causes box-shadow on <tr> to silently
   not render and <tr> backgrounds to be covered by TDs in some browsers. */
.acc-table-row.is-new > td {
  background-color: rgba(22,163,74, 0.14);
  transition: background-color 1s ease-out, box-shadow 1s ease-out;
}
.acc-table-row.is-new > td:first-child {
  box-shadow: inset 4px 0 0 var(--green);
}
.acc-table-row.is-new.is-fading > td {
  background-color: transparent;
}
.acc-table-row.is-new.is-fading > td:first-child {
  box-shadow: inset 4px 0 0 transparent;
}

/* Pulsing NEW badge — placed in the Order column for newly-arrived rows. */
.acc-new-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  animation: accNewPulse 1.1s ease-in-out infinite;
}
@keyframes accNewPulse {
  0%, 100% { transform: scale(1);    opacity: 1;    box-shadow: 0 0 0 0 rgba(22,163,74, 0.5); }
  50%      { transform: scale(1.12); opacity: 0.92; box-shadow: 0 0 0 5px rgba(22,163,74, 0); }
}
.acc-row-variants { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.acc-row-actions { white-space: nowrap; }

/* ──────── Live Orders table v2 — stacked cells ──────── */
.acc-table--v2 tbody td { padding: 14px 12px; vertical-align: middle; }

.acc-order-stack { display: flex; flex-direction: column; gap: 3px; }
.acc-order-num { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.acc-order-sub { font-size: 11px; color: var(--muted); }

.acc-cust-stack { display: flex; flex-direction: column; gap: 3px; }
.acc-cust-name { font-size: 13px; font-weight: 600; color: #4a4a4a; line-height: 1.2; }
.acc-cust-sub  { font-size: 11px; color: var(--muted); }

.acc-item-stack { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.acc-item-name {
  font-size: 13px; font-weight: 600; color: #4a4a4a; line-height: 1.25;
  max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-item-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px;
}
.acc-item-line .acc-c-accent { font-weight: 700; letter-spacing: -0.1px; }
.acc-item-qty { margin-left: auto; }

.acc-paid-cell {
  font-size: 15px; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap;
}

.acc-label-cell {
  display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start;
}
.acc-label-sub { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }

/* Empty-state button in the Auction Item cell (opens Reassign modal). */
.acc-item-assign-btn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 10px; margin: -6px -10px;
  background: transparent; border: 1px dashed var(--border);
  border-radius: 6px; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.acc-item-assign-btn:hover {
  background: var(--surface-alt);
  border-color: var(--accent, #e54d2e);
}
.acc-item-assign-btn:hover .acc-item-assign-hint {
  color: var(--accent, #e54d2e);
}
.acc-item-assign-hint {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}

/* ──────── Status pills ──────── */
.acc-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.acc-status--printed { background: rgba(22,163,74,0.1); color: var(--green); }
.acc-status--queued  { background: var(--surface-alt); color: var(--muted); }
.acc-status--failed  { background: rgba(220,38,38,0.1); color: var(--red); }
.acc-status--printing {
  background: rgba(217,119,6,0.1); color: var(--amber);
}

/* ──────── Unmatched panel ──────── */
.acc-unmatched { margin: 14px 0; }
.acc-unmatched-header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; text-align: left;
  background: transparent; border: none; cursor: pointer;
}
.acc-unmatched-header:hover { background: var(--surface-alt); }
.acc-unmatched-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.acc-unmatched-count { font-size: 11px; }
.acc-unmatched-chev { color: var(--muted); transition: transform 0.15s; }
.acc-unmatched[data-open="true"] .acc-unmatched-chev { transform: rotate(180deg); }
.acc-unmatched-body { padding: 0 14px 14px; }

/* ──────── Modals ──────── */
.acc-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: accFade 0.15s ease-out;
}
/* `display: flex` above overrides the default `[hidden] { display: none }`. Restore it. */
.acc-modal-backdrop[hidden] { display: none !important; }
.acc-modal {
  background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; animation: accModalIn 0.2s ease-out;
}
.acc-modal-sm { width: 460px; }
.acc-modal-md { width: 540px; }
.acc-modal-lg { width: 760px; }
.acc-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.acc-modal-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.acc-modal-body { padding: 20px; overflow-y: auto; flex: 1; font-size: 13px; line-height: 1.5; }
.acc-modal-body p { margin: 0 0 10px; }
.acc-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 16px 20px; border-top: 1px solid var(--border);
}
@keyframes accFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes accModalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ──────── Auto-print help modal body ──────── */
.acc-help-body h4.acc-help-h {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.acc-help-body h4.acc-help-h:first-child { margin-top: 8px; }
.acc-help-list { margin: 0 0 12px 18px; padding: 0; }
.acc-help-list li { margin: 4px 0; }
.acc-help-body code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.acc-help-code-block { margin: 8px 0 14px; }
.acc-help-code-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.acc-help-code {
  background: #1e1e1e;
  color: #f5f5f5;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.acc-help-warn {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid var(--amber);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #92400e;
  margin: 6px 0 12px;
}

/* ──────── Picker popover ──────── */
.acc-picker-popover {
  position: absolute; z-index: 150; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  width: 520px; max-height: 540px; display: flex; flex-direction: column;
}
.acc-picker-top {
  padding: 12px 12px 8px; border-bottom: 1px solid var(--border-light, #f0eeea);
  display: flex; flex-direction: column; gap: 8px;
}
.acc-picker-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.acc-picker-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface-alt);
  font-size: 11px; color: var(--muted); cursor: pointer;
}
.acc-picker-back:hover { border-color: var(--border-hover, #d4d2cd); color: var(--ink); }
.acc-picker-crumb-title { font-size: 12px; font-weight: 600; color: var(--ink); }
.acc-picker-section {
  padding: 8px 12px 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--light);
}

.acc-product-row { cursor: pointer; }
.acc-product-row-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.acc-sku-row-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.acc-product-row-arrow { color: var(--muted); display: flex; align-items: center; }
.acc-product-row:hover .acc-product-row-arrow { color: var(--accent, #e54d2e); }

.acc-sku-row.is-focused { background: var(--surface-alt); border-color: var(--border); }
.acc-search-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-alt);
}
.acc-search-input input {
  flex: 1; border: none; background: transparent; outline: none; font-size: 13px; color: var(--ink);
}
.acc-search-icon { color: var(--muted); }
.acc-sku-results {
  margin-top: 10px; overflow-y: auto; max-height: 320px;
  display: flex; flex-direction: column; gap: 4px;
}
.acc-sku-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: center;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; background: transparent;
  border: 1px solid transparent;
}
.acc-sku-row-stock {
  align-self: center; white-space: nowrap;
}
.acc-sku-row:hover { background: var(--surface-alt); border-color: var(--border); }
.acc-sku-row-sku { font-size: 13px; font-weight: 600; }
.acc-sku-row-name { font-size: 12px; color: var(--muted); }
.acc-sku-row-stock {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.acc-sku-row-stock.ok { background: rgba(22,163,74,0.1); color: var(--green); }
.acc-sku-row-stock.low { background: rgba(217,119,6,0.1); color: var(--amber); }
.acc-sku-row-stock.oos { background: rgba(220,38,38,0.1); color: var(--red); }

/* ──────── Row menu (3-dot dropdown on cards + rows) ──────── */
.acc-row-menu-wrap { position: relative; display: inline-block; }
.acc-row-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;
  min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-dropdown, 0 8px 30px rgba(0,0,0,0.12));
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
/* `display: flex` above overrides the default `[hidden] { display: none }`. Restore it. */
.acc-row-menu[hidden] { display: none !important; }
.acc-row-menu--right { right: 0; left: auto; }
.acc-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: transparent; border: none; text-align: left;
  font-size: 12px; color: var(--ink); cursor: pointer; border-radius: 6px; width: 100%;
}
.acc-menu-item:hover { background: var(--surface-alt); }
.acc-menu-item .acc-menu-hint { margin-left: auto; font: 600 10px var(--font-mono); color: var(--light); }
.acc-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ──────── All Orders toolbar (search + filter segment) ──────── */
.acc-table-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.acc-search-input--inline { flex: 1 1 auto; max-width: 420px; padding: 6px 10px; }
.acc-filter-seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-alt); padding: 2px;
}
.acc-filter-seg-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  background: transparent; color: var(--muted); border: none; border-radius: 6px; cursor: pointer;
}
.acc-filter-seg-btn.is-active {
  background: var(--surface); color: var(--accent, #e54d2e);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ──────── Accent color utility (matches mockup SKU red) ──────── */
.acc-c-accent { color: var(--accent, #e54d2e); font-weight: 700; }

/* ──────── Order detail drawer (extends .drawer-*) ──────── */
.acc-order-drawer { width: 480px; }

/* ──────── Settings drawer ──────── */
.acc-settings-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 190;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.acc-settings-backdrop.is-open { opacity: 1; pointer-events: auto; }
.acc-settings-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -8px 0 28px rgba(0,0,0,0.08); z-index: 200;
  transform: translateX(100%); transition: transform 0.2s ease-out;
  display: flex; flex-direction: column;
}
.acc-settings-drawer.is-open { transform: translateX(0); }
.acc-settings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
}
.acc-settings-body { padding: 8px 20px 20px; flex: 1; overflow-y: auto; }
.acc-settings-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
}
.acc-settings-footer .skv-text-caption { margin-right: auto; }
.acc-settings-group {
  padding: 16px 0; border-bottom: 1px solid var(--border-light, #f0eeea);
}
.acc-settings-group:last-child { border-bottom: none; }
.acc-settings-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--light); margin-bottom: 10px;
}
.acc-settings-field { margin-bottom: 16px; }
.acc-settings-field:last-child { margin-bottom: 0; }
.acc-settings-field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.acc-settings-field .skv-text-muted-sm { margin-top: 4px; display: block; }
.acc-radio-group { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.acc-radio-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border-radius: 6px; border: 1px solid transparent;
}
.acc-radio-row:hover { background: var(--surface-alt); }
.acc-radio-row.is-active { background: rgba(234,88,12,0.04); border-color: rgba(234,88,12,0.2); }
.acc-radio-row input[type="radio"] { accent-color: var(--accent); }

/* ──────── Broadcast History page ──────── */
.acc-history-page { padding-top: 16px; padding-bottom: 60px; }
.acc-history-table-wrap { overflow-x: auto; }
.acc-history-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.acc-history-filters select {
  padding: 6px 10px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.acc-active-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(22,163,74,0.1); color: var(--green);
  font-size: 11px; font-weight: 700;
}
.acc-active-pill .acc-live-dot { width: 6px; height: 6px; }

.acc-history-name-link {
  display: block; padding: 2px 0;
  color: var(--ink); text-decoration: none;
  transition: color 0.15s;
}
.acc-history-name-link:hover { color: var(--accent, #e54d2e); }
.acc-history-name-title {
  font-size: 13px; font-weight: 600; line-height: 1.2;
}
.acc-history-name-link:hover .acc-history-name-title { text-decoration: underline; }
.acc-history-name-sub {
  font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px;
}

/* ──────── Retrospective page ──────── */
.acc-retro-page { padding-top: 20px; padding-bottom: 60px; }
.acc-retro-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.acc-retro-title { font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
.acc-retro-sub { font-size: 12px; color: var(--muted); }
.acc-retro-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-light, #f0eeea); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 18px;
}
.acc-retro-kpis .dash-kpi-card { border: none; border-radius: 0; }
.acc-retro-orders-preview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.acc-retro-orders-preview h3 {
  font-size: 13px; font-weight: 700; margin: 0 0 10px;
}

/* ──────── Print label ──────── */
.acc-label-outer { display: flex; justify-content: center; padding: 24px 12px; }
.acc-label {
  background: #fff; color: #000; font-family: system-ui, -apple-system, 'DM Sans', sans-serif;
  border: 1px solid #bbb; padding: 0.2in; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  /* border-box so width/height include padding — otherwise 4×6 + 0.2in padding = 4.4×6.4in and overflows a 4×6 page. */
  box-sizing: border-box;
}
.acc-label--4x6 { width: 4in; height: 6in; }
/* Letter — let content flow naturally; forcing min-height caused overflow onto a second blank page. */
.acc-label--letter { width: 7in; padding: 0.6in; }
.acc-lbl-order { font-size: 40pt; font-weight: 900; line-height: 1; margin: 0 0 6pt; letter-spacing: -0.5pt; }
.acc-lbl-shop { font-size: 9pt; color: #555; margin-bottom: 6pt; }
.acc-lbl-shop:has(+ .acc-lbl-buyer) { margin-bottom: 2pt; }
.acc-lbl-buyer { font-size: 12pt; font-weight: 700; color: #111; margin-bottom: 6pt; }
.acc-lbl-cust { font-size: 15pt; font-weight: 700; margin-bottom: 2pt; }
.acc-lbl-loc { font-size: 12pt; margin-bottom: 2pt; color: #333; }
.acc-lbl-time { font-size: 10pt; color: #555; margin-bottom: 10pt; }
.acc-lbl-box {
  border: 2px solid #000; padding: 10pt; margin-top: 8pt;
}
.acc-lbl-sku { font-size: 18pt; font-weight: 800; letter-spacing: -0.3pt; }
.acc-lbl-pname { font-size: 13pt; margin-top: 2pt; }
.acc-lbl-vars { font-size: 11pt; color: #333; margin-top: 2pt; }
.acc-lbl-qp { display: flex; justify-content: space-between; margin-top: 8pt; font-size: 11pt; }
.acc-lbl-barcode { margin-top: 10pt; text-align: center; }
.acc-lbl-barcode svg { width: 100%; max-width: 3in; height: 0.6in; display: block; margin: 0 auto; }
.acc-lbl-barcode-text { font-size: 8pt; letter-spacing: 0.5pt; margin-top: 2pt; color: #333; }
.acc-label--letter .acc-lbl-barcode svg { max-width: 3.5in; height: 0.7in; }
.acc-lbl-foot { font-size: 8pt; color: #666; text-align: center; margin-top: 10pt; }

@media print {
  /* @page size + margin is emitted per-request by the print layout —
     CSS doesn't allow @page rules scoped to a body class. */
  body { margin: 0; }
  .acc-label { border: none; box-shadow: none; }
  .acc-label-outer { padding: 0; }
}
