/* =====================================================================
 * /admin SPA stylesheet.
 *
 * Reads from /assets/tokens.css for colours, fonts, surfaces. This
 * file just paints the admin-specific layout (topbar, sidebar, panels,
 * tables, modal, cards) using those tokens. Two-tier theming lives in
 * tokens.css; this file is theme-agnostic.
 *
 * Layout shape:
 *   .topbar          full-width header strip with brand and right-aligned status
 *   .layout          flex container holding sidebar + content
 *   .sidebar         vertical nav rail with section headings + tab buttons
 *   .content         right pane, holds the active <section.panel>
 * ===================================================================== */

/* =====================================================================
 * TOP BAR
 * =====================================================================
 *
 * Layout:
 *   [ THE ROCK ]   [ till chips · The Wall ]   [ 🔔 ]   [ John  Sign out ]
 *
 * The brand is left-anchored. The status-chip group flows next to the
 * brand. The alerts bell + identity slot are right-anchored via
 * margin-left: auto on .topbar-alerts (the first auto-margin pushes
 * it and everything after to the right).
 *
 * Sticky so the bar stays visible while panel content scrolls.
 * =================================================================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-brand {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
}
.topbar-brand .brand-display {
  font-family: var(--display);
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0.06em;
}

/* ----- Status group (tills + The Wall) --------------------------------
 *
 * Inline-flex of chips with a vertical divider between the till group
 * and the wall chip. The divider is purely decorative — same hue as
 * --border but slightly more opaque so the eye separates "tills" from
 * "the wall" at a glance even when both are green. */
.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-tills {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.topbar-tills-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}
.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border2, var(--border));
}

/* ----- Status dot -----------------------------------------------------
 *
 * 8px round, used inside each chip and the wall chip. Colour driven by
 * data-state so JS can flip it without touching styles. */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.18s;
}
.status-dot[data-state="green"]  { background: var(--tip-green, #4caf50); }
.status-dot[data-state="amber"]  { background: var(--warn, #f5a623); }
.status-dot[data-state="red"]    { background: var(--danger, #c44); }
.status-dot[data-state="unknown"]{ background: var(--muted); }

/* ----- Till + Wall chip ----------------------------------------------
 *
 * Inline button. Border picks up the chip's state colour subtly so the
 * chip itself reinforces the dot. Hover: gentle lift, accent border to
 * advertise it as clickable. */
.topbar-till,
.topbar-wall {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  white-space: nowrap;
}
.topbar-till:hover,
.topbar-wall:hover:not(:disabled) {
  border-color: var(--accent);
}
.topbar-till:active,
.topbar-wall:active:not(:disabled) { transform: scale(0.98); }

.topbar-till[data-state="red"],
.topbar-wall[data-state="red"]   { border-color: rgba(204, 68, 68, 0.5); }
.topbar-till[data-state="amber"],
.topbar-wall[data-state="amber"] { border-color: rgba(245, 166, 35, 0.5); }

.topbar-wall:disabled {
  opacity: 0.6;
  cursor: default;
}

.topbar-till-name,
.topbar-wall-label {
  font-family: var(--display);
  letter-spacing: 0.04em;
}

/* ----- Alerts bell ----------------------------------------------------
 *
 * Pushed to the right via margin-left: auto, taking the alerts +
 * identity together. The bell is a simple unicode glyph; we may swap
 * to an SVG later if we want consistent rendering across platforms. */
.topbar-alerts {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-bell {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--fg-dim);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.topbar-bell:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.topbar-bell[data-state="has-alerts"] { color: var(--accent); }
.topbar-bell[aria-expanded="true"] {
  background: var(--surface2);
  border-color: var(--accent);
}
.topbar-bell-icon { font-size: 18px; }
.topbar-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger, #c44);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ----- Bell dropdown panel -------------------------------------------
 *
 * Anchored under the bell button, right-aligned so it doesn't overflow
 * the viewport on narrower windows. Closed-state uses [hidden] (the
 * UA stylesheet reset elsewhere ensures display:none with
 * !important). */
.topbar-bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.topbar-bell-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.topbar-bell-panel-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 10px;
}
.topbar-bell-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topbar-bell-panel-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.topbar-bell-panel-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.topbar-bell-panel-item:last-child { border-bottom: none; }
.topbar-bell-panel-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.topbar-bell-panel-item-detail {
  margin-top: 2px;
  font-size: 12px;
  color: var(--fg-dim);
}
.topbar-bell-panel-item[data-severity="action"] .topbar-bell-panel-item-title { color: var(--warn, #f5a623); }
.topbar-bell-panel-item[data-severity="critical"] .topbar-bell-panel-item-title { color: var(--danger, #c44); }

/* ----- Identity slot --------------------------------------------------
 *
 * RockAuth mounts here. Keep the .topright class so the existing auth
 * code keeps finding the host element. */
.topbar .topright {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* =====================================================================
 * AUTH GATING
 * =====================================================================
 *
 * The whole admin (everything below the topbar) is hidden when no
 * admin session is active. The sign-in veil takes its place. The
 * topbar's status section also hides when signed out — there's
 * nothing useful to show there until we know who's looking. Brand
 * and the right-side sign-in slot stay visible always.
 *
 * State driven by body[data-auth]:
 *   "signed-out" — initial state, also after logout
 *   "signed-in"  — after a valid login
 *
 * admin-visibility.js sets data-auth from RockAuth.onChange. We
 * default to signed-out in the JS so a slow boot doesn't briefly
 * flash an unauthenticated user the entire layout.
 * =================================================================== */

body[data-auth="signed-out"] .layout         { display: none; }
body[data-auth="signed-out"] .topbar-status  { display: none; }
body[data-auth="signed-in"]  .signin-veil    { display: none; }

/* ----- Sign-in veil --------------------------------------------------
 *
 * Centered card sitting in the space the layout would occupy. Min-
 * height keeps it filling the viewport below the topbar so the page
 * never looks half-empty. */
.signin-veil {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
}
.signin-veil-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.signin-veil-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.signin-veil-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.signin-veil-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-dim);
  margin: 0 0 1.6rem;
}
.signin-veil-btn {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.06em;
  padding: 10px 28px;
  border-radius: 6px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-fg, #000);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.12s, opacity 0.12s;
}
.signin-veil-btn:hover {
  box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.18);
}
.signin-veil-btn:active { transform: scale(0.98); }

/* ----- Layout: sidebar + content -----------------------------------
 *
 * Locked to the viewport in desktop mode: body is a flex column,
 * topbar at the top, layout fills the remaining height. This lets
 * the sidebar and content each manage their own scroll so the user
 * doesn't end up scrolled past the fold of a freshly-clicked panel.
 *
 * Mobile (≤720px) keeps the natural document-flow scroll — the
 * media query at the bottom of this section reverts the locks. */
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar { flex-shrink: 0; }
.layout {
  display: flex;
  flex: 1;
  min-height: 0;        /* allow children to overflow inside the flex item */
}
.sidebar {
  flex: 0 0 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0.4rem 2rem;
  overflow-y: auto;     /* sidebar scrolls itself when tall */
}
.sidebar-section {
  margin-bottom: 1.4rem;
}
.sidebar-heading {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.9rem 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.sidebar .tab {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  font-family: var(--body);
  font-size: 13.5px;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.sidebar .tab:hover {
  background: var(--surface2);
  color: var(--fg);
}
.sidebar .tab.active {
  background: var(--surface2);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: calc(0.9rem - 3px);
}

/* ----- Main content ------------------------------------------------ */
.content {
  flex: 1;
  padding: 1.5rem 2rem 4rem;
  max-width: 1100px;
  overflow-x: auto;
  overflow-y: auto;     /* content scrolls itself — see body lock above */
}
.panel { display: none; }
.panel.active { display: block; }
.panel-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin: 0 0 0.4rem;
}
.hint {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0 0 1rem;
  line-height: 1.55;
}
.hint.ok     { color: var(--tip-green); }
.hint.danger { color: var(--danger); }

/* ----- Cards ------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.6rem;
  color: var(--fg);
}
.card-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ----- Forms ------------------------------------------------------- */
.form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.form-row > * { flex: 1 1 auto; min-width: 0; }
input, select, textarea {
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-family: var(--body);
  font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
input::placeholder { color: var(--muted); }

/* Field label + input pair (used in printer cards, edit modals, etc.) */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field > span {
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field.wide { grid-column: 1 / -1; }

/* ----- Buttons ----------------------------------------------------- */
button {
  font-family: var(--body);
  font-size: 13px;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, transform 0.08s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
button.primary {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border: 1px solid var(--accent);
  font-weight: 600;
}
button.primary:hover  { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:active { transform: translateY(1px); }
button.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
button.secondary:hover { background: var(--surface2); }
button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
button.danger:hover { background: rgba(207, 92, 92, 0.08); }
button.ok {
  background: var(--tip-green);
  color: var(--accent-fg, #ffffff);
  border: 1px solid var(--tip-green);
  font-weight: 600;
}
button.ok:hover { filter: brightness(1.08); }
button.ghost {
  background: transparent;
  color: var(--fg-dim);
  border: 0;
}

/* Tag pills used in table cells. tag-off = neutral grey, tag-pending
 * = amber attention-grabber for unverified members. */
.tag-off {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-pending {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Suspended pill — danger tone since it's a hard lock on the
 * account. Same shape as tag-pending so the eye groups them as
 * "states needing attention". */
.tag-suspended {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Members table — highlight rows that need staff attention. Subtle
 * accent-tinted left border so they catch the eye without being
 * jarring; the tag pill in the ID-check cell carries the attention. */
table.grid tbody tr.row-pending {
  background: rgba(212, 160, 23, 0.06);
  box-shadow: inset 3px 0 0 var(--accent);
}
/* Suspended rows take precedence visually — danger left-border
 * trumps the amber border (priority sort puts suspended below
 * pending though, so they still appear lower in the list). */
table.grid tbody tr.row-suspended {
  background: rgba(207, 92, 92, 0.05);
  box-shadow: inset 3px 0 0 var(--danger);
}
/* Brief flash when a "Find in list" pill is tapped from the today
 * section — draws the eye to the right row in the main table. */
@keyframes row-flash-anim {
  0%   { background: rgba(212, 160, 23, 0.35); }
  100% { background: rgba(212, 160, 23, 0); }
}
table.grid tbody tr.row-flash {
  animation: row-flash-anim 1.6s ease-out;
}

/* "Active today" list — compact card-strip rendered above the main
 * members table. Each row is a horizontal layout with name/balance/
 * tags/action. Stacks vertically on narrow screens. */
.today-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--border-radius-md, 8px);
  background: var(--surface2);
  font-size: 13px;
}
.today-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-meta {
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-tags {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.today-actions button {
  font-size: 12px;
  padding: 4px 10px;
}

/* ----- Tables ------------------------------------------------------ */
table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.grid th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
table.grid td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.actions { text-align: right; white-space: nowrap; }
table.grid td.actions button { margin-left: 0.4rem; }
table.grid code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
}
.muted { color: var(--muted); }
.preview { font-family: var(--mono); color: var(--fg-dim); }

/* Source pills shown in the credentials tables */
.source-env       { color: var(--fg-dim); font-size: 11px; }
.source-database  { color: var(--tip-green); font-size: 11px; }
.source-unset     { color: var(--danger); font-size: 11px; }

/* ----- Email rules cards ------------------------------------------ */
.rules-list { display: flex; flex-direction: column; gap: 14px; }

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.rule-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}
.rule-title { display: flex; gap: 10px; align-items: baseline; flex: 1; }
.rule-title strong { font-size: 14px; color: var(--fg); }
.rule-kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 3px;
}
.rule-actions { display: flex; gap: 0.4rem; }
.rule-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin: 0.6rem 0;
}
.rule-result {
  margin-top: 0.4rem;
  min-height: 1em;
  font-size: 12px;
}
.rule-result.ok      { color: var(--tip-green); }
.rule-result.danger  { color: var(--danger); }

/* ----- Printer cards ---------------------------------------------- */
.printer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.8rem;
}

/* ----- Receipt-details card (top of Printers panel) -------------- */
/* Edits the business.* settings that print at the top + bottom of
   every receipt. Two-column grid on desktop, single-column when
   the panel narrows. */
.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem 1.2rem;
  margin: 0.6rem 0 0.8rem;
}
.receipt-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.receipt-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim, #888);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.receipt-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.receipt-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.receipt-field-help {
  font-size: 11px;
  color: var(--fg-dim, #888);
  line-height: 1.35;
}
.receipt-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.receipt-actions .hint { margin: 0; }

.printer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.printer-head strong { font-size: 14px; color: var(--fg); }
.printer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
.printer-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.p-result { font-size: 12px; }
.p-result.ok     { color: var(--tip-green); }
.p-result.danger { color: var(--danger); }

/* ----- Toggle switch (used in rule + printer cards) --------------- */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.18s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(16px); }

/* ----- WiFi panel -------------------------------------------------- */
#wifi-current { font-size: 14px; }
#wifi-current .wifi-ok   { color: var(--tip-green); font-weight: 600; }
#wifi-current .wifi-bad  { color: var(--danger);    font-weight: 600; }
#wifi-networks .signal-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
#wifi-networks .signal-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ----- Modal (legacy, used by member create/edit dialogs) -------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  /* z-index 9500 puts old-style modals above .rock-auth-modal-overlay
     (z:9000), so an Untappd / beer dialog opened from inside the
     Add Product wizard sits in front of the wizard rather than
     behind it. PIN keypad (.pinpad-overlay, z:10000) still wins
     over everything, which is correct — security prompts always
     belong on top. */
  z-index: 9500;
  animation: fadein 0.15s ease-out;
}
/* The HTML [hidden] attribute is supposed to imply display:none,
   but our `display: flex` above wins over the UA stylesheet. Make
   our hidden rule explicit so closing the modal actually hides it. */
.modal-overlay[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 560px;        /* wider for the combined beer editor (name+prices+clip) */
  width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);   /* leave room top + bottom on small screens */
  overflow: auto;          /* scroll inside the card if its content overflows */
  box-shadow: var(--shadow);
}
.modal-card h2,
.modal-card h3 { margin: 0 0 0.6rem; font-size: 16px; }
/* Inside-card section divider for the combined beer editor.
   Visually splits Details / Prices / Pumpclip so the form doesn't
   read as one giant strip of inputs. */
.modal-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.modal-section h3 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.7rem;
}
.prices-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 360px;       /* keeps lines short — easier to scan */
}
.price-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: center;
  gap: 0.7rem;
}
.price-row label {
  font-size: 14px;
  color: var(--fg);
  margin: 0;
  text-align: left;
}
.price-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.price-input-wrap .price-prefix {
  position: absolute;
  left: 0.7rem;
  color: var(--fg-dim);
  font-size: 14px;
  pointer-events: none;
}
.price-input-wrap input {
  padding-left: 1.5rem;     /* room for the £ prefix */
  text-align: right;        /* digits right-align — easier to compare visually */
  width: 100%;
  font-variant-numeric: tabular-nums;
}

/* ----- Mobile / tablet — drawer-style sidebar -------------------- */
/* Hamburger button — hidden on wide layouts where the sidebar is
 * persistent. Shows at the same breakpoint the drawer takes over. */
.topbar-burger {
  display: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  margin-right: 0.2rem;
  cursor: pointer;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.topbar-burger:hover { background: var(--surface2); }

/* Backdrop sits under the sidebar drawer but above content. Hidden
 * by default (zero opacity, pointer-events:none) — animates in only
 * when the drawer is open. Tapping it closes the drawer (JS handler). */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 90;
}

@media (max-width: 960px) {
  /* Topbar gets the hamburger; sidebar collapses to a slide-in
   * drawer. Body scrolls normally — we no longer try to keep the
   * viewport "locked" at narrow widths because the drawer animation
   * needs to glide over content rather than push it. */
  body { display: block; overflow-x: hidden; }
  .topbar { position: sticky; top: 0; z-index: 100; gap: 0.5rem; padding: 0.5rem 0.75rem; }
  .topbar-burger { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  /* Status chip row gets its own scroll context so it can't push
   * the bell/identity off-screen on narrow viewports. Hide the
   * scrollbar visually but keep flick-to-scroll on touch. */
  .topbar-status {
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;            /* Firefox */
    -webkit-overflow-scrolling: touch;
    padding-right: 0.25rem;
  }
  .topbar-status::-webkit-scrollbar { display: none; }   /* Chromium */
  .topbar-tills { flex-wrap: nowrap; }
  .layout {
    display: block;
    flex: initial;
    min-height: calc(100vh - 50px);
  }
  /* Drawer styling — fixed positioned so it doesn't push content,
   * slides in from the left, scrolls internally when its content
   * is taller than the viewport (which it usually is). */
  .sidebar {
    position: fixed;
    top: 50px;             /* sits below the topbar */
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    border-right: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 95;
    padding: 1rem 0.6rem 2rem;
    /* Big enough tap targets — touch devices are the primary
     * audience at this breakpoint. */
    -webkit-overflow-scrolling: touch;
  }
  body[data-drawer-open="true"] .sidebar { transform: translateX(0); }
  body[data-drawer-open="true"] .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  /* Larger touch targets inside the drawer. */
  .sidebar .tab {
    font-size: 16px;
    padding: 0.8rem 1rem;
    min-height: 48px;
  }
  .sidebar-heading { padding: 0.4rem 1rem 0.4rem; font-size: 11px; }
  .sidebar-section { margin-bottom: 1rem; }

  /* Content always takes full width at narrow viewports — drawer
   * floats over it. Generous bottom padding for any iOS PWA safe
   * area gesture zone. */
  .content {
    padding: 1rem;
    max-width: 100%;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
  }
  .signin-veil { min-height: calc(100vh - 50px); }
}

/* Older 720px breakpoint kept for the tightest phone widths — used
 * to tighten typography and spacing further. */
@media (max-width: 720px) {
  .topbar-brand { display: none; }     /* phone: reclaim space for chips + bell */
  .content { padding: 0.6rem; }
}

/* ----- Live activity panel --------------------------------------
   Active-pour card is the visual anchor: it lives in DOM at all
   times so layout doesn't jump when a pour starts. The progress
   bar animates smoothly via CSS transition on width — even though
   we re-render the inner HTML every poll, the bar's container is
   stable so the transition has a stable starting width to ease from. */
.live-active {
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
}
.live-active.pouring {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(184, 134, 11, 0.06) 100%);
}
.live-active-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}
.live-active-head strong {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--fg-dim);
}
.live-active-body {
  display: grid;
  gap: 0.5rem;
}
.live-active-line {
  font-size: 22px;
  font-weight: 600;
}
.live-active-meta {
  font-size: 14px;
  color: var(--fg-dim);
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.live-bar {
  height: 14px;
  background: var(--bg-elev);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.live-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 250ms linear;   /* matches our 1s poll well */
}

.live-meta {
  display: flex;
  gap: 2rem;
  padding: 0.7rem 1.2rem;
  font-size: 14px;
  color: var(--fg-dim);
}
.live-meta strong { color: var(--fg); margin-right: 0.3rem; }

/* Status pills in the recent-pours table. Reuses the existing tag
   pattern but with status-specific colours so eyes can scan the
   column quickly. */
.pour-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pour-status.completed { background: rgba(60, 160, 90, 0.18);  color: #5cd084; }
.pour-status.started   { background: rgba(184, 134, 11, 0.22); color: var(--accent); }
.pour-status.aborted,
.pour-status.timed_out { background: rgba(200, 80, 80, 0.18);  color: #e88; }
.pour-status.hardware_error { background: rgba(200, 80, 80, 0.3); color: #fbb; }

/* ----- Untappd integration --------------------------------------
   Search-picker rows: image, meta, action button. Shown inside a
   modal when the manager taps "Import from Untappd" in the beer
   editor. Compact rows so 10 results fit without scrolling on a
   typical desktop. */
.utfb-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}
.utfb-row:first-child { border-top: none; }
.utfb-row img,
.utfb-row .utfb-row-noimg {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  flex: none;
}
.utfb-row .utfb-row-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--fg-dim);
  text-align: center;
}
.utfb-row .utfb-row-meta { flex: 1; min-width: 0; }
.utfb-row .utfb-row-name { font-weight: 600; }

/* Location-pill on Untappd search results. Tells you which UTFB
   venue this hit came from (we fan-search across both The Rock and
   The Boar's menus). Sized down so it sits next to the meta line
   without dominating it. */
.utfb-loc-pill {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(184, 134, 11, 0.18);
  color: var(--accent);
}

/* Two-tier picker section labels — visually separates "On your menus"
   (top tier) from "From the Untappd database" (bottom tier).
   Subtle uppercase header with a dim rule, so the eye finds the
   correct tier without effort but the labels don't compete with
   the actual results. */
.utfb-tier-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 1rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.utfb-tier-label:first-child { margin-top: 0.2rem; }

/* Wall-sync status pills. Used in the per-pump table on the Untappd
   tab and in the Beers list to show each beer's UTFB sync state. */
.ws-pill {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  vertical-align: middle;
}
.ws-pill.pill-ok    { background: rgba(70, 200, 90, 0.18);  color: #67c97f; }
.ws-pill.pill-warn  { background: rgba(220, 170, 30, 0.20); color: #d4a017; }
.ws-pill.pill-error { background: rgba(220, 70, 60, 0.20);  color: #e88078; }
.ws-pill.pill-muted { background: rgba(128, 128, 128, 0.20); color: var(--fg-dim); }

/* Hide the up/down spinner arrows on <input type="number">.
 * Reasons:
 *   - Tiny touch targets, easy to hit accidentally with a thumb or
 *     adjacent finger when typing a value
 *   - Cluttered look on price/ABV/coil/port fields which are common
 *   - The numeric keyboard on mobile is unaffected — that's driven
 *     by the input's `type="number"`, not the spinner UI
 * Cross-browser CSS: WebKit pseudo-elements + Firefox + standard. */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* SumUp Test Connection result pill */
.sumup-test-result {
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.sumup-test-result.ok {
  background: rgba(106, 175, 100, 0.08);
  border-color: rgba(106, 175, 100, 0.4);
  color: var(--tip-green, #6aaf64);
}
.sumup-test-result.danger {
  background: rgba(207, 92, 92, 0.08);
  border-color: rgba(207, 92, 92, 0.4);
  color: var(--danger, #cf5c5c);
}

/* =====================================================================
 * SEEN TODAY panel
 * ===================================================================== */
#seen-today-table .seen-uid code {
  font-size: 12px;
  background: var(--surface, rgba(0,0,0,0.2));
  padding: 2px 6px;
  border-radius: 4px;
}
#seen-today-table .seen-row { cursor: pointer; }
#seen-today-table .seen-row:hover { background: var(--accent-soft, rgba(212, 160, 23, 0.06)); }
.seen-who    { font-weight: 600; }
.seen-detail { font-size: 12px; color: var(--fg-dim); margin-top: 2px; }
.seen-actions { text-align: right; }

/* Status badges — colour codes the row category at a glance.
   Categories collapse onto a small palette so the eye doesn't
   have to learn 10 colours. */
.seen-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: 4px;
  vertical-align: middle;
}
.seen-badge-ok      { background: #1e8449; color: #fff; }
.seen-badge-warn    { background: #c0392b; color: #fff; }
.seen-badge-muted   { background: var(--surface-strong, #444); color: var(--fg-dim); }
.seen-badge-neutral { background: #34495e; color: #fff; }
.seen-badge-gift    { background: #8e44ad; color: #fff; }
/* Legacy badge — distinct from gift so you can tell at a glance
   "old-system migration" vs "fresh purchase". */
.seen-badge-legacy  { background: #d4a017; color: #1a1a1a; }

.seen-detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  margin: 16px 0 6px;
}
.seen-detail-section-title:first-child { margin-top: 0; }

.seen-detail-grid th {
  text-align: left;
  font-weight: 500;
  width: 35%;
  color: var(--fg-dim);
}

.seen-raw-details { margin-top: 8px; }
.seen-raw-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--fg-dim);
}
.seen-raw-pre {
  background: var(--surface, rgba(0,0,0,0.2));
  padding: 12px;
  border-radius: 4px;
  font-size: 11px;
  overflow-x: auto;
  margin-top: 8px;
}

/* Pending ID check — distinct amber to read as "needs action" */
.seen-badge-idcheck {
  background: #d97706;
  color: #fff;
}

/* Verify-and-link modal — guard rail box at the top of the modal */
.verify-warn {
  background: rgba(217, 119, 6, 0.15);
  border-left: 4px solid #d97706;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* When a row has multiple action buttons, give them a small gap. */
.seen-actions { white-space: nowrap; }
.seen-actions .seen-action + .seen-action { margin-left: 4px; }

/* Small primary button — distinct from .ghost.small but compact. */
.seen-action.primary.small {
  background: var(--accent, #d4a017);
  color: #1a1a1a;
  border: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.seen-action.primary.small:hover {
  background: var(--accent-strong, #b88c14);
}

/* ---------------------------------------------------------------------
 * Tables admin grid — area separators + inactive row dim.
 * --------------------------------------------------------------------- */
.grid-section-row {
  background: rgba(255, 255, 255, 0.02);
}
.grid-section-cell {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim, #888);
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.grid-row-inactive td {
  opacity: 0.5;
}
.grid-row-inactive:hover td {
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────────

/* =====================================================================
   Layouts admin — list view + editor.

   Uses theme tokens (--bg, --surface, --surface2, --fg, --fg-dim,
   --accent, --border) so it works in dark mode (the default for admin)
   and light mode without parallel rule sets. A previous version
   hardcoded light hex values and was unreadable on dark.
   ===================================================================== */

/* ----- List view ----- */

.layouts-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.layout-list-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.layout-list-group-head {
  background: var(--surface2);
  color: var(--fg);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.layout-list-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto auto auto;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg);
}
.layout-list-row:last-child { border-bottom: none; }
.layout-list-row .layout-list-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 15px;
}
.layout-list-row .layout-list-meta {
  color: var(--fg-dim);
  font-size: 13px;
  margin-top: 2px;
}

/* Pills — solid coloured tokens with high contrast in BOTH themes.
   Default uses the gold accent (your brand colour). Active uses a
   vivid green. Inactive is muted. All have explicit text colours so
   contrast doesn't depend on inherit. */
.layout-list-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  display: inline-block;
}
.layout-pill-default {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}
.layout-pill-active {
  background: var(--tip-green, #2ecc71);
  color: #0d2914;
}
.layout-pill-inactive {
  background: var(--border2);
  color: var(--fg-dim);
}

.layout-list-row .layout-list-actions {
  display: flex;
  gap: 6px;
}
.layout-list-row .layout-list-actions button {
  padding: 6px 12px;
  font-size: 13px;
}
.layout-list-empty {
  padding: 16px;
  color: var(--fg-dim);
  font-style: italic;
}

/* ----- Editor view ----- */

.layout-editor-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.layout-editor-head .panel-title { margin: 0; color: var(--fg); }

.layout-editor-meta {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
}
.layout-editor-meta label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
  color: var(--fg);
}
.layout-editor-meta label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}
.layout-editor-meta input[type="text"],
.layout-editor-meta input[type="number"] {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: var(--radius-sm);
  min-width: 60px;
}
.layout-editor-meta input[type="text"]:focus,
.layout-editor-meta input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}
.layout-editor-meta input[type="number"] { max-width: 80px; }

.layout-pages-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.layout-pages-tabs .layout-page-tab {
  padding: 8px 14px;
  background: var(--surface2);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  bottom: -1px;
  white-space: nowrap;
  font-family: inherit;
}
.layout-pages-tabs .layout-page-tab:hover {
  background: var(--border);
  color: var(--fg);
}
.layout-pages-tabs .layout-page-tab.active {
  background: var(--surface);
  color: var(--accent);
  border-bottom: 1px solid var(--surface);
  font-weight: 700;
}
.layout-pages-tabs .layout-page-tab-inactive {
  opacity: 0.6;
  font-style: italic;
}
.layout-pages-tabs .layout-page-tab-empty {
  padding: 8px 14px;
  color: var(--fg-dim);
  font-style: italic;
}

.layout-page-head {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.layout-page-head label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
  color: var(--fg);
}
.layout-page-head label.checkbox-row {
  flex-direction: row;
  align-items: center;
  padding-bottom: 6px;
}
.layout-page-head input[type="text"] {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: var(--radius-sm);
  min-width: 200px;
}
.layout-page-head input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.layout-page-head .danger {
  color: var(--danger);
  border-color: var(--danger);
}

/* Button grid — the canvas where buttons render in row-major order. */
.layout-button-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), 1fr);
  gap: 6px;
  background: var(--bg);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 80px;
}
.layout-tile {
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  min-height: 56px;
  transition: transform 0.08s ease, border-color 0.1s;
  text-align: center;
  word-break: break-word;
  color: var(--fg);
}
.layout-tile:hover { transform: scale(1.02); border-color: var(--accent); }
/* Drag-to-reorder feedback: the lifted tile fades; the drop target
 * shows a thick accent bar on its leading edge ("insert before here"). */
.layout-tile[draggable="true"] { cursor: grab; }
.layout-tile-dragging { opacity: 0.35; }
.layout-tile-dropbefore { box-shadow: inset 4px 0 0 0 var(--accent); }
/* Reserved/auto placeholders on packaged pages (search bar, quick picks).
 * Visually distinct from real buttons: dashed, muted, not interactive. */
.layout-tile-reserved {
  background: repeating-linear-gradient(45deg, #f4f6fa, #f4f6fa 8px, #eef1f6 8px, #eef1f6 16px);
  border: 1px dashed var(--border, #c7cdd6);
  color: #5a6473;
  cursor: default;
}
.layout-tile-reserved:hover { transform: none; border-color: var(--border, #c7cdd6); }
.layout-tile-empty {
  background: transparent;
  border: 1px dashed var(--border2);
  color: var(--fg-dim);
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
}
.layout-tile-empty:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
}
.layout-tile-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.75;
  letter-spacing: 0.04em;
}
.layout-tile-label { font-weight: 600; }
.layout-tile-meta {
  font-size: 11px;
  opacity: 0.7;
}

/* Locked tiles (tap_slot today) — gold left border + lock icon in
 * the kind line. Visual contract: "you can click me, but most of
 * what's in this tile is determined elsewhere (The Bar)." */
.layout-tile-locked {
  border-left: 4px solid #d4a017;
  padding-left: 6px;        /* 8 - 2 to compensate for the thicker left border */
}
.layout-tile-locked:hover {
  border-color: #d4a017;
}

/* Add-button modal — kind picker grid */
.layout-kind-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.layout-kind-picker .kind-option {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  background: var(--surface2);
  color: var(--fg);
}
.layout-kind-picker .kind-option:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.layout-kind-picker .kind-option.selected {
  border-color: var(--accent);
  background: rgba(212, 160, 23, 0.18);   /* accent at 18% opacity */
  color: var(--accent);
}
.layout-kind-picker .kind-option small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  margin-top: 4px;
  color: var(--fg-dim);
}

.layout-button-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.layout-button-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.layout-button-form input[type="text"],
.layout-button-form input[type="number"],
.layout-button-form select {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: var(--radius-sm);
}
.layout-button-form input[type="text"]:focus,
.layout-button-form input[type="number"]:focus,
.layout-button-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.layout-button-form input[type="color"] {
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  height: 36px;
  width: 100%;
  cursor: pointer;
}
.layout-button-form .row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.layout-button-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.layout-button-form-actions .danger-action {
  margin-right: auto;
  color: var(--danger);
}


/* =====================================================================
   Floor plan editor (Tables admin).

   Same theme-token rule as above: every colour is read from a token
   so light/dark themes both look right. Dark is the default for admin.
   ===================================================================== */

.floor-plan-areas-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  background: var(--surface);
}
.floor-plan-areas-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
/* Area chips — passive informational labels showing how many active
   tables tag with each area. Not clickable, no hover. The unified
   floor plan put paid to area-tab navigation; these chips are kept
   so the manager remembers which areas exist + sees their counts. */
.floor-plan-area-chip {
  padding: 6px 14px;
  background: var(--surface2);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.floor-plan-area-chip .floor-plan-area-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
/* Area chips are now buttons (tap to set the area's colour). */
.floor-plan-area-chip { cursor: pointer; }
.floor-plan-area-chip:hover { border-color: var(--accent); color: var(--fg); }
.floor-plan-area-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
/* Old .floor-plan-area-tab kept for safety in case any cached HTML
   still references it — collapses to the chip look. */
.floor-plan-area-tab {
  padding: 6px 14px;
  background: var(--surface2);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.floor-plan-canvas-wrap {
  width: 100%;
  /* Fill available height instead of locking to a fixed aspect, so the
     editor uses the screen. Tables are %-positioned with no min pixel
     size, so any aspect renders correctly and overlap-free. */
  height: calc(100vh - 220px);
  min-height: 460px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.floor-plan-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(to right,  var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 2% 3.2%;
  user-select: none;
  cursor: crosshair;
  touch-action: none;
}
.floor-plan-canvas.dragging { cursor: grabbing; }
.floor-plan-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--fg-dim);
}
.floor-plan-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--fg-dim);
  font-style: italic;
  text-align: center;
  padding: 0 32px;
  pointer-events: none;
}

.floor-plan-tile {
  position: absolute;
  width: 92px;
  height: 68px;
  transform: translate(-50%, -50%);
  background: var(--surface);
  color: var(--fg);
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  text-align: center;
  padding: 4px;
  line-height: 1.2;
}
.floor-plan-tile:hover {
  border-color: var(--accent);
}
.floor-plan-tile.dragging {
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: none;
  border-color: var(--accent);
}
.floor-plan-tile.shape-circle {
  border-radius: 50%;
  width: 80px;
  height: 80px;
}
.floor-plan-tile.inactive {
  opacity: 0.55;
  background: var(--bg);
  border-style: dashed;
  border-color: var(--border);
}
.floor-plan-tile.has-tab {
  border-color: var(--danger);
  background: rgba(207, 92, 92, 0.18);   /* danger at 18% */
}
.floor-plan-tile.tab-bill-printed {
  border-color: var(--warn);
  background: rgba(232, 160, 32, 0.18);  /* warn at 18% */
}
/* Overlap warning — tile sits on top of another. Drag it apart; the till
   needs non-overlapping tiles to render the plan cleanly. */
.floor-plan-tile.fp-overlap {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger), var(--shadow-lg);
  z-index: 50;
}
.floor-plan-hint.fp-hint-warn {
  color: var(--danger);
  font-weight: 600;
}
.floor-plan-tile-code {
  font-size: 16px;
  font-weight: 700;
}
.floor-plan-tile-meta {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
  margin-top: 2px;
}
.floor-plan-tile.has-tab .floor-plan-tile-meta {
  color: var(--danger);
  opacity: 1;
}

.floor-plan-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
  background: var(--surface);
}
.floor-plan-hint {
  color: var(--fg-dim);
  font-size: 13px;
}
.floor-plan-actions {
  display: flex;
  gap: 8px;
}
.floor-plan-actions button {
  padding: 6px 12px;
  font-size: 13px;
}

/* Add/Edit Table modal form */
.table-form .row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.table-form .row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.table-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.table-form input[type="text"],
.table-form input[type="number"],
.table-form select {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: var(--radius-sm);
}
.table-form input[type="text"]:focus,
.table-form input[type="number"]:focus,
.table-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.table-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.table-form-actions .danger-action {
  margin-right: auto;
  color: var(--danger);
  border-color: var(--danger);
}

/* ─────────────────────────────────────────────────────────────────
   Generic data table (used by no-sale audit and similar reports)
   ───────────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface2); }
.badge-ok, .badge-warn {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-ok   { background: #1e8449; color: #fff; }
.badge-warn { background: #c0392b; color: #fff; }

.card-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-dim);
}
.card-toolbar select {
  font: inherit;
  padding: 6px 10px;
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* =====================================================================
 * SumUp readers — assignment model
 * ===================================================================== */

/* Generic small-text utility (used by .muted.small for sublabels). */
.small { font-size: 12px; line-height: 1.3; }

/* Pill representing one Solo assigned to a target (or one target a
 * Solo serves). Subtle accent so a row with multiple readers still
 * scans cleanly. */
.solo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  margin: 2px 4px 2px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg);
  vertical-align: middle;
}
.solo-pill-name { font-weight: 600; }
.solo-pill-prio {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Assignment modal — checkbox + multi-line label flex layout. */
.assign-table { width: 100%; margin-top: 0.5rem; }
.assign-table td { vertical-align: middle; padding: 8px 10px; }
.assign-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.assign-toggle input[type="checkbox"] {
  margin: 3px 0 0;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.assign-toggle > span { flex: 1; }
.assign-priority {
  width: 5rem;
  padding: 6px 8px;
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.assign-priority:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Status text used in the Paired Solos table (battery + connectivity).
 * Inline-friendly (no background pill — sits as plain coloured text
 * separated by middle dots). Colour palette matches .ws-pill so the
 * admin looks consistent.
 *   .status-ok    — battery > 40% OR connectivity ONLINE
 *   .status-warn  — battery 21-40% OR mid-firmware-update
 *   .status-bad   — battery <= 20% OR connectivity OFFLINE
 */
.status-ok    { color: #67c97f; font-weight: 600; }
.status-warn  { color: #d4a017; font-weight: 600; }
.status-bad   { color: #e88078; font-weight: 600; }

/* Solo battery indicator inside the Paired Solos Status cell.
 * Mirrors the till's Card-button battery so a low/charging Solo
 * reads the same in both places. Inline-flex so it sits naturally
 * in the dot-separated Status row. */
.solo-battery {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
}
.solo-battery-seg {
  display: inline-block;
  width: 4px;
  height: 9px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
}
.solo-battery[data-level="ok"]   .solo-battery-seg.on { background: #67c97f; }
.solo-battery[data-level="warn"] .solo-battery-seg.on { background: #d4a017; }
.solo-battery[data-level="bad"]  .solo-battery-seg.on { background: #e88078; }

.solo-battery-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-left: 4px;
  font-size: 0.95em;
}
.solo-battery[data-level="ok"]   .solo-battery-pct { color: #67c97f; }
.solo-battery[data-level="warn"] .solo-battery-pct { color: #d4a017; }
.solo-battery[data-level="bad"]  .solo-battery-pct { color: #e88078; }

/* "as of 3m ago" pill in the Status cell. Quiet visual weight so it
 * doesn't dominate the row, but always visible so the manager can
 * see at a glance whether the displayed values are fresh. */
.solo-asof {
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── Section flash (Phase B "Save & add modifiers ›" landing) ─────
   Brief amber pulse on the modifier-groups section header when the
   manager arrives via the wizard's "Save & add modifiers ›" CTA. 
   The scrollIntoView + flash combo says "here's where to put your
   sides/sizes/toppings" without forcing a tooltip. */
@keyframes section-flash-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.6); }
  50%  { box-shadow: 0 0 0 12px rgba(212, 160, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); }
}
.section-flash {
  animation: section-flash-pulse 1.6s ease-out;
  border-radius: 8px;
}

/* ─── Modifier templates panel (Phase C) ──────────────────────────
   Reusable modifier groups library. Card-per-group, with linked-
   count badge showing how many products carry a clone. */
.mt-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "No" lists admin */
.no-admin-toolbar { margin-bottom: 12px; }
.no-admin-catlabel { font-weight: 600; }
.no-admin-catlabel select { margin-left: 8px; padding: 8px 10px; min-height: 40px; }
.no-admin-list { display: flex; flex-direction: column; gap: 8px; }
.no-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg, #1a1f2e);
  border: 1px solid var(--border, #2d3748);
  border-radius: 8px;
  padding: 8px 12px;
}
.no-admin-row[data-inactive="true"] { opacity: 0.55; border-style: dashed; }
.no-admin-reorder { display: flex; flex-direction: column; gap: 2px; }
.no-admin-reorder button { padding: 2px 8px; line-height: 1.1; }
.no-admin-name { flex: 1; font-weight: 600; }
.no-admin-acts { display: flex; gap: 6px; }
.no-admin-acts .danger { color: #e23b3b; }
.no-admin-add { display: flex; gap: 8px; align-items: center; }
.no-admin-add input { flex: 1; padding: 10px 12px; min-height: 44px; }

.mt-group-card {
  background: var(--card-bg, #1a1f2e);
  border: 1px solid var(--border, #2d3748);
  border-radius: 10px;
  padding: 14px 16px;
}
.mt-group-card[data-inactive="true"] {
  opacity: 0.55;
  border-style: dashed;
}
.mt-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.mt-group-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-group-info strong { font-size: 16px; }
.mt-group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-linked-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mt-linked-badge.mt-linked-empty {
  background: rgba(148, 163, 184, 0.12);
  color: var(--fg-muted, #94a3b8);
}
.mt-option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mt-option-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.mt-option-row[data-inactive="true"] { opacity: 0.55; }
.mt-option-row.mt-option-empty {
  display: block;
  background: transparent;
  padding: 6px 0;
}
.mt-option-name { font-size: 14px; }
.mt-option-price {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg-muted, #94a3b8);
}
.mt-add-option {
  margin-top: 10px;
}

/* Cascade-warning banner inside the edit modal: tells the manager
   how many products will be affected by their change. */
.mt-cascade-hint {
  background: rgba(212, 160, 23, 0.12);
  border-left: 3px solid var(--accent, #d4a017);
  color: var(--fg, #f5f5f5);
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 4px;
  font-size: 13px;
}

/* ─── Product editor — linked-templates section (Phase C) ────────
   Lives inside the Products edit modal between Modifier groups and
   the bottom Save row. Shows attached templates as chips with a 
   detach button, plus a + Attach picker. */
.ep-linked-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.ep-template-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(96, 165, 250, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
}
.ep-template-chip[data-inactive="true"] {
  opacity: 0.5;
  background: rgba(148, 163, 184, 0.1);
  color: var(--fg-muted, #94a3b8);
  border-color: rgba(148, 163, 184, 0.25);
}
.ep-template-chip-detach {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
}
.ep-template-chip-detach:hover { opacity: 1; color: #f87171; }
.ep-template-empty {
  font-size: 13px;
  color: var(--fg-muted, #94a3b8);
  font-style: italic;
}

/* ===== Cashup history actions column (Phase 1 of cashup-merge) ===== */
.ch-actions {
  white-space: nowrap;
  text-align: right;
}
.ch-actions .btn {
  margin-left: 4px;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ===== Cashup edit modal ===== */
.modal-cashup-edit {
  max-width: 520px;
  width: 92%;
}
.ch-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 14px;
}
.ch-edit-form .ch-field-wide {
  grid-column: 1 / -1;
}
.ch-edit-form .ch-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ch-edit-form .ch-field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ch-edit-form input,
.ch-edit-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  background: var(--surface, #1a1a1a);
  color: var(--fg, #e8e4dc);
  border: 1px solid var(--border, #2e2e2e);
  border-radius: 4px;
}
.ch-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Backup status rows (Admin → System → Backups) */
.backup-status-row { display:flex; justify-content:space-between; gap:16px; padding:4px 0; border-bottom:1px solid var(--border, #2a2a2a); }
.backup-status-row span { color: var(--fg-dim, #8a8a8a); }
.backup-status-row strong { text-align:right; word-break:break-word; }

/* ---------------------------------------------------------------------
   Beerboard adverts
   --------------------------------------------------------------------- */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.ad-card {
  background: var(--panel, #1a1f26);
  border-radius: 6px;
  padding: 0.6rem;
  text-align: center;
}
/* Letterboxed on the board's own background rather than cropped to
   fill, so what a manager sees here is what the wall will actually do
   with their poster. */
.ad-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #07090c;
  border-radius: 4px;
  display: block;
}
.ad-name {
  font-size: 0.85rem;
  margin: 0.4rem 0;
  word-break: break-all;
  opacity: 0.85;
}

/* Beerboard messages */
.bm-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.bm-form input[type=text] { flex: 1 1 320px; padding: 8px 10px; }
.bm-form label { display: flex; align-items: center; gap: 6px; }
.bm-list { list-style: none; padding: 0; margin-top: 12px; }
.bm-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 10px 12px; border: 1px solid var(--border, #334155); border-radius: 8px; margin-bottom: 8px; }
.bm-row.is-live { border-color: #f0b93f; }
.bm-text { font-weight: 600; grid-column: 1; }
.bm-when { color: var(--fg-dim, #a8998a); font-size: 0.9em; grid-column: 1; }
.bm-del { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.bm-surfaces { font-size: 0.85em; opacity: 0.85; grid-column: 1; }

/* The wall & the website: one planner */
.bm-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.bm-subtab { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border, #334155); background: transparent; color: var(--fg-dim, #a8998a); cursor: pointer; font-weight: 600; }
.bm-subtab.active { background: var(--accent, #f0b93f); color: #14171c; border-color: transparent; }
.bm-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.bm-form input[type=text] { flex: 1 1 320px; padding: 8px 10px; }
.bm-form label { display: flex; align-items: center; gap: 6px; }
.bm-list { list-style: none; padding: 0; margin-top: 14px; }
.bm-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "thumb text del" "thumb surfaces del" "thumb when del";
  gap: 2px 14px;
  padding: 10px 12px; border: 1px solid var(--border, #334155); border-radius: 8px; margin-bottom: 8px;
  align-items: center;
}
.bm-row:has(.bm-thumb) { grid-template-columns: 56px 1fr auto; }
.bm-row.is-live { border-color: #f0b93f; }
.bm-row.is-missing { border-color: #c0392b; }
.bm-thumb { grid-area: thumb; width: 56px; height: 40px; object-fit: cover; border-radius: 4px; background: #222; }
.bm-thumb-missing { display: flex; align-items: center; justify-content: center; color: #c0392b; font-weight: 700; }
.bm-text { grid-area: text; font-weight: 600; }
.bm-surfaces { grid-area: surfaces; font-size: 0.85em; opacity: 0.85; }
.bm-when { grid-area: when; color: var(--fg-dim, #a8998a); font-size: 0.9em; }


/* Edit affordance */
.bm-actions { grid-area: del; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.bm-actions button { font-size: 0.85em; padding: 4px 10px; }
.bm-edit { background: transparent; border: 1px solid var(--border, #334155); color: var(--fg, #f5f5f5); border-radius: 6px; cursor: pointer; }
.bm-row.is-editing { border-color: #4a9eff; background: rgba(74,158,255,0.06); }
.btn-secondary { background: transparent; border: 1px solid var(--border, #334155); color: var(--fg-dim, #a8998a); border-radius: 8px; padding: 8px 16px; cursor: pointer; }

/* ---- Reports + Exceptions (v1.5.260) ------------------------------ */
.report-frame { width: 100%; height: calc(100vh - 190px); min-height: 640px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg, #0d0f12); display: block; }
.exc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.exc-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.exc-periods button { appearance: none; border: 1px solid var(--border); background: var(--surface2, transparent); color: var(--fg); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.exc-periods button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600; }
.exc-dates input, #exc-till { background: var(--surface2, transparent); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.exc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.exc-tile { appearance: none; text-align: left; border: 1px solid var(--border); background: var(--surface2, transparent); color: var(--fg); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; }
.exc-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.exc-tile .l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); }
.exc-tile .n { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.exc-tile .p { font-size: 12px; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.exc-tile.zero .n { color: var(--fg-dim); }
.exc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exc-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.exc-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.exc-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exc-table .items { color: var(--fg-dim); font-size: 12px; margin-top: 3px; }
