/* ═══════════════════════════════════════════════════════════════════════
   AutoPartsAgent.ai — Chrome Overhaul Layer
   Loads AFTER /style.css, /pos/pos.css, /inventory/inventory.css.
   Refines shared chrome (topbar, brand, nav, kpi, tile, button, table,
   chip, modal, page-header, role-strip, empty-state, focus ring) using
   the evolved design tokens. Selector-compatible with existing HTML —
   most surfaces upgrade without markup changes.

   2026-05-26 overhaul. Cache-bust: ?v=2026-05-26-overhaul
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts: Fraunces display + DM Sans body + DM Mono numerals ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

/* ─────────────────────────────────────────────────────────────────────
   Body anchor — make sure new tokens hit the whole page even if older
   resets used pure-black. Non-marketing pages set body bg explicitly.
   ───────────────────────────────────────────────────────────────────── */
body { color: var(--ink); }
.pos-body, .inv-body { background: var(--bg); color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────────
   Topbar — restructure into three zones with refined hierarchy.
   ───────────────────────────────────────────────────────────────────── */
/* Topbar — 3-column grid (fixed left + right tracks) so the center nav
   stays anchored at the same x position on every page, regardless of how
   many links it has or what right-zone content the module renders.
   Previously it used flex with centered nav, which made the active pill
   jump 30-55px between modules when right content / link count differed. */
.pos-topbar {
  /* Absolute-centered nav so the cross-app pill stays in the SAME x
     position on every module page, regardless of left/right zone width.
     Left/right zones float against the topbar edges. */
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  box-shadow: var(--shadow-xs);
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  gap: var(--s-4);
}
.pos-topbar__center {
  display: contents;
}
.pos-topbar .inv-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
/* Reserve enough horizontal breathing room on the side zones so they don't
   collide with the centered nav (which is ~600px wide at desktop). */
.pos-topbar__left,
.pos-topbar__right {
  position: relative;
  z-index: 2;
  background: var(--paper);
}
.pos-topbar__left { padding-right: 12px; }
.pos-topbar__right { padding-left: 12px; }
/* Note: the old grid-based .pos-topbar__center block was removed here in
   the v5 overhaul. The absolute-positioned version above is the single
   source of truth for keeping the nav dead-centered across modules. */
/* Demote cashier-strip out of topbar — info is already in role-strip + KPI tiles.
   Re-show on huge monitors (1600+) only. */
.pos-topbar .pos-cashier-strip { display: none; }
@media (min-width: 1600px) {
  .pos-topbar .pos-cashier-strip { display: inline-flex; }
}
/* Truncate over-long customer names so they don't push the nav. */
.pos-brand__customer {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The cross-app nav has a fixed slot in the center track. Wrap is OFF so
   it never breaks to a second line and shifts page height. Each anchor
   stays on one line so multi-word labels ("E-commerce", "Agent budget")
   don't fracture at the hyphen / space. */
.pos-topbar .inv-nav { flex-wrap: nowrap; max-width: 100%; }
.pos-topbar .inv-nav a { white-space: nowrap; }
/* Narrower viewports (<1280): demote nav text size, hide the meta strip, and
   let the brand shrink. Prevents wraparound on iPad landscape POS. */
@media (max-width: 1280px) {
  .pos-topbar {
    grid-template-columns:
      minmax(180px, max-content)
      1fr
      minmax(160px, max-content);
  }
  /* WCAG 2.5.8 — 24×24 minimum target. Padding 6+12.5+6 = 24.5px just clears. */
  .pos-topbar .inv-nav a { padding: 6px 10px; font-size: 12.5px; }
  .pos-brand__customer { max-width: 140px; }
}
@media (max-width: 1024px) {
  .pos-topbar {
    grid-template-columns:
      auto
      1fr
      auto;
  }
  /* WCAG 2.5.8 — was padding:5px,font:12 → 22px tall, failed 24×24.
     Bumped vertical padding so total height = 7+12+7 = 26px. */
  .pos-topbar .inv-nav a { padding: 7px 8px; font-size: 12px; }
}
/* MOBILE: the absolute-centered nav becomes a horizontal-scroll strip
   that lives in normal flow so it doesn't overflow off-canvas. Brand
   shrinks, "Demo Shop (read-only)" customer name truncates aggressively,
   right zone hides the verbose "Search anywhere ⌘K" label keeping only
   the icon. */
@media (max-width: 640px) {
  .pos-topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    height: auto;
    min-height: 56px;
    max-height: none;
  }
  .pos-topbar__left {
    flex: 0 0 auto;
    gap: 6px;
    min-width: 0;
  }
  .pos-topbar__left .pos-brand__divider { display: none; }
  .pos-topbar__left .pos-brand__customer {
    font-size: 12.5px;
    max-width: 100px;
  }
  .pos-topbar__center {
    position: static;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .pos-topbar__center::-webkit-scrollbar { display: none; }
  .pos-topbar__center .inv-nav {
    /* Override the desktop absolute-centering (.pos-topbar .inv-nav sets
       position:absolute; left:50%; transform:translate(-50%,-50%)). Without
       these resets the nav floats on top of the brand + cashier strip
       instead of flowing inside the horizontal-scroll center zone, causing
       a topbar collision on phones (<=640px). */
    position: static;
    left: auto;
    top: auto;
    transform: none;
    flex: 0 0 auto;
    border-radius: var(--radius-full);
    padding: 3px;
  }
  /* WCAG 2.5.8 — mobile horizontal-scroll strip MUST keep the 24×24 min
     target. Was padding:4px 8px,font:11.5 → 19.5px tall (fail). Bumped
     to 7+12+7 = 26px so the scroll strip still hits the standard. */
  .pos-topbar__center .inv-nav a {
    padding: 7px 8px;
    font-size: 12px;
  }
  .pos-topbar__right {
    flex: 0 0 auto;
    gap: 6px;
  }
  .pos-topbar__right .pos-btn span { display: none; }
  .pos-topbar__right .pos-btn kbd { display: none; }
  .pos-topbar__right .pos-online-pill__label { display: none; }
  .pos-topbar__right .pos-online-pill { padding: 4px; }
  /* Wide right-zone status pills crush the nav scroll-strip (or overflow
     the topbar edge) on phones. Hide them at mobile — each value is shown
     in-page on its own surface. Matches the POS online-pill label hide.
       - .cust-aging-pill : "UNPAID … $2,465 ($1,690 past due)" (~276px)
       - .ops-drawer-pill : "Drawer open $100.00"
       - .ab-status-pill  : "Today: $5.02 / $25.00"
       - .hw-agent-pill   : "Shop agent: online" */
  .pos-topbar__right .cust-aging-pill,
  .pos-topbar__right .ops-drawer-pill,
  .pos-topbar__right .ab-status-pill,
  .pos-topbar__right .hw-agent-pill { display: none; }
  .pos-brand__logo { height: 24px; width: auto; }
}

/* ─────────────────────────────────────────────────────────────────────
   Brand block — proper wordmark + monogram + customer divider.
   Replaces the tiny placeholder logo treatment.
   ───────────────────────────────────────────────────────────────────── */
.pos-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  transition: opacity var(--duration-fast) var(--ease-out);
}
.pos-brand:hover { opacity: 0.85; }
.pos-brand:focus-visible { outline: none; box-shadow: var(--halo-accent); }
/* The brand asset is a wide wordmark (~3.6:1), not a square glyph. Render
   it at its natural ratio (height-constrained, width auto) like the
   marketing nav does — the old 32×32 object-fit:cover box cropped it into
   an unreadable blob (gap-doc C1). No border/background box: a wordmark
   sits on the paper, it isn't a chip. */
.pos-brand__logo {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.pos-brand__divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  margin: 0 2px;
}
.pos-brand__customer {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────
   Cross-app nav (inv-nav) — refined pill row with active indicator.
   ───────────────────────────────────────────────────────────────────── */
.inv-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--paper-deep);
  border: 1px solid var(--border);
}
.inv-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-muted);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  position: relative;
  line-height: 1;
}
.inv-nav a:hover { color: var(--ink); background: rgba(26, 23, 20, 0.04); }
.inv-nav a.is-active,
.inv-nav a[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(26,23,20,0.06), 0 0 0 1px var(--border);
}
.inv-nav a:focus-visible { outline: none; box-shadow: var(--halo-accent); }

/* ─────────────────────────────────────────────────────────────────────
   Meta strip (right side of topbar) — role, today, sales, online.
   Demote to small refined meta-text instead of pill row.
   ───────────────────────────────────────────────────────────────────── */
.pos-cashier-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.pos-cashier-strip strong { color: var(--ink); font-weight: 600; }
.pos-cashier-strip__role {
  font-family: var(--font-body);
  color: var(--ink-muted);
  font-weight: 500;
}
.pos-cashier-strip__sales {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--ink);
  font-weight: 500;
  font-size: 11.5px;
}
.pos-cashier-strip__sep {
  display: inline-block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--border-bold);
  flex-shrink: 0;
}

.pos-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: var(--radius-full);
  background: var(--paper-deep);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: -0.005em;
}
.pos-online-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}
.pos-online-pill[data-state="offline"] .pos-online-pill__dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.pos-online-pill[data-state="syncing"] .pos-online-pill__dot { background: var(--blue);  box-shadow: 0 0 0 3px var(--blue-soft); }

.pos-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────
   Page header — breadcrumb + title + meta + actions.
   ───────────────────────────────────────────────────────────────────── */
.page-header {
  padding: var(--s-8) var(--s-8) var(--s-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-header__crumbs {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-header__crumbs a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.page-header__crumbs a:hover { color: var(--accent); }
.page-header__crumbs span.sep { color: var(--ink-subtle); opacity: 0.5; }
.page-header__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
}
.page-header__sub {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink-muted);
  max-width: 720px;
  line-height: 1.55;
}
.page-header__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.page-header__actions {
  display: flex;
  gap: var(--s-2);
  align-items: center;
}

/* ─────────────────────────────────────────────────────────────────────
   Role strip — replaces the inverted-black hero block on dashboard.
   ───────────────────────────────────────────────────────────────────── */
.role-strip {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.role-strip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.role-strip__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.role-strip__meta {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-muted);
}
.role-strip__badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-on-soft);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────
   KPI card — Stripe/Mercury-style hierarchy.
   Selector-compatible with existing .pos-kpi / .kpi-card markup.
   ───────────────────────────────────────────────────────────────────── */
.kpi-card, .pos-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover, .pos-kpi:hover {
  box-shadow: var(--shadow-sm);
}
.kpi-card__label, .pos-kpi__label {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 2px;
  text-align: left;
}
.kpi-card__value, .pos-kpi__value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-strong);
  text-align: left;
}
.kpi-card__sub, .pos-kpi__sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: left;
}
.kpi-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-top: 4px;
  width: fit-content;
}
.kpi-card__delta--up   { color: var(--green-ink); background: var(--green-soft); }
.kpi-card__delta--down { color: var(--red-ink);   background: var(--red-soft); }
.kpi-card__delta--flat { color: var(--ink-muted); background: var(--paper-deep); }

/* Force-left-align KPI content even if older markup uses .center */
.kpi-card, .pos-kpi { text-align: left; }
.kpi-card *, .pos-kpi * { text-align: left; }

/* ─────────────────────────────────────────────────────────────────────
   Action tile — icon + headline + sub + chevron, hover-lift.
   Selector-compatible with existing .pos-tile / .action-tile.
   ───────────────────────────────────────────────────────────────────── */
.action-tile, .pos-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
  font-family: var(--font-body);
  width: 100%;
  box-shadow: var(--shadow-xs);
}
.action-tile:hover, .pos-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.action-tile:focus-visible, .pos-tile:focus-visible {
  outline: none;
  box-shadow: var(--halo-accent), var(--shadow-sm);
  border-color: var(--accent);
}
.action-tile::after, .pos-tile::after {
  content: "→";
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  color: var(--ink-subtle);
  font-size: 14px;
  transition: transform var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}
.action-tile:hover::after, .pos-tile:hover::after {
  transform: translateX(2px);
  color: var(--accent);
}
.action-tile strong, .pos-tile strong {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.action-tile small, .pos-tile small,
.action-tile span:not(:first-child), .pos-tile span:not(:first-child) {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ─────────────────────────────────────────────────────────────────────
   Buttons — refined system with primary brick, ghost, secondary, danger.
   ───────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: scale(0.98); background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:focus-visible { outline: none; box-shadow: var(--halo-accent); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Legacy .btn-black — keep the class name for HTML compatibility but route
   to the brick primary so marketing CTAs match the in-app accent ladder
   per gap-doc C10 (single brand colour across product + marketing). */
.btn-black {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-black:hover { background: var(--accent-hover); border-color: var(--accent-hover); opacity: 1; }
.btn-black:active { transform: scale(0.98); background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-black:focus-visible { outline: none; box-shadow: var(--halo-accent); }

/* Ghost / outline */
.btn-outline, .btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover, .btn-ghost:hover {
  background: var(--paper-deep);
  border-color: var(--border-bold);
}
.btn-outline:focus-visible, .btn-ghost:focus-visible { outline: none; box-shadow: var(--halo-accent); }

/* Secondary (paper card) */
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--paper-deep); border-color: var(--border-bold); }
.btn-secondary:focus-visible { outline: none; box-shadow: var(--halo-accent); }

/* Destructive */
.btn-danger, .btn-destructive {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-danger:hover, .btn-destructive:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn-danger:focus-visible, .btn-destructive:focus-visible { outline: none; box-shadow: var(--halo-danger); }

/* Sizing */
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; font-weight: 600; }
.btn-xl { padding: 18px 32px; font-size: 16px; font-weight: 600; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* Loading state */
.btn[aria-busy="true"] { position: relative; color: transparent !important; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: btn-spin 0.6s linear infinite;
  color: var(--accent-ink);
}
.btn-outline[aria-busy="true"]::after,
.btn-ghost[aria-busy="true"]::after,
.btn-secondary[aria-busy="true"]::after { color: var(--ink); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────────────
   Status chip — pill with leading dot indicator (Linear pattern).
   ───────────────────────────────────────────────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip--success { color: var(--green-ink); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.status-chip--danger  { color: var(--red-ink);   background: var(--red-soft);   border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.status-chip--warn    { color: var(--amber-ink); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.status-chip--info    { color: var(--blue-ink);  background: var(--blue-soft);  border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.status-chip--neutral { color: var(--ink-muted); background: var(--paper-deep); border-color: var(--border); }
.status-chip--accent  { color: var(--accent-on-soft); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ─────────────────────────────────────────────────────────────────────
   Data table — refined chrome for any tabular display.
   ───────────────────────────────────────────────────────────────────── */
.data-table, table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.data-table thead th {
  background: var(--paper-deep);
  text-align: left;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--duration-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--paper-deep); }
.data-table td.num, .data-table th.num,
.data-table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.data-table .mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* ─────────────────────────────────────────────────────────────────────
   Form fields — refined inputs, labels, helper text, error state.
   ───────────────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s-4);
}
.field label, label.field-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.field-hint {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.field-error {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--red-ink);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-error::before { content: "!"; display: inline-flex; width: 14px; height: 14px; align-items: center; justify-content: center; background: var(--red); color: var(--white); border-radius: 50%; font-weight: 700; font-size: 10px; }

/* Inputs across modules — apply via attribute selector so legacy markup picks up */
input[type="text"]:not(.bare),
input[type="email"]:not(.bare),
input[type="password"]:not(.bare),
input[type="tel"]:not(.bare),
input[type="number"]:not(.bare),
input[type="search"]:not(.bare),
input[type="url"]:not(.bare),
input[type="date"]:not(.bare),
input[type="datetime-local"]:not(.bare),
input[type="time"]:not(.bare),
select:not(.bare),
textarea:not(.bare) {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  line-height: 1.4;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
input:not(.bare):hover, select:not(.bare):hover, textarea:not(.bare):hover {
  border-color: var(--border-bold);
}
input:not(.bare):focus, select:not(.bare):focus, textarea:not(.bare):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--halo-accent);
  background: var(--paper);
}
input:not(.bare)::placeholder, textarea:not(.bare)::placeholder { color: var(--ink-subtle); }
input:disabled, select:disabled, textarea:disabled { background: var(--paper-deep); color: var(--ink-muted); cursor: not-allowed; }
textarea:not(.bare) { resize: vertical; min-height: 80px; font-family: var(--font-body); }

/* ─────────────────────────────────────────────────────────────────────
   Card — generic paper surface used by sections, panels, summary boxes.
   ───────────────────────────────────────────────────────────────────── */
.surface {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.surface--deep { background: var(--paper-deep); box-shadow: none; }
.surface--quiet { box-shadow: none; }

/* ─────────────────────────────────────────────────────────────────────
   Action panel — replaces the "wall-of-grey-text" right rail on POS.
   ───────────────────────────────────────────────────────────────────── */
.action-panel {
  background: var(--bg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.action-panel__block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--border);
}
.action-panel__block:last-child { border-bottom: 0; padding-bottom: 0; }
.action-panel__label {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.action-panel__body {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ─────────────────────────────────────────────────────────────────────
   Empty state — design the absence.
   ───────────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-12) var(--s-8);
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}
.empty-state__icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  margin-bottom: 4px;
}
.empty-state__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.empty-state__sub {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 380px;
  line-height: 1.55;
}

/* ─────────────────────────────────────────────────────────────────────
   Focus rings — global accent fallback for anything missed above.
   ───────────────────────────────────────────────────────────────────── */
:where(button, a, [role="button"], [tabindex], summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ─────────────────────────────────────────────────────────────────────
   Section titles + page titles — Fraunces editorial display.
   Routes legacy class names through new tokens.
   ───────────────────────────────────────────────────────────────────── */
.section-title,
.hero-title,
.hero-sub-top {
  font-family: var(--font-display);
  font-weight: 500;
}
.section-title { letter-spacing: -0.022em; }
.hero-title { font-weight: 500; letter-spacing: -0.022em; }
.hero-sub-top {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12.5px;
  color: var(--accent-on-soft);
  background: var(--accent-soft);
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.section-subtitle { font-family: var(--font-display); font-weight: 500; }

/* Page-level h1/h2 fallback for pages without .page-header */
h1.page-title, .page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
h2.page-title { font-size: clamp(20px, 2.2vw, 26px); }

/* ─────────────────────────────────────────────────────────────────────
   Numeric / tabular helpers
   ───────────────────────────────────────────────────────────────────── */
.mono, .num, .tabular {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────────────────
   Toast / inline-banner refinement
   ───────────────────────────────────────────────────────────────────── */
.toast, .inline-banner {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toast:empty {
  display: none;
}

/* ─────────────────────────────────────────────────────────────────────
   Subtle motion for surfaces appearing
   ───────────────────────────────────────────────────────────────────── */
@keyframes surface-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi-card, .action-tile, .pos-tile, .surface, .role-strip {
  animation: surface-rise var(--duration-base) var(--ease-out) both;
}

/* ─────────────────────────────────────────────────────────────────────
   Demo / read-only badge — refined replacement for the legacy
   inverted-black "Demo Shop (read-only)" pill.
   ───────────────────────────────────────────────────────────────────── */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-on-soft);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.demo-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════
   PART 2 — Module-specific overrides (real class names from existing CSS)
   These overrides preserve markup and functionality, only refining visuals.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── POS: workspace, panes, cart, totals ─────────────────────────── */
.pos-workspace {
  background: var(--bg);
}
.pos-pane--search { border-right: 1px solid var(--border); background: var(--bg); }
.pos-pane--cart   { background: var(--paper); }
.pos-pane--actions {
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 22px 22px;
  gap: 0;
}

/* Cart header */
.pos-cart-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.pos-cart-header__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.pos-cart-header__sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* Stepbar — refined indicator row */
.pos-stepbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--paper-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin: 12px 24px 18px;
  font-family: var(--font-body);
}
.pos-stepbar__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  color: var(--ink-subtle);
  letter-spacing: -0.005em;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.pos-stepbar__step--active {
  color: var(--accent-on-soft);
  background: var(--accent-soft);
  font-weight: 600;
}
.pos-stepbar__step--done { color: var(--green-ink); }
.pos-stepbar__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px solid var(--border-strong);
}
.pos-stepbar__step--active .pos-stepbar__num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.pos-stepbar__step--done .pos-stepbar__num {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.pos-stepbar__arrow { color: var(--ink-subtle); font-family: var(--font-mono); font-size: 12px; }

/* Empty / rich home dashboard inside cart pane */
.pos-empty--rich { padding: 28px 28px; gap: 22px; }
.pos-empty__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.pos-empty__hint {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* Monogram icon for empty states — brick-soft roundel with accent glyph.
   Per gap-doc C12: empty states pair "design the absence" with a visual
   anchor so the column doesn't read as a load-failure. */
.pos-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-on-soft, var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.pos-empty__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.pos-empty--search { padding-top: 36px; }

/* CTA card at top of empty cart */
.pos-home-card--cta {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--paper) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-lg);
  padding: 28px 28px 30px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}
.pos-home-card--cta .pos-empty__title,
.pos-home-card--cta * {
  text-align: center;
}
.pos-home-card--cta .pos-empty__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.pos-home-card--cta .pos-empty__hint {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.55;
}

/* KPI grid + cards. Breakpoints prevent number-ellipsis truncation:
   at 1280px (a wide laptop) the 4-up grid still fits; below that we
   drop to 2-up so the mono digits don't clip into "..." */
.pos-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1280px) {
  .pos-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pos-home-grid { grid-template-columns: 1fr; }
}
.pos-quick-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1280px) {
  .pos-quick-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pos-quick-rail { grid-template-columns: 1fr; }
}
.pos-home-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
  text-align: left;
}
.pos-home-card:hover { box-shadow: var(--shadow-sm); }
.pos-home-card__label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
  font-weight: 600;
  text-align: left;
}
.pos-home-card__big {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink-strong);
  line-height: 1.1;
  text-align: left;
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pos-home-card {
  min-width: 0;
  padding: 14px 16px;
}
.pos-home-card__sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-muted);
  text-align: left;
}

/* Recent sales list — paper card with refined rows */
.pos-home-recent {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.pos-home-recent__title {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
  font-weight: 600;
  margin: 0 0 10px;
}
.pos-home-recent__row {
  grid-template-columns: 90px 1fr auto;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.pos-home-recent__row span:first-child {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 12px;
}
.pos-home-recent__row strong {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--ink);
  font-weight: 600;
}

/* Quick-action rail buttons — proper action tile look.
   NOTE: grid columns + breakpoints are defined earlier in this file
   (responsive section). This block only styles the tile look. */
.pos-quick-rail__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}
.pos-quick-rail__btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.pos-quick-rail__btn:focus-visible {
  outline: none;
  box-shadow: var(--halo-accent), var(--shadow-sm);
  border-color: var(--accent);
}
.pos-quick-rail__btn::after {
  content: "→";
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  color: var(--ink-subtle);
  font-size: 13px;
  transition: transform var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.pos-quick-rail__btn:hover::after {
  transform: translateX(3px);
  color: var(--accent);
}
.pos-quick-rail__btn strong {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.pos-quick-rail__btn span {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Totals footer */
.pos-cart-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--paper);
}
.pos-totals__row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-muted);
  padding: 4px 0;
}
.pos-totals__row--total {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
}
.pos-totals__row--total .pos-tabular {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-strong);
}
.pos-tabular {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Sale complete success panel */
.pos-sale-complete {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 8%, var(--paper)), var(--paper));
  border: 1px solid color-mix(in srgb, var(--green) 24%, transparent);
  border-radius: var(--radius-md);
  margin: 12px 24px;
  box-shadow: var(--shadow-sm);
}
.pos-sale-complete__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent);
}
.pos-sale-complete__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  display: block;
}
.pos-sale-complete__sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-muted);
}
.pos-sale-complete__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* Right-rail action panel — convert "wall of grey help text" into
   structured sections. Each button + its inline help becomes a single
   block separated by a hairline divider, so the eye reads them as
   distinct actions (Take payment / Attach customer / Apply discount /
   Void sale) instead of a paragraph of legalese. */
.pos-pane--actions {
  padding: 22px 22px 28px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  gap: 0;
  display: flex;
  flex-direction: column;
}
.pos-pane--actions > .pos-btn {
  width: 100%;
  margin-top: 0;
}
.pos-pane--actions > .pos-btn + .pos-action-help {
  margin: 8px 2px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.pos-pane--actions > .pos-action-help:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.pos-pane--actions > .pos-btn + .pos-action-help + .pos-btn,
.pos-pane--actions > .pos-action-help + .pos-btn {
  margin-top: 20px;
}
.pos-action-help {
  display: block;
  padding: 0;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.pos-action-help strong { color: var(--ink); font-weight: 600; }
.pos-action-help--danger strong { color: var(--red-ink); }
/* Demote the standalone divider before Void — the section-dividers above
   already handle visual separation, so the explicit <div class="pos-divider">
   becomes redundant noise. */
.pos-pane--actions .pos-divider {
  display: none;
}
/* Fallback divider for any non-actions context that still uses it */
.pos-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0 16px;
}
/* Void sale — keep the red link treatment but tighten copy alignment */
.pos-pane--actions .pos-btn--link {
  text-align: left;
  justify-content: flex-start;
  padding: 8px 4px !important;
}

/* Search hint */
.pos-search__hint {
  padding: 8px 18px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}
.pos-search__hint strong { color: var(--ink); font-weight: 600; }
.pos-search__hint em {
  font-family: var(--font-mono);
  font-style: normal;
  background: var(--paper-deep);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
}

/* Search field */
.pos-search {
  position: relative;
  padding: 16px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.pos-search__icon {
  /* Anchor the magnifying glass at left:30px inside the input. The input's
     left-padding (46px below) keeps the placeholder + typed text clear of
     the icon so the first letter isn't clipped. */
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-subtle);
  pointer-events: none;
  width: 18px;
  height: 18px;
}
/* Higher specificity (attribute + class) so this beats the generic
   input[type="search"]:not(.bare) reset above. Without this, the
   generic 10px-12px shorthand padding wipes the 46px left-padding and
   the placeholder text overlaps the magnifying-glass icon. */
input[type="search"].pos-search__input,
input.pos-search__input {
  border: 1px solid var(--border-strong);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 46px;       /* 46px clears the 30px icon + 18px width + 2px buffer */
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
  height: 44px;
}
input.pos-search__input::placeholder { color: var(--ink-subtle); }
input.pos-search__input:focus {
  border-color: var(--accent);
  box-shadow: var(--halo-accent);
  outline: none;
}

/* POS button system — primary becomes brick, ghost refined */
.pos-btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.pos-btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.pos-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.pos-btn--primary:active:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.pos-btn--primary:focus-visible { outline: none; box-shadow: var(--halo-accent); }
.pos-btn--ghost {
  background: var(--paper);
  border-color: var(--border-strong);
  color: var(--ink);
}
.pos-btn--ghost:hover:not(:disabled) {
  background: var(--paper-deep);
  border-color: var(--border-bold);
}
.pos-btn--ghost:focus-visible { outline: none; box-shadow: var(--halo-accent); }
.pos-btn--danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.pos-btn--danger:hover:not(:disabled) {
  background: var(--red-ink);
  border-color: var(--red-ink);
}
.pos-btn--danger:focus-visible { outline: none; box-shadow: var(--halo-danger); }
/* When a danger button is ALSO the text-link or ghost variant (e.g. the POS
   "Void sale" control = .pos-btn--danger.pos-btn--link), it has a
   transparent background — so the solid-danger white text above renders
   white-on-cream and the label vanishes (contrast ~1.04:1). Force red ink
   for the transparent danger variants so the label is readable. */
.pos-btn--danger.pos-btn--link,
.pos-btn--danger.pos-btn--ghost {
  color: var(--red-ink);
  background: transparent;
}
.pos-btn--danger.pos-btn--ghost { border-color: var(--red); }
.pos-btn--lg { padding: 12px 22px; font-size: 15px; font-weight: 600; }
.pos-btn--sm { padding: 6px 12px; font-size: 12.5px; }

/* Modal chrome */
.pos-modal__backdrop { background: rgba(20, 17, 14, 0.55); }
.pos-modal__panel {
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.pos-modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--paper-deep);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.pos-modal__head-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pos-modal__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.pos-modal__sub {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.45;
}
.pos-icon-btn {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pos-icon-btn:hover { background: var(--paper); color: var(--ink); }
.pos-modal__body { padding: 22px 24px; background: var(--paper); }
.pos-modal__foot {
  padding: 16px 22px;
  background: var(--paper-deep);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Payment modal specifics */
.pos-pay-summary {
  background: var(--paper-deep);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.pos-pay-summary__label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
  font-weight: 600;
}
.pos-pay-summary__amount {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.pos-pay-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--paper-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}
.pos-pay-tab {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.pos-pay-tab:hover { color: var(--ink); }
.pos-pay-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26,23,20,0.08);
  font-weight: 600;
}
.pos-pay-field input,
.pos-pay-field select {
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}
.pos-pay-field input:focus {
  border-color: var(--accent);
  box-shadow: var(--halo-accent);
  outline: none;
}
.pos-pay-change {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 12px;
}
.pos-pay-change span {
  font-family: var(--font-body);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-on-soft);
  font-weight: 600;
}
.pos-pay-change strong {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-on-soft);
}

/* ─── Inventory module overrides ────────────────────────────────── */
.inv-workspace { background: var(--bg); }
.inv-pane--detail { background: var(--paper); }
.inv-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-out);
}
.inv-list-item:hover { background: var(--paper-deep); }
.inv-list-item.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 24%, transparent);
}
.inv-list-item__sku {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink-strong);
  font-size: 13.5px;
}
.inv-list-item__brand {
  font-family: var(--font-body);
  color: var(--ink-subtle);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
  font-weight: 600;
}
.inv-list-item__desc {
  font-family: var(--font-body);
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 4px;
}
.inv-list-item__stock {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.inv-detail__head { padding: 24px 28px 16px; border-bottom: 1px solid var(--border); }
.inv-detail__sku {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.inv-detail__brand {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-subtle);
  font-weight: 600;
  margin-top: 4px;
}
.inv-detail__stock-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--green-soft);
  color: var(--green-ink);
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
}
.inv-detail__stock-badge[data-state="low"]  { background: var(--amber-soft); color: var(--amber-ink); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.inv-detail__stock-badge[data-state="out"]  { background: var(--red-soft);   color: var(--red-ink);   border-color: color-mix(in srgb, var(--red) 22%, transparent); }

.inv-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.inv-tab {
  background: transparent;
  border: 0;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  position: relative;
  margin-right: 4px;
}
.inv-tab:hover { color: var(--ink); }
.inv-tab.is-active { color: var(--ink); font-weight: 600; }
.inv-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.inv-tab-pane { padding: 22px 28px; }
.inv-field span {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.inv-field input,
.inv-field textarea,
.inv-tab-pane > textarea,
.inv-tab-pane select {
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}
.inv-field input:focus,
.inv-field textarea:focus,
.inv-tab-pane > textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--halo-accent);
  outline: none;
}
.inv-help, .inv-margin {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.inv-help strong { color: var(--ink); font-weight: 600; }
.inv-detail__actions {
  border-top: 1px solid var(--border);
  background: var(--paper-deep);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Customers module overrides ────────────────────────────────── */
.cust-balance {
  background: var(--paper-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cust-balance__label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
  font-weight: 600;
}
.cust-balance__val {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.cust-aging-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cust-aging-cell {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-xs);
}
.cust-aging-cell strong {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-strong);
}
.cust-aging-cell span {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
  font-weight: 600;
}
.cust-aging-cell--warning { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 24%, transparent); }
.cust-aging-cell--warning strong { color: var(--amber-ink); }
.cust-aging-cell--danger { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 24%, transparent); }
.cust-aging-cell--danger strong { color: var(--red-ink); }

.cust-section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
}
.cust-ledger { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); }
.cust-ledger-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.cust-ledger-row--header {
  background: var(--paper-deep);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
}
.cust-ledger-row__type {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cust-list-balance {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.cust-list-balance--due  { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent); }
.cust-list-balance--zero { background: var(--green-soft); color: var(--green-ink); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); }

.cust-pastdue-action-bar {
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 26%, transparent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cust-pastdue-action-bar__text {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--amber-ink);
  flex: 1;
}
.cust-pastdue-action-bar__text strong { color: var(--amber-ink); font-weight: 700; }

/* ─── Operations module overrides ────────────────────────────────── */
.ops-workspace { background: var(--bg); }
.ops-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ops-tab {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  min-width: 200px;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-xs);
}
.ops-tab:hover { background: var(--paper); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ops-tab.is-active {
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}
.ops-tab__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ops-tab__sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.ops-tab.is-active .ops-tab__title { font-weight: 700; color: var(--accent-on-soft); }

.ops-section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-xs);
}
.ops-section__head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 6px;
}
.ops-section__head p {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0 0 18px;
}

.ops-drawer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--paper-deep);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.ops-drawer-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}
.ops-drawer-pill__amount {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--ink);
  font-weight: 600;
}

.ops-po-row {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 120px 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}
.ops-po-row__no { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.ops-po-row__supplier { font-family: var(--font-body); font-weight: 600; color: var(--ink); }
.ops-po-row__status {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ops-po-row__total { font-family: var(--font-mono); font-feature-settings: "tnum"; font-weight: 600; color: var(--ink); }

.ops-drawer-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
}
.ops-drawer-card--open {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--paper) 80%);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.ops-drawer-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.ops-drawer-card__sub { font-family: var(--font-body); font-size: 13px; color: var(--ink-muted); }
.ops-drawer-metric__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-subtle);
}
.ops-drawer-metric__val {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-strong);
  margin-top: 2px;
}

/* ─── Section + page title generic upgrades ───────────────────────── */
/* Many module pages drop a plain h2 to introduce a section. Style it
   without requiring a class change. */
.pos-pane--cart > h2,
.inv-pane--detail > h2,
.ops-workspace > h2,
section > header > h2:not(.section-title) {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
