/* Qasir V2 mockup: design tokens + components.
   Design artifact only. Class names are meant to be reused 1:1 in React components. */

/* ---------- 1. Tokens ---------- */
:root {
  /* Surfaces and text ("kertas buku tulis" + "tinta biru") */
  --paper: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #EBEFF8;
  --ink: #101528;
  --ink-2: #434E69;
  --line: #CBD3E6;          /* decorative dividers only */
  --control-line: #6B7796;  /* borders of inputs and buttons, 3:1+ on surface (WCAG 1.4.11) */
  --rule: #DAE1F1;          /* ruled-notebook lines */
  /* Brand and semantic */
  --primary: #1F3FA6;
  --primary-press: #162E80;
  --on-primary: #FFFFFF;
  --primary-soft: #E2E8FA;
  --margin: #B3261E;        /* the red margin line of a school notebook: errors, BELUM LUNAS, danger */
  --on-margin: #FFFFFF;
  --margin-soft: #FBE5E3;
  --ok: #0F6B3C;
  --ok-soft: #DCF2E5;
  --warn: #FFDE7A;
  --on-warn: #4A3200;
  /* Focus: two rings so it is visible on any background */
  --focus-ring: #101528;
  --focus-halo: #FFD43B;
  /* Shape and space */
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --shadow-sheet: 0 -8px 24px rgba(16, 21, 40, .18);
  --shadow-pop: 0 12px 32px rgba(16, 21, 40, .28);
  /* Type scale */
  --t-sm: .875rem;   /* 14 */
  --t-md: 1rem;      /* 16 body */
  --t-lg: 1.125rem;  /* 18 */
  --t-xl: 1.375rem;  /* 22 */
  --t-2xl: 1.75rem;  /* 28 */
  --t-amount: clamp(2.25rem, 11vw, 3.5rem); /* 36-56 payment numbers */
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-nota: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --target: 48px;    /* NFR-14 minimum touch target */
}
:root[data-theme="dark"] {
  --paper: #0C1121; --surface: #151C33; --surface-2: #1E2745;
  --ink: #EEF1FB; --ink-2: #B0BAD6; --line: #2C3659; --control-line: #8A97C2; --rule: #232C4C;
  --primary: #9DB2FF; --primary-press: #B9C8FF; --on-primary: #0C1121; --primary-soft: #22305F;
  --margin: #FF9C94; --on-margin: #2B0A07; --margin-soft: #3A1614;
  --ok: #6EDC9C; --ok-soft: #12301F;
  --warn: #FFDE7A; --on-warn: #2A1C00;
  --focus-ring: #FFFFFF; --focus-halo: #B07B00;
  --shadow-sheet: 0 -8px 24px rgba(0, 0, 0, .5);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .6);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; scroll-padding-bottom: 190px; } /* sticky bars never hide the focused field (WCAG 2.4.11) */
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 var(--t-md)/1.45 var(--font);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: var(--t-2xl); } h2 { font-size: var(--t-xl); } h3 { font-size: var(--t-lg); }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }
.skip-link { position: absolute; left: var(--s-2); top: -100px; background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: var(--s-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.page { width: 100%; max-width: 560px; margin: 0 auto; padding: var(--s-4); flex: 1; }
.page--wide { max-width: 1120px; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--target); min-width: var(--target); padding: 0 var(--s-5);
  border: 2px solid var(--primary); border-radius: var(--r-md);
  background: var(--primary); color: var(--on-primary);
  font: 700 var(--t-md)/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-press); border-color: var(--primary-press); }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: var(--surface); color: var(--primary); border-color: var(--control-line); }
.btn--secondary:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn--ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn--ghost:hover { background: var(--primary-soft); }
.btn--danger { background: var(--margin); border-color: var(--margin); color: var(--on-margin); }
.btn--danger:hover { filter: brightness(.92); background: var(--margin); border-color: var(--margin); }
.btn--lg { min-height: 64px; font-size: var(--t-lg); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); cursor: not-allowed; transform: none; }
.btn--sm { min-height: var(--target); padding: 0 var(--s-3); font-size: var(--t-sm); }

/* ---------- 4. Fields ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field__label { font-weight: 700; }
.field__hint { font-size: var(--t-sm); color: var(--ink-2); }
.field__error { font-size: var(--t-sm); color: var(--margin); font-weight: 700; display: flex; gap: var(--s-1); }
.input, .select, .textarea {
  width: 100%; min-height: var(--target); padding: var(--s-2) var(--s-3);
  border: 2px solid var(--control-line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.input--amount { font-size: var(--t-2xl); font-weight: 700; text-align: right; min-height: 64px; }
.input[aria-invalid="true"] { border-color: var(--margin); background: var(--margin-soft); }
.input-prefix { display: flex; align-items: center; gap: var(--s-2); }
.input-prefix > span { font-weight: 700; font-size: var(--t-lg); }
.check { display: flex; gap: var(--s-3); align-items: center; min-height: var(--target); }
.check input { width: 24px; height: 24px; accent-color: var(--primary); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: var(--s-2); }

/* ---------- 5. Chips, tabs, pills, badges ---------- */
.tabs { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: var(--s-1); scrollbar-width: thin; }
.tab {
  flex: none; min-height: var(--target); padding: 0 var(--s-4);
  border: 2px solid var(--control-line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 700 var(--t-md) var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.tab[aria-selected="true"], .tab[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs--underline { border-bottom: 2px solid var(--line); gap: var(--s-4); }
.tabs--underline .tab { border: 0; border-radius: 0; background: transparent; color: var(--ink-2); border-bottom: 4px solid transparent; padding: 0 var(--s-1); }
.tabs--underline .tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.pill { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 32px; padding: 0 var(--s-3); border-radius: 999px; font-size: var(--t-sm); font-weight: 700; text-decoration: none; border: 2px solid transparent; }
.pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.pill--online { background: var(--ok-soft); color: var(--ok); }
.pill--offline { background: var(--warn); color: var(--on-warn); }
.pill--offline::before { border-radius: 2px; }            /* shape differs, never color alone */
.pill--sync { background: var(--surface); color: var(--ink); border-color: var(--control-line); }
.pill--sync::before { display: none; }
.badge { display: inline-block; padding: 2px var(--s-2); border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: 700; border: 2px solid currentColor; }
.badge--lunas { color: var(--ok); background: var(--ok-soft); }
.badge--belum { color: var(--margin); background: var(--margin-soft); }
.badge--batal { color: var(--ink-2); background: var(--surface-2); text-decoration: line-through; }
.badge--warn { color: var(--on-warn); background: var(--warn); border-color: var(--on-warn); }
.badge--info { color: var(--primary); background: var(--primary-soft); }

/* ---------- 6. Banners, toasts, empty, skeleton ---------- */
.banner { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border-left: 8px solid currentColor; background: var(--surface); font-size: var(--t-md); }
.banner strong { display: block; }
.banner--info { color: var(--primary); background: var(--primary-soft); }
.banner--ok { color: var(--ok); background: var(--ok-soft); }
.banner--warn { color: var(--on-warn); background: var(--warn); }
.banner--error { color: var(--margin); background: var(--margin-soft); }
.banner > div { color: var(--ink); }
.toast { position: fixed; left: var(--s-4); right: var(--s-4); bottom: 160px; z-index: 40; max-width: 520px; margin: 0 auto; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ink); color: var(--paper); font-weight: 700; box-shadow: var(--shadow-pop); }
.toast[hidden] { display: none; }
.toast--error { background: var(--margin); color: var(--on-margin); }
.empty { text-align: center; padding: var(--s-6) var(--s-4); border: 2px dashed var(--control-line); border-radius: var(--r-lg); color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: var(--s-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; border-radius: var(--r-sm); min-height: 20px; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Offline-aware visibility, driven by body.is-offline (set by the app from navigator.onLine + sync state) */
.when-offline, .net-msg { display: none; }
.is-offline .when-offline { display: inline-flex; }
.is-offline .when-online { display: none; }
.is-offline .net-msg { display: block; }
.net-msg { color: var(--margin); font-weight: 700; font-size: var(--t-sm); }

/* ---------- 7. Cashier chrome ---------- */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 2px solid var(--line); padding: var(--s-2) var(--s-4); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.appbar__who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.appbar__who strong { font-size: var(--t-lg); }
.appbar__status { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.offline-banner { display: none; background: var(--warn); color: var(--on-warn); padding: var(--s-2) var(--s-4); font-weight: 700; border-bottom: 2px solid var(--on-warn); }
.is-offline .offline-banner { display: block; }
.dock { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 2px solid var(--line); box-shadow: var(--shadow-sheet); }
.paybar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.paybar__total { display: flex; flex-direction: column; line-height: 1.15; }
.paybar__total strong { font-size: var(--t-xl); }
.paybar .btn { flex: 1; max-width: 220px; }
.bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.bottom-nav a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-2); font-size: var(--t-sm); font-weight: 700; padding: var(--s-1); }
.bottom-nav a[aria-current="page"] { color: var(--primary); box-shadow: inset 0 4px 0 var(--primary); }
.bottom-nav svg { width: 24px; height: 24px; }

/* ---------- 8. Sale screen ---------- */
.sale { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4); width: 100%; max-width: 1120px; margin: 0 auto; }
.sale > * { min-width: 0; }
.searchbar { display: flex; gap: var(--s-2); }
.item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 88px; padding: var(--s-3); text-align: left; border: 2px solid var(--control-line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.item:hover { border-color: var(--primary); background: var(--primary-soft); }
.item__name { font-weight: 700; line-height: 1.2; }
.item__price { color: var(--primary); font-weight: 700; }
.item__stock { font-size: var(--t-sm); color: var(--ink-2); margin-top: auto; }
.item__stock--low { color: var(--on-warn); background: var(--warn); padding: 0 var(--s-2); border-radius: var(--r-sm); font-weight: 700; }
.item__stock--out { color: var(--on-margin); background: var(--margin); padding: 0 var(--s-2); border-radius: var(--r-sm); font-weight: 700; }
.item__qty { position: absolute; top: -8px; right: -8px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 700; display: grid; place-items: center; padding: 0 6px; border: 2px solid var(--surface); }
/* The "nota": ruled notebook paper with a red margin line. This is the product's signature element. */
.nota { position: relative; background-color: var(--surface); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--rule) 55px, var(--rule) 56px); border: 2px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4) var(--s-3) calc(var(--s-5) + var(--s-3)); }
.nota::before { content: ""; position: absolute; left: var(--s-4); top: 0; bottom: 0; width: 2px; background: var(--margin); opacity: .8; }
.nota__title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-2); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s-3); min-height: 56px; align-content: center; padding: var(--s-2) 0; }
.cart-line__name { font-weight: 700; }
.cart-line__sum { font-weight: 700; text-align: right; }
.cart-line__tools { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
.cart-line__note { font-size: var(--t-sm); color: var(--ink-2); font-style: italic; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--control-line); border-radius: var(--r-md); background: var(--surface); }
.stepper button { width: var(--target); height: var(--target); border: 0; background: transparent; font: 700 var(--t-xl) var(--font); color: var(--primary); cursor: pointer; border-radius: var(--r-md); }
.stepper output { min-width: 36px; text-align: center; font-weight: 700; }
.totals { margin-top: var(--s-3); border-top: 2px solid var(--ink); padding-top: var(--s-2); }
@media (min-width: 768px) {
  .sale { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .sale__cart { position: sticky; top: 88px; }
  .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- 9. Keypad (PIN and Mode Cepat) ---------- */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.key { min-height: 60px; border: 2px solid var(--control-line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: 700 var(--t-xl) var(--font); cursor: pointer; }
.key:hover { background: var(--primary-soft); }
.key--fn { font-size: var(--t-md); color: var(--ink-2); }
.pin-dots { display: flex; justify-content: center; gap: var(--s-4); padding: var(--s-4) 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); }
.person { display: flex; align-items: center; gap: var(--s-2); min-height: 56px; padding: var(--s-2) var(--s-3); border: 2px solid var(--control-line); border-radius: var(--r-md); background: var(--surface); font: 700 var(--t-md) var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.person[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; }

/* ---------- 10. Payment screens: amounts first ---------- */
.amount-due { text-align: left; padding: var(--s-3) 0; }
.amount-due small { display: block; font-size: var(--t-md); color: var(--ink-2); }
.amount-due strong { display: block; font-size: var(--t-amount); line-height: 1.05; letter-spacing: -.01em; }
.amount-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: var(--s-2) 0; }
.amount-line strong { font-size: var(--t-2xl); }
.amount-line--change strong { color: var(--ok); font-size: var(--t-amount); }
.amount-line--short strong { color: var(--margin); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s-2); }
.qris-box { display: grid; place-items: center; gap: var(--s-2); padding: var(--s-4); background: #FFFFFF; color: #101528; border: 2px solid var(--line); border-radius: var(--r-md); text-align: center; }
.qris-box svg { width: min(240px, 70%); height: auto; }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.radio-cards label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: var(--target); padding: var(--s-2); border: 2px solid var(--control-line); border-radius: var(--r-md); background: var(--surface); font-weight: 700; cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-cards input:checked + span { color: var(--primary); }
.radio-cards label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.radio-cards label:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); }
.card--flag { border-left: 8px solid var(--margin); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); min-height: var(--target); }

/* ---------- 11. Receipt preview (NFR-12): width = paper, text = ESC/POS lines ---------- */
.receipt { margin: 0 auto; background: #FFFFFF; color: #111; border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line); padding: 8px 6px; overflow-x: auto; max-width: 100%; }
.receipt pre { margin: 0; font: 13px/1.35 var(--font-nota); white-space: pre; }
.receipt--58 { width: calc(32ch + 12px); }
.receipt--80 { width: calc(48ch + 12px); }
@media print { .receipt { border: 0; box-shadow: none; } }

/* ---------- 12. Dialogs and sheets ---------- */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); width: min(520px, calc(100% - 24px)); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(10, 14, 30, .6); }
.dialog__body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.dialog__actions { display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; }
.dialog__actions .btn { flex: 1 1 140px; }
@media (max-width: 560px) { dialog { margin: auto auto 0; width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; } }

/* ---------- 13. Ledger rows ("buku kas": dotted leaders) ---------- */
.ledger { margin: 0; display: flex; flex-direction: column; }
.ledger__row { display: flex; align-items: baseline; gap: var(--s-2); padding: var(--s-2) 0; min-height: 40px; }
.ledger__row dt { margin: 0; }
.ledger__row::after { order: 1; content: ""; }
.ledger__leader { flex: 1; border-bottom: 2px dotted var(--control-line); transform: translateY(-4px); min-width: 16px; }
.ledger__row dd { margin: 0; font-weight: 700; text-align: right; white-space: nowrap; }
.ledger__row--sub { padding-left: var(--s-5); color: var(--ink-2); }
.ledger__row--total { border-top: 2px solid var(--ink); font-size: var(--t-lg); margin-top: var(--s-1); }
.ledger__row--flag dd { color: var(--margin); }

/* ---------- 14. Tables (stack into cards on phones) ---------- */
.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }  /* wide tables scroll inside their box, never the page */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table caption { text-align: left; font-weight: 700; padding: var(--s-2) 0; }
.table th { text-align: left; font-size: var(--t-sm); color: var(--ink-2); padding: var(--s-2) var(--s-3); border-bottom: 2px solid var(--ink); }
.table td { padding: var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th.num, .table td.num { text-align: right; }
.table tr.is-flag td:first-child { box-shadow: inset 6px 0 0 var(--margin); }
@media (max-width: 767px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--s-3); padding: var(--s-2) 0; }
  .table td { display: flex; justify-content: space-between; gap: var(--s-3); border: 0; padding: var(--s-1) var(--s-3); text-align: right; }
  .table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-2); text-align: left; flex: none; }
  .table td.table__actions { justify-content: stretch; padding-top: var(--s-2); }
  .table td.table__actions::before { display: none; }
  .table td.table__actions .btn { flex: 1; }
}

/* ---------- 15. Backoffice shell ---------- */
.bo { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.bo__top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--paper); }
.bo__top .pill--online { background: var(--ok-soft); }
.bo__brand { font-weight: 700; font-size: var(--t-lg); }
.bo__menu { min-height: var(--target); padding: 0 var(--s-4); border-radius: var(--r-md); border: 2px solid var(--paper); background: transparent; color: var(--paper); font: 700 var(--t-md) var(--font); cursor: pointer; }
.bo__nav { display: none; background: var(--surface); border-bottom: 2px solid var(--line); padding: var(--s-2); }
.bo__nav.open { display: block; }
.bo__nav h2 { font-size: var(--t-sm); color: var(--ink-2); padding: var(--s-3) var(--s-3) var(--s-1); font-weight: 700; }
.bo__nav a { display: flex; align-items: center; justify-content: space-between; min-height: var(--target); padding: 0 var(--s-3); border-radius: var(--r-md); color: var(--ink); text-decoration: none; font-weight: 700; }
.bo__nav a:hover { background: var(--primary-soft); }
.bo__nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.bo__main { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; max-width: 1100px; width: 100%; }
.toolbar { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { flex: 1 1 160px; }
@media (min-width: 1024px) {
  .bo { grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .bo__top { grid-column: 1 / -1; }
  .bo__menu { display: none; }
  .bo__nav { display: block; border-bottom: 0; border-right: 2px solid var(--line); position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; }
  .bo__main { padding: var(--s-5) var(--s-6); }
}
.stat-strip { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .stat-strip { grid-template-columns: 1fr 1fr; } }

/* ---------- 16. Mockup-only helpers ---------- */
.mock-note { font-size: var(--t-sm); color: var(--ink-2); border: 1px dashed var(--control-line); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); }
