/* public/shared/h1-ui.css — the H1 UI standard (28 Oct 2026, Andrea), lifted from the website's
   product demos (hospitalityin1-site assets/product-ui.css and assets/departments.css, the
   "Checklist & H&S" screen). The rules and the reasons are in docs/design/h1-ui-standard.md.

   Opt-in: nothing here styles a page until it uses a .ui-* class. The --ui-* names sit beside the
   H1 tokens (/shared/h1-tokens.css, loaded first) and never replace them. Light mode takes the
   demo's values; dark mode (html[data-theme="dark"]) points the same names at the H1 dark tokens.
   Sizes are the demo's scaled for a touch screen held at arm's length (the demo is drawn at
   desktop scale), with 44px touch targets. Fonts come from /shared/h1-fonts.css. */
:root {
  --ui-page: #f4f3ee;          /* the page behind the cards */
  --ui-card: #fffefa;          /* a card, a panel, a secondary button */
  --ui-line: #e5e4db;          /* a card's 1px border */
  --ui-rule: #eceee5;          /* the hairline between rows inside a card */
  --ui-ink: #29332c;           /* titles and body text */
  --ui-muted: #6d7568;         /* the one grey meta line (4.7:1 on the card) */
  --ui-faint: #c3c6bc;         /* a to-do dot; never text */
  --ui-green: #315d4c;         /* the primary button; the score line */
  --ui-green-hover: #234537;
  --ui-done: #5f8a58;          /* a done dot, the progress fill; never text */
  --ui-done-ink: #426346;      /* "Done" words on a label */
  --ui-issue: #d29a32;         /* an issue or late dot; never text */
  --ui-mustard: #8d692f;       /* "Something is wrong" and the issue words (5:1) */
  --ui-issue-bg: #fbf4e4;      /* the issue box under a row */
  --ui-issue-ink: #6e5a2c;     /* words inside the issue box */
  --ui-red: #a4583b;           /* an overdue dot; red words on a label only */
  --ui-gold: #b88c45;          /* the dashed target line; never text */
  --ui-track: #e9ece2;         /* the progress bar's track */
  --ui-seg: #eaece4;           /* the tabs' track */
  --ui-seg-line: #e0e3d8;
  --ui-btn-line: #dedfd3;      /* a secondary button's border */
  --ui-btn-ink: #3a4b3d;
  --ui-label-green: #eaf0e8;   /* label backgrounds */
  --ui-label-amber: #f7eedc;
  --ui-label-red: #f9e9e3;
  --ui-label-neutral: #efeee9;
  --ui-label-amber-ink: var(--warning-ink, #80591f);  /* the demo's #93712c is 3.9:1 on its tint */
  --ui-label-red-ink: var(--danger-ink, #a4392e);     /* the demo's #a4583b is 4.4:1 on its tint */
  --ui-side: #293d32;          /* the app sidebar */
  --ui-side-ink: #b9c8b3;
  --ui-side-on: #52634a;       /* the selected sidebar row */
  --ui-side-hover: #3c5142;
  --ui-side-on-ink: #fffdf8;    /* the picked row's words */
  --ui-side-label: #a7b39c;     /* the venue in small capitals; the fold button */
  --ui-side-name: #dce5d5;      /* the signed-in person's name */
  --ui-side-role: #9eac92;      /* their role under it */
  --ui-side-avatar: #53644c;    /* the round initials */
  --ui-side-avatar-ink: #e2e9dc;
  --ui-shadow-seg: 0 2px 5px rgba(21,40,23,.06);
  --ui-font-head: "Inter Tight", Inter, system-ui, sans-serif;
  --ui-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui-radius-card: 11px;
  --ui-radius-btn: 6px;
  --ui-radius-label: 5px;
}
html[data-theme="dark"] {
  --ui-page: var(--surface);
  --ui-card: var(--surface-raised);
  --ui-line: var(--border-default);
  --ui-rule: var(--border-subtle);
  --ui-ink: var(--text-primary);
  --ui-muted: var(--text-secondary);
  --ui-faint: var(--border-default);
  --ui-green: var(--success);
  --ui-green-hover: var(--success-ink);
  --ui-done: var(--success);
  --ui-done-ink: var(--success-ink);
  --ui-issue: var(--warning);
  --ui-mustard: var(--warning-ink);
  --ui-issue-bg: var(--warning-subtle);
  --ui-issue-ink: var(--text-primary);
  --ui-red: var(--danger);
  --ui-gold: var(--accent);
  --ui-track: var(--surface-sunken);
  --ui-seg: var(--surface-sunken);
  --ui-seg-line: var(--border-subtle);
  --ui-btn-line: var(--border-default);
  --ui-btn-ink: var(--text-primary);
  --ui-label-green: var(--success-subtle);
  --ui-label-amber: var(--warning-subtle);
  --ui-label-red: var(--danger-subtle);
  --ui-label-neutral: var(--surface-sunken);
  --ui-side: var(--surface-sunken);
  --ui-side-ink: var(--text-secondary);
  --ui-side-on: var(--surface-raised);
  --ui-side-hover: var(--surface);
  --ui-side-on-ink: var(--text-primary);
  --ui-side-label: var(--text-secondary);
  --ui-side-name: var(--text-primary);
  --ui-side-role: var(--text-secondary);
  --ui-side-avatar: var(--surface-raised);
  --ui-side-avatar-ink: var(--text-primary);
  --ui-shadow-seg: 0 2px 5px rgba(0,0,0,.3);
}

/* The page and its header: breadcrumb, title, one grey line, actions on the right. */
.ui-page { background: var(--ui-page); color: var(--ui-ink); font-family: var(--ui-font); }
.ui-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ui-crumb { margin: 0 0 8px; font-size: 12px; color: var(--ui-muted); }
.ui-title { margin: 0; font: 600 28px/1.1 var(--ui-font-head); letter-spacing: -.035em; color: var(--ui-ink); }
.ui-sub { margin: 6px 0 0; font-size: 13px; color: var(--ui-muted); }

/* A card: one per section. Its heading has the title on the left and the count on the right. */
.ui-card { min-width: 0; padding: 20px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); background: var(--ui-card); color: var(--ui-ink); }
.ui-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.ui-card-title { margin: 0; font: 600 18px/1.25 var(--ui-font-head); letter-spacing: -.025em; color: var(--ui-ink); }
.ui-count { flex: none; font-size: 12px; color: var(--ui-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-kicker { display: block; margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-muted); }

/* A row: dot, title, one grey meta line, actions on the right. Rows inside a card are split by hairlines. */
.ui-rows { margin: 0; padding: 0; list-style: none; }
.ui-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 12px 0; border-top: 1px solid var(--ui-rule); }
.ui-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ui-faint); }
.ui-dot.is-done { background: var(--ui-done); }
.ui-dot.is-issue, .ui-dot.is-late { background: var(--ui-issue); }
.ui-dot.is-overdue, .ui-dot.is-bad { background: var(--ui-red); }
.ui-row-title { display: block; font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ui-ink); }
.ui-row.is-done .ui-row-title { color: var(--ui-muted); }
.ui-meta { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.ui-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }

/* Buttons: one primary per row; the rest secondary or a text action. */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--ui-btn-line); border-radius: var(--ui-radius-btn); background: var(--ui-card); color: var(--ui-btn-ink); font: 600 14px/1.2 var(--ui-font); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-btn:hover { border-color: #a7b29b; background: #f1f3eb; }
.ui-btn.primary { background: var(--ui-green); border-color: var(--ui-green); color: #fff; }
.ui-btn.primary:hover { background: var(--ui-green-hover); border-color: var(--ui-green-hover); }
.ui-btn.text { padding-left: 6px; padding-right: 6px; border-color: transparent; background: transparent; color: var(--ui-mustard); }
.ui-btn:disabled { opacity: .55; cursor: default; }
html[data-theme="dark"] .ui-btn:hover { border-color: var(--border-default); background: var(--surface); }
html[data-theme="dark"] .ui-btn.primary { color: var(--surface); }

/* A small status label: red and amber live here and on a dot, never on a block of text. */
.ui-label { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--ui-radius-label); font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; vertical-align: 1px; background: var(--ui-label-neutral); color: var(--ui-muted); }
.ui-label.green { background: var(--ui-label-green); color: var(--ui-done-ink); }
.ui-label.amber { background: var(--ui-label-amber); color: var(--ui-label-amber-ink); }
.ui-label.red { background: var(--ui-label-red); color: var(--ui-label-red-ink); }

/* The issue box: under the row it belongs to, beige, the words in brown. */
.ui-issue { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--ui-issue-bg); color: var(--ui-issue-ink); font-size: 13px; line-height: 1.6; }

/* Progress: a bold count, an 8px bar and a legend of dots. */
.ui-progress-head { display: flex; align-items: baseline; gap: 8px; }
.ui-progress-head strong { font: 600 20px/1.2 var(--ui-font-head); letter-spacing: -.02em; }
.ui-progress-head span { font-size: 12px; color: var(--ui-muted); }
.ui-bar { height: 8px; margin: 12px 0; overflow: hidden; border-radius: 8px; background: var(--ui-track); }
.ui-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ui-done); }
.ui-key { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; font-size: 12px; color: var(--ui-muted); }
.ui-key .ui-dot { width: 9px; height: 9px; }
.ui-key .ui-dot:not(:first-child) { margin-left: 6px; }
@media (prefers-reduced-motion: no-preference) { .ui-bar > span { transition: width .4s ease; } }

/* The score card: kicker, one big figure, one grey line, the 30-day line against a dashed target. */
.ui-score { display: block; font: 500 34px/1.1 var(--ui-font-head); letter-spacing: -.035em; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.ui-score-line { stroke: var(--ui-green); stroke-width: 2; fill: none; }
.ui-score-target { stroke: var(--ui-gold); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }

/* A page with a side panel: the work on the left, a 260px panel on the right; one column under 1024px. */
.ui-split { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px 18px; align-items: start; }
.ui-stack { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1023px) { .ui-split { grid-template-columns: minmax(0, 1fr); } }

/* Tabs: a segmented track; the picked one is a white chip. */
.ui-tabs { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--ui-seg-line); border-radius: 8px; background: var(--ui-seg); }
.ui-tabs > button { min-height: 40px; padding: 8px 13px; border: 0; border-radius: 5px; background: transparent; color: var(--ui-muted); font: 500 13px/1.2 var(--ui-font); white-space: nowrap; cursor: pointer; }
.ui-tabs > button[aria-selected="true"], .ui-tabs > button[aria-pressed="true"] { background: var(--ui-card); color: var(--ui-ink); box-shadow: var(--ui-shadow-seg); }

/* The app sidebar (back office): dark green, the picked row a lighter green. */
.ui-sidebar { display: flex; flex-direction: column; padding: 24px 12px 16px; background: var(--ui-side); color: var(--ui-side-ink); }
.ui-sidebar a, .ui-sidebar button { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--ui-side-ink); font: 500 14px/1.35 var(--ui-font); text-align: left; text-decoration: none; }
.ui-sidebar :is(a, button):hover { background: var(--ui-side-hover); }
.ui-sidebar [aria-current="page"] { background: var(--ui-side-on); color: #fffdf8; }

/* The booking grid (28 Oct 2026, Andrea: "Bookings must look the same on the POS and in the back
   office"): one table a row, one half hour a column, a block per party coloured by where the party is.
   Drawn by /shared/h1-booking-grid.js on the POS's Bookings page and in the back office's Bookings & guests ›
   Reservations; the container is .ui-bkgrid. The sizes are the POS grid's (a 44px row, a 36px block,
   the 128px table column, 96px half hours or the evening across the view); the font is the page's. */
.ui-bkgrid { box-sizing: border-box; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); background: var(--ui-card); color: var(--ui-ink); overflow: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scroll-padding-left: 128px; }
.ui-bkgrid .empty { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--ui-muted); }
.ui-bkgrid .bkgrid-head, .ui-bkgrid .bkgrid-row { display: flex; min-width: max-content; }
.ui-bkgrid .bkgrid-head { position: sticky; top: 0; z-index: 4; background: var(--ui-card); border-bottom: 1px solid var(--ui-line); }
.ui-bkgrid .bkgrid-corner, .ui-bkgrid .bkgrid-tb { position: sticky; left: 0; z-index: 3; flex: none; width: 128px; box-sizing: border-box; padding: 6px 12px 5px; background: var(--ui-card); border-right: 1px solid var(--ui-line); }
/* The heads: the small uppercase label. "TABLE" and a half hour's covers ("19:00 · 3") in the text-action ink. */
.ui-bkgrid .bkgrid-corner, .ui-bkgrid .bkgrid-col { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.ui-bkgrid .bkgrid-corner, .ui-bkgrid .bkgrid-cv { color: var(--ui-mustard); }
/* A half hour's head stays on one line in a 64px column ("19:00 · 11"): no letter-spacing, 6px in. */
.ui-bkgrid .bkgrid-col { flex: none; width: 96px; box-sizing: border-box; padding: 6px 0 5px 6px; border-left: 1px solid var(--ui-rule); letter-spacing: 0; white-space: nowrap; scroll-snap-align: start; }
/* Blank room after the close, so the current half hour can open first in view late in the day. */
.ui-bkgrid .bkgrid-pad { flex: none; border-left: 1px solid var(--ui-rule); }
/* A row is 44px: the line under it is drawn inside it, so the table's name stays a 44px tap target. */
.ui-bkgrid .bkgrid-row > * { box-shadow: inset 0 -1px 0 var(--ui-rule); }
.ui-bkgrid .bkgrid-row:last-child > * { box-shadow: none; }
.ui-bkgrid .bkgrid-tb { display: flex; align-items: baseline; gap: 6px; padding-top: 11px; padding-bottom: 0; }
.ui-bkgrid button.bkgrid-tb { width: 128px; margin: 0; text-align: left; font: inherit; color: var(--ui-ink); border-radius: 0; border-left: 0; border-top: 0; border-bottom: 0; cursor: pointer; }
.ui-bkgrid button.bkgrid-tb:active { background: var(--ui-label-neutral); }
.ui-bkgrid .bkgrid-tn { min-width: 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ui-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-bkgrid .bkgrid-ts { flex: none; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ui-muted); white-space: nowrap; }
.ui-bkgrid .bkgrid-ts::before { content: "\00b7"; margin-right: 6px; }
.ui-bkgrid .bkgrid-row.unplaced .bkgrid-tn { color: var(--ui-mustard); }
/* Visible: a joined party's block runs down into the next rows. */
.ui-bkgrid .bkgrid-lane { position: relative; flex: none; overflow: visible; }
.ui-bkgrid .bkgrid-cell { position: absolute; top: 0; bottom: 0; width: 96px; border-left: 1px solid var(--ui-rule); pointer-events: none; }
/* A free half hour the page lets a person book (the POS): a tap target, tinted under the finger. */
.ui-bkgrid .bkgrid-cell.free { display: block; box-sizing: border-box; -webkit-appearance: none; appearance: none; pointer-events: auto; padding: 0; margin: 0; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-bkgrid .bkgrid-cell.free:active { background: var(--ui-label-neutral); }
@media (hover: hover) { .ui-bkgrid .bkgrid-cell.free:hover { background: var(--ui-label-neutral); } }
.ui-bkgrid .bkgrid-note { position: sticky; left: 0; padding: 14px 16px; font-size: 14px; line-height: 20px; color: var(--ui-muted); }
/* The now line: a line, never words, in gold. It runs through the empty cells, under the blocks. */
.ui-bkgrid .bknow { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ui-gold); pointer-events: none; }
.ui-bkgrid .bkchip { position: absolute; z-index: 1; display: flex; align-items: center; gap: 6px; height: 36px; box-sizing: border-box; margin: 0; padding: 0 10px; border: 1px solid var(--ui-line); border-left-width: 3px; border-radius: 8px; background: var(--ui-card); color: var(--ui-ink); font: inherit; font-size: 14px; line-height: 20px; text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-bkgrid .bkchip:active { filter: brightness(.96); }
.ui-bkgrid .bkchip-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ui-bkgrid .bkchip-cv { flex: none; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.ui-bkgrid .bkchip-cv::before { content: "\00b7"; margin-right: 6px; }
.ui-bkgrid .bkchip-fl { flex: none; font-size: 12px; color: var(--ui-muted); }
.ui-bkgrid .bkchip-ok { color: var(--ui-done-ink); font-weight: 600; }
.ui-bkgrid .bkchip .bkst.late { flex: none; margin-left: auto; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ui-label-amber-ink); font-size: 12px; font-weight: 600; }
/* The colours by status, as labels and dots are: the fill a label's background, the 3px left edge the
   dot's colour. Upcoming: white, a gold edge. Arrived or seated: green. Late: amber, never red. A
   walk-in: charcoal. A no-show or a cancellation: red, the only red. Finished: grey. A key beside the
   grid (.ui-bkkey) takes the same colours. */
.ui-bkgrid .bkchip.k-upcoming, .ui-bkkey .k-upcoming { border-left-color: var(--ui-gold); }
.ui-bkgrid .bkchip.k-in, .ui-bkkey .k-in { background: var(--ui-label-green); border-color: var(--ui-label-green); border-left-color: var(--ui-done); }
.ui-bkgrid .bkchip.k-late, .ui-bkkey .k-late { background: var(--ui-label-amber); border-color: var(--ui-label-amber); border-left-color: var(--ui-issue); }
.ui-bkgrid .bkchip.k-walkin, .ui-bkkey .k-walkin { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-card); }
.ui-bkgrid .bkchip.k-walkin .bkchip-cv, .ui-bkgrid .bkchip.k-walkin .bkchip-fl { color: inherit; opacity: .8; }
.ui-bkgrid .bkchip.k-fell, .ui-bkkey .k-fell { background: var(--ui-label-red); border-color: var(--ui-label-red); border-left-color: var(--ui-red); color: var(--ui-label-red-ink); }
.ui-bkgrid .bkchip.k-fell .bkchip-cv { color: inherit; }
.ui-bkgrid .bkchip.k-finished, .ui-bkkey .k-finished { background: var(--ui-label-neutral); border-color: var(--ui-label-neutral); border-left-color: var(--ui-faint); color: var(--ui-muted); }
/* Joined tables: the block down side-by-side rows sits over their lines; on a table that is not next
   to the first, the lighter "Rossi (with T12)". */
.ui-bkgrid .bkchip.span { z-index: 2; align-items: flex-start; padding-top: 7px; }
.ui-bkgrid .bkchip.with { opacity: .6; font-size: 13px; }
.ui-bkgrid .bkchip.with .bkchip-nm { font-weight: 500; }
.ui-bkkey { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; font-size: 12px; color: var(--ui-muted); }
.ui-bkkey > span { display: inline-flex; align-items: center; gap: 6px; }
.ui-bkkey i { flex: none; width: 16px; height: 11px; box-sizing: border-box; border: 1px solid var(--ui-line); border-left-width: 3px; border-radius: 3px; background: var(--ui-card); }
/* The phone: a 96px table column, the seats under the name (the row stays 44px). */
@media (max-width: 720px) {
  .ui-bkgrid { scroll-padding-left: 96px; }
  .ui-bkgrid .bkgrid-corner, .ui-bkgrid .bkgrid-tb, .ui-bkgrid button.bkgrid-tb { width: 96px; padding-left: 10px; padding-right: 10px; }
  .ui-bkgrid .bkgrid-tb { flex-direction: column; align-items: stretch; gap: 0; padding-top: 3px; }
  .ui-bkgrid .bkgrid-ts::before { content: none; }
}

@media (max-width: 760px) {
  .ui-card { padding: 16px; }
  .ui-row { grid-template-columns: 10px minmax(0, 1fr); }
  .ui-row > .ui-actions { grid-column: 2; justify-content: flex-start; }
  .ui-title { font-size: 25px; }
}
