/* Inter, shipped rather than hoped for.
 *
 * This file named Inter from the start and set four Inter-specific features on
 * every screen -- and the font was never delivered. There is no @font-face here
 * and no font file in the repo, so every shop has been reading Roboto (Android)
 * or whatever the browser defaults to, and "cv02" and friends did nothing at
 * all. Measured in the browser on 2026-09-13: a deliberately fake font name
 * rendered at exactly the width "Inter" did.
 *
 * Self-hosted because it has to be: the hosting CSP is font-src 'self' data:,
 * so Google Fonts is blocked outright -- and a till works offline, where a CDN
 * is not there anyway. The service worker pre-caches it with the same ?v= stamp
 * discipline as the rest of the shell.
 *
 * 39 KB: Inter 4.1 variable, subset to Latin, optical-size axis pinned at 14
 * (the size this UI actually reads at) and weight held to 400-700, which is
 * every weight this stylesheet asks for. The full file is 352 KB. One file
 * rather than two statics (48 KB) so weights stay continuous.
 *
 * SIL Open Font License 1.1 -- fonts/OFL.txt travels with it, as the licence
 * requires.
 */
@font-face {
  font-family: "Inter";
  /* The whole 400-700 range from one file. */
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  src: url("./fonts/inter-latin.woff2?v=20261028b") format("woff2");
}

:root {
  color-scheme: dark;

  /* Surfaces climb in luminance with elevation: bg (page) -> surface (chrome)
     -> panel (cards) -> panel-soft (nested rows). Steps are deliberately
     narrow; depth is carried by borders and shadow, not by big jumps in
     lightness, which is what keeps a dark UI calm rather than stripey. */
  --bg: #0b0d10;
  --surface: #121519;
  --panel: #171b21;
  --panel-soft: #1e232b;
  --panel-hover: #232933;

  --text: #f2f5f9;
  --text-strong: #ffffff;
  --muted: #929db0;
  --muted-strong: #b6c0d0;

  /* Hairlines sit just above the surface they divide. High-contrast borders
     are the single biggest giveaway of an unconsidered dark theme. */
  --line: #262d38;
  --line-soft: #1c222a;
  --line-strong: #333c4a;

  /* WCAG 1.4.11 wants the boundary of an interactive control to reach 3:1
     against what surrounds it. --line-strong is deliberately quiet -- the
     comment above is right that shouty borders are how a dark theme goes wrong
     -- but at 1.55:1 against --panel a text field was not distinguishable from
     the card holding it. That is felt hardest in a lit shop on a cheap screen,
     which is where this app runs.
     Controls only. Dividers and dashed decoration keep the quiet hairline. */
  --control-border: #6b7789;

  /* The Savia mark as a mask, so any element can stamp it in whatever colour
     it already has. The channel stroke only -- icons/savia-mark.svg wraps this
     in a dark app-icon tile, which is right on a home screen and reads as a
     sticker inside a banner. Theme-independent: a mask has no colour of its
     own, so this is declared once and never restated for light. */
  --savia-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M 330 170 A 74 74 0 1 0 256 244 A 74 74 0 1 1 182 318' fill='none' stroke='%23000' stroke-width='52' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --accent: #3ddc97;
  --accent-strong: #2bb87b;
  --accent-quiet: rgb(61 220 151 / 12%);
  --accent-ink: #04180f;

  --blue: #7aa2ff;
  --amber: #f5b942;
  --red: #f87171;
  --green: #4ade80;
  --violet: #a78bfa;

  --danger-quiet: rgb(248 113 113 / 12%);
  --warn-quiet: rgb(245 185 66 / 12%);

  /* Layered shadows read as real depth; a single large blur reads as a smudge. */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 32%);
  --shadow: 0 1px 2px rgb(0 0 0 / 28%), 0 4px 12px rgb(0 0 0 / 22%);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 24%), 0 12px 32px rgb(0 0 0 / 34%);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* 4px base grid. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* A till is operated with fingers, often quickly. Material's 48dp guidance
     is the target for primary POS controls; 40px is the floor for dense
     secondary actions in table rows. */
  --tap: 44px;
  --tap-lg: 52px;

  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Disambiguation, not decoration. ss02 is Inter's disambiguation set; cv05
     gives lower-case l a tail and cv08 gives capital I serifs, so 1, l and I
     stop looking alike. The slashed zero (the "zero" feature) is deliberately
     NOT on: it reads as a technical mark on a customer receipt, and O against 0
     is already separated by ss02. */
  font-feature-settings: "ss02" 1, "cv05" 1, "cv08" 1;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f2f5f8;
  --panel-hover: #eaeff5;

  --text: #0e1420;
  --text-strong: #000000;
  --muted: #5b6675;
  --muted-strong: #3d4757;

  --line: #e2e8ef;
  --line-soft: #eef2f6;
  --line-strong: #cfd8e3;
  /* 3.42:1 against both #fff and --bg. #848fa0 also clears 3.0, by 0.07 --
     close enough that any later change to a panel colour would silently push
     it back under. */
  --control-border: #7b8799;

  /* Measured against white, not eyeballed. The first pass of this palette
     failed WCAG AA for normal text in five places -- most importantly white
     button text on the accent at 3.34:1, i.e. the label on the primary action
     in the app. Semantic hues are darkened until each clears 4.5:1 on
     --panel (#fff), which also makes white-on-colour pass by the same figure.
     Ratios: accent 5.36 · red 6.54 · amber 5.93 · green 5.49 · blue 5.72.
     Dark theme already passed everywhere and is unchanged. */
  --accent: #0b7a51;
  --accent-strong: #096341;
  --accent-quiet: rgb(11 122 81 / 10%);
  --accent-ink: #ffffff;

  --blue: #2f5fd0;
  --amber: #8a5a00;
  --red: #b3261e;
  --green: #12784f;
  --violet: #6544c0;

  --danger-quiet: rgb(179 38 30 / 9%);
  --warn-quiet: rgb(138 90 0 / 10%);

  --shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 12px rgb(16 24 40 / 7%);
  --shadow-lg: 0 2px 4px rgb(16 24 40 / 7%), 0 12px 32px rgb(16 24 40 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Money, quantities and any figure that stacks in a column must use tabular
   (fixed-width) digits, otherwise "1" is narrower than "8" and the decimal
   points drift out of alignment down a receipt or a stock table. This is the
   single highest-impact typographic detail in a retail interface. */
table,
.kpi-card strong,
.cart-total,
.receipt,
.receipt-row,
.delta,
.payment-summary,
.payment-summary-row,
.money,
input[type="number"],
.pos-qty-input,
.pos-price-input,
.cart-qty-input,
kbd {
  font-variant-numeric: tabular-nums;
  /* Tabular figures, so a column of money lines up and 124.17 is the same
     width as 680.90. font-feature-settings overrides font-variant-numeric
     above, so the disambiguation features have to be repeated here or money
     would lose them. */
  font-feature-settings: "tnum" 1, "ss02" 1, "cv05" 1, "cv08" 1;
}

/* Inputs previously set `outline: none` with nothing in its place, leaving
   keyboard users with no visible focus indicator at all (WCAG 2.4.7). Focus
   is now explicit everywhere, and only for keyboard users so a mouse click
   doesn't leave a ring behind. */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

.sidebar :focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand,
.sidebar-card,
.page-title,
.panel-head,
.button-row,
.search-wrap,
.cart-total,
.account-chip {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #061412;
  font-weight: 900;
}

.brand span,
.sidebar-card span,
.eyebrow,
td small,
.muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

/* The password-reset confirmation. Deliberately NOT a toast: it has to still
   be on screen when somebody comes back from their inbox, and it carries the
   address the link went to, which a fading message never showed. */
.auth-notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--green);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}
.auth-notice p {
  margin: 0;
  font-size: 0.9rem;
}
.auth-notice[hidden] {
  display: none;
}

.nav-item {
  position: relative;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 var(--space-3);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: -0.006em;
  transition: background-color 0.13s ease, color 0.13s ease;
}

.nav-item[hidden] {
  display: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.nav-item.active {
  color: var(--text-strong);
  background: var(--panel-soft);
  font-weight: 600;
}

/* The active marker is a rail on the leading edge rather than a heavier fill,
   so scanning the nav gives you position at a glance without four competing
   blocks of colour. */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--accent);
}

.sidebar-card {
  margin-top: auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  flex: 0 0 auto;
}

.status-dot.connected {
  background: var(--green);
}

.main {
  min-width: 0;
  padding: 18px 22px 38px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 10px;
  padding-bottom: 18px;
  background: var(--bg);
}

.search-wrap {
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0 12px;
  min-height: 42px;
}

.search-wrap input,
.panel-head input,
.command-box input,
textarea,
select,
label input {
  width: 100%;
  border: 1px solid var(--control-border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-3);
  min-height: 40px;
  outline: none;
  transition: border-color 0.13s ease, box-shadow 0.13s ease, background-color 0.13s ease;
}

.panel-head input:hover,
.command-box input:hover,
textarea:hover,
select:hover,
label input:hover {
  border-color: var(--muted);
}

.panel-head input:focus,
.command-box input:focus,
textarea:focus,
select:focus,
label input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-quiet);
}

::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.search-wrap input {
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
}

.search-wrap input:hover,
.search-wrap input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-quiet);
}

kbd {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.primary-button,
.ghost-button,
.icon-button,
.question-grid button {
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-border);
  color: var(--text);
  background: var(--panel);
  padding: 0 var(--space-4);
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: -0.006em;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.13s ease, border-color 0.13s ease, transform 0.13s ease,
    box-shadow 0.13s ease, color 0.13s ease;
}

/* 36px is below the 44px comfortable-tap floor, so `compact` is reserved for
   dense secondary actions (table rows, panel headers) that sit alongside a
   full-size primary -- never for the POS keypad or payment buttons. */
.compact {
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: 0.813rem;
  border-radius: var(--radius-sm);
}

.danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 32%, var(--line-strong));
}

.danger:hover:not(:disabled) {
  background: var(--danger-quiet);
  border-color: var(--red);
}

.primary-button {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / 18%);
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.07);
}

.ghost-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.question-grid button:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--line-strong);
}

/* A small, immediate press response is what separates an interface that feels
   built from one that feels like a document with clickable text. */
.primary-button:active:not(:disabled),
.ghost-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.nav-item:active {
  transform: translateY(1px);
}

.icon-button {
  width: var(--tap);
  padding: 0;
}

.mobile-menu {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-title {
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 22px;
}

h1,
h2,
p {
  margin: 0;
}

/* Was clamp(2rem, 4vw, 3.4rem) -- a 54px page title is marketing-site scale
   and ate the fold on a working dashboard. Operational tools want a title
   that labels the view and then gets out of the way. */
h1 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
  color: var(--text-strong);
}

h2 {
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.011em;
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.688rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.branch-pill,
.count-badge,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 3px var(--space-2);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* A zero count is information, not an alarm -- only tint it when there is
   actually something needing attention. */
.count-badge {
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  justify-content: center;
}

.account-chip {
  gap: 8px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--surface);
}

.account-chip[hidden] {
  display: none;
}

.account-chip span {
  min-width: 0;
  overflow: hidden;
  padding-left: 8px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-grid,
.card-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card,
.panel,
.entity-card,
.report-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

/* A hairline of accent along the top edge of each KPI reads as considered
   without adding another border colour to the page. */
.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 65%);
  opacity: 0.65;
}

.kpi-card strong {
  display: block;
  margin-top: var(--space-2);
  font-size: 1.625rem;
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-strong);
}

.delta {
  display: inline-block;
  margin-top: var(--space-2);
  color: var(--green);
  font-size: 0.813rem;
  font-weight: 550;
}

.dashboard-grid,
.pos-grid,
.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.secondary-grid {
  grid-template-columns: 0.9fr 1.1fr;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

canvas {
  width: 100%;
  height: 320px;
}

.alert-list,
.movement-list,
.recommendation-list,
.pos-products,
.cart-items {
  display: grid;
  gap: 10px;
}

/* Separates the menu from the stock list in the same till panel. A rule rather
   than a gap alone, because the two lists hold the same-shaped rows and without
   a line the boundary reads as an accident of spacing. */
.pos-services-heading {
  margin: var(--space-4) 0 var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-item,
.movement-row,
.recommendation,
.pos-product,
.cart-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  font-size: 0.875rem;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

/* A POS product row is a tap target, not a list item -- it needs to look
   pressable and clear the comfortable-touch floor. */
.pos-product {
  min-height: var(--tap-lg);
  cursor: pointer;
}

.pos-product:hover,
.alert-item[data-view-movement]:hover,
.recommendation:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.pos-product:active {
  transform: translateY(1px);
}

.alert-item.red {
  border-left: 3px solid var(--red);
  background: var(--danger-quiet);
}

.alert-item.amber {
  border-left: 3px solid var(--amber);
  background: var(--warn-quiet);
}

.filters {
  display: grid;
  grid-template-columns: 240px 240px;
  gap: 10px;
  margin-bottom: 12px;
}

.table-panel {
  overflow: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.875rem;
}

/* Sticky header: stock and sales tables run long, and a column you have to
   scroll back up to identify is a column you misread. */
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

tbody tr {
  transition: background-color 0.1s ease;
}

tbody tr:hover {
  background: var(--panel-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  user-select: none;
}

th[data-sort] {
  cursor: pointer;
}

/* Stock status as a pill rather than coloured text. Colour alone is not a
   sufficient signal (WCAG 1.4.1) and, more practically, a bare coloured word
   in a dense table is easy to skim past -- the tinted chip is scannable at a
   glance and still legible to anyone who cannot separate red from green. */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentcolor;
  flex: 0 0 auto;
}

.status.low {
  color: var(--amber);
  background: var(--warn-quiet);
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
}

.status.out {
  color: var(--red);
  background: var(--danger-quiet);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
}

.status.healthy {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
}

.payment-grid,
.question-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

/* A field marked `full` spans both columns. The markup has asked for this on
   eight fields since the supplier dialog was built -- an address, a note, a
   reason -- and nothing ever defined the class, so every one of them sat in a
   half-width cell and pushed its neighbour out of line. Long single-line inputs
   are the ones that need the room, which is exactly where it was marked.
   `.full-width` below is a different thing: a block button, not a grid child. */
.form-grid .full,
.question-grid .full {
  grid-column: 1 / -1;
}

/* Payment method is the last decision before money changes hands, chosen at
   speed with a finger. These get the largest tap target in the app, and the
   selected state is unmistakable rather than a subtle tint. */
.payment-grid button {
  min-height: var(--tap-lg);
  font-weight: 600;
}

.payment-grid button.active,
[data-payment].active {
  background: var(--accent-quiet);
  border-color: var(--accent);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cart-total {
  justify-content: space-between;
  margin: var(--space-4) 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: 0.938rem;
}

/* The final total is the single number a cashier and customer both check, so
   it steps up in size and weight away from the subtotal and discount lines. */
.cart-total:last-of-type strong,
#cartTotal {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.discount-controls {
  margin: 10px 0;
  display: grid;
  gap: 8px;
}

.discount-controls label {
  gap: 6px;
}

.discount-value-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.discount-value-row input {
  flex: 1;
  min-width: 0;
}

.return-item-row {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.return-item-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.return-item-row input {
  width: 100%;
}

.po-supplier-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
}

.po-supplier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.po-item-row {
  display: grid;
  grid-template-columns: 1fr auto 90px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.po-item-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.po-item-row input {
  width: 100%;
}

.pos-product-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.pos-qty-input,
.pos-price-input,
.cart-qty-input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  text-align: center;
}

.pos-price-input {
  width: 90px;
}

.scan-input-row {
  display: flex;
  gap: 8px;
}

.scan-input-row input {
  flex: 1;
  min-width: 0;
}

#barcodeReaderRegion {
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

/* A receipt should read like a receipt -- monospace, narrow measure, dashed
   tear-off edges. ui-monospace ahead of Courier picks up the crisper system
   mono (SF Mono / Cascadia) where available and falls back cleanly. */
.receipt {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.813rem;
  line-height: 1.6;
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-5) var(--space-4);
  max-width: 320px;
  margin: 0 auto;
  color: var(--text);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.receipt-divider {
  border-top: 1px dashed var(--line-strong);
  margin: var(--space-2) 0;
}

.receipt-center {
  text-align: center;
}

.link-button {
  background: none;
  border: none;
  color: var(--blue);
  padding: 0;
  margin-left: var(--space-1);
  font-size: inherit;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  border-radius: 3px;
}

.link-button:hover {
  color: var(--text-strong);
}

/* Disabled controls read as inert rather than merely faded: no pointer, no
   hover response, no press. Note this is the DISABLED state -- role-gated
   controls are hidden outright instead, per the hide-don't-disable decision,
   so a visible-but-dead button never signals hidden capability to staff. */
.ghost-button:disabled,
.primary-button:disabled,
.icon-button:disabled,
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
  transform: none;
}

.sales-range-custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.payment-method-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.payment-method-card .method-total {
  font-size: 1.3rem;
}

.payment-summary {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 4px;
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.store-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.store-switcher select {
  min-width: 160px;
}

.staff-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

/* Reads as a statement of fact, not an editable control: the seller is the
   signed-in account and there is nothing here to change. */
.pos-staff-identity {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 0.813rem;
  font-weight: 550;
}

.pos-staff-identity strong {
  color: var(--text);
  font-size: 0.938rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-breakdown {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 4px;
}

.staff-order-result,
.daily-staff-report {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.staff-order-card,
.daily-staff-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
}

.staff-order-card table,
.daily-staff-card table {
  min-width: 0;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.workflow div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  text-align: center;
  font-weight: 800;
}

.entity-card,
.report-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.warehouse-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.warehouse-zone {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
}

.ai-layout textarea {
  min-height: 160px;
  margin: 12px 0;
  resize: vertical;
}

.ai-answer {
  min-height: 360px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  line-height: 1.5;
  max-width: 92%;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #051310;
  border-color: var(--accent);
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
}

/* Markdown inside an assistant reply. The model answers in Markdown and
   renderChatMarkdown() turns a small subset of it into real elements, so these
   need to sit sensibly inside a bubble rather than inherit page defaults --
   a browser's own ul/ol margins are far too wide in a narrow chat column. */
.chat-bubble p {
  margin: 0 0 6px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble .chat-heading {
  font-weight: 600;
  margin: 10px 0 4px;
}

.chat-bubble .chat-heading:first-child {
  margin-top: 0;
}

.chat-bubble ul,
.chat-bubble ol {
  margin: 4px 0 8px;
  padding-left: 20px;
}

.chat-bubble li {
  margin: 2px 0;
}

.chat-bubble code {
  background: color-mix(in srgb, var(--panel-soft) 60%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.92em;
}

.chat-bubble hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  /* Modals sit above everything, so they carry the heaviest elevation --
     without it a dialog on a dark page reads as an inline panel. */
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}

dialog::backdrop {
  background: rgb(0 0 0 / 62%);
  backdrop-filter: blur(3px);
}

/* Only animate the open transition, and only for users who want motion. */
@media (prefers-reduced-motion: no-preference) {
  dialog[open] {
    animation: dialog-in 140ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

/* The two flex spacers this used to rely on for centring were competing with
   the panel for width -- the panel had no flex-shrink:0, so a pair of 1fr
   pseudo-elements squeezed it into a narrow column pinned to one side.
   `margin: auto` centres a scrollable flex child on both axes without that
   fight, and still lets a tall panel scroll instead of clipping. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: block;
  overflow: hidden;
  padding: 0;
  background: var(--bg);
}

.auth-gate.hidden {
  display: none;
}

/* Two panes: what the product is on the left, the way in on the right. The
   single 440px column that was here made a first impression of a form and
   nothing else. Collapses to one column below 900px, where a phone has no room
   for an argument beside a password field. */
/* Full bleed, both halves floor to ceiling. A centred card floating in a dark
   room reads as a dialog interrupting something; a full screen reads as the
   front of the product. */
.auth-panel {
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/*
  The same warehouse the landing page opens with, so arriving here is
  continuous rather than a flat panel after a photograph.

  Everything inside is pinned to light ink and a fixed dark ground, NOT to the
  theme tokens. Those tokens flip with the light theme, and light-theme text on
  a dark photograph is unreadable -- the panel has its own world now and does
  not follow the switch.

  The 800px variant is deliberate: this column is about 490px wide, so the wide
  file would be three times the pixels for nothing. It is also the same file the
  phone breakpoint of the landing page uses, so anyone arriving from there
  already has it cached.

  Contrast is carried by the scrim, checked against a pure white photograph, so
  swapping the image cannot quietly make the text unreadable.
*/
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  padding: clamp(28px, 5vw, 64px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background-color: #0d1117;
  background-image:
    linear-gradient(180deg, rgb(9 13 18 / 88%) 0%, rgb(9 13 18 / 78%) 55%, rgb(9 13 18 / 90%) 100%),
    url("./images/hero-warehouse-800.jpg");
  background-size: cover;
  background-position: center;
}

.auth-brand .eyebrow { color: #6fe0ab; }
.auth-brand h1 { color: #ffffff; }
.auth-brand .auth-copy { color: #d3dae2; }
.auth-brand .auth-copy a { color: #6fe0ab; }
.auth-brand .auth-why {
  border-color: rgb(244 247 250 / 16%);
  background: rgb(9 13 18 / 45%);
}
.auth-brand .auth-why .eyebrow { color: #9fe8c6; }
.auth-brand .auth-why-list { color: #cbd4de; }
.auth-brand .auth-why-list li::marker { color: #6fe0ab; }
.auth-brand .auth-ledger { border-top-color: rgb(244 247 250 / 18%); }
.auth-brand .auth-ledger-row { color: #c8d1db; }
.auth-brand .auth-ledger-row b { color: #ffffff; }
.auth-brand .auth-ledger-row.short b { color: #ff9d8f; }

/* Plain. No panel, no border, no shadow -- the form sits on the page itself so
   the eye goes to the fields rather than to a box drawn around them. Capped in
   width because a password field stretched across half a monitor is neither
   comfortable nor legible. */
.auth-fields {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: var(--space-4);
  width: min(420px, 100%);
  margin-inline: auto;
  padding: var(--space-8) var(--space-6);
  overflow-y: auto;
  background: transparent;
}

/* The close-of-day figures, in the same ruled shape the landing page uses. */
.auth-ledger {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}
.auth-ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: baseline;
  padding-block: 7px;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-ledger-row b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.auth-ledger-row.short b { color: var(--red); }

@media (max-width: 900px) {
  .auth-panel { grid-template-columns: 1fr; }
  /* The argument is for someone deciding. On a phone, someone opening this
     already decided -- so the form leads and the pitch is not shown at all. */
  .auth-brand { display: none; }
}

.auth-panel h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.125rem);
  letter-spacing: -0.03em;
  font-weight: 680;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.938rem;
}

.auth-why {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.auth-why-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-why-list li::marker {
  color: var(--accent);
}

/* ---- Staff invitation page -------------------------------------------------

   accept-invite.html deliberately does NOT reuse .auth-panel. That class is a
   full-bleed two-pane grid whose left half is a pitch, hidden outright below
   900px -- the right shape for a stranger deciding whether to sign up, and the
   wrong one here. Nobody browses to an invite page. They arrive from a link,
   already invited, most often on the phone the mail landed on, and the one
   thing they must be able to read is who invited them and as what. .auth-brand
   hides exactly that on a phone.

   This page borrowed .auth-panel back when it was a centred card, and kept the
   class after the sign-in gate was rebuilt around a two-column grid. Its four
   plain <div>s were then auto-placed into that grid: heading top-left, invite
   context top-right, fields underneath, no card, no padding. Giving the page
   its own container is what stops the two from breaking each other again. */
.invite-gate {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 100vh;
  padding: clamp(20px, 5vw, 56px) var(--space-4);
  background: var(--bg);
}

/* Capped and centred: this is a short form, and a password field stretched
   across a monitor is neither comfortable nor legible. `margin: auto` centres
   it vertically when it is short and lets the page scroll when it is not,
   which the verification step makes it. */
.invite-panel {
  display: grid;
  gap: var(--space-5);
  width: min(520px, 100%);
  margin: auto;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.invite-panel h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  letter-spacing: -0.03em;
  font-weight: 680;
}

.invite-heading {
  display: grid;
  gap: var(--space-2);
}

/* Each step of the page is one child of the card, so it has to carry its own
   rhythm -- the card's gap only separates the steps from each other. */
.invite-fields {
  display: grid;
  gap: var(--space-4);
}

.auth-consent-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

/* Kept more specific than the checkbox reset below so the nudge survives: this
   caption wraps to two lines, so the box aligns to the first line, not centre. */
.auth-consent-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.auth-consent-row > span {
  flex: 1 1 auto;
  min-width: 0;
}

/* A checkbox is not a text field: the generic `label input` rule above stretches
   it to full width with a 40px field box, and the `label` grid drops it onto its
   own row under the caption. Both get undone here. */
label input[type="checkbox"],
label input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

/* Checkbox and its caption sit on one centred row. */
.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.checkbox-row > span {
  flex: 1 1 auto;
  min-width: 0;
}

/* Ticking "All stores" disables the per-branch boxes (see the change handler in
   app.js). Say so visually, matching the disabled-button treatment above --
   otherwise the rows read as clickable and just silently do nothing. */
.checkbox-row:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.store-checkbox-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Role control panels. Deliberately flatter than .panel: these are read-only
   instrument clusters, and competing with the cards below for attention would
   bury the alerts that actually need acting on. */
.control-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  /* Without min-width:0 a grid/flex child refuses to shrink below its content,
     so the wide staff table pushed the whole page sideways instead of scrolling
     inside its own box. A till is operated on a phone; the body must never
     scroll horizontally. */
  min-width: 0;
  max-width: 100%;
}

.control-scope {
  font-size: 0.8rem;
  white-space: nowrap;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.control-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
}

.control-tile.accent { border-left-color: var(--accent); }
.control-tile.warn { border-left-color: var(--amber); }
.control-tile.danger { border-left-color: var(--red); }

.control-tile-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.control-tile-value {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.control-tile-note {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.control-subhead {
  margin: var(--space-5) 0 var(--space-2);
}

.control-subhead h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 650;
}

/* Wide tables scroll inside their own box; the page itself must never scroll
   sideways on a phone, which is what a till operator is holding. */
.table-scroll {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
}

.control-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 460px;
}

.control-table th,
.control-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.control-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
}

.control-table tr:last-child td { border-bottom: 0; }
.cell-warn { color: var(--amber); font-weight: 600; }
.cell-danger { color: var(--red); font-weight: 650; }

.control-governance {
  display: grid;
  gap: 6px;
}

.governance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px var(--space-4);
  font-size: 0.85rem;
  color: var(--muted);
}

.governance-row strong { color: var(--text); text-align: right; }
.governance-row.warn strong { color: var(--amber); }
.governance-row.danger strong { color: var(--red); }

.field-error {
  display: block;
  min-height: 1em;
  color: var(--red);
  font-size: 0.78rem;
  line-height: 1.3;
}

/* Show/hide on a password box.
 *
 * The control sits INSIDE the field rather than beside it: these forms are laid
 * out as a two-column grid that collapses to one on a phone, and a button added
 * as a sibling would take a grid cell of its own and drop onto the next line,
 * leaving the input looking cut in half.
 *
 * The wrapper is added by script around the existing input, so the input keeps
 * its own id, name, autocomplete and validation exactly as they were -- a
 * password manager must not be able to tell the difference. */
.password-field {
  position: relative;
  display: block;
}

.password-field > input {
  width: 100%;
  /* Room for the button, so a long password never runs underneath it. */
  padding-right: 2.6rem;
}

.password-reveal {
  position: absolute;
  top: 0;
  right: 0.3rem;
  /* The wrapper holds the input and this button and nothing else -- the label
   * text and the validation message stay outside it -- so full height here is
   * exactly the input's height, at any font size, without hard-coding one. */
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.password-reveal:hover {
  color: var(--text);
}

.password-reveal svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.legal-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  line-height: 1.7;
}

.legal-doc h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.legal-doc h2 {
  font-size: 1.15rem;
  margin-top: 34px;
  margin-bottom: 10px;
  color: var(--accent);
}

.legal-doc h3 {
  font-size: 1rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-doc p,
.legal-doc li {
  color: var(--muted);
  font-size: 0.94rem;
}

.legal-doc ul,
.legal-doc ol {
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.legal-doc .doc-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.legal-doc .placeholder {
  color: var(--amber);
  font-weight: 700;
}

.legal-doc .back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--blue);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-soft);
}

/* Field labels: the caption is muted, but the value the user types must be
   full-contrast or the form reads as disabled. */
label {
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 0.813rem;
  font-weight: 550;
}

label input,
label select,
label textarea {
  color: var(--text);
  font-size: 0.938rem;
  font-weight: 400;
}

.end {
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.toast {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  max-width: min(420px, calc(100vw - 40px));
  transform: translateY(140%);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms ease;
  background: var(--surface);
  color: var(--text);
  --banner-hue: var(--accent);
  border: 1px solid color-mix(in srgb, var(--banner-hue) 45%, var(--line-strong));
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  /* The lift it always had, plus the same radiance the banners carry, so a
     confirmation and a standing notice look like the same system speaking.
     The left bar is gone: the chip above now says who is talking, and the two
     together read as a stripe plus a badge rather than one mark. */
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px color-mix(in srgb, var(--banner-hue) 25%, transparent),
    0 0 26px -6px color-mix(in srgb, var(--banner-hue) 50%, transparent);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.toast-message {
  color: var(--text);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.command-palette {
  position: fixed;
  inset: 0;
  display: none;
  place-items: start center;
  padding-top: 12vh;
  background: rgb(0 0 0 / 52%);
  backdrop-filter: blur(3px);
  z-index: 30;
}

.command-palette.open {
  display: grid;
}

.command-box {
  width: min(620px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
}

.command-result {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-1);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.command-result:hover {
  background: var(--panel-soft);
  color: var(--text-strong);
}

/* Banners are SYSTEM NOTIFICATIONS, and they say who is speaking.
 *
 * One hue token drives the whole thing -- border, glow, and the brand chip --
 * so a banner picks its severity by setting --banner-hue and nothing else has
 * to be restated. Three levels, and they mean three different things:
 *   amber  something wants attending to
 *   red    data or money is at risk
 *   accent the app itself, with nothing wrong
 */
.verify-banner {
  --banner-hue: var(--amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--banner-hue);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--banner-hue) 14%, var(--panel));
  /* The radiance: a tight ring plus a soft bloom, both from the same hue. Kept
     low and negative-spread so it reads as a lit edge rather than a drop
     shadow, which on a cheap handset at midday is the difference between
     "notification" and "smudge". */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--banner-hue) 30%, transparent),
    0 0 26px -5px color-mix(in srgb, var(--banner-hue) 55%, transparent);
  color: var(--text);
  font-size: 0.9rem;
}

/* Who is speaking. The mark is a CSS mask rather than inline SVG so one rule
   covers every banner and the glyph takes --banner-hue with the border, and so
   a banner that has to render while the app is degraded needs no extra
   request. The name is not translated: it is a proper noun. */
.banner-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--banner-hue);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.banner-brand::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--savia-mark) center / contain no-repeat;
  mask: var(--savia-mark) center / contain no-repeat;
}

/* Takes the slack, so the brand sits left and the controls stay right. */
.banner-message {
  flex: 1 1 260px;
  min-width: 0;
}

.verify-banner[hidden] {
  display: none;
}

/* A new build is good news, not a warning. Amber is right for the banners that
   want something fixed -- an unverified email, an unsynced sale -- and wrong
   here, where nothing is broken and nothing is owed. The accent puts it in the
   product's own colour instead, with the mark beside it, so it reads as the
   app speaking rather than as a fault being reported. */
.update-banner {
  --banner-hue: var(--accent);
}

/* .link-button is --blue everywhere else, which on an accent-tinted banner is
   a third hue fighting the other two. The link keeps its underline so it still
   reads as a link, but takes the text colour and hangs the underline off the
   accent. */
.update-banner .link-button {
  color: var(--text-strong);
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.update-banner .link-button:hover {
  text-decoration-color: currentColor;
}

/* Pending account deletion is not a nudge -- it is a countdown to
   irreversible data loss, so it reads as an alert rather than a suggestion. */
.danger-banner {
  --banner-hue: var(--red);
  font-weight: 550;
}

@media (max-width: 1100px) {
  .kpi-grid,
  .card-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .secondary-grid,
  .pos-grid,
  .ai-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  /* The search box measured 35px wide on a 375px screen -- unusable. Its two
     flex siblings were taking 107px of a 189px row: a decorative "Search"
     label duplicating the placeholder, and a keyboard shortcut hint for a
     shortcut no touch device can perform. Both go, and the field gets the
     128px back. The label is safe to drop because it was never associated
     with the input; a real aria-label now does that job. */
  .search-wrap > span,
  .search-wrap > kbd {
    display: none;
  }

  /* iOS Safari zooms the page whenever a focused input is under 16px, and
     every field here was 15px. The user then has to pinch back out, mid-sale.
     Applied only at this breakpoint so desktop keeps its denser type. */
  input,
  select,
  textarea,
  /* label-wrapped fields need the same specificity as the (0,0,2) rule that
     sets them to 0.938rem, or they keep it: a media query adds no specificity,
     so source order never gets a say. 45 of the 59 fields sit inside a label,
     which is exactly the set that stayed at 15px on the first attempt. */
  label input,
  label select,
  label textarea {
    font-size: 16px;
  }

  /* Tap targets. The label is the real target for a wrapped checkbox, and this
     row was 18px tall against a 44px guideline -- a miss at the till is a
     setting silently toggled, or not toggled, with no feedback either way. */
  .checkbox-row,
  .checkbox-row label {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 285px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 25;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-grid;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .account-chip {
    grid-column: 1 / -1;
    max-width: none;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .kpi-grid,
  .card-grid,
  .report-grid,
  .filters,
  .payment-grid,
  .payment-method-grid,
  .sales-range-custom,
  .question-grid,
  .form-grid,
  .workflow,
  .warehouse-map {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.1rem;
  }
}

/* Visible only when focused. Sits above the top layer's siblings so it is not
   clipped by the shell, and is the first thing Tab reaches on any view. */
.skip-link {
  position: fixed;
  top: var(--space-3, 12px);
  left: var(--space-3, 12px);
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-sm, 8px);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
  transition: transform 140ms ease;
}
.skip-link:focus-visible,
.skip-link:focus {
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* The main landmark takes focus from the skip link but must not draw a ring
   when clicked with a mouse. */
.main:focus { outline: none; }

/* box-shadow rings vanish in Windows high-contrast mode, which strips shadows.
   An outline keeps a visible focus indicator for exactly the users most likely
   to be navigating by keyboard. */
@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}

/* Results are buttons now, so they need the button reset the app applies
   elsewhere -- otherwise they inherit UA chrome and lose full-width layout. */
.command-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

/* Rendering without JavaScript is worse than rendering nothing: the shell
   markup contains every view, so six of them stack up complete with buttons
   and form fields that respond to nothing. A shopkeeper reads that as a broken
   product rather than an unsupported browser. */
.app-unavailable { display: none; }

/* Everything except the message, rather than a list of the containers that
   happen to exist today. #authGate sits outside .app-shell and was still
   rendering a full sign-in form under the notice; the next top-level element
   added would have done the same. */
.js-pending body > *:not(.app-unavailable) { display: none; }

.js-pending .app-unavailable {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-5, 24px);
  /* Held back briefly so a normal load never flashes it: a browser that CAN
     run modules clears .js-pending during parse, long before this fades in. */
  opacity: 0;
  animation: app-unavailable-in 200ms ease 700ms forwards;
}

@keyframes app-unavailable-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .js-pending .app-unavailable { animation-duration: 1ms; }
}

.app-unavailable-card {
  max-width: 40ch;
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  padding: var(--space-5, 24px);
  border: 1px solid var(--line, #262d38);
  border-radius: var(--radius, 12px);
  background: var(--panel, #171b21);
  color: var(--text, #f2f5f9);
  line-height: 1.55;
}
.app-unavailable-card strong { font-size: 1.05rem; color: var(--text-strong, #fff); }
.app-unavailable-card p { color: var(--muted-strong, #b6c0d0); font-size: 0.94rem; }

/* Shift and cash reconciliation panel. */
.shift-panel { display: flex; flex-direction: column; gap: var(--space-4, 16px); }
.shift-open { display: flex; flex-direction: column; gap: var(--space-3, 12px); }
.shift-facts { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px) var(--space-5, 24px); }
.shift-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3, 12px);
}
.shift-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 150px; }
.shift-field span { font-size: 0.8rem; color: var(--muted); }
/* Variance carries meaning, so it is coloured as well as signed: a drawer that
   is short reads differently from one that is over. */
.control-table td.warn { color: var(--amber); }
.control-table td.danger { color: var(--red); }
.control-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .shift-actions { flex-direction: column; align-items: stretch; }
}

/* The hidden attribute means "this is not here". It was losing: label sets
   display:grid and .auth-consent-row sets display:flex, so setAuthMode("signin")
   hid three fields that the stylesheet kept drawing -- someone signing in was
   shown Business name, Confirm password and a consent checkbox they had no
   business seeing. There is no case where an element should be hidden and
   visible at once, so this is allowed to be absolute. */
[hidden] {
  display: none !important;
}

/* Receive delivery -- DESIGN-landed-costs.md phase 4.
   Wider than the standard dialog because this one carries a table: the docx
   section 6 allocation preview has six columns, and at 760px they wrap into
   unreadability on a laptop. The min() keeps it inside a phone viewport, where
   the table scrolls horizontally inside .table-scroll rather than pushing the
   page sideways. */
dialog.wide-dialog {
  width: min(1040px, calc(100vw - 28px));
}

.delivery-block {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.delivery-block h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

/* One product line. Wide enough for a product name, then two numeric boxes and
   a remove button; collapses to a stack on a phone rather than shrinking the
   product picker to a width nobody can read a name in. */
.delivery-line {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr) auto;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-3);
}

.delivery-line.has-manual {
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 1.1fr) auto;
}

.delivery-line label {
  min-width: 0;
}

.delivery-line .line-remove {
  /* Aligns with the inputs rather than their labels. */
  margin-bottom: 2px;
}

/* The new-product fields are the LAST child of the row and span every column, so
   they fall onto a second grid row underneath Product / Quantity / Total paid
   rather than pushing those three sideways out of alignment. */
.delivery-line-new {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.delivery-line-new-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.delivery-line-new-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: end;
}

.delivery-line-new-fields label {
  min-width: 0;
}

@media (max-width: 720px) {
  .delivery-line-new-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .delivery-line,
  .delivery-line.has-manual {
    grid-template-columns: 1fr 1fr;
  }
  .delivery-line > label:first-child {
    grid-column: 1 / -1;
  }
}

/* The preview's TOTAL row. It is the number the shop reconciles against the
   supplier's invoice, so it is the one row that must not read as another line. */
.delivery-preview-total td {
  font-weight: 650;
  border-top: 2px solid var(--line-strong);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The Profit Report -- DESIGN-landed-costs.md phase 6, docx section 9.
   A statement, not a grid of tiles. The figures are read down a column and
   compared to each other, which is what a right-aligned single column of money
   is for; four tiles put them side by side, where GROSS and NET read as two
   unrelated headlines. */
.statement-wrap {
  overflow-x: auto;
}

table.statement {
  width: 100%;
  border-collapse: collapse;
  /* Tabular figures, so the digits line up down the column. Without it a 1 is
     narrower than an 8 and a column of money reads as ragged. */
  font-variant-numeric: tabular-nums;
}

table.statement th,
table.statement td {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

table.statement th {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

/* The caption under each line: what the figure is computed from, and what it is
   not. DESIGN-purchases.md 11 -- completeness is stated, never assumed -- and
   this is where it is stated. */
table.statement th span.muted {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 400;
}

table.statement td {
  text-align: right;
  white-space: nowrap;
  font-weight: 550;
}

/* GROSS PROFIT and NET PROFIT. A rule above and heavier type, because they are
   subtotals of the lines above them and not more lines.

   Written as `table.statement .statement-total td`, not `.statement-total td`.
   The shorter form loses to `table.statement td` above on specificity -- two
   elements and a class beats one element and a class -- so the border applied
   and the weight silently did not. Caught by measuring the rendered weight,
   which came back identical to an ordinary line. */
table.statement .statement-total th,
table.statement .statement-total td {
  border-top: 2px solid var(--line-strong);
  font-weight: 700;
}

table.statement .statement-bottom th,
table.statement .statement-bottom td {
  border-bottom: none;
  font-size: 1.05rem;
}

/* The tones the tiles used, kept: a gross profit that has gone negative on real
   revenue, and a net profit at or below zero. */
/* --red and --amber, which are the tokens this file actually defines. The first
   version used --danger and --warn: undefined custom properties, so `color`
   resolved to nothing and the tone silently did not apply. Same names
   .control-table td.warn already uses. */
table.statement td.danger { color: var(--red); }
table.statement td.warn { color: var(--amber); }

@media (max-width: 560px) {
  table.statement th,
  table.statement td {
    padding: var(--space-2) 0;
  }
}

/* The docx section 10 drill-down. Nine columns of which seven are money, so the
   figures get the same treatment as the statement above them: right-aligned,
   tabular digits, and a TOTAL row ruled off. Reuses .statement-total, which is
   why that rule is scoped to `table.statement` AND matched here explicitly --
   see the specificity note above. */
table.statement-figures {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.statement-figures th,
table.statement-figures td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.statement-figures th { text-align: left; }

/* Every column but the product name is a figure. */
table.statement-figures th:not(:first-child),
table.statement-figures td:not(:first-child) {
  text-align: right;
}

table.statement-figures .statement-total td {
  border-top: 2px solid var(--line-strong);
  border-bottom: none;
  font-weight: 700;
}

table.statement-figures td.danger { color: var(--red); }

/* Nav icons. Inline SVG rather than an icon font or a sprite: this app is
   offline-first and ships no external assets beyond the Firebase SDK, so an
   icon that needed the network would be a blank square on the one day it
   matters most.

   Stroked in currentColor, so they inherit the nav item's own colour and
   follow hover, the active state and the light/dark theme with no extra rules
   and nothing to keep in sync. */
.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Slightly recessive against the label, which is what a reader scans. The
     active item brings its icon up to full strength below. */
  opacity: 0.75;
  transition: opacity 0.13s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

/* A dormant nav item: named, visible, and plainly not ready. Dimmed and
   non-interactive, with a badge that says why -- a greyed-out control with no
   explanation reads as a fault, and a shop that thinks a tab is broken calls
   about it. Pointer events are off as well as `disabled`, so the cursor never
   suggests it can be pressed. */
.nav-item-dormant {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.nav-item-dormant:hover {
  background: transparent;
}
.nav-soon {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.75;
  white-space: nowrap;
}




/* The invite link, shown so it can be read, selected or typed out when the
   clipboard refuses. Monospace and full width because it is a long token that
   somebody may have to check character by character over a phone call. */
.invite-link-label {
  display: block;
  margin: var(--space-3) 0;
}
.invite-link-label input {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

/* The reports chooser.
   The first version reached for two custom properties this file never
   defines (a "surface-2" and a plain "border"). Both fell back to nothing, so
   every card rendered with no background and no outline -- eighteen reports as
   bare text floating in a panel. Only tokens declared above are used here. */

.reports-index-list {
  display: grid;
  gap: var(--space-5);
}

.report-group-label {
  margin: 0 0 var(--space-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* A hairline running out from the label ties the group's cards to their
   heading without drawing a box around them. */
.report-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.report-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

/* One card per report: icon, name, and a line saying what it answers. The
   name alone made the reader open three reports to find the one they meant. */
.report-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  min-height: 64px;
  padding: var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.report-choice:hover,
.report-choice:focus-visible {
  border-color: var(--accent);
  background: var(--panel-hover);
}
/* Movement only where the device says it is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .report-choice:hover { transform: translateY(-1px); }
}
.report-choice:active { transform: none; }

.report-choice-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-quiet);
  color: var(--accent);
}
.report-choice-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.report-choice-name {
  font-weight: 600;
  color: var(--text);
  /* Long report names wrap rather than overflow their card. */
  overflow-wrap: anywhere;
}
.report-choice-hint {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--muted);
}

.report-choice-go {
  flex: 0 0 auto;
  align-self: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}
.report-choice-go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.report-choice:hover .report-choice-go,
.report-choice:focus-visible .report-choice-go {
  opacity: 1;
  transform: translateX(2px);
}
/* A pointer is not guaranteed: on a phone the chevron is the only thing
   saying these cards go somewhere, so it stays put. */
@media (hover: none) {
  .report-choice-go { opacity: 0.55; }
}

/* Cashier permissions -- DESIGN-permissions.md. The checklist the owner ticks,
   in the invite dialog and on the roster. */
.permission-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.permission-row { align-items: flex-start; gap: var(--space-2); }
.permission-row .permission-name { display: block; font-weight: 600; }
.permission-hint { display: block; font-size: 0.85rem; line-height: 1.35; }
.permission-summary { font-size: 0.85rem; margin-top: 2px; }

/* A cashier's delivery request: product, quantity, remove. */
.request-search-results { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.request-line {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel-soft); margin-bottom: var(--space-2);
}
.request-line-name { flex: 1; font-weight: 600; }
.request-line label { flex-direction: row; align-items: center; gap: var(--space-2); margin: 0; }
.request-line input { width: 96px; }

/* Today's takings at the till. */
.pos-today-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; }
.pos-today-row + .pos-today-row { border-top: 1px solid var(--line); }

/* What changed, per release. The version and its badge sit on one line so a
   shop can see at a glance which block is the one they are about to get, and
   the list below it reads as prose rather than as a settings table. */
.whats-new-release + .whats-new-release {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.whats-new-release h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.whats-new-release h3 .muted {
  font-size: 0.8rem;
  font-weight: 500;
}

.whats-new-release ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.whats-new-release li {
  line-height: 1.5;
}

#whatsNewContent {
  max-height: 55vh;
  overflow-y: auto;
}

/* From / To / This month, on one line. The Profit Report asks for a period the
   same way the Cost of Goods Sold report does, so the two screens do not ask
   the same question in two different shapes. Wraps rather than squashing on a
   narrow handset, which is most of them. */
.period-picker {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.period-picker > label {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: inherit;
}

.period-picker input {
  min-width: 9.5rem;
}

/* A panel head was built for a title and ONE month box. Six of them now hold a
   three-part period picker, which on a handset is wider than the title beside
   it -- and .panel-head is a non-wrapping flex row, so without this the dates
   are pushed off the edge of the screen. Wrapping puts the picker on its own
   line instead, which is where it was going to end up anyway. */
.panel-head {
  flex-wrap: wrap;
}

/* Below this the two date boxes cannot both keep their 9.5rem and still fit, so
   they stop insisting on it and share the row. The min-width:0 matters: a flex
   item will not shrink past its min-width however little room is left. */
@media (max-width: 560px) {
  .period-picker {
    width: 100%;
  }

  .period-picker > label {
    flex: 1 1 8rem;
  }

  .period-picker input {
    min-width: 0;
  }
}

/* The audit tiles. Same grid, dialled down: they are worth watching and they
   are not what the owner came to find out, so they read as a second voice
   rather than competing with the trading figures above them. A tile that has
   something to say still sets its own warn/danger tone, which overrides this. */
.control-grid-quiet .control-tile {
  background: var(--panel-soft);
}

.control-grid-quiet .control-tile-value {
  font-size: 1.05rem;
}

/* The nav, grouped. Five entries instead of fourteen: a flat list was right at
   eight screens and a wall at fourteen, and a shopkeeper looking for the till
   read past nine other things to find it.

   <details> rather than a scripted accordion, so the open state is the
   browser's own, the keyboard and screen-reader behaviour come free, and the
   nav still works if the group script never runs. */
.nav-group[hidden] {
  display: none;
}

.nav-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  list-style: none;
  user-select: none;
}

/* The default triangle, replaced by our own so it sits on the right where a
   disclosure belongs rather than crowding the icon on the left. */
.nav-group-head::-webkit-details-marker { display: none; }

.nav-group-head::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 140ms ease;
  opacity: 0.7;
}

.nav-group[open] > .nav-group-head::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.nav-group-head:hover {
  background: var(--panel-hover);
  color: var(--text);
}

/* Indented, so a child reads as belonging to the group above it rather than as
   another top-level destination. */
.nav-group > .nav-item {
  padding-left: 30px;
}
