/* The Gastronome System — built on The Gastronome design system (thegastronome.co.ke).
   White page, one red, square corners, Raleway with Cormorant for page titles. */
:root {
  --surface: #ffffff;
  --surface-wash: #f7f3f0;
  --brand-wash: #f6ecec;
  --line: #e5e5e5;
  --line-strong: #cfc8c4;
  --ink: #333333;
  --ink-2: #5c5552;           /* derived: secondary small text, 7.3:1 on surface */
  --ink-muted: #888888;       /* large text and marks only (3.5:1) */
  --brand: #941a1d;
  --brand-deep: #6e1316;
  --on-brand: #ffffff;
  --good: #2e6b3a; --good-wash: #e9f3eb;
  --warn: #7a5600; --warn-wash: #fbf2d9;
  --bad: #6e1316;  --bad-wash: #f6ecec;
  --danger: var(--bad);
  --focus: #941a1d;
  --serif: Cormorant, "Cormorant Garamond", Georgia, serif;
  --sans: Raleway, "Helvetica Neue", Arial, sans-serif;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px; --space-6: 48px;
  --radius-sm: 3px;
  --shadow-float: 0 8px 24px rgba(51, 51, 51, .18);
  --topbar: 56px;
  --sidebar: 236px;
  /* Aliases for names some page styles use. They were never defined, so those rules fell back to nothing
     (the live floor's active area tab was red text on red). Keep them pointing at the system tokens. */
  --brand-ink: var(--on-brand);
  --soft: var(--surface-wash);
  --danger-bg: var(--bad-wash);
  --warn-bg: var(--warn-wash);
  --font: var(--sans);
  /* Motion. Strong curves; UI motion stays under 300ms. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 24px; font-variant-numeric: lining-nums;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 var(--space-2); }
small, .small { font-size: 13px; line-height: 20px; }
.muted { color: var(--ink-2); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[x-cloak] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-1);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent;
  color: var(--ink); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-wash); color: var(--brand); }
.icon-btn[aria-expanded="true"] { background: var(--brand-wash); color: var(--brand); }
.icon-btn .dot {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center;
  box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums;
}
.wordmark { display: flex; align-items: baseline; gap: 6px; color: var(--brand); white-space: nowrap; }
.wordmark:hover { text-decoration: none; color: var(--brand-deep); }
.wordmark .the { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.wordmark .name { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; letter-spacing: .5px; min-width: 0; }
.crumbs .sep { color: var(--line-strong); }
.crumbs a { color: var(--ink); }
.topbar .spacer { flex: 1; }
.site-switch select {
  height: 36px; border: 1px solid var(--line); background: var(--surface); padding: 0 28px 0 10px; font: 500 13px var(--sans); color: var(--ink);
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border: 0; background: transparent; cursor: pointer; color: var(--ink); font: inherit; }
.user-chip:hover { background: var(--surface-wash); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.user-chip .who { text-align: left; line-height: 16px; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who span { font-size: 12px; color: var(--ink-2); }
.menu {
  position: absolute; right: var(--space-2); top: calc(var(--topbar) - 4px); min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-float); padding: 6px 0; z-index: 60;
}
.menu a, .menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 16px; color: var(--ink); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-wash); color: var(--brand); text-decoration: none; }
.menu .menu-head { padding: 10px 16px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

.scrim { position: fixed; inset: var(--topbar) 0 0 0; background: rgba(0,0,0,.25); z-index: 45; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidenav { border-right: 1px solid var(--line); padding: var(--space-3) 0; position: sticky; top: var(--topbar); align-self: start; max-height: calc(100vh - var(--topbar)); overflow-y: auto; }
.sidenav .app-title { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-3) var(--space-2); font-weight: 300; font-size: 20px; line-height: 28px; color: var(--brand); }
.sidenav nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px var(--space-3); color: var(--ink);
  font-size: 14px; font-weight: 500; letter-spacing: .3px;
}
.sidenav nav a svg { color: var(--ink-2); flex: none; }
.sidenav nav a:hover { background: var(--surface-wash); text-decoration: none; color: var(--brand); }
.sidenav nav a:hover svg { color: var(--brand); }
.sidenav nav a[aria-current="page"] { background: var(--brand-wash); color: var(--brand); font-weight: 600; }
.sidenav nav a[aria-current="page"] svg { color: var(--brand); }
.sidenav .side-foot { margin: var(--space-3) var(--space-3) 0; padding-top: var(--space-2); border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--ink-2); }
.main { padding: var(--space-3) var(--space-4) var(--space-6); min-width: 0; }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.page-head h1 { font-family: var(--serif); font-weight: 700; font-size: 36px; line-height: 40px; color: var(--ink); letter-spacing: -.01em; }
.page-head .sub { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.page-head .actions { display: flex; gap: var(--space-1); flex-wrap: wrap; align-items: center; }
h2.section { font-weight: 300; font-size: 22.5px; line-height: 36px; color: var(--brand); margin: var(--space-4) 0 var(--space-2); }
h2.section:first-child { margin-top: 0; }
h3.label { font-size: 14.4px; line-height: 24px; font-weight: 600; margin-bottom: var(--space-1); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 var(--space-2);
  border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand);
  font: 600 13px/20px var(--sans); letter-spacing: .02em; text-transform: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); text-decoration: none; }
.btn:focus-visible { outline-color: var(--brand); }
.btn.secondary { background: var(--surface); color: var(--brand); }
.btn.secondary:hover { background: var(--brand-wash); color: var(--brand-deep); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-wash); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-wash); border-color: var(--bad); color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; letter-spacing: .6px; }
.btn.lg { height: 52px; padding: 0 var(--space-3); font-size: 14px; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.btn-row { display: flex; gap: var(--space-1); flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- panels & layout helpers */
.panel { border: 1px solid var(--line); background: var(--surface); }
.panel + .panel { margin-top: var(--space-3); }
/* Inside a grid the gap spaces the panels; the stacking margin would push the second column down. */
:is(.grid, .grid-2, .home-charts) > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 14px var(--space-3); border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-weight: 300; font-size: 19px; line-height: 28px; color: var(--brand); }
.panel-body { padding: var(--space-3); }
.panel-body.flush { padding: 0; }
.wash { background: var(--surface-wash); }
.grid { display: grid; gap: var(--space-3); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack > * + * { margin-top: var(--space-3); }

/* Figures strip: a ruled row of figures, not tiles */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); }
.figure { padding: 14px var(--space-2) 16px; border-right: 1px solid var(--line); }
.figure:last-child { border-right: 0; }
.figure .k { font-size: 13px; line-height: 18px; color: var(--ink-2); font-weight: 500; }
.figure .v { font-size: clamp(19px, 1.7vw, 24px); line-height: 32px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; margin-top: 4px; color: var(--ink); }
.figure .v.brand { color: var(--brand); }
.figure .v.good { color: var(--good); }
.figure .v.bad { color: var(--bad); }
.figure .h { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.figure .h.bad { color: var(--bad); font-weight: 600; }
.figure .h.good { color: var(--good); font-weight: 600; }

/* definition list */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--space-3); margin: 0; }
dl.facts dt { color: var(--ink-2); font-size: 13px; }
dl.facts dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-2);
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--surface);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:hover td { background: #fcfaf9; }
table.data tr.row-link { cursor: pointer; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
table.data td.strong, table.data .strong { font-weight: 600; }
table.data .sub { display: block; font-size: 12.5px; color: var(--ink-2); }
table.data input, table.data select { height: 34px; }
.panel table.data th:first-child, .panel table.data td:first-child { padding-left: var(--space-3); }
.panel table.data th:last-child, .panel table.data td:last-child { padding-right: var(--space-3); }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; background: var(--surface-wash); color: var(--ink); }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; opacity: .85; }
.badge.good { background: var(--good-wash); color: var(--good); }
.badge.warn { background: var(--warn-wash); color: var(--warn); }
.badge.bad { background: var(--bad-wash); color: var(--bad); }
.badge.plain::before { display: none; }
.tag { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--ink-2); margin: 0 4px 4px 0; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: var(--space-3); overflow-x: auto; }
.tabs button, .tabs a {
  appearance: none; border: 0; background: none; padding: 12px var(--space-2) 11px; margin-bottom: -1px; cursor: pointer;
  font: 500 14px/20px var(--sans); letter-spacing: .5px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover, .tabs a:hover { color: var(--brand); text-decoration: none; }
.tabs [aria-selected="true"], .tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs.tabs-wrap { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
.tabs .count { margin-left: 6px; font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); }
.form-grid .full { grid-column: 1 / -1; }
.field label, label.lbl { display: block; font-size: 13px; line-height: 20px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.field .help { font-size: 12.5px; line-height: 18px; color: var(--ink-2); margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=week], input[type=time], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: 400 15px var(--sans); color: var(--ink);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 22px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: #757575; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error-text { color: var(--bad); font-size: 13px; margin-top: 4px; }
.form-actions { display: flex; gap: var(--space-1); justify-content: flex-end; margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- flash & notices */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 12px var(--space-2); margin-bottom: var(--space-3); font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--good-wash); border-color: #bfd9c4; color: #1f4d29; }
.flash.err { background: var(--bad-wash); border-color: #e2c3c4; color: var(--bad); }
.flash.info { background: var(--surface-wash); border-color: var(--line); color: var(--ink); }
.flash ul { margin: 0; padding-left: 18px; }
.notice { padding: 12px var(--space-2); background: var(--surface-wash); font-size: 14px; color: var(--ink); margin-bottom: var(--space-3); }
.notice b { color: var(--brand); }

.empty { padding: var(--space-6) var(--space-3); text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; font-size: 15px; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; }
.chart text { font-family: var(--sans); fill: var(--ink-2); font-size: 11px; }
.chart .bar { fill: var(--brand); }
.chart .bar.alt { fill: #d9a7a8; }
.chart .grid { stroke: var(--line); }
.legend { display: flex; gap: var(--space-2); font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

/* meter (budget used etc.) */
.meter { height: 6px; background: var(--surface-wash); position: relative; margin-top: 6px; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--brand); }
.meter.over > span { background: var(--bad); }

/* ---------------------------------------------------------------- login */
/* ---------------------------------------------------------------- sign-in (Login, Forgot, Reset) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--space-4) var(--space-2); }
.auth-card { width: 100%; max-width: 440px; padding: var(--space-4) var(--space-4) var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.auth-card .wordmark { font: 700 34px/1 var(--serif); letter-spacing: -.02em; }
.auth-card h1 { font-weight: 300; font-size: 22.5px; line-height: 36px; color: var(--brand); margin: var(--space-3) 0 var(--space-2); }
.auth-card .btn.lg { width: 100%; margin-top: var(--space-1); }
.auth-card .check { margin: 4px 0 0; }
.auth-card .small a { font-weight: 600; }
.seg { display: inline-flex; padding: 2px; margin-bottom: var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-wash); }
.seg button { min-height: 36px; padding: 6px 18px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font: 600 13px/1 var(--sans); cursor: pointer; }
.seg button.on, .seg button[aria-checked="true"] { background: var(--brand); color: var(--on-brand); }
.field-req { font-weight: 500; color: var(--ink-2); }
.notice table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.notice td { padding: 3px 0; }
.demo-accounts { margin-top: var(--space-4); border-top: 1px solid var(--line); padding-top: var(--space-2); }
.demo-accounts summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand); }
.demo-accounts table { width: 100%; border-collapse: collapse; margin-top: var(--space-1); font-size: 13px; line-height: 18px; }
.demo-accounts td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.demo-accounts button { border: 0; background: none; color: var(--brand); cursor: pointer; font: 600 13px var(--sans); padding: 0; text-align: left; }
.demo-accounts button:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- POS register */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: calc(100vh - var(--topbar)); margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-4)) calc(-1 * var(--space-6)); }
.pos-menu { padding: var(--space-3); overflow-y: auto; }
.pos-cats { display: flex; gap: 0; margin-bottom: var(--space-2); flex-wrap: wrap; border: 1px solid var(--line); width: max-content; max-width: 100%; }
.pos-cats button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 10px 16px; font: 500 14px var(--sans); cursor: pointer; color: var(--ink); }
.pos-cats button:last-child { border-right: 0; }
.pos-cats button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.pos-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1px; padding: 1px; }
.pos-items .pos-item { box-shadow: 0 0 0 1px var(--line); }
.pos-item { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 104px; padding: 14px; border: 0; background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.pos-item:hover { background: var(--brand-wash); }
.pos-item:active { background: #efdcdc; }
.pos-item b { font-weight: 600; font-size: 15px; line-height: 20px; }
.pos-item .price { font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 600; }
.pos-item .tags { font-size: 11.5px; color: var(--ink-2); }
.pos-cart { border-left: 1px solid var(--line); display: flex; flex-direction: column; background: var(--surface); position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); }
.pos-cart .cart-head { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.pos-cart .cart-lines { flex: 1; overflow-y: auto; padding: 0 var(--space-3); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .qty { display: flex; align-items: center; gap: 6px; }
.cart-line .qty button { width: 28px; height: 28px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font: 600 15px var(--sans); color: var(--ink); }
.cart-foot { border-top: 1px solid var(--line); padding: var(--space-2) var(--space-3) var(--space-3); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cart-total b { font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tender-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin: var(--space-2) 0; }
.tender-tabs button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 10px 4px; font: 600 12px var(--sans); letter-spacing: .6px; text-transform: uppercase; cursor: pointer; color: var(--ink); }
.tender-tabs button:last-child { border-right: 0; }
.tender-tabs button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.offline-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 8px; background: var(--warn-wash); color: var(--warn); }
.online-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 8px; background: var(--good-wash); color: var(--good); }

/* receipt */
.receipt { max-width: 360px; margin: 0 auto; padding: var(--space-3); border: 1px dashed var(--line-strong); font-size: 13px; line-height: 20px; background: #fff; }
.receipt .center { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 10px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; }

/* ---------------------------------------------------------------- treasury flow */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); }
.flow .step { padding: var(--space-2); border-right: 1px solid var(--line); position: relative; }
.flow .step:last-child { border-right: 0; }
.flow .step .k { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.flow .step .v { font-size: 20px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0; }
.flow .step.key { background: var(--brand-wash); }
.flow .step.key .v { color: var(--brand); }
.flow .step:not(:last-child)::after {
  content: ""; position: absolute; right: -7px; top: 50%; width: 12px; height: 12px; background: var(--surface);
  border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); transform: translateY(-50%) rotate(45deg); z-index: 1;
}
.flow .step.key:not(:last-child)::after { background: var(--brand-wash); }

/* ---------------------------------------------------------------- print */
@media print {
  .topbar, .sidenav, .page-head .actions, .tabs, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .panel { border: 0; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid.side, .grid.three { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidenav { position: fixed; left: 0; top: var(--topbar); bottom: 0; width: 260px; background: var(--surface); z-index: 44; transform: translateX(-100%); transition: transform 280ms var(--ease-drawer); max-height: none; }
  .sidenav.open { transform: none; box-shadow: var(--shadow-float); }
  .main { padding: var(--space-2) var(--space-2) var(--space-6); }
  .grid.two, .form-grid { grid-template-columns: 1fr; }
  .crumbs, .user-chip .who { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .pos { grid-template-columns: 1fr; margin: calc(-1 * var(--space-2)); }
  .pos-cart { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .flow { grid-template-columns: 1fr; }
  .flow .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .flow .step::after { display: none; }
  .page-head h1 { font-size: 30px; line-height: 34px; }
}
@media (min-width: 861px) { .menu-toggle { display: none; } }

/* On the register, messages float so they never push the cart off screen */
.main:has(> .pos) > .flash { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; box-shadow: var(--shadow-float); max-width: 560px; }
@media (max-width: 860px) {
  .topbar { gap: 4px; padding-right: 8px; }
  .wordmark .name { font-size: 22px; }
  .site-switch select { max-width: 92px; padding-right: 18px; font-size: 12px; }
  .user-chip { padding: 4px; gap: 4px; }
  .user-chip > svg { display: none; }
  .page-head .actions { width: 100%; }
}
@media (max-width: 420px) { .wordmark .the { display: none; } }
.grid > * { min-width: 0; }

/* ---------------------------------------------------------------- assistant */
.assistant-btn { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; color: var(--brand); font: 600 12px var(--sans); letter-spacing: .6px; text-transform: uppercase; }
.assistant-drawer { position: fixed; top: var(--topbar); right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-float); z-index: 55; display: flex; flex-direction: column; }
.assistant-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 24px; border-bottom: 1px solid var(--line); }
.assistant-head b { font-weight: 300; font-size: 19px; color: var(--brand); }
.assistant { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.assistant-page .assistant { height: calc(100vh - var(--topbar) - 200px); min-height: 420px; }
.assistant-log { flex: 1; overflow-y: auto; padding: 16px 24px; }
.assistant-empty p { color: var(--ink-2); font-size: 14px; }
.assistant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.assistant-chips .tag { cursor: pointer; background: var(--surface); text-align: left; font: 13px/18px var(--sans); color: var(--ink); padding: 6px 10px; margin: 0; }
.assistant-chips .tag:hover { border-color: var(--brand); color: var(--brand); }
.msg { margin-bottom: 14px; max-width: 92%; }
.msg.user { margin-left: auto; }
.msg.user .msg-body { background: var(--brand-wash); padding: 8px 12px; }
.msg-body { font-size: 14px; line-height: 21px; }
.msg-body p { margin: 0 0 8px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul { margin: 4px 0 8px; padding-left: 18px; }
.msg-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }
.assistant-input { border-top: 1px solid var(--line); padding: 12px 24px 16px; display: grid; gap: 8px; }
.assistant-input textarea { min-height: 64px; resize: vertical; }
@media (max-width: 860px) { .assistant-btn-label { display: none; } .assistant-btn { padding: 0; width: 40px; justify-content: center; } }

/* ---------------------------------------------------------------- home: run sheet (date, status line, figures, tabs, the day) */
.status-line { margin: 10px 0 0; font-size: 16px; line-height: 26px; color: var(--ink-2); max-width: 70ch; }
.status-line b { color: var(--ink); font-weight: 600; }
.figures.ledger { border-top-color: var(--line-strong); }
.figures.ledger .figure .v { font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; }
.home-tabs.tabs { margin-bottom: 20px; scrollbar-width: none; }
.home-tabs.tabs::-webkit-scrollbar { display: none; }
.home-tabs.tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 4px;
  background: var(--warn-wash); color: var(--warn); font: 700 11.5px/1 var(--sans); }
.home-tabs.tabs .count.brand { background: var(--brand); color: var(--on-brand); }
.home-pane { min-width: 0; }
.tab-tools { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.tab-tools a { font-weight: 600; }
.wait-list { display: block; }
.wait-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px var(--space-3); border-bottom: 1px solid var(--line); color: var(--ink); }
.wait-row:last-child { border-bottom: 0; }
.wait-row:hover { background: var(--surface-wash); text-decoration: none; color: var(--ink); }
.wait-type { display: block; font-size: 13px; font-weight: 600; color: var(--brand); }
.wait-desc { display: block; font-size: 14.5px; line-height: 21px; }
.wait-when { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.home-ask .assistant { height: 520px; min-height: 0; }

.day-legend { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.day-legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-legend i { width: 12px; height: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.day-legend i.done { background: var(--surface-wash); border-color: var(--line); }
.day-legend i.now { background: var(--brand-wash); border-color: var(--brand); }
.day-legend i.alert { background: var(--warn-wash); border-color: var(--warn); }
.lanes-wrap { --lab: 150px; overflow-x: auto; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.lanes { position: relative; width: calc(var(--lab) + var(--w)); }
.axis, .lane { display: flex; }
.axis { height: 30px; border-bottom: 1px solid var(--line); }
.lane { border-bottom: 1px solid var(--line); }
.lane:last-of-type { border-bottom: 0; }
.lane-name { flex: none; width: var(--lab); position: sticky; left: 0; z-index: 3; background: var(--surface); padding: 12px 12px 12px 0; border-right: 1px solid var(--line);
  font-size: 13px; line-height: 18px; font-weight: 600; }
.axis .lane-name { padding: 0; border-right: 0; }
.lane-name span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.ticks { position: relative; flex: none; width: var(--w); }
.ticks span { position: absolute; top: 6px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums lining-nums; }
.track { position: relative; flex: none; width: var(--w); background-image: linear-gradient(to right, #f1edea 1px, transparent 1px); background-size: 64px 100%; }
.blk { position: absolute; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line-strong); background: var(--surface);
  font: 600 12.5px/16px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; cursor: pointer; z-index: 1; }
.blk .t { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums lining-nums; }
.blk.pt::before { content: ""; width: 6px; height: 6px; flex: none; background: currentColor; }
.blk.done { background: var(--surface-wash); border-color: var(--line); color: var(--ink-2); }
.blk.now { background: var(--brand-wash); border-color: var(--brand); color: var(--brand); }
.blk.now .t { color: var(--brand); }
.blk.alert { background: var(--warn-wash); border-color: var(--warn); color: var(--warn); }
.blk.alert .t { color: var(--warn); }
.blk:hover { z-index: 2; border-color: var(--ink-2); }
.blk[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 2; }
.now-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--brand); z-index: 2; pointer-events: none; }
.now-line b { position: absolute; top: 5px; left: -22px; width: 44px; text-align: center; background: var(--brand); color: var(--on-brand); font: 700 11.5px/20px var(--sans);
  font-variant-numeric: tabular-nums lining-nums; }
.lanes-hint { display: none; font-size: 12.5px; color: var(--ink-2); margin: 8px 0 0; }
.day-detail { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: center; padding: 14px 0 0; }
.day-detail .when { font: 700 22px/26px var(--serif); white-space: nowrap; font-variant-numeric: lining-nums; }
.day-detail .what b { display: block; font-size: 15px; font-weight: 600; }
.day-detail .what span { display: block; font-size: 13.5px; color: var(--ink-2); }
.day-detail-acts { display: flex; gap: 10px; align-items: center; }
@media (max-width: 640px) {
  .lanes-wrap { --lab: 104px; }
  .lanes-hint { display: block; }
  .day-detail { grid-template-columns: minmax(0, 1fr); }
  .wait-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .status-line { font-size: 15px; line-height: 24px; }
}
.pane-block + .pane-block { margin-top: 32px; }
.pane-h { font: 700 21px/26px var(--serif); margin: 0 0 4px; }

/* ================================================================ design refresh, from the improved dashboard mockup:
   Inter body, Cormorant Garamond titles, 6px controls, 8px containers, tinted table headers, sans tabs. */
:root { --serif: "Cormorant Garamond", Cormorant, Georgia, serif; --sans: Inter, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px; --radius-lg: 8px; --radius-sm: 6px; }
body { font-size: 14px; line-height: 1.55; }
.page-head h1 { font-size: clamp(32px, 3vw, 40px); line-height: 1.1; letter-spacing: -.03em; }
.page-head .sub { font-size: 13.5px; }
.wordmark .name { letter-spacing: -.03em; }
.topbar { box-shadow: 0 1px 0 var(--line); }
.icon-btn, .user-chip, .site-switch select { border-radius: var(--radius); }
.avatar { border-radius: 4px; }
.btn { border-radius: var(--radius); font-size: 13px; letter-spacing: .02em; min-height: 40px; height: auto; padding: 10px 15px; line-height: 1.2; }
.btn.sm { min-height: 34px; height: auto; padding: 8px 11px; font-size: 12px; }
.btn.lg { min-height: 52px; height: auto; }
.badge { border-radius: 4px; font-size: 11.5px; }
.flash, .notice { border-radius: var(--radius); }
.menu { border-radius: var(--radius-lg); }
.panel { border-radius: var(--radius-lg); }
.panel:has(> .table-wrap, > .panel-body.flush) { overflow: hidden; }
.panel-head { padding: 14px 20px; }
table.data { font-size: 13.5px; line-height: 1.45; }
table.data th { background: var(--surface-wash); font-size: 10.5px; letter-spacing: .055em; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.data tbody tr:hover td { background: var(--surface-wash); }
.sidenav nav a { margin: 1px 10px; padding: 8px 14px; border-radius: var(--radius); }
.tabs { gap: 6px; border-bottom-color: var(--line); }
.tabs button, .tabs a { font: 600 14px/1.3 var(--sans); letter-spacing: 0; padding: 11px 14px; border: 1px solid transparent; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.tabs [aria-selected="true"], .tabs a.active { background: var(--brand-wash); border-color: var(--line); border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }

/* home */
.status-line { font-size: 15px; line-height: 1.55; }
.figures.ledger { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-4); }
.figures.ledger .figure { border-right: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); padding: 16px 20px 17px; }
.figures.ledger .figure .k { font-size: 12px; font-weight: 600; letter-spacing: .015em; }
.figures.ledger .figure .v { font-size: clamp(20px, 1.7vw, 25px); line-height: 1.25; margin-top: 7px; letter-spacing: -.035em; }
.figures.ledger .figure .h { font-size: 12px; line-height: 1.45; margin-top: 5px; }
.tab-tools { font-size: 12px; }
.lanes-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface); }
.axis, .axis .lane-name { background: var(--surface-wash); }
.lane-name { padding-left: 12px; }
.axis .lane-name { padding: 0; }
.blk { border-radius: 5px; height: 30px; }
.day-detail { padding: 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.day-detail .when { font-size: 20px; }
.wait-row:first-child { border-top: 0; }
@media (max-width: 640px) {
  .tabs button, .tabs a { font-size: 13px; padding: 10px 10px; flex: none; }
  .figures.ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures.ledger .figure { padding: 13px 12px; }
  .day-detail { padding: 13px; gap: 8px; }
}

/* ---------------------------------------------------------------- logo and app drawer */
.wordmark.logo { display: inline-flex; align-items: center; padding: 0 4px; }
.wordmark.logo img { display: block; height: 40px; width: auto; }
.drawer { position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 50; width: min(400px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); box-shadow: 8px 0 28px rgba(51, 51, 51, .14); padding-left: env(safe-area-inset-left, 0px); }
.drawer-enter { transition: transform 260ms var(--ease-drawer), opacity 200ms var(--ease-out); }
.drawer-leave { transition: transform 180ms var(--ease-out), opacity 150ms ease; }
.drawer-from { transform: translateX(-24px); opacity: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; }
.drawer-head b { font: 700 24px/30px var(--serif); letter-spacing: -.02em; }
.drawer-find { display: flex; align-items: center; gap: 8px; margin: 6px 20px 8px; padding: 0 12px; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-wash); color: var(--ink-2); }
.drawer-find:focus-within { background: var(--surface); border-color: var(--brand); }
.drawer-find input { border: 0 !important; outline: 0 !important; background: transparent; height: 40px; padding: 0; font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.drawer-group h3 { margin: 14px 8px 6px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.drawer-app { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius); color: var(--ink); }
.drawer-app:hover { background: var(--surface-wash); text-decoration: none; color: var(--ink); }
.drawer-app.current { background: var(--brand-wash); }
.drawer-tile { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-wash); color: var(--brand); }
.drawer-app.current .drawer-tile { background: var(--brand); color: var(--on-brand); }
.drawer-text b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.drawer-text span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-page { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--radius); color: var(--ink); font-size: 13.5px; }
.drawer-page:hover { background: var(--surface-wash); text-decoration: none; color: var(--ink); }
.drawer-page svg { color: var(--ink-2); }
.drawer-page em { font-style: normal; font-size: 12px; color: var(--ink-2); }
.drawer-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 640px) { .wordmark.logo img { height: 34px; } }

.apps-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 11px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; flex: none; }
.apps-btn svg { color: var(--brand); }
.apps-btn svg:last-child { color: var(--ink-2); transition: transform .18s ease; }
.apps-btn:hover { border-color: var(--line-strong); background: var(--surface-wash); }
.apps-btn[aria-expanded="true"] { background: var(--brand-wash); border-color: var(--brand); color: var(--brand); }
.apps-btn[aria-expanded="true"] svg:last-child { transform: rotate(180deg); color: var(--brand); }
@media (max-width: 640px) { .apps-btn span, .apps-btn svg:last-child { display: none; } .apps-btn { padding: 0 9px; } }

/* ---------------------------------------------------------------- home charts */
.home-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: var(--space-4); }
.chart-card { display: flex; flex-direction: column; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px 4px; }
.chart-head h2 { font: 700 20px/1.2 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.chart-head span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.chart-head a { font-weight: 600; white-space: nowrap; }
.chart-body { padding: 6px 18px 14px; flex: 1; }
.gx-chart { margin: 0; }
.gx-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.gx-chart .grid { stroke: #ece7e3; stroke-width: 1; }
.gx-chart .axis { fill: var(--ink-2); font: 500 11px var(--sans); font-variant-numeric: tabular-nums lining-nums; }
.gx-chart .area { fill: var(--brand-wash); opacity: .85; }
.gx-chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gx-chart .cmp { fill: none; stroke: #a59d99; stroke-width: 1.5; stroke-dasharray: 4 4; }
.gx-chart .end { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.gx-chart .end-label { fill: var(--ink); font: 700 12px var(--sans); font-variant-numeric: tabular-nums lining-nums; }
.gx-chart .hit { fill: transparent; }
.gx-chart .hit:hover { fill: rgba(148, 26, 29, .05); }
.gx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.gx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gx-legend .sw { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--brand); }
.gx-legend .sw.cmp { border-top: 2px dashed #a59d99; }
.gx-legend .sw.band { height: 10px; border: 0; background: var(--good-wash); outline: 1px solid #bfd9c4; }
.gx-legend .sw.over { height: 10px; border: 0; background: var(--warn); border-radius: 2px; }
.gx-bars { margin: 6px 0 0; display: grid; gap: 10px; }
.gx-bar { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.gx-bar-label { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-bar-label small { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 400; }
.gx-bar-track { position: relative; height: 12px; background: var(--surface-wash); border-radius: 3px; }
.gx-band { position: absolute; top: -3px; bottom: -3px; background: var(--good-wash); outline: 1px solid #bfd9c4; border-radius: 2px; }
.gx-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.gx-bar-fill.over { background: var(--warn); }
.gx-bar-value { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; text-align: right; min-width: 64px; }
@media (max-width: 640px) { .home-charts { grid-template-columns: minmax(0, 1fr); } .gx-bar { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; } }

/* ---------------------------------------------------------------- work / staff portal switch */
.mode-switch { display: inline-flex; gap: 2px; padding: 3px; margin-left: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-wash); flex: none; }
.mode-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.mode-switch a:hover { color: var(--ink); text-decoration: none; }
.mode-switch a[aria-current="page"] { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(51, 51, 51, .12); }
.portal-back { display: flex; align-items: center; gap: 10px; margin: 16px 10px 0; padding: 9px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 13.5px; font-weight: 600; }
@media (max-width: 900px) { .mode-switch span { display: none; } .mode-switch a { padding: 6px 9px; } }
@media (max-width: 640px) { .mode-switch { margin-left: 6px; } .mode-switch a { padding: 6px 8px; } }

/* ---------------------------------------------------------------- report printing */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .print-only { display: block; }
  .print-letterhead { display: flex; align-items: center; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--brand); }
  .print-letterhead b { display: block; font: 600 20px/1.2 var(--serif); color: var(--ink); }
  .print-letterhead span, .print-letterhead small { display: block; font-size: 11px; color: var(--ink-2); }
  .page-head h1, .page-head .sub { display: none; }
  form.no-print, .notice.no-print, .ai-drawer, .toast, [x-cloak] { display: none !important; }
  .grid.side { display: block; }
  .figures { break-inside: avoid; }
  table.data { font-size: 11px; }
  table.data th, table.data td { padding: 4px 6px; }
  table.data tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------------------------------------------------------------- environment badge, beside the brand in both shells */
.env-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font: 700 11px/1 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap; border: 1px solid var(--warn); color: var(--warn); background: var(--warn-wash); }
.env-badge.live { border-color: var(--good); color: var(--good); background: var(--good-wash); }
.env-badge.demo { border-color: var(--warn); color: var(--warn); background: var(--warn-wash); }

/* Phone widths: the top bar wraps and tightens so no page scrolls sideways. The environment badge stays beside the brand. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 4px; padding-left: 4px; padding-right: 4px; }
  .wordmark.logo img { height: 28px; }
  .env-badge { height: 18px; padding: 0 5px; font-size: 9.5px; letter-spacing: .04em; }
  .apps-btn { height: 34px; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  /* The site selector gets its own full-width row under the brand row. The bar grows to two rows and --topbar
     follows, so the sticky sidenav, scrim and apps drawer keep their offsets. Desktop is unchanged. */
  :root:has(.site-switch) { --topbar: 120px; }
  .topbar { align-content: flex-start; row-gap: 0; }
  .site-switch { order: 10; flex: 0 0 100%; min-width: 0; }
  .site-switch select { width: 100%; max-width: none; height: 36px; font-size: 14px; padding-right: 28px; }
}

/* Wide tables scroll inside their box on phones. Edge shadows show there is more to see, and the first
   (identifier) column stays put while the rest scrolls. */
@media (max-width: 640px) {
  .table-wrap {
    background:
      linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left center / 40px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right center / 40px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(51, 51, 51, .22), rgba(51, 51, 51, 0)) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(51, 51, 51, .22), rgba(51, 51, 51, 0)) right center / 12px 100% no-repeat scroll;
    background-color: var(--surface);
    scrollbar-width: thin;
  }
  .table-wrap table.data th:first-child,
  .table-wrap table.data td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }
  .table-wrap table.data thead th:first-child { background: var(--surface-wash); z-index: 2; }
}

/* ---------------------------------------------------------------- shared utilities (design audit) */
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.user-menu-wrap { position: relative; }
.panel-titles { flex: 1; min-width: 0; }
.panel-sub { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; }
.btn.touch { min-height: 44px; }
@media (pointer: coarse) { .btn, .btn.sm, .icon-btn { min-height: 44px; min-width: 44px; } }


/* ---------------------------------------------------------------- phone top bar (Nov 2026 critique)
   One row of brand and icons, then the site picker. The Work / My portal switch is also in the user menu,
   so it leaves the bar on phones; that is what made Ask, the bell and the avatar wrap onto a row of their own. */
@media (max-width: 640px) {
  :root:has(.site-switch) { --topbar: 98px; }
  .topbar { padding-top: 6px; padding-bottom: 6px; row-gap: 6px; }
  .topbar .mode-switch { display: none; }
  .topbar > .spacer { min-width: 0; }
  .wordmark.logo { padding: 0 2px; }
  .user-chip { padding: 2px; }
}
/* Narrow phones: the logo lockup shows only its red M mark (the left of the image), so the icons keep one row. */
@media (max-width: 480px) {
  .wordmark.logo img { width: 22px; height: 28px; object-fit: cover; object-position: left center; }
}

/* ---------------------------------------------------------------- motion (Emil Kowalski's rules)
   A crisp work tool: fast, ease-out, nothing decorative. Presses answer at once, colour eases, anything that
   appears comes from where it lives, and closing is quicker than opening. Only transform, opacity and colour move. */

/* Colour feedback: a short plain ease on the properties that change, never `all`. */
.btn, .icon-btn, .apps-btn, .user-chip, .mode-switch a, .tabs button, .tabs a, .sidenav nav a, .portal-back,
.drawer-app, .drawer-page, .menu a, .menu button, .seg button, .pos-cats button, .tender-tabs button, .pos-item,
.cart-line .qty button, .demo-accounts button, .assistant-chips .tag, .wait-row, .blk {
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease,
    transform 160ms var(--ease-out);
}

/* Press feedback: the control dips as it is pressed and springs back on release. */
.btn:active:not([disabled]):not(.disabled), .icon-btn:active, .apps-btn:active, .user-chip:active, .seg button:active,
.mode-switch a:active, .pos-cats button:active, .tender-tabs button:active, .cart-line .qty button:active,
.demo-accounts button:active, .assistant-chips .tag:active {
  transform: scale(0.97);
}
/* Wide controls and tiles dip less, so the edge does not travel far. */
.btn.lg:active:not([disabled]), .auth-card .btn:active:not([disabled]), .pos-item:active, .drawer-app:active { transform: scale(0.985); }

/* User menu: scales out of the avatar (top right), 150ms. Closing is instant. */
.menu { transform-origin: top right; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); }
@starting-style { .menu { opacity: 0; transform: translateY(-4px) scale(0.97); } }

/* Apps drawer and its scrim (React shell mounts them; the Blade shell keeps its Alpine classes above). */
.scrim { transition: opacity 200ms ease; }
@starting-style { .scrim { opacity: 0; } }
[data-shell="react"] .drawer { transition: transform 260ms var(--ease-drawer), opacity 200ms var(--ease-out); }
@starting-style { [data-shell="react"] .drawer { opacity: 0; transform: translateX(-24px); } }

/* Assistant drawer slides in from the right edge it is pinned to. */
.assistant-drawer { transition: transform 300ms var(--ease-drawer); }
@starting-style { .assistant-drawer { transform: translateX(100%); } }

/* Messages settle in from just above, so a save or an error is noticed without a jump in the page. */
.flash { transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
@starting-style { .flash { opacity: 0; transform: translateY(-6px); } }
@starting-style { .main:has(> .pos) > .flash { opacity: 0; transform: translate(-50%, 8px); } }

/* Phone side menu: a scrim to tap away, on the same drawer curve. */
.nav-scrim { z-index: 43; }
@media (min-width: 861px) { .nav-scrim { display: none; } }

/* Reduced motion means gentler, not none: keep the fades, drop the movement. */
@media (prefers-reduced-motion: reduce) {
  .btn:active, .icon-btn:active, .apps-btn:active, .user-chip:active, .seg button:active, .mode-switch a:active,
  .pos-cats button:active, .tender-tabs button:active, .cart-line .qty button:active, .demo-accounts button:active,
  .assistant-chips .tag:active, .pos-item:active, .drawer-app:active { transform: none !important; }
  .menu, .flash, [data-shell="react"] .drawer, .drawer-enter, .drawer-leave { transition-property: opacity !important; }
  .sidenav, .assistant-drawer, .apps-btn svg:last-child { transition: none !important; }
}

/* Figure strips on phones: two per row, ruled as a grid, so no column keeps a stray right edge. */
@media (max-width: 640px) {
  .figures:not(.ledger) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures:not(.ledger) .figure:nth-child(2n) { border-right: 0; }
  .figures:not(.ledger) .figure:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* Phone side menu runs the full height under the top bar (align-self: start had cut it off after the last link). */
@media (max-width: 860px) {
  .sidenav { align-self: stretch; height: auto; overflow-y: auto; overscroll-behavior: contain; }
}

/* Phone tables already scroll inside their box; give text columns a readable minimum so a long description
   does not wrap one word per line (approvals detail, stock locations). */
@media (max-width: 640px) {
  .table-wrap table.data td:not(.num), .table-wrap table.data th[scope="row"] { min-width: 9rem; }
}
