/* ===========================================================================
   Cafe POS - design system
   Dark, high-contrast, touch-first. Built for a 10" tablet in a dim cafe and
   a phone in a waiter's apron, then scaled up to a desktop cashier station.
   Arabic RTL is the primary direction; every rule uses logical properties so
   the LTR build is the same CSS.
   =========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  /* surfaces, darkest to lightest */
  --bg:            #0b0b10;
  --surface:       #13131c;
  --surface-2:     #1b1b27;
  --surface-3:     #242433;
  --line:          #2e2e3f;
  --line-soft:     #26263455;

  /* text */
  --text:          #ecebf3;
  --text-dim:      #a3a2b6;
  --text-faint:    #6e6d82;

  /* brand: warm espresso amber against cool slate */
  --brand:         #f0a94c;
  --brand-ink:     #2a1a05;
  --brand-dim:     #c9872f;
  --brand-glow:    #f0a94c33;

  --accent:        #6ea8fe;
  --ok:            #37d399;
  --ok-dim:        #1d6b4f;
  --warn:          #f5c451;
  --danger:        #f4717f;
  --danger-dim:    #7a2a35;

  --radius:        14px;
  --radius-sm:     10px;
  --radius-lg:     20px;
  --pad:           16px;

  --shadow:        0 10px 30px #00000066;
  --shadow-sm:     0 4px 14px #00000044;

  /* touch target floor, used everywhere a finger lands */
  --tap:           48px;

  --font: "Segoe UI", "Noto Kufi Arabic", "Cairo", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

/* no page ever scrolls sideways; wide content scrolls inside its own box */
body { overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .75rem; color: var(--text-dim); }

/* ------------------------------------------------------------------- shell */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-dim));
  color: var(--brand-ink);
  font-size: 20px;
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-name {
  font-weight: 800; font-size: .98rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-size: .72rem; color: var(--text-faint); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active {
  background: var(--brand-glow);
  color: var(--brand);
  border-color: #f0a94c44;
}
.nav-link .ico { width: 20px; text-align: center; flex: 0 0 auto; font-size: 1.05rem; }
.nav-link .badge { margin-inline-start: auto; }

.nav-spacer { flex: 1 1 auto; }

.nav-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.nav-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2);
  margin-bottom: 8px;
}
.nav-user .who { min-width: 0; }
.nav-user .who b { display: block; font-size: .88rem; }
.nav-user .who span { font-size: .72rem; color: var(--text-faint); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: #0b0b10e6;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 1.15rem; }
.topbar .spacer { flex: 1 1 auto; }

.burger {
  display: none;
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 1.2rem;
}

.content { padding: 20px; flex: 1 1 auto; min-width: 0; }

/* ------------------------------------------------------------------ pieces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  /* grid/flex children default to min-width:auto: without this a wide table
     widens its track instead of scrolling inside .table-wrap */
  min-width: 0;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 12px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1 1 auto; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stack > * { min-width: 0; }

/* stat tiles */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { font-size: .78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 1.2rem; }
.stat.is-brand .value { color: var(--brand); }
.stat.is-ok    .value { color: var(--ok); }
.stat.is-warn  .value { color: var(--warn); }
.stat.is-danger .value { color: var(--danger); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-dim);
  white-space: nowrap;
}
.badge.ok     { background: #37d39922; color: var(--ok); }
.badge.warn   { background: #f5c45122; color: var(--warn); }
.badge.danger { background: #f4717f22; color: var(--danger); }
.badge.brand  { background: var(--brand-glow); color: var(--brand); }
.badge.info   { background: #6ea8fe22; color: var(--accent); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-weight: 700;
  cursor: pointer;
  transition: transform .08s, filter .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.btn-primary { background: linear-gradient(145deg, var(--brand), var(--brand-dim)); color: var(--brand-ink); border-color: transparent; }
.btn-ok      { background: var(--ok); color: #04231a; border-color: transparent; }
.btn-danger  { background: var(--danger); color: #2b0a10; border-color: transparent; }
.btn-ghost   { background: transparent; }
.btn-lg      { min-height: 60px; font-size: 1.05rem; padding: 0 26px; }
.btn-sm      { min-height: 40px; padding: 0 12px; font-size: .86rem; }
.btn-block   { width: 100%; }
.btn-icon    { width: var(--tap); padding: 0; }

/* ------------------------------------------------------------------- forms */
/* One box for every control, so a text field, a number, a date, a time and a
   dropdown are the same height, the same colour and the same corner radius
   wherever they appear. */

label { display: block; font-size: .84rem; color: var(--text-dim); margin-bottom: 5px; font-weight: 600; }

/* Styling every input EXCEPT the ones that must stay native, rather than
   listing the ones that should be styled.
   The old rule listed types - and silently missed three things: `type="time"`
   and `type="month"`, which arrived with the reservation form and the report
   period picker; and the thirty inputs written with no `type` attribute at all.
   An attribute selector matches the ATTRIBUTE, not the effective type, so
   `<input name="note">` was never matched and rendered as a bare native box
   beside its styled neighbours. Inverting the rule is what keeps them
   consistent as new field types get added. */
.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  /* Not `font: inherit`. The floor-plan editor puts controls inside a .tbl,
     which sets .92rem - so those fields rendered a size smaller than the same
     field on any other screen. Pinning to the root keeps a control identical
     wherever it is nested. */
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}

textarea { min-height: 80px; resize: vertical; }

/* The native dropdown arrow cannot be recoloured, so it is replaced: without
   this a select reads as a lighter, shorter control than the input beside it.
   The chevron is a data: URI, which the app's CSP allows under img-src. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a3a2b6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}
/* the arrow follows the writing direction */
html[dir="rtl"] select { background-position: left 13px center; }
select::-ms-expand { display: none; }

/* A dark form needs this declared, or the browser paints the date/time picker
   panels and the select's own dropdown list white. */
:root { color-scheme: dark; }

/* and the little calendar / clock glyph inside a date, time or month field is
   black-on-dark until it is inverted */
input::-webkit-calendar-picker-indicator {
  filter: invert(0.68);
  cursor: pointer;
  opacity: .85;
}
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

::placeholder { color: var(--text-faint); opacity: 1; }

.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.input:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* tick boxes: a checkbox and a radio are the same size as each other, and both
   big enough for a finger */
input[type="checkbox"], input[type="radio"] {
  width: 22px; height: 22px;
  min-height: 0; flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* the colour picker in the category editor: same height as its neighbours */
input[type="color"] {
  width: 100%;
  min-height: var(--tap);
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.field { margin-bottom: 12px; }
/* a field sitting in a flex row carries its own gap, so drop the stacked margin
   and let the labels line up across the row */
.row > .field { margin-bottom: 0; }
/* every direct child of a .row that holds a control lines its label up too */
.row > .field > label, .row > div > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Width utilities for anything sitting in a .row - a .field wrapper, or a bare
   control in one of the one-line forms. One vocabulary for both, so a filter
   bar lays itself out with classes rather than a style attribute per element,
   which is how these drifted apart in the first place.
   min-width:0 lets a control shrink below its intrinsic width instead of
   pushing the row wider than the card. */
.is-w-num  { flex: 0 0 90px;   min-width: 0; }
.is-w-xs   { flex: 0 0 90px;   min-width: 0; }
.is-w-fix  { flex: 0 0 150px;  min-width: 0; }
.is-w-sm   { flex: 1 1 110px;  min-width: 0; }
.is-w-md   { flex: 1 1 150px;  min-width: 0; }
.is-w-lg   { flex: 1 1 170px;  min-width: 0; }
.is-w-xl   { flex: 1 1 220px;  min-width: 0; }
.is-w-auto { flex: 1 1 auto;   min-width: 0; }

/* a spacer pushes what follows to the end of its row, wherever it is used */
.spacer { flex: 1 1 auto; }

/* buttons that share a row equally, e.g. the prep ticket's two actions */
.btn-grow { flex: 1 1 0; min-width: 0; }
.is-danger-text { color: var(--danger); }

/* on a phone everything in a row takes the full width instead of squeezing -
   except the small numeric boxes, which stay small so they do not look like
   a mis-set text field */
@media (max-width: 620px) {
  [class*="is-w-"]:not(.is-w-num):not(.is-w-xs) { flex: 1 1 100%; }
}

/* The buttons at the end of a filter row. Bottom-aligned so they sit level with
   the controls beside them, which have a label above and these do not. */
.field-actions {
  align-self: flex-end;
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 0;
}

/* The one control that is deliberately NOT like the others: the counted-cash
   box at shift close. It is the single number whose mis-keying costs money, so
   it is big and centred on purpose. Marked with a class rather than an inline
   style so the consistency test can allow for it by name. */
.input-xl {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  text-align: center;
  min-height: 56px;
}

/* a field that fills the rest of its row */
.field.is-w-auto, .check.is-w-auto { flex: 1 1 auto; }
/* a tick-box row item that shares the row evenly */
.check.is-w-half { flex: 1 1 0; }
/* bottom-aligned, for a tick box sitting beside labelled fields */
.check.is-bottom { align-self: flex-end; }

.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.check label { margin: 0; }
/* a label wrapping its own radio or checkbox is clickable as one target */
label.check { cursor: pointer; font-weight: 600; color: var(--text); }

.hint { font-size: .78rem; color: var(--text-faint); margin-top: 4px; }

/* -------------------------------------------------------------------- flash */
.flashes { position: fixed; inset-block-start: 14px; inset-inline-end: 14px; z-index: 300; display: grid; gap: 8px; max-width: min(92vw, 420px); }
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-weight: 600;
  animation: flashIn .22s ease-out;
}
.flash.ok   { border-color: var(--ok-dim); background: #0f2a21; color: #b6f0d8; }
.flash.err  { border-color: var(--danger-dim); background: #2b1016; color: #ffd0d6; }
.flash.warn { border-color: #6b541d; background: #2a2210; color: #ffe9b8; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
/* a phone has no room for a 480px floor; let the wrapper scroll instead */
@media (max-width: 620px) { table.tbl { min-width: 360px; } }
table.tbl th, table.tbl td { padding: 11px 12px; text-align: start; border-bottom: 1px solid var(--line-soft); }
table.tbl th { color: var(--text-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num { text-align: end; font-variant-numeric: tabular-nums; }
table.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); }

.empty { padding: 36px 20px; text-align: center; color: var(--text-faint); }
.empty .big { font-size: 2.2rem; margin-bottom: 8px; opacity: .5; }

/* ======================================================= floor (tables map) */
.area-title {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 10px; font-size: 1rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.area-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

.tables-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.table-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 132px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.table-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.table-card .t-name { font-size: 1.15rem; font-weight: 800; }
.table-card .t-seats { font-size: .78rem; color: var(--text-faint); }
.table-card .t-foot { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.table-card .t-total { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.table-card .t-time { font-size: .78rem; color: var(--text-faint); margin-inline-start: auto; }

.table-card.is-free { border-style: dashed; border-color: #34344a; }
.table-card.is-free .t-name { color: var(--text-dim); }
.table-card.is-busy { border-color: #f0a94c55; background: linear-gradient(160deg, #1d1710, var(--surface)); }
.table-card.is-busy .t-total { color: var(--brand); }
.table-card .corner {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  width: 10px; height: 10px; border-radius: 50%;
}
.table-card.is-free .corner { background: #3b3b52; }
.table-card.is-busy .corner { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }

/* =============================================================== order screen */
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
/* a grid item's `auto` minimum is its min-content width: without this the
   nowrap category strip forces the track to the full width of all chips */
.order-layout > *, .pay-layout > * { min-width: 0; }

.cat-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  min-width: 0; max-width: 100%;
}
.cat-chip {
  flex: 0 0 auto;
  min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 700; font-size: .92rem;
  cursor: pointer; text-decoration: none;
}
.cat-chip:hover { color: var(--text); text-decoration: none; }
.cat-chip.is-active { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.cat-chip .dot { width: 9px; height: 9px; border-radius: 50%; }

.items-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 14px; min-width: 0; }

.item-btn {
  position: relative;
  display: flex; flex-direction: column; gap: 4px; justify-content: space-between;
  min-height: 104px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit; text-align: start;
  cursor: pointer;
  transition: transform .08s, border-color .15s, background .15s;
}
.item-btn:hover { border-color: var(--brand); background: var(--surface-2); }
.item-btn:active { transform: scale(.97); }
.item-btn .i-name { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.item-btn .i-price { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.item-btn .i-tag { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; }
.item-btn.is-out { opacity: .42; cursor: not-allowed; }
.item-btn.is-out:hover { border-color: var(--line); background: var(--surface); }

/* bill panel */
.bill {
  position: sticky; top: 76px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
}
.bill-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bill-head .b-code { font-weight: 800; font-size: 1.05rem; }
.bill-head .b-meta { font-size: .8rem; color: var(--text-faint); margin-top: 2px; }

.bill-lines { overflow-y: auto; flex: 1 1 auto; padding: 6px 0; min-height: 90px; }
.bill-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.bill-line .l-name { font-weight: 700; font-size: .94rem; }
.bill-line .l-sub { font-size: .76rem; color: var(--text-faint); grid-column: 1 / -1; }
.bill-line .l-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.bill-line .l-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 6px; }

.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.qty-box button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--text); font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.qty-box button:hover { background: var(--surface-3); }
.qty-box .q { min-width: 38px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.bill-totals { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.bill-totals .t-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-dim); }
.bill-totals .t-row.grand { font-size: 1.3rem; font-weight: 800; color: var(--text); padding-top: 8px; border-top: 1px solid var(--line); }
.bill-totals .t-row span:last-child { font-variant-numeric: tabular-nums; }
.bill-actions { padding: 12px 16px 16px; display: grid; gap: 8px; }

/* =================================================================== KDS */
.kds-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.ticket {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ticket-head { padding: 12px 14px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ticket-head .t-code { font-weight: 800; }
.ticket-head .t-age { margin-inline-start: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.ticket.age-warn  { border-color: #6b541d; }
.ticket.age-warn .t-age { color: var(--warn); }
.ticket.age-late  { border-color: var(--danger-dim); animation: pulseLate 1.6s ease-in-out infinite; }
.ticket.age-late .t-age { color: var(--danger); }
@keyframes pulseLate { 0%,100% { box-shadow: 0 0 0 0 #f4717f00; } 50% { box-shadow: 0 0 0 4px #f4717f33; } }

.ticket-lines { padding: 6px 0; flex: 1 1 auto; }
.k-line { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; }
.k-line .k-qty { min-width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.k-line .k-name { font-weight: 700; }
.k-line .k-note { font-size: .8rem; color: var(--warn); }
.k-line.is-preparing .k-qty { background: #6ea8fe33; color: var(--accent); }
.ticket-actions { padding: 10px 14px 14px; display: flex; gap: 8px; }

/* ================================================================ receipt */
.receipt-sheet {
  width: 80mm; max-width: 100%;
  margin: 16px auto;
  background: #fff; color: #111;
  padding: 14px 12px;
  font-family: "Courier New", monospace;
  font-size: 12px; line-height: 1.5;
}
.receipt-sheet h2 { text-align: center; font-size: 15px; margin: 0 0 2px; color: #111; }
.receipt-sheet .r-sub { text-align: center; font-size: 11px; margin-bottom: 8px; }
.receipt-sheet hr { border: 0; border-top: 1px dashed #999; margin: 7px 0; }
.receipt-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.receipt-sheet td { padding: 2px 0; vertical-align: top; }
.receipt-sheet .num { text-align: end; white-space: nowrap; }
.receipt-sheet .grand { font-size: 15px; font-weight: 700; }
.receipt-sheet .r-foot { text-align: center; margin-top: 10px; font-size: 11px; }
.print-bar { text-align: center; padding: 14px; }

/* ================================================================= login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 600px at 50% -10%, #1d1710, var(--bg)); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow); }
.login-card .brand { justify-content: center; border: 0; padding-bottom: 8px; }
.login-card h1 { text-align: center; font-size: 1.25rem; margin-bottom: 18px; }

/* ================================================================== bars */
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.bar-row .bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-dim), var(--brand)); }
.bar-row .bar-val { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ================================================================ modals */
.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: #05050acc; backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
}
.modal-back[hidden] { display: none; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; }
.modal-head .spacer { flex: 1 1 auto; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* =========================================================== pay screen */
.pay-layout { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 16px; align-items: start; }
.method-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.method {
  display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  min-height: 92px; padding: 12px;
  border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-weight: 700;
}
.method .m-ico { font-size: 1.5rem; }
.method.is-on { border-color: var(--brand); background: var(--brand-glow); color: var(--brand); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 58px; font-size: 1.2rem; font-weight: 800; }

.due-big { font-size: 2.4rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.change-big { font-size: 1.8rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }


/* ===================================================== stat sub-caption */
/* the one-line gloss under a figure: "12 entries", "sales - expenses" */
.stat .sub { font-size: .72rem; color: var(--text-faint); margin-top: 3px; }

/* ============================================================ tab strip */
/* the report tabs. Scrolls sideways inside itself on a phone rather than
   wrapping into three ragged rows. */
.tab-strip {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
}
.tab-strip::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 10px 14px; min-height: 42px;
  display: inline-flex; align-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-dim); font-weight: 700; font-size: .88rem;
  white-space: nowrap; text-decoration: none;
}
.tab:hover { text-decoration: none; color: var(--text); border-color: var(--surface-3); }
.tab.is-active { background: var(--brand-glow); border-color: var(--brand); color: var(--brand); }

/* the four period pickers sit side by side on a desk, stack on a phone */
.period-forms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.period-forms label { font-size: .74rem; color: var(--text-faint); }

/* ========================================================= reservations */
.res-list { display: grid; gap: 10px; }
.res-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px; align-items: start;
  padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* a cancelled or finished booking stays readable but stops competing for attention */
.res-card.is-dim { opacity: .55; }
.res-when {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 0; border-radius: var(--radius-sm);
  background: var(--surface-3); font-variant-numeric: tabular-nums;
}
.res-when b { font-size: 1.05rem; }
.res-when span { font-size: .74rem; color: var(--text-faint); }
.res-body { min-width: 0; }
.res-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 5px; }
.res-icon { font-size: 1.1rem; }
.res-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .84rem; color: var(--text-dim); }
.res-note {
  margin-top: 6px; font-size: .84rem; color: var(--text-dim);
  border-inline-start: 2px solid var(--line); padding-inline-start: 8px;
}
.res-note b { color: var(--text); margin-inline-end: 6px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }

/* the overflow menu. <details> rather than JS, so it works with none loaded. */
.res-more { position: relative; }
.res-more > summary { list-style: none; cursor: pointer; }
.res-more > summary::-webkit-details-marker { display: none; }
.res-more-body {
  position: absolute; z-index: 60; inset-inline-end: 0; margin-top: 6px;
  min-width: 170px; display: grid; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}

/* table picker on the booking form */
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); margin-bottom: 8px; }
.pick {
  display: flex; flex-direction: column; gap: 2px;
  min-height: var(--tap); padding: 9px 10px; cursor: pointer;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}
.pick input { margin: 0 0 3px; }
.pick-name { font-weight: 700; }
.pick-sub { font-size: .72rem; color: var(--text-faint); }
.pick.is-on { border-color: var(--brand); background: var(--brand-glow); }
.pick.is-busy { border-color: var(--danger-dim); }
.pick-busy { font-size: .7rem; color: var(--danger); }

/* ============================================================= QR sheet */
.qr-sheet { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.qr-card {
  background: #fff; color: #111;
  border-radius: var(--radius); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; break-inside: avoid;
}
.qr-store { font-size: .78rem; color: #666; }
.qr-table { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.qr-area { font-size: .74rem; color: #888; margin-bottom: 6px; }
/* the quiet zone the scanner needs comes from this white padding plus the
   4 modules the SVG already carries */
.qr-img { padding: 6px; background: #fff; }
.qr-img svg { display: block; width: 100%; height: auto; max-width: 230px; }
.qr-cta { font-size: .84rem; font-weight: 700; margin-top: 6px; }
.qr-url { font-size: .56rem; color: #999; word-break: break-all; line-height: 1.3; }
.qr-card .btn { margin-top: 8px; }

/* ====================================================== guest QR screens */
/* The customer's own phone. Light-on-dark like the rest of the app, but with
   no staff chrome and a single column at any width. */
body.guest { background: var(--bg); }
.guest-wrap { max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; }
.guest-head {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 4px 14px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.guest-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.guest-store { font-size: .76rem; color: var(--text-faint); }
.guest-table { font-size: 1.3rem; font-weight: 800; }
.guest-table .hint { display: inline; font-size: .74rem; margin-inline-start: 6px; }
.guest-note {
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--brand-glow); border: 1px solid var(--brand-dim);
  border-radius: var(--radius-sm); font-size: .86rem; color: var(--brand);
}
.guest-sent { margin-bottom: 12px; }
.guest-search { display: flex; gap: 8px; margin-bottom: 12px; }
.guest-search input { flex: 1 1 auto; }

.guest-items { display: grid; gap: 10px; margin-bottom: 16px; }
.guest-item {
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.gi-top { display: flex; align-items: baseline; gap: 10px; }
.gi-name { flex: 1 1 auto; font-weight: 700; }
.gi-price { font-weight: 800; color: var(--brand); white-space: nowrap; }
.gi-desc { font-size: .82rem; color: var(--text-faint); margin-top: 3px; }
.gi-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.gi-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; min-height: 40px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; font-size: .8rem; cursor: pointer;
}
.gi-foot { display: flex; gap: 8px; margin-top: 10px; }
.gi-foot input[name="note"] { flex: 1 1 auto; min-width: 0; }
.gi-foot input[name="qty"] { flex: 0 0 72px; text-align: center; }

/* the basket: still the guest's to change, nothing has fired yet */
.guest-basket { position: sticky; inset-block-end: 10px; }
.gb-line {
  display: grid; grid-template-columns: minmax(0,1fr) auto 76px;
  gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.gb-line.is-gone { opacity: .55; }
.gb-name { min-width: 0; font-weight: 600; }
.gb-qty { display: flex; align-items: center; gap: 6px; }
.gb-n { min-width: 26px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.gb-total { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.gb-sum {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 4px; font-size: 1.05rem;
}
.gb-sum b { color: var(--brand); font-size: 1.2rem; }

.gs-lines { display: grid; gap: 2px; }
.gs-line {
  display: grid; grid-template-columns: 34px minmax(0,1fr) auto 76px;
  gap: 9px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.gs-qty {
  display: grid; place-items: center; min-height: 28px;
  border-radius: var(--radius-sm); background: var(--surface-3);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.gs-name { min-width: 0; }
.gs-total { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ================================================ topbar clock & shift */
.topbar-now {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15; margin-inline-end: 4px;
}
.now-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .98rem; }
.now-date { font-size: .7rem; color: var(--text-faint); }

/* ===================================================== leaving screen */
.logout-who { display: flex; align-items: center; gap: 12px; }
.logout-when { text-align: end; line-height: 1.2; }
.logout-when b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.logout-when span { display: block; font-size: .74rem; color: var(--text-faint); }

/* Two separate actions, deliberately the same size: ending a shift and
   logging out are different decisions and neither is the "safe" default. */
.logout-choices { display: grid; gap: 10px; }
.logout-choices form { margin: 0; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 14px 16px; text-align: start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text);
  font: inherit; cursor: pointer;
}
.choice:hover { border-color: var(--brand); text-decoration: none; }
.choice-ico { font-size: 1.3rem; color: var(--brand); flex: 0 0 auto; }
.choice-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-body b { font-size: 1rem; }
.choice-body span { font-size: .82rem; color: var(--text-dim); }
.choice-body .badge { align-self: flex-start; margin-top: 3px; }

/* ============================================================ responsive */
@media (max-width: 1100px) {
  .order-layout, .pay-layout { grid-template-columns: minmax(0, 1fr); }
  .bill { position: static; max-height: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 150;
    inset-block: 0; inset-inline-start: 0;
    width: 272px; height: 100vh;
    transform: translateX(-110%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  html[dir="rtl"] .sidebar { transform: translateX(110%); }
  .sidebar.is-open, html[dir="rtl"] .sidebar.is-open { transform: none; }
  .burger { display: grid; place-items: center; }
  .scrim { position: fixed; inset: 0; z-index: 140; background: #05050a99; }
  .scrim[hidden] { display: none; }
  .content { padding: 14px; }
  .topbar { padding: 10px 14px; }
}

@media (max-width: 620px) {
  :root { --pad: 13px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  /* the booking card's time column and action column both lose their own
     track and sit above / below the body instead */
  .res-card { grid-template-columns: 62px minmax(0, 1fr); }
  .res-actions { grid-column: 1 / -1; }
  .res-when { flex-direction: row; gap: 6px; padding: 5px 8px; }
  .qr-sheet { grid-template-columns: 1fr; }
  .gi-foot { flex-wrap: wrap; }
  .gi-foot input[name="note"] { flex: 1 1 100%; }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .items-grid  { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .kds-grid    { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 76px; }
  h1 { font-size: 1.25rem; }
  .topbar h1 { font-size: 1rem; }
  .due-big { font-size: 1.9rem; }
}

/* ============================================================== printing */
@media print {
  .sidebar, .topbar, .flashes, .print-bar, .no-print { display: none !important; }
  html, body { background: #fff; color: #000; }
  .app { display: block; }
  .content { padding: 0; }
  .receipt-sheet { margin: 0; width: auto; box-shadow: none; }

  /* QR sheet: three to a row on A4, and never split a code across a page */
  .qr-sheet { grid-template-columns: repeat(3, 1fr); gap: 8mm; }
  .qr-card { border: 1px dashed #bbb; padding: 8mm 4mm; page-break-inside: avoid; }
  .qr-card .qr-url { color: #666; }
  .tab-strip, .report-shell .period-forms { display: none !important; }
}

/* respects a user who asked for less motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================== attendance ==
   The clock screen is a kiosk: one enormous time, one enormous input, and
   nothing else competing for a thumb. It is used by somebody walking past
   with a tray in one hand.
   ------------------------------------------------------------------------ */
.clock-screen { max-width: 760px; margin: 0 auto; }

.clock-now {
  text-align: center;
  padding: 18px 12px 10px;
}
.clock-time {
  font-size: clamp(3rem, 14vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.clock-date { font-size: 1.05rem; color: var(--muted); margin-top: 6px; }
.clock-sub  { font-size: .9rem;   color: var(--muted); margin-top: 2px; }

.clock-pad {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  max-width: 380px;
  margin: 10px auto 18px;
  text-align: center;
}
.clock-pad label { color: var(--muted); font-size: .95rem; }
/* a PIN is typed, read back at a glance and then gone - 2rem is the size at
   which somebody can see they fat-fingered it without leaning in */
.clock-pad .input-xl {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.5em;
  padding: 14px 10px;
}
.clock-counts { margin-bottom: 10px; }

/* ---- the month grid ---- */
/* One letter per day so thirty-one days fit without sideways scrolling. The
   colour carries the meaning and the letter is there for anyone who cannot
   tell the colours apart - never colour alone. */
.att-grid { font-size: .88rem; }
.att-grid .att-day {
  width: 1.6rem;
  padding: 4px 0;
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
}
.att-grid .att-day.is-weekend { color: var(--accent); }
.att-grid .sticky-col {
  position: sticky;
  inset-inline-start: 0;
  background: var(--card);
  z-index: 1;
  min-width: 9rem;
}
.att-cell {
  width: 1.6rem;
  padding: 3px 0;
  text-align: center;
  font-weight: 700;
  border-radius: 4px;
}
.att-cell.is-present { color: #2ecc71; }
.att-cell.is-absent  { color: #e74c3c; background: rgba(231, 76, 60, .12); }
.att-cell.is-leave   { color: #3498db; }
.att-cell.is-excused { color: #9b59b6; }
.att-cell.is-off     { color: var(--muted); opacity: .5; }
.att-cell.is-holiday { color: #f39c12; }
.att-cell.is-pending { color: transparent; }
.att-cell.is-none    { background: repeating-linear-gradient(
                         45deg, transparent, transparent 3px,
                         rgba(255,255,255,.04) 3px, rgba(255,255,255,.04) 6px); }
/* late is an underline rather than another colour: a day can be present AND
   late, and two colours in one cell would be unreadable */
.att-cell.has-late { box-shadow: inset 0 -2px 0 #f39c12; }

.att-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: .85rem;
  color: var(--muted);
}

/* a form sitting inside a table cell, so a decision is one click from the row
   it belongs to rather than a separate screen */
.row-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.btn-x {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
}
.btn-x:hover { color: #e74c3c; }

/* `.check` is defined once, further up, WITH min-height: var(--tap) - a
   checkbox and its label are a tap target. Redefining it here cost that
   min-height (equal specificity, later wins) and shrank every control on the
   floor plan to 21px. Only the wrapper is new. */
.checks { display: flex; flex-wrap: wrap; gap: 10px; }

/* =============================================================== payslip ==
   Printed and handed over, so it has to survive losing every colour. */
.slip {
  max-width: 640px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}
.slip-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 10px;
}
.slip-who { text-align: end; }
.slip-tbl .is-group th {
  padding-top: 14px;
  color: var(--accent);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.slip-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  .slip { border: 0; padding: 0; max-width: none; }
}

/* a wrapping row of chips - used where a short list reads better as tags than
   as a table: who is on the floor, which punches made up a day */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }

/* ============================================================== loyalty ==
   The customer strip sits at the top of an open bill. It has to be glanceable
   from a standing position at a till, so the balance is a badge rather than a
   line of prose, and the whole thing collapses to one row on a phone.
   ------------------------------------------------------------------------ */
.cust-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}
.cust-hint {
  margin: 0;
  padding: 0 12px 8px;
  font-size: .8rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.cust-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(46, 204, 113, .07);
}
.cust-who { display: flex; flex-direction: column; min-width: 0; }
.cust-who .mono { font-size: .8rem; }
/* the points already on this bill: amber, because it is money off and the
   person reading it is usually about to take payment */
.cust-redeemed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 156, 18, .10);
  font-size: .9rem;
}

/* a sub-heading inside a settings card, for the two halves of a rate */
.sub-head {
  margin: 14px 0 6px;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}

/* The lookup folds away when the shop has turned off "ask every customer".
   A <details> rather than a JS toggle: it works with no script, keeps the box
   reachable, and remembers nothing it should not. */
.cust-fold { border-bottom: 1px solid var(--line); }
.cust-fold > summary {
  padding: 8px 12px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
  list-style: none;
}
.cust-fold > summary::-webkit-details-marker { display: none; }
.cust-fold > summary::before { content: '+ '; color: var(--accent); }
.cust-fold[open] > summary { display: none; }
.cust-fold > .cust-ask,
.cust-fold > .cust-hint { border-bottom: 0; }

/* The row delete. Quiet until hovered, because on a list of twenty rows a row
   of red buttons reads as a warning about the data rather than an action you
   can take. Still a full tap target: it is the one control where hitting the
   neighbouring row actually costs something. */
.btn-del {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm, 6px);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 8px;
}
.btn-del:hover,
.btn-del:focus-visible {
  color: #e74c3c;
  border-color: rgba(231, 76, 60, .45);
  background: rgba(231, 76, 60, .10);
}

/* The stamp card. Dots rather than a number, because "three of five" is
   something a customer understands across a counter at a glance, and a row
   that is nearly full is the whole reason the scheme works. */
.stamp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(52, 152, 219, .08);
}
.stamps { display: flex; gap: 4px; }
.stamp {
  font-size: 1rem;
  line-height: 1;
  color: var(--line);
}
.stamp.is-on { color: #3498db; }
