/* ============================================================================
   Any POS - application stylesheet (monochrome edition)
   Black chrome, white paper, gray structure. The receipt tape stays the
   signature. Color is reserved for one job only: a muted red on destructive
   and error states, because a Delete button should never look like Save.
   Touch targets stay at 48px or larger for register hardware.
   ========================================================================= */

:root {
  --canvas: #f4f4f3;
  --surface: #ffffff;
  --surface-dim: #ececeb;
  --ink: #141414;
  --ink-soft: #575757;
  --ink-faint: #8f8f8f;
  --brand: #1f1f1f;        /* primary actions, links */
  --brand-deep: #0f0f0f;   /* chrome: register topbar, total display */
  --brand-tint: #ececec;
  /* Navigation and back-office chrome. Default to the light look; branding can
     recolour these to theme the whole back end, including a dark sidebar. */
  --nav-bg: #ffffff;
  --nav-ink: #141414;
  --nav-ink-soft: #575757;
  --nav-line: #dedede;
  --nav-active-bg: #141414;
  --nav-active-ink: #ffffff;
  --nav-hover-bg: #ececeb;
  --brass: #ffffff;        /* the Cash key + display numerals (white on black) */
  --brass-deep: #111111;
  --line: #dedede;
  --danger: #9c2f2f;
  --danger-tint: #f5e9e9;
  --good: #2e2e2e;
  --good-tint: #eaeaea;
  --warn-tint: #efefec;
  /* Table status is the one place colour carries meaning at a glance. */
  --free: #1f7a3d;
  --free-tint: #e7f3eb;
  --busy: #9c2f2f;
  --busy-tint: #f7e9e9;
  /* Floor scenery reads faster with a couple of literal colours. */
  --plant: #2f7d4f;
  --plant-tint: #e6f2ea;
  --door: #8a5a2b;
  --door-tint: #f3e9df;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.06);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-tape: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.money, .tape, td.num, .amount { font-variant-numeric: tabular-nums; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--ink); }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Top bar ------------------------------------------------------------- */
.topbar {
  background: var(--nav-bg);
  color: var(--nav-ink);
  border-bottom: 1px solid var(--nav-line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  min-height: 58px;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
body[data-page] .topbar .wordmark { display: none; }
.wordmark .mark {
  display: inline-block;
  background: #ffffff;
  color: #0f0f0f;
  border-radius: 6px;
  padding: 2px 7px;
  margin-right: 8px;
  letter-spacing: 0;
}
.topbar .tenant-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #c9c9c9;
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 6px 10px;
  font-size: 0.9rem;
}
.topbar .spacer { flex: 1; }
.topbar .user-chip {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}





/* --- Bulk product tools ---------------------------------------------------- */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
}
.bulk-bar .spacer { flex: 1; }
.bulk-bar .btn { min-height: 34px; }
table.data th.pick, table.data td.pick { width: 34px; text-align: center; }
table.data td.pick input, table.data th.pick input { width: 18px; height: 18px; min-height: 0; }

/* --- Permission tree ------------------------------------------------------- */
.perm-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.perm-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}
.perm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.perm-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 3px 0 3px 14px;
}
.perm-head input, .perm-child input { width: 18px; height: 18px; min-height: 0; flex-shrink: 0; }

/* --- Sidebar search and favorites ------------------------------------------ */
.nav-search { width: calc(100% - 16px); margin: 0 8px 4px; }
.nav-favorites { padding: 0 8px; }
.nav-heading {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8d8d8d;
  padding: 8px 10px 2px;
}
body.nav-collapsed .nav-heading { display: none; }

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.55);
  display: none;
  z-index: 300;
  padding: 8vh 16px 16px;
}
.search-overlay.open { display: block; }
.search-panel {
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 14px;
}
.search-panel input[type="search"] { font-size: 1.05rem; margin-bottom: 10px; }
.search-results { max-height: 56vh; overflow-y: auto; }
.search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
}
.search-row.first { background: var(--surface-dim); }
.search-row:hover { background: var(--surface-dim); }
.search-go {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.search-go svg { width: 20px; height: 20px; flex-shrink: 0; }
.search-go span { display: flex; flex-direction: column; min-width: 0; }
.search-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-star {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  color: #b8b8b8;
  min-height: 0;
}
.search-star svg { width: 20px; height: 20px; }
.search-star.on { color: var(--ink); }
.search-star.on svg { fill: currentColor; }
.search-foot { font-size: 0.78rem; color: var(--ink-soft); margin: 10px 2px 2px; }

/* --- Register terminal (register.php) --------------------------------------
   A kiosk surface: dark chrome, big touch targets, no sidebar. The lock
   screen puts the staff roster on the left and the PIN pad on the right.   */
body.terminal-body { padding-left: 0; background: var(--canvas); }

.t-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--brand-deep, #0f0f0f);
  color: #fff;
  min-height: 58px;
  flex-wrap: wrap;
}
.t-topbar .spacer { flex: 1; }
.t-biz { font-weight: 700; font-size: 1rem; }
.t-chip {
  font-size: 0.8rem;
  color: #cfcfcf;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.t-chip.t-pending { color: #111; background: #e8c37a; border-color: #e8c37a; cursor: pointer; }
.t-cashier { font-weight: 700; font-size: 0.95rem; }
.t-dot { width: 10px; height: 10px; border-radius: 50%; background: #6b6b6b; flex-shrink: 0; }
.t-dot.on { background: #3f9d5a; }
.t-dot.off { background: #9c2f2f; }

.lock-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 420px);
  gap: 18px;
  padding: 18px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
.lock-roster, .lock-pin {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.roster-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.roster-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 14px 16px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}
.roster-item:hover { background: var(--surface-dim); }
.roster-item.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.roster-item:disabled { opacity: 0.5; cursor: not-allowed; }
.roster-item .r-name { font-weight: 700; font-size: 1.05rem; }
.roster-item .r-role { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75; }

.pin-person { font-weight: 700; font-size: 1.1rem; text-align: center; margin-bottom: 10px; min-height: 26px; }
.pin-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.pin-dot.filled { background: var(--ink); border-color: var(--ink); }

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key {
  min-height: 68px;
  font-size: 1.5rem;
  font-weight: 700;
  border: 1px solid #c9c9c9;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.pin-key:active { background: var(--surface-dim); }
.pin-key.pin-aux { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.pin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

@media (max-width: 780px) {
  .lock-layout { grid-template-columns: 1fr; }
  .roster-list { max-height: 34vh; }
}
@media print {
  .t-topbar { display: none; }
}

/* --- Left sidebar (shell.js) ------------------------------------------------ */
:root { --nav-w: 232px; --nav-w-min: 64px; }
body[data-page] { padding-left: var(--nav-w); transition: padding-left 150ms ease; }
body[data-page].nav-collapsed { padding-left: var(--nav-w-min); }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--nav-w);
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width 150ms ease;
  overflow: hidden;
}
body.nav-collapsed .sidebar { width: var(--nav-w-min); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  min-height: 62px;
}
.sidebar-brand .mark {
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-foot { padding: 10px 8px; border-top: 1px solid var(--line); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--nav-ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--nav-hover-bg); color: var(--nav-ink); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-ink); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

body.nav-collapsed .nav-label,
body.nav-collapsed .sidebar-brand .nav-label { display: none; }
body.nav-collapsed .nav-item { justify-content: center; padding: 11px 0; }
/* The search launcher normally has side margins for its pill shape; collapsed,
   drop them so its icon lines up centered like every other nav icon. */
body.nav-collapsed .nav-search { width: auto; margin: 0 8px 4px; }
body.nav-collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }

@media (max-width: 720px) {
  body[data-page], body[data-page].nav-collapsed { padding-left: var(--nav-w-min); }
  .sidebar, body.nav-collapsed .sidebar { width: var(--nav-w-min); }
  .nav-label, .sidebar-brand .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-search { width: auto; margin: 0 8px 4px; }
  .sidebar-brand { justify-content: center; padding: 16px 8px; }
  #shell-collapse { display: none; }
}

/* --- Back-office subnav ----------------------------------------------------- */
.subnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.subnav a,
.subnav button {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.subnav button { font-family: inherit; cursor: pointer; }
.subnav a:hover,
.subnav button:hover { border-color: var(--ink); color: var(--ink); }
.subnav a.active,
.subnav button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- Status strip -------------------------------------------------------- */
.status-strip {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 4px solid var(--ink);
}
.status-strip.offline { display: flex; background: #eceae4; color: #3a3a35; }
.status-strip.pending { display: flex; background: var(--surface-dim); color: var(--ink); border-left-style: dashed; }
.status-strip button { min-height: 36px; }

/* --- Layout -------------------------------------------------------------- */
.app-shell { padding: 16px; max-width: 1400px; margin: 0 auto; }
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.muted { color: var(--ink-soft); font-size: 0.9rem; }
.tiny { font-size: 0.8rem; color: var(--ink-faint); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid #c9c9c9;
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 120ms ease, transform 60ms ease;
}
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brass {
  background: #ffffff;
  border: 2px solid var(--ink);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}
.btn-brass:active { box-shadow: none; transform: translateY(2px); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 0.88rem; }
.btn-block { display: block; width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.05rem; }

/* --- Forms --------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 10px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #c9c9c9;
  border-radius: var(--radius-sm);
  min-height: 48px;
  padding: 10px 12px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row > * { flex: 1; min-width: 160px; }
.help { font-size: 0.82rem; color: var(--ink-soft); margin-top: 3px; }
.form-error {
  background: var(--danger-tint);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 10px 0;
}
.form-good {
  background: var(--good-tint);
  color: var(--good);
  border: 1px solid #d4d4d4;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 10px 0;
}

/* --- Tables --------------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
}
table.data td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:hover td { background: var(--surface-dim); }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid transparent;
}
.badge-good { background: #f1f1f0; color: #222; border-color: #222; }
.badge-warn { background: var(--warn-tint); color: #444; border-color: #999; border-style: dashed; }
.badge-dim { background: var(--surface-dim); color: var(--ink-soft); }
.badge-bad { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }

/* --- Register layout ------------------------------------------------------ */
.register-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) { .register-grid { grid-template-columns: 1fr; } }

.catalog-tools { display: flex; gap: 10px; margin-bottom: 12px; }
.catalog-tools input[type="search"] { flex: 1; }

.category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.chip {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  border: 1px solid #c9c9c9;
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 18px;
  cursor: pointer;
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.product-btn {
  appearance: none;
  font: inherit;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  min-height: 92px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow);
}
.product-btn:hover { border-color: var(--ink); }
.product-btn:active { transform: translateY(1px); }
.product-btn .p-name { font-weight: 700; font-size: 0.95rem; }
.product-btn .p-price { color: var(--ink); font-weight: 800; }
.product-btn .p-sku { font-size: 0.72rem; color: var(--ink-faint); }
.catalog-empty { padding: 30px 10px; text-align: center; color: var(--ink-soft); }

/* --- Cart: the receipt-tape signature -------------------------------------- */
.cart-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
}
@media (max-width: 980px) { .cart-panel { position: static; max-height: none; } }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 2px dashed var(--line);
}
.cart-lines {
  font-family: var(--font-tape);
  font-size: 0.9rem;
  overflow-y: auto;
  padding: 6px 0;
  min-height: 120px;
}
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px dotted var(--line);
  align-items: center;
}
.cart-line .line-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .line-total { text-align: right; font-weight: 700; }
.cart-line .line-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.qty-btn {
  appearance: none;
  border: 1px solid #c9c9c9;
  background: var(--surface-dim);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 800;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.qty-value { min-width: 34px; text-align: center; font-weight: 800; }
.line-remove { margin-left: auto; color: var(--danger); background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; padding: 0 8px; }
.cart-empty { text-align: center; color: var(--ink-faint); padding: 26px 12px; font-family: var(--font-body); }

.cart-sums { padding: 10px 14px; border-top: 2px dashed var(--line); font-family: var(--font-tape); font-size: 0.92rem; }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; }
.sum-row.discount { color: var(--danger); }

.total-display {
  margin: 10px 14px;
  background: var(--brand-deep);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-tape);
}
.total-display .t-label { color: #a8a8a8; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.total-display .t-amount { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.02em; }

.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.cart-actions .span-2 { grid-column: 1 / -1; }

/* --- Modals ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 12px;
  z-index: 60;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 460px;
  padding: 18px;
}
.modal.wide { max-width: 660px; }
.modal-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-soft); min-height: 44px; min-width: 44px; }

.quick-cash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.change-due {
  background: var(--good-tint);
  color: var(--ink);
  border: 1px solid #c9c9c9;
  font-family: var(--font-tape);
  font-weight: 800;
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  margin: 10px 0;
}
.change-due.short { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }

/* --- Receipt --------------------------------------------------------------- */
.receipt {
  font-family: var(--font-tape);
  font-size: 0.86rem;
  background: #fdfdfc;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 16px;
  max-width: 340px;
  margin: 0 auto;
  position: relative;
  color: #111;
}
.receipt::before, .receipt::after {
  content: "";
  display: block;
  height: 8px;
  background-image: radial-gradient(circle at 5px -2px, transparent 5px, #fdfdfc 5px);
  background-size: 12px 8px;
  background-repeat: repeat-x;
  margin: -18px -16px 12px;
}
.receipt::after {
  margin: 12px -16px -18px;
  transform: scaleY(-1);
}
.receipt .r-center { text-align: center; }
.receipt .r-head { font-weight: 800; font-size: 1rem; letter-spacing: 0.06em; }
.receipt hr { border: 0; border-top: 1px dashed #b5b5b5; margin: 8px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r-total { font-weight: 800; font-size: 1rem; }
.receipt .r-pending {
  border: 2px dashed #111;
  color: #111;
  font-weight: 800;
  text-align: center;
  padding: 6px;
  margin: 8px 0;
  letter-spacing: 0.1em;
}

/* --- End of Day ------------------------------------------------------------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
}
.stat .s-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 4px;
}
.stat .s-value { font-family: var(--font-tape); font-weight: 800; font-size: 1.35rem; }
.stat.stat-hero { background: var(--brand-deep); border-color: var(--brand-deep); }
.stat.stat-hero .s-label { color: #a8a8a8; }
.stat.stat-hero .s-value { color: #fff; }
.stat.stat-bad .s-value { color: var(--danger); }

.zreport {
  font-family: var(--font-tape);
  font-size: 0.9rem;
  background: #fdfdfc;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 18px;
  max-width: 460px;
  margin: 0 auto;
  color: #111;
}
.zreport .r-center { text-align: center; }
.zreport .r-head { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em; }
.zreport hr { border: 0; border-top: 1px dashed #b5b5b5; margin: 8px 0; }
.zreport .r-row { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.zreport .r-total { font-weight: 800; font-size: 1rem; }

/* --- Toast + misc ------------------------------------------------------------ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 90;
  max-width: min(92vw, 480px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.good { background: #2c2c2c; }
#toast.bad { background: var(--danger); }

.setup-note { max-width: 560px; margin: 12vh auto; padding: 20px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.loading { color: var(--ink-soft); padding: 30px; text-align: center; }

/* --- Login ------------------------------------------------------------------ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .wordmark { color: var(--ink); display: inline-block; margin-bottom: 8px; }
.login-card .wordmark .mark { background: var(--ink); color: #fff; }

/* --- Module pages -------------------------------------------------------------- */
.module-locked { max-width: 520px; margin: 8vh auto; text-align: center; }
.table-floor {
  position: relative;
  background: repeating-linear-gradient(0deg, transparent, transparent 39px, var(--line) 39px, var(--line) 40px),
              repeating-linear-gradient(90deg, transparent, transparent 39px, var(--line) 39px, var(--line) 40px),
              var(--surface-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 460px;
  overflow: hidden;
}
.floor-table {
  position: absolute;
  width: 96px;  /* fallback; real size scales with seats */
  height: 76px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  touch-action: none;
}
.floor-table.held { border-style: dashed; background: var(--warn-tint); }
.floor-table.held::after {
  content: "HELD";
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.floor-table .seats { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }

/* --- Print: receipt or day report only ------------------------------------------ */
@media print {
  body[data-page], body[data-page].nav-collapsed { padding-left: 0; }
  .sidebar { display: none; }
  body * { visibility: hidden; }
  #receipt-print, #receipt-print *, #eod-print, #eod-print * { visibility: visible; }
  #receipt-print, #eod-print { position: absolute; inset: 0 auto auto 0; width: 100%; }
  .receipt, .zreport { border: 0; max-width: none; }
}

@media (max-width: 640px) {
  .app-shell { padding: 10px; }
  .quick-cash { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 8px 12px; }
}

/* ------------------------------------------------------------------ charge modal (u5) */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 84px; font-size: 1.1rem; font-weight: 700;
}
.method-btn .method-sub { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; opacity: 0.65; text-transform: uppercase; }
.method-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qr-wrap { display: flex; justify-content: center; padding: 8px; background: #fff; border: 1px solid var(--line, #d9d5cc); border-radius: 8px; }
.qr-wrap canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }

/* ============================================================================
   Update 6: branding and the Restaurant module
   ========================================================================= */

/* The logo art is black on transparent. Light chrome keeps it black; only the
   dark register bar flips it white. */
.brand-img { height: 20px; display: block; filter: brightness(0); }
.t-topbar .brand-img { height: 26px; filter: brightness(0) invert(1); }
.login-brand { display: flex; justify-content: center; margin-bottom: 10px; }
.login-brand .brand-img { height: 24px; }

/* A wide sidebar shows the wordmark; a collapsed one shows the letter mark. */
.sidebar-brand .brand-mini { display: none; height: 24px; }
body.nav-collapsed .sidebar-brand .brand-full { display: none; }
body.nav-collapsed .sidebar-brand .brand-mini { display: block; }
@media (max-width: 900px) {
  .sidebar-brand .brand-full { display: none; }
  .sidebar-brand .brand-mini { display: block; }
}

/* The open-check chip and its action row in the cart column. */
.check-chip {
  margin: 0 0 8px;
  padding: 7px 10px;
  background: var(--brand-deep);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.check-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 8px;
}

/* Cart sublines: modifiers, kitchen notes, and the sent marker. */
.line-mod,
.line-note {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  padding-left: 10px;
}
.line-note { font-style: italic; }
.sent-tag {
  display: inline-block;
  margin: 2px 0 0 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #444444;
  background: var(--warn-tint);
  border: 1px dashed #999999;
  border-radius: 999px;
}

/* The tables and tabs modal. */
.modal-wide { max-width: 720px; width: calc(100vw - 32px); }
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.table-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-height: 64px;
  padding: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.table-cell:hover { border-color: var(--ink-faint); }
.table-cell.occupied {
  border-style: dashed;
  background: var(--warn-tint);
}
.tc-name { font-weight: 700; }
.tc-meta { font-size: 12px; color: var(--ink-soft); }

/* The modifier sheet. */
.modsheet-group { margin-bottom: 12px; }
.modsheet-group h3 { margin: 0 0 6px; font-size: 14px; }
.modsheet-group h3 .tiny { font-weight: 400; color: var(--ink-soft); }
.modsheet-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.modsheet-opt {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.modsheet-opt.on {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #ffffff;
}

/* Dine in / to go, and the two-column input rows. */
.type-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.type-toggle .btn.on {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #ffffff;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

/* The Restaurant back office: modifier manager layout. */
.mod-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.mod-groups { display: flex; flex-direction: column; gap: 8px; }
.mod-group-btn { text-align: left; }
.mod-detail { min-width: 0; }
.pick-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 14px;
}
.check-row input { width: auto; margin: 0; }
@media (max-width: 720px) {
  .mod-layout { grid-template-columns: 1fr; }
}

/* =========================================================================
   Update 7: floor plan builder, register floor map, brand theming
   ========================================================================= */

/* --- Builder chrome ------------------------------------------------------ */
.zone-tabs { margin: 0 0 10px; }
.floor-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 10px;
}
.floor-tools .spacer { flex: 1; }
.floor-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 520px;
  background: var(--surface-dim);
}
.floor-frame .table-floor { border: 0; border-radius: 0; height: auto; }
.table-floor.plain-floor { background-image: none; }
.room-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 0 0 10px;
}
.room-bar label { margin: 0 0 2px; font-size: 0.8rem; }
.room-bar input[type="number"] { width: 110px; }
.room-bar input[type="color"] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }

.floor-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  align-items: start;
}
.floor-inspector {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}
.floor-inspector label { margin-top: 8px; }
.insp-zone-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.rot-row { display: flex; align-items: center; gap: 8px; }
.rot-val { font-weight: 800; min-width: 46px; text-align: center; }
@media (max-width: 900px) {
  .floor-layout { grid-template-columns: 1fr; }
}

/* --- Floor pieces -------------------------------------------------------- */
.table-floor .floor-table { width: auto; height: auto; }
.floor-table.round { border-radius: 50%; }
.floor-table.selected,
.floor-object.selected { outline: 3px solid var(--ink); outline-offset: 3px; }

.chair {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 5px;
  background: var(--ink-soft);
  opacity: 0.55;
  pointer-events: none;
}

.floor-object {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: none;
  overflow: hidden;
}
.obj-wall  { background: var(--ink); border-radius: 3px; }
.obj-bar   { background: var(--surface); border: 2px dashed var(--ink-soft); border-radius: var(--radius-sm); }
.obj-door  { background: var(--door-tint); border: 2px solid var(--door); color: var(--door); border-radius: 3px; }
.obj-plant { background: var(--plant-tint); border: 2px solid var(--plant); color: var(--plant); border-radius: 50%; }
.obj-label { background: transparent; color: var(--ink); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }

.resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--surface);
  border: 2px solid var(--ink);
  cursor: nwse-resize;
  touch-action: none;
}

/* --- Register floor map -------------------------------------------------- */
.map-wrap {
  position: relative;
  height: 420px;
  max-height: 60vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-dim);
  padding: 8px;
}
.map-canvas { position: relative; }
.map-table {
  position: absolute;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 2px solid var(--free);
  background: var(--free-tint);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  padding: 2px;
  text-align: center;
  line-height: 1.15;
}
.map-table.round { border-radius: 50%; }
.map-table.busy { border-color: var(--busy); background: var(--busy-tint); }
.map-table .map-meta { font-size: 0.68rem; font-weight: 600; color: var(--ink-soft); }
.map-legend { display: flex; gap: 14px; align-items: center; margin: 10px 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.map-key { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--free); background: var(--free-tint); }
.map-dot.busy { border-color: var(--busy); background: var(--busy-tint); }

/* --- Branding module ----------------------------------------------------- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.brand-field label { margin-top: 0; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] {
  width: 52px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.color-row input[type="text"] { flex: 1; font-family: var(--font-tape); }

.logo-drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-dim);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-bottom: 8px;
}
.logo-drop img { max-width: 100%; max-height: 70px; display: block; }

.brand-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--p-canvas);
}
.bp-bar {
  background: var(--p-chrome);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.bp-mark img { height: 20px; display: block; }
.bp-biz { font-weight: 600; letter-spacing: 0; opacity: 0.85; font-size: 0.9rem; }
.bp-body { padding: 16px; }
.bp-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  padding: 14px;
  max-width: 320px;
  color: var(--p-ink);
}
.bp-total {
  background: var(--p-chrome);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-family: var(--font-tape);
}
.bp-btn {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--p-ink);
}
.bp-btn.primary { background: var(--p-accent); border-color: var(--p-accent); color: #fff; }

/* --- Product pictures ---------------------------------------------------- */
.product-btn.has-img { padding-top: 10px; }
.product-btn .prod-thumb { margin: 0 0 2px; }

.prod-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  display: block;
  background: var(--surface-dim);
}
.prod-img-cell { display: flex; align-items: center; gap: 10px; }
.prod-img-cell img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface-dim); }

/* --- Expandable order rows ---------------------------------------------- */
.order-row { cursor: pointer; }
.order-row:hover td { background: var(--surface-dim); }
.order-row .row-caret {
  display: inline-block;
  font-size: 1.2rem;
  color: var(--ink-faint);
  transition: transform 120ms ease;
}
.order-row.open .row-caret { transform: rotate(90deg); color: var(--ink); }
.order-detail > td { background: var(--surface-dim); padding: 0; }
.order-detail-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  padding: 16px;
}
.od-items table { background: var(--surface); }
.od-side { display: flex; flex-direction: column; }
.od-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.od-line.strong { font-weight: 800; font-size: 1rem; border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; }
.od-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 800px) {
  .order-detail-body { grid-template-columns: 1fr; }
}

/* --- Module store ------------------------------------------------------- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.store-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  box-shadow: var(--shadow);
  font: inherit;
}
.store-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.store-flag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
}
.store-icon { width: 36px; height: 36px; color: var(--ink); }
.store-icon svg { width: 100%; height: 100%; }
.store-name { font-weight: 800; font-size: 1.05rem; }
.store-tag { color: var(--ink-soft); font-size: 0.88rem; flex: 1; }
.store-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.store-price { font-weight: 800; }
.mm-price { font-weight: 800; font-size: 1.2rem; margin-top: 10px; }

/* --- Golf module -------------------------------------------------------- */
.sheet-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 0 0 12px;
}
.sheet-controls label { margin: 0 0 2px; font-size: 0.8rem; }
.sheet-nav { display: flex; gap: 6px; }
.slot-time { font-family: var(--font-tape); font-weight: 700; white-space: nowrap; }
.slot-open td { background: var(--free-tint); }
.slot-taken td { background: var(--surface); }
.course-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.course-row:last-child { border-bottom: 0; }
.tmpl-table input[type="time"] { width: 120px; }

/* --- Checkout result pages ---------------------------------------------- */
.checkout-result { max-width: 480px; margin: 60px auto; text-align: center; }
.checkout-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 16px;
  color: #fff;
}
.checkout-mark.good { background: var(--free, #1f7a3d); }
.checkout-mark.warn { background: var(--ink-soft); }

/* --- Inventory module --------------------------------------------------- */
.inv-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.inv-controls input[type="search"] { flex: 1; min-width: 200px; }
.row-low td { background: var(--busy-tint, #fbeaea); }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.pos { color: var(--free, #1f7a3d); }
.delta.neg { color: var(--busy, #b3261e); }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}
.seg-btn {
  border: 0;
  background: var(--surface);
  color: var(--ink-soft);
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--brand); color: #fff; }

/* --- On-screen pinpad (touchscreen keypad) ------------------------------ */
.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 4px;
}
.pin-key {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm, 10px);
  padding: 16px 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
}
.pin-key:hover { background: var(--surface-dim); }
.pin-key:active { transform: translateY(1px); }
.pin-back { color: var(--ink-soft); }

/* --- Back office tiles and grid nav ------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  min-height: 140px;
}
.tile:hover { border-color: var(--ink); transform: translateY(-1px); }
.tile-icon { width: 34px; height: 34px; color: var(--brand); }
.tile-icon svg { width: 100%; height: 100%; }
.tile-title { font-weight: 800; font-size: 1.1rem; }
.tile-desc { color: var(--ink-soft); font-size: 0.9rem; flex: 1; }

/* Grid navigation across back office pages (replaces the oval subnav). */
.bo-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.bo-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.bo-nav a:hover { border-color: var(--ink); color: var(--ink); }
.bo-nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Section cards in a responsive grid instead of one long column. Pages opt in
   by wrapping their .card sections in .bo-sections. */
.bo-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.bo-sections .card { margin: 0; }
.bo-sections .bo-span-2 { grid-column: 1 / -1; }

/* Back-office breadcrumb heading links to the hub. */
.crumb-back { color: inherit; text-decoration: none; }
.crumb-back:hover { text-decoration: underline; }
.crumb-back::before { content: "\2190\00a0"; font-weight: 400; opacity: 0.5; }

/* --- Staff: add panel beside the team table ----------------------------- */
.staff-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  align-items: start;
}
.staff-add { position: sticky; top: 16px; }
@media (max-width: 860px) {
  .staff-layout { grid-template-columns: 1fr; }
  .staff-add { position: static; }
}
