/* =============================================================
   CoreIQ POS — Component styles
   ============================================================= */

/* -------------------------------------------------------------
   App shell
   ------------------------------------------------------------- */
.ds-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ds-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(8px);
}
.ds-topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.ds-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: var(--fw-title);
  font-size: var(--fs-16);
  letter-spacing: var(--tracking-snug);
}
.ds-brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--navy-900);
  color: var(--teal-400);
  display: grid; place-items: center;
  font-weight: var(--fw-title);
  letter-spacing: -0.04em;
  font-size: 15px;
}
[data-theme="dark"] .ds-brand-mark {
  background: var(--teal-500);
  color: var(--navy-950);
}
.ds-brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.ds-brand-meta small {
  font-size: var(--fs-11);
  color: var(--text-subtle);
  font-weight: var(--fw-body);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.ds-tabs {
  margin-left: auto;
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.ds-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: var(--fw-label);
  font-size: var(--fs-14);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.ds-tab:hover { color: var(--text); }
.ds-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.ds-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font: inherit;
  font-size: var(--fs-13);
  font-weight: var(--fw-label);
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.ds-theme-toggle:hover { background: var(--bg-subtle); }

/* -------------------------------------------------------------
   Page + section structure
   ------------------------------------------------------------- */
.ds-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-8) var(--space-24);
  width: 100%;
}

.ds-page-header { margin-bottom: var(--space-12); }
.ds-page-eyebrow {
  font-size: var(--fs-12);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 var(--space-3);
}
.ds-page-title {
  font-size: var(--fs-48);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  color: var(--text);
}
.ds-page-lede {
  font-size: var(--fs-18);
  line-height: var(--lh-snug);
  color: var(--text-muted);
  max-width: 64ch;
  margin: 0;
}

.ds-section {
  margin-top: var(--space-16);
  padding-top: var(--space-12);
  border-top: 1px solid var(--border);
}
.ds-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.ds-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.ds-section-title {
  font-size: var(--fs-30);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-snug);
  margin: 0;
  color: var(--text);
}
.ds-section-meta {
  font-size: var(--fs-13);
  color: var(--text-subtle);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.ds-subsection-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-snug);
  margin: 0 0 var(--space-4);
  color: var(--text);
}
.ds-subsection-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
  margin: 0 0 var(--space-6);
}

/* Grid helpers */
.ds-grid { display: grid; gap: var(--space-6); }
.ds-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ds-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ds-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ds-grid-6 { grid-template-columns: repeat(6, 1fr); }
.ds-grid-12 { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 900px) {
  .ds-grid-3, .ds-grid-4, .ds-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* Demo card — frames every example */
.ds-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.ds-demo-body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.ds-demo-stage {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: var(--space-10);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  min-height: 160px;
}
.ds-demo-stage--start { justify-content: flex-start; }
.ds-demo-stage--pad-lg { padding: var(--space-16) var(--space-10); }
.ds-demo-stage--column { flex-direction: column; align-items: stretch; }

.ds-demo-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: var(--fs-12);
  color: var(--text-subtle);
  letter-spacing: var(--tracking-wide);
}
.ds-demo-caption code {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* -------------------------------------------------------------
   TYPOGRAPHY showcase
   ------------------------------------------------------------- */
.type-row {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  gap: var(--space-6);
  align-items: baseline;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.type-row:last-child { border-bottom: none; }
.type-row-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-subtle);
}
.type-row-meta strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: var(--fw-label);
  font-size: var(--fs-13);
  color: var(--text);
  letter-spacing: var(--tracking-snug);
}
.type-row-sample { color: var(--text); }
.type-row-spec {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-subtle);
  text-align: right;
}

.type-h-display { font-size: var(--fs-60); font-weight: var(--fw-title); letter-spacing: -0.025em; line-height: 1.05; }
.type-h-1       { font-size: var(--fs-48); font-weight: var(--fw-title); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.type-h-2       { font-size: var(--fs-36); font-weight: var(--fw-title); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.type-h-3       { font-size: var(--fs-30); font-weight: var(--fw-title); letter-spacing: var(--tracking-snug); line-height: var(--lh-snug); }
.type-h-4       { font-size: var(--fs-24); font-weight: var(--fw-title); letter-spacing: var(--tracking-snug); line-height: var(--lh-snug); }
.type-h-5       { font-size: var(--fs-20); font-weight: var(--fw-title); letter-spacing: var(--tracking-snug); line-height: var(--lh-snug); }
.type-body-lg   { font-size: var(--fs-18); font-weight: var(--fw-body); line-height: var(--lh-normal); }
.type-body      { font-size: var(--fs-15); font-weight: var(--fw-body); line-height: var(--lh-normal); }
.type-body-sm   { font-size: var(--fs-13); font-weight: var(--fw-body); line-height: var(--lh-snug); }
.type-label     { font-size: var(--fs-13); font-weight: var(--fw-label); letter-spacing: var(--tracking-snug); }
.type-caption   { font-size: var(--fs-12); font-weight: var(--fw-body); color: var(--text-muted); }
.type-overline  { font-size: var(--fs-12); font-weight: var(--fw-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted); }
.type-num-total { font-size: var(--fs-36); font-weight: var(--fw-title); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums lining-nums; }
.type-num-price { font-size: var(--fs-18); font-weight: var(--fw-label); font-variant-numeric: tabular-nums lining-nums; }

/* Numerals proof block */
.type-numerals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.type-num-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.type-num-card-label {
  font-size: var(--fs-12);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: var(--fw-label);
  margin-bottom: var(--space-3);
}
.type-num-card-stack {
  display: grid;
  gap: var(--space-2);
  font-size: var(--fs-18);
  font-weight: var(--fw-label);
}
.type-num-card-stack span { color: var(--text); }
.type-num-card-stack.tabular span {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum","lnum";
}

/* -------------------------------------------------------------
   COLOR showcase
   ------------------------------------------------------------- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.swatch {
  position: relative;
  aspect-ratio: 1 / 1.15;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: var(--fs-11);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.swatch-name {
  font-family: var(--font-sans);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-snug);
  font-size: var(--fs-12);
}
.swatch-hex { opacity: 0.85; }

.ramp-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  align-items: center;
}
.ramp-row-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ramp-row-label-name {
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-snug);
  font-size: var(--fs-14);
}
.ramp-row-label-meta {
  font-size: var(--fs-12);
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

/* Semantic palettes */
.sem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .sem-grid { grid-template-columns: repeat(2, 1fr); }
}
.sem-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.sem-card-swatch {
  height: 88px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--space-4);
  color: #fff;
  font-weight: var(--fw-label);
  font-size: var(--fs-13);
  letter-spacing: var(--tracking-snug);
}
.sem-card-swatch--paid  { background: var(--paid); }
.sem-card-swatch--void  { background: var(--void); }
.sem-card-swatch--hold  { background: var(--hold); }
.sem-card-swatch--sched { background: var(--sched); }
.sem-card-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sem-card-name {
  font-weight: var(--fw-title);
  font-size: var(--fs-15);
}
.sem-card-meaning {
  font-size: var(--fs-13);
  color: var(--text-muted);
}
.sem-card-token {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* -------------------------------------------------------------
   SPACING showcase
   ------------------------------------------------------------- */
.scale-grid {
  display: grid;
  grid-template-columns: 80px 80px 1fr;
  gap: var(--space-3);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
}
.scale-grid-header {
  font-family: var(--font-sans);
  font-weight: var(--fw-label);
  font-size: var(--fs-12);
  color: var(--text-subtle);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.scale-row { padding: 6px 0; }
.scale-bar {
  height: 10px;
  background: var(--brand);
  border-radius: 2px;
}

.radii-row {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  align-items: flex-end;
}
.radii-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.radii-shape {
  width: 80px;
  height: 80px;
  background: var(--brand-bg-strong);
  border: 1px solid var(--brand-border);
}
.radii-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-subtle);
  text-align: center;
}
.radii-meta strong {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: var(--fw-label);
  color: var(--text);
}

.shadow-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
}
@media (max-width: 900px) {
  .shadow-row { grid-template-columns: repeat(2, 1fr); }
}
.shadow-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.shadow-block {
  width: 100%;
  height: 100px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.shadow-block--xs { box-shadow: var(--shadow-xs); }
.shadow-block--sm { box-shadow: var(--shadow-sm); }
.shadow-block--md { box-shadow: var(--shadow-md); }
.shadow-block--lg { box-shadow: var(--shadow-lg); }
.shadow-block--xl { box-shadow: var(--shadow-xl); }

/* -------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------- */
.btn {
  --btn-pad-x: 20px;
  --btn-pad-y: 12px;
  --btn-h: var(--touch);
  --btn-fs: var(--fs-14);

  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-weight: var(--fw-label);
  font-size: var(--btn-fs);
  letter-spacing: var(--tracking-snug);
  padding: 0 var(--btn-pad-x);
  height: var(--btn-h);
  min-width: var(--btn-h);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn--primary:active:not(:disabled) { background: var(--brand-active); }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--text-subtle);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) { background: var(--bg-subtle); }

.btn--destructive {
  background: var(--void);
  color: var(--void-fg);
  box-shadow: var(--shadow-sm);
}
.btn--destructive:hover:not(:disabled) { background: var(--rose-800); }

.btn--sm {
  --btn-h: 36px;
  --btn-pad-x: 14px;
  --btn-fs: var(--fs-13);
}
.btn--lg {
  --btn-h: var(--touch-lg);
  --btn-pad-x: 24px;
  --btn-fs: var(--fs-16);
}
.btn--icon {
  --btn-pad-x: 0;
  width: var(--btn-h);
}
.btn--block { width: 100%; }

/* Icon inside button */
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--lg svg { width: 18px; height: 18px; }
.btn--sm svg { width: 14px; height: 14px; }

/* -------------------------------------------------------------
   FORM INPUTS
   ------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: var(--fs-13);
  font-weight: var(--fw-label);
  color: var(--text);
  letter-spacing: var(--tracking-snug);
}
.field-help {
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.field-error {
  font-size: var(--fs-12);
  color: var(--void-text);
  font-weight: var(--fw-label);
}
.field-required { color: var(--void); margin-left: 2px; }

.input {
  height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-15);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
  width: 100%;
}
.input::placeholder { color: var(--text-subtle); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--text-subtle); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input:disabled { background: var(--bg-muted); color: var(--text-subtle); cursor: not-allowed; }
.input--error { border-color: var(--void); }
.input--error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22); border-color: var(--void); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input { padding-left: 42px; }
.input-wrap-icon {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}
.input-wrap-suffix {
  position: absolute;
  right: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* Numeric stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  height: var(--touch);
  overflow: hidden;
}
.stepper-btn {
  width: var(--touch);
  height: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-18);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stepper-btn:hover { background: var(--bg-subtle); }
.stepper-val {
  min-width: 64px;
  text-align: center;
  font-weight: var(--fw-label);
  font-size: var(--fs-16);
  font-variant-numeric: tabular-nums lining-nums;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 100%;
  display: grid;
  place-items: center;
}

/* Select — restyled native */
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* Barcode input — extra-large, monospace numerals */
.barcode-input {
  height: var(--touch-lg);
  padding: 0 18px 0 52px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-18);
  letter-spacing: 0.08em;
  width: 100%;
  color: var(--text);
}
.barcode-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.barcode-wrap { position: relative; }
.barcode-wrap-icon {
  position: absolute;
  left: 18px;
  top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px;
  color: var(--brand);
}

/* Checkbox / radio (custom) */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-14);
  user-select: none;
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  display: grid; place-items: center;
  color: transparent;
  transition: all var(--dur-fast) var(--ease-out);
}
.checkbox input:checked + .checkbox-box {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.checkbox input:focus-visible + .checkbox-box { box-shadow: var(--ring); }

/* Toggle */
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 40px; height: 22px;
  border-radius: var(--radius-full);
  background: var(--stone-300);
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
[data-theme="dark"] .toggle-track { background: var(--stone-700); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out);
}
.toggle input:checked + .toggle-track { background: var(--brand); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }

/* -------------------------------------------------------------
   BADGES / PILLS / STATUS
   ------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-12);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-snug);
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}
.badge--neutral { background: var(--bg-muted); color: var(--text-muted); border-color: var(--border); }
.badge--brand   { background: var(--brand-bg); color: var(--brand); border-color: var(--brand-border); }
.badge--paid    { background: var(--paid-bg); color: var(--paid-text); border-color: var(--paid-border); }
.badge--void    { background: var(--void-bg); color: var(--void-text); border-color: var(--void-border); }
.badge--hold    { background: var(--hold-bg); color: var(--hold-text); border-color: var(--hold-border); }
.badge--sched   { background: var(--sched-bg); color: var(--sched-text); border-color: var(--sched-border); }

.badge--solid.badge--paid  { background: var(--paid); color: var(--paid-fg); border-color: transparent; }
.badge--solid.badge--void  { background: var(--void); color: var(--void-fg); border-color: transparent; }
.badge--solid.badge--hold  { background: var(--hold); color: var(--hold-fg); border-color: transparent; }
.badge--solid.badge--sched { background: var(--sched); color: var(--sched-fg); border-color: transparent; }
.badge--solid.badge--brand { background: var(--brand); color: var(--brand-fg); border-color: transparent; }

.badge-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  flex-shrink: 0;
}

/* Schedule badges — AU drug scheduling.
   Schedule and workflow state live on DIFFERENT visual channels:
   "what schedule it is" (S2/S3/S4/S8) must not collide with
   "what state it's in" (paid/hold/void). So S2/S3/S4 are the SAME
   neutral outlined chip — the S-number does the talking. Only S8
   escalates colour, onto the locked --sched (violet) role, because
   it is the one schedule with materially different legal handling
   (controlled-drug register, witnessing, separate safe). */
.sched-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-md);
  font-size: var(--fs-12);
  font-weight: var(--fw-label);
  line-height: 1;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sched-badge-label {
  font-family: var(--font-mono);
  font-weight: var(--fw-title);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
}
.sched-badge-label span { color: inherit; }

/* S2 · S3 · S4 — identical neutral chips. Differentiated by the
   S-number glyph itself, not by colour. */
.sched-badge--s2,
.sched-badge--s3,
.sched-badge--s4 { /* inherits base */ }

/* S8 — the only schedule with a colour escalation. Uses --sched
   (violet), the locked semantic role for scheduling/controlled-drug. */
.sched-badge--s8 {
  background: var(--sched-bg);
  color: var(--sched-text);
  border-color: var(--sched-border);
}
.sched-badge--s8 .sched-badge-label {
  background: var(--sched);
  border-color: transparent;
  color: var(--sched-fg);
}

/* PBS / private price pill */
.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-label);
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  border: 1px solid;
}
.price-pill--pbs     { background: var(--brand-bg); color: var(--brand); border-color: var(--brand-border); }
.price-pill--private { background: var(--bg-muted); color: var(--text-muted); border-color: var(--border); }
.price-pill--safetynet { background: var(--paid-bg); color: var(--paid-text); border-color: var(--paid-border); }

/* -------------------------------------------------------------
   CARDS & CONTAINERS
   ------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.card--raised { box-shadow: var(--shadow-md); }
.card--flat { box-shadow: none; }
.card-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}
.card-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   TABLE / DATA GRID
   ------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.dtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
}
.dtable thead th {
  text-align: left;
  font-weight: var(--fw-label);
  font-size: var(--fs-11);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.dtable tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: middle;
}
.dtable tbody tr:last-child td { border-bottom: none; }
.dtable tbody tr:hover { background: var(--bg-subtle); }
.dtable td.num, .dtable th.num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}
.dtable .row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dtable .row-meta strong {
  font-weight: var(--fw-label);
}
.dtable .row-meta small {
  font-size: var(--fs-12);
  color: var(--text-subtle);
}

/* -------------------------------------------------------------
   NAVIGATION
   ------------------------------------------------------------- */
.sidebar {
  background: var(--structure-bg);
  color: var(--structure-fg);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 420px;
  width: 260px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-3) var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--structure-border);
  margin-bottom: var(--space-4);
  color: var(--structure-fg);
}
.sidebar-brand-mark {
  width: 32px; height: 32px;
  background: var(--teal-500);
  color: var(--navy-950);
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: var(--fw-title);
  font-size: 15px;
  letter-spacing: -0.04em;
}
.sidebar-brand-name {
  font-weight: var(--fw-title);
  font-size: var(--fs-15);
  letter-spacing: var(--tracking-snug);
}
.sidebar-brand-tag {
  display: block;
  font-size: var(--fs-11);
  color: var(--structure-fg-muted);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  font-weight: var(--fw-body);
}
.sidebar-section {
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--structure-fg-muted);
  font-weight: var(--fw-label);
  padding: var(--space-4) var(--space-3) var(--space-2);
}
.sidenav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--structure-fg);
  font-size: var(--fs-14);
  font-weight: var(--fw-label);
  text-decoration: none;
  cursor: pointer;
}
.sidenav-item:hover { background: rgba(255, 255, 255, 0.06); }
.sidenav-item--active {
  background: var(--teal-700);
  color: #fff;
}
.sidenav-item--active:hover { background: var(--teal-700); }
.sidenav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidenav-badge {
  margin-left: auto;
  font-size: var(--fs-11);
  font-weight: var(--fw-label);
  background: rgba(255, 255, 255, 0.12);
  color: var(--structure-fg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}
.sidenav-item--active .sidenav-badge {
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}

/* Tabs (in-component) */
.tabset {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: var(--space-2);
}
.tabset-item {
  appearance: none;
  background: transparent;
  border: none;
  padding: 12px 16px;
  font: inherit;
  font-size: var(--fs-14);
  font-weight: var(--fw-label);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tabset-item:hover { color: var(--text); }
.tabset-item[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--brand);
}

/* Breadcrumb */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-13);
  color: var(--text-muted);
}
.crumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.crumb a:hover { color: var(--text); }
.crumb-sep {
  color: var(--border-strong);
  font-size: 11px;
}
.crumb-current {
  color: var(--text);
  font-weight: var(--fw-label);
}

/* -------------------------------------------------------------
   MODAL / DRAWER
   ------------------------------------------------------------- */
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.modal-header {
  padding: var(--space-6) var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}
.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.modal-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
  color: var(--text-muted);
}
.modal-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 380px;
  max-height: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-body {
  flex: 1;
  overflow: auto;
  padding: var(--space-5);
  font-size: var(--fs-14);
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   TOAST
   ------------------------------------------------------------- */
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
}
.toast-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--brand);
}
.toast-body { flex: 1; }
.toast-title {
  font-size: var(--fs-14);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-snug);
  margin: 0 0 2px;
  color: var(--text);
}
.toast-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
  margin: 0;
}
.toast-action {
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  font-size: var(--fs-13);
  font-weight: var(--fw-label);
  color: var(--brand);
  cursor: pointer;
  padding: 0 6px;
}
.toast-dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-subtle);
  width: 24px; height: 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast-dismiss:hover { background: var(--bg-subtle); color: var(--text); }

.toast--paid  { border-left-color: var(--paid); }
.toast--paid .toast-icon { color: var(--paid); }
.toast--void  { border-left-color: var(--void); }
.toast--void .toast-icon { color: var(--void); }
.toast--hold  { border-left-color: var(--hold); }
.toast--hold .toast-icon { color: var(--hold); }
.toast--sched { border-left-color: var(--sched); }
.toast--sched .toast-icon { color: var(--sched); }

/* -------------------------------------------------------------
   EMPTY / LOADING
   ------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.empty-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  display: grid; place-items: center;
  color: var(--text-subtle);
}
.empty-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-title);
  margin: 0;
  color: var(--text);
}
.empty-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
  margin: 0;
  max-width: 36ch;
}

.skeleton {
  background: linear-gradient(90deg,
    var(--bg-muted) 0%,
    var(--bg-subtle) 50%,
    var(--bg-muted) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton 1.4s linear infinite;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 12px; }
.skeleton-line.lg { height: 18px; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------
   ICONS — sample grid
   ------------------------------------------------------------- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-3);
}
@media (max-width: 900px) {
  .icon-grid { grid-template-columns: repeat(4, 1fr); }
}
.icon-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.icon-cell svg { width: 22px; height: 22px; color: var(--text); }
.icon-cell-name {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-subtle);
  letter-spacing: 0;
}

/* -------------------------------------------------------------
   POS-SPECIFIC: line items, totals, payment tile, receipt
   ------------------------------------------------------------- */
.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}
.line:last-child { border-bottom: none; }
.line-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.line-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.line-title {
  font-weight: var(--fw-label);
  font-size: var(--fs-15);
  color: var(--text);
}
.line-meta {
  font-size: var(--fs-12);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.line-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.line-qty {
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--fs-14);
  font-weight: var(--fw-label);
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}
.line-price {
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--fs-15);
  font-weight: var(--fw-label);
  color: var(--text);
  min-width: 72px;
  text-align: right;
}
.line-price small {
  display: block;
  font-size: var(--fs-11);
  color: var(--text-subtle);
  font-weight: var(--fw-body);
  text-decoration: line-through;
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--space-5);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums lining-nums;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-14);
  color: var(--text-muted);
}
.totals-row strong { color: var(--text); font-weight: var(--fw-label); }
.totals-row--grand {
  font-size: var(--fs-20);
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.totals-row--grand .totals-amount {
  font-size: var(--fs-30);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-tight);
}

/* Payment tile */
.pay-tile {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: all var(--dur-fast) var(--ease-out);
}
.pay-tile:hover { border-color: var(--brand); background: var(--brand-bg); }
.pay-tile--active {
  border-color: var(--brand);
  background: var(--brand-bg);
  box-shadow: 0 0 0 1px var(--brand);
}
.pay-tile-icon { width: 22px; height: 22px; color: var(--brand); }
.pay-tile-name {
  font-weight: var(--fw-label);
  font-size: var(--fs-15);
  letter-spacing: var(--tracking-snug);
}

/* Receipt */
.receipt {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text);
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-variant-numeric: tabular-nums lining-nums;
}
.receipt-header { text-align: center; }
.receipt-header strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: var(--fw-title);
  font-size: var(--fs-14);
  letter-spacing: var(--tracking-snug);
  margin-bottom: 4px;
}
.receipt-header small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}
.receipt-divider {
  border-top: 1px dashed var(--border-strong);
  height: 0;
  margin: 0;
}
.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.receipt-line span:first-child {
  flex: 1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.receipt-line.grand {
  font-family: var(--font-sans);
  font-weight: var(--fw-title);
  font-size: var(--fs-14);
}

/* -------------------------------------------------------------
   PHARMACY-SPECIFIC: Rx status timeline, dosage label
   ------------------------------------------------------------- */
.rx-status {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 var(--space-2);
}
.rx-status-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.rx-status-step::after {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--border-strong);
}
.rx-status-step:last-child::after { display: none; }
.rx-status-dot {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 2px solid var(--border-strong);
  display: grid; place-items: center;
  color: var(--text-subtle);
  font-size: 11px;
  z-index: 1;
  position: relative;
}
.rx-status-step--done .rx-status-dot {
  background: var(--paid);
  border-color: var(--paid);
  color: var(--paid-fg);
}
.rx-status-step--done::after { background: var(--paid); }
.rx-status-step--current .rx-status-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-bg);
}
.rx-status-step--hold .rx-status-dot {
  background: var(--hold);
  border-color: var(--hold);
  color: var(--hold-fg);
}
.rx-status-label {
  font-size: var(--fs-12);
  font-weight: var(--fw-label);
  color: var(--text-muted);
  letter-spacing: var(--tracking-snug);
  text-align: center;
}
.rx-status-step--done .rx-status-label,
.rx-status-step--current .rx-status-label { color: var(--text); }

/* Dosage label — printed-look component */
.dosage-label {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.dosage-label-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-strong);
}
.dosage-label-pharm {
  font-family: var(--font-sans);
  font-weight: var(--fw-title);
  font-size: var(--fs-14);
  letter-spacing: var(--tracking-snug);
}
.dosage-label-pharm small {
  display: block;
  font-family: var(--font-mono);
  font-weight: var(--fw-body);
  font-size: 11px;
  color: var(--text-muted);
}
.dosage-label-drug {
  font-family: var(--font-sans);
  font-weight: var(--fw-title);
  font-size: var(--fs-18);
  letter-spacing: var(--tracking-snug);
  line-height: 1.2;
}
.dosage-label-drug small {
  display: block;
  font-family: var(--font-sans);
  font-weight: var(--fw-body);
  font-size: var(--fs-12);
  color: var(--text-muted);
  margin-top: 2px;
}
.dosage-label-sig {
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--text);
  border-left: 3px solid var(--brand);
}
.dosage-label-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 11px;
  color: var(--text-muted);
}
.dosage-label-foot strong {
  display: block;
  color: var(--text);
  font-weight: var(--fw-label);
  font-family: var(--font-sans);
  font-size: var(--fs-12);
}

/* Stock / expiry banner */
.stock-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--hold-bg);
  border: 1px solid var(--hold-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-13);
  color: var(--hold-text);
}
.stock-alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.stock-alert strong {
  font-weight: var(--fw-label);
  color: var(--hold-text);
}

/* Loyalty chip */
.loyalty-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-size: var(--fs-13);
  font-weight: var(--fw-label);
}
.loyalty-chip-avatar {
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--brand-fg);
  display: grid; place-items: center;
  font-size: var(--fs-11);
  font-weight: var(--fw-title);
  letter-spacing: 0;
}
.loyalty-chip small {
  font-size: var(--fs-11);
  color: var(--text-muted);
  font-weight: var(--fw-body);
  margin-left: 2px;
}

/* -------------------------------------------------------------
   PATTERNS — composed mini scenes
   ------------------------------------------------------------- */
.scene {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.scene-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.scene-title h4 {
  margin: 0;
  font-size: var(--fs-15);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-snug);
}
.scene-title small {
  font-size: var(--fs-12);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Checkout scene layout */
.scene-checkout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
}
@media (max-width: 1024px) {
  .scene-checkout { grid-template-columns: 1fr; }
}
.scene-checkout-cart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.scene-checkout-cart-head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.scene-checkout-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Script lookup scene */
.scene-lookup {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
.lookup-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lookup-row {
  display: grid;
  grid-template-columns: 1fr 160px 160px 100px;
  gap: var(--space-4);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  font-size: var(--fs-13);
}
.lookup-row:last-child { border-bottom: none; }
.lookup-row:hover { background: var(--bg-subtle); }
.lookup-row--header {
  background: var(--bg-subtle);
  font-size: var(--fs-11);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: var(--fw-label);
}
.lookup-patient {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lookup-patient strong {
  font-weight: var(--fw-label);
  color: var(--text);
}
.lookup-patient small {
  font-size: var(--fs-12);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* End-of-day */
.eod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .eod-grid { grid-template-columns: repeat(2, 1fr); }
}
.eod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eod-card-label {
  font-size: var(--fs-12);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: var(--fw-label);
}
.eod-card-value {
  font-size: var(--fs-30);
  font-weight: var(--fw-title);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
}
.eod-card-delta {
  font-size: var(--fs-12);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.eod-card-delta--up { color: var(--paid-text); }
.eod-card-delta--down { color: var(--void-text); }

/* Mini bar chart */
.bar-mini {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-top: var(--space-2);
}
.bar-mini span {
  flex: 1;
  background: var(--brand-bg-strong);
  border-radius: 2px;
  min-height: 4px;
}
.bar-mini span.peak { background: var(--brand); }

/* Age verification dialog (pattern) */
.age-verify {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}
.age-verify-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--hold-bg);
  color: var(--hold-text);
  display: grid; place-items: center;
  border: 1px solid var(--hold-border);
  flex-shrink: 0;
}
.age-verify-icon svg { width: 22px; height: 22px; }
.age-verify-body { flex: 1; }
.age-verify-title {
  font-weight: var(--fw-title);
  font-size: var(--fs-16);
  margin: 0 0 4px;
}
.age-verify-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
  margin: 0;
}

/* Token / inline code */
code.tok {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  background: var(--bg-muted);
  color: var(--text);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* Two-up split for examples */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
@media (max-width: 900px) {
  .split-2 { grid-template-columns: 1fr; }
}

.notes {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-13);
  color: var(--text-muted);
  line-height: var(--lh-normal);
}
.notes strong { color: var(--text); font-weight: var(--fw-label); }
.notes ul { margin: 8px 0 0; padding-left: 18px; }
.notes li { margin-bottom: 4px; }

/* Tab panel transitions */
[role="tabpanel"][hidden] { display: none; }
