/* =====================================================================
 * EPOS admin styles — sidebar gating + panels
 * =====================================================================
 * Loaded after admin.css and admin-auth.css. Inherits the same design
 * tokens. All rules namespaced under `.epos-*`, `.till-*`, `.sidebar-section-epos`,
 * etc. so it can't collide with the existing kiosk admin.
 * ===================================================================== */

/* Belt-and-braces: ensure [hidden] really hides things in the admin
 * area. The original admin.css doesn't override this, but we add it
 * explicitly so a future author rule on .content won't accidentally
 * unhide our EPOS main. Same fix we applied to the till SPA. */
[hidden] { display: none !important; }

/* Sidebar EPOS section — locked-out look when unsigned-in */
.sidebar-section-epos[data-locked="true"] .tab,
.sidebar-section-epos .tab[data-locked="true"] {
  opacity: 0.5;
  cursor: pointer;
}
.sidebar-section-epos[data-locked="true"] .tab::after,
.sidebar-section-epos .tab[data-locked="true"]::after {
  content: ' 🔒';
  font-size: 11px;
}
.sidebar-section-epos[data-locked="true"] .sidebar-heading::after {
  content: ' (sign in)';
  font-size: 10px;
  color: var(--fg-dim);
  text-transform: none;
  font-weight: normal;
}

/* EPOS main panel — same look as the original .content but separated */
.content-epos { padding: 24px; }

/* Status pills inside the tills table.
 *
 * The bar/cafe slugs ARE the original two; new types (outdoor, festival,
 * bbq, etc.) fall through the [class*="till-type-"] catch-all to a
 * neutral accent. Adding a per-slug rule for every custom type would
 * make the admin CSS grow with operator data — bad. The header style
 * (bar/cafe/minimal) is the visual classifier; this is just a tint
 * for the table cell. */
.till-type-bar  { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.till-type-cafe { color: var(--tip-green, #4caf50); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
[class^="till-type-"]:not(.till-type-bar):not(.till-type-cafe):not(.till-type-slug):not([class*="till-type-header-"]):not([class*="till-type-usage"]) {
  color: var(--fg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* Header style chips on the till-types table — three flavours
 * matching the back-end's HEADER_STYLES catalog. */
.till-type-header-bar     { color: var(--accent);                    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.till-type-header-cafe    { color: var(--tip-green, #4caf50);        font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.till-type-header-minimal { color: var(--fg-dim);                    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Slug code badge — small, mono, dimmer than primary content. */
.till-type-slug {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  color: var(--fg-dim);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* "Tills using" usage indicator: active / total. Empty (0 references)
 * dims to nothing so it doesn't draw the eye — only types in active
 * use should stand out. */
.till-type-usage {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12px;
  color: var(--fg);
}
.till-type-usage-empty { color: var(--fg-dim); }

.till-status-active   { color: var(--tip-green, #4caf50); font-weight: 600; }
.till-status-inactive { color: var(--fg-dim); }

.till-paired { color: var(--tip-green, #4caf50); font-weight: 600; font-size: 12px; }
.till-pairing-code {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px dashed var(--accent);
}

.till-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.till-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.till-actions button:hover:not(:disabled) { color: var(--fg); border-color: var(--fg-dim); }
.till-actions .till-deactivate:hover:not(:disabled),
.till-actions .till-type-deactivate:hover:not(:disabled),
.till-actions .till-type-delete:hover:not(:disabled) {
  color: var(--danger, #c44);
  border-color: var(--danger, #c44);
}
/* Disabled action — used for protected/referenced rows. The tooltip
 * (set via title=) explains why; we just need to look unclickable. */
.till-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Inline form hints inside modals — secondary text below an input. */
.hint-inline {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.4;
}

/* Big pairing code display in the post-create modal */
.till-pairing-code-display {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: var(--bg);
  padding: 24px;
  margin: 16px 0;
  border-radius: 12px;
  border: 2px dashed var(--accent);
  user-select: all;
}

/* Loading / empty / error states inside grids */
.grid-loading,
.grid-empty,
.grid-error {
  text-align: center;
  padding: 32px;
  color: var(--fg-dim);
  font-style: italic;
}
.grid-error { color: var(--danger, #c44); font-style: normal; }

/* Form fields used in modals (Add till, etc.) */
.epos-field {
  display: block;
  margin-bottom: 16px;
}
.epos-field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.epos-field input,
.epos-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
}
.epos-field input:focus,
.epos-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.epos-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.epos-btn-primary,
.epos-btn-secondary {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.12s;
}
.epos-btn-primary {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
.epos-btn-primary:hover { filter: brightness(1.1); }
.epos-btn-secondary { background: transparent; color: var(--fg-dim); }
.epos-btn-secondary:hover { color: var(--fg); border-color: var(--fg-dim); }

/* =====================================================================
 * STAFF PANEL
 * ===================================================================== */

.staff-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 12px;
  gap: 12px;
}
.staff-filters {
  display: flex;
  gap: 4px;
}
.staff-filter {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.staff-filter:hover { color: var(--fg); border-color: var(--fg-dim); }
.staff-filter[data-active="true"] {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}

/* Self-row visual: subtle accent on the LEFT edge */
#epos-staff-table tr[data-self="true"] td:first-child {
  position: relative;
  padding-left: 16px;
}
#epos-staff-table tr[data-self="true"] td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.staff-self-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-radius: 3px;
  vertical-align: middle;
}

/* Per-staff colour dot in the admin staff list. Sits to the LEFT of
 * the name, before the name text. Visual at-a-glance reminder of who
 * has which colour without needing to open the edit modal. */
.staff-list-colordot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--staff-color, var(--border));
  margin-right: 8px;
  vertical-align: middle;
  /* On the YOU row the gold left-edge already exists; the dot sits
   * after that edge so they don't fight. */
}

/* Colour swatch picker — used by Add + Edit staff modals. */
.staff-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.staff-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--staff-color, var(--surface2));
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
  /* Make the focus ring obvious for keyboard users */
  outline-offset: 2px;
}
.staff-color-swatch:hover { transform: scale(1.1); }
.staff-color-swatch[data-selected="true"] {
  /* Selected: a gold ring around the swatch makes it unmistakable
   * against any background colour. */
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}
/* "No colour" swatch: visually distinct from coloured swatches —
 * a diagonal line through a neutral background reads as "none". */
.staff-color-swatch-none {
  background: var(--surface2);
  border: 2px solid var(--border);
  position: relative;
}
.staff-color-swatch-none::after {
  content: '';
  position: absolute;
  top: 50%; left: 4px; right: 4px;
  height: 2px;
  background: var(--fg-dim);
  transform: rotate(-45deg);
  transform-origin: center;
}
.staff-color-swatch-none[data-selected="true"] {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}
.staff-fullname {
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: 2px;
}

.staff-role {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.staff-role-admin       { color: var(--accent); border-color: var(--accent); }
.staff-role-manager     { color: var(--tip-green, #4caf50); border-color: var(--tip-green, #4caf50); }
.staff-role-supervisor  { color: var(--warn, #f5a623); border-color: var(--warn, #f5a623); }
.staff-role-staff       { color: var(--fg-dim); }
.staff-role-accountant  { color: #6ec1d6; border-color: #6ec1d6; }

/* Access levels (v1.5.95): one badge style, brighter as the level rises. */
.staff-level {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.staff-level[data-level="4"], .staff-level[data-level="5"] { color: var(--fg); border-color: var(--fg-dim); }
.staff-level[data-level="6"] { color: var(--accent); border-color: var(--accent); }

.levels-card { margin-top: 16px; }
.levels-title { margin: 0 0 4px; }
.levels-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.levels-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); font-weight: 700; cursor: pointer;
}
.levels-chip[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.levels-chip-n { font-size: 11px; font-weight: 500; color: var(--fg-dim); }
.levels-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.levels-group { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.levels-group legend { font-weight: 700; padding: 0 6px; }
.levels-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.levels-item input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.levels-item.is-locked { cursor: default; opacity: 0.75; }
.levels-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.levels-status { color: var(--fg-dim); font-size: 13px; margin-right: auto; }

.staff-status-active   { color: var(--tip-green, #4caf50); font-weight: 600; font-size: 12px; }
.staff-status-inactive { color: var(--fg-dim); font-size: 12px; }
.staff-status-archived { color: var(--danger, #c44); font-size: 12px; font-style: italic; }

.staff-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.staff-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.staff-actions button:hover:not(:disabled) {
  color: var(--fg);
  border-color: var(--fg-dim);
}
.staff-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.staff-actions .staff-action-danger:hover:not(:disabled) {
  color: var(--danger, #c44);
  border-color: var(--danger, #c44);
}

/* ----- Edit modal layout: two columns (profile + perms) ----- */

.staff-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.staff-edit-grid h3 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.staff-edit-perms {
  max-height: 60vh;
  overflow-y: auto;
}
.hint-small {
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 12px;
}
.hint-warning {
  background: rgba(245, 166, 35, 0.1);
  border-left: 3px solid var(--warn, #f5a623);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.epos-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.epos-field-hint {
  display: block;
  font-size: 11px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-dim);
  margin-top: 4px;
}

/* ----- Permission matrix ----- */

.perm-group {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.perm-group-head {
  background: var(--bg);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.perm-group-list {
  display: flex;
  flex-direction: column;
}
.perm-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.perm-row:first-child { border-top: none; }
.perm-key {
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 11px;
  color: var(--fg);
}
.perm-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.perm-status-role-on  { color: var(--tip-green, #4caf50); }
.perm-status-role-off { color: var(--fg-dim); }
.perm-status-grant    { color: var(--accent); }
.perm-status-deny     { color: var(--danger, #c44); }

.perm-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.perm-toggle button {
  padding: 4px 10px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.1s;
}
.perm-toggle button:last-child { border-right: none; }
.perm-toggle button:hover { color: var(--fg); }
.perm-toggle button[data-active="true"][data-mode="grant"] {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}
.perm-toggle button[data-active="true"][data-mode="deny"] {
  background: var(--danger, #c44);
  color: #fff;
}
.perm-toggle button[data-active="true"][data-mode="clear"] {
  background: var(--surface);
  color: var(--fg);
}

/* =====================================================================
 * PRODUCTS TAB
 * =====================================================================
 *
 * Filter bar at the top of the panel, then a wide grid of products.
 * Each row gets a status pill (active/inactive/sold-out) and an edit
 * button. BBE column shows green/amber/red pills for time-to-expiry.
 * =================================================================== */

.products-filters {
  margin-bottom: 1rem;
}
.products-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.field-inline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 12px;
  color: var(--fg-dim);
}
.field-inline > span {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.field-inline select,
.field-inline input[type="search"] {
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 4px;
  font-size: 13px;
  min-width: 160px;
}
.products-filter-search input { min-width: 220px; }
.products-filter-inactive {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 13px;
  color: var(--fg);
}
.products-filter-inactive > span { font-size: 13px; text-transform: none; letter-spacing: 0; }

/* ----- Product table cells -------------------------------------------
 *
 * Pills are reused for status + BBE + group. .pill is a single base;
 * the modifier classes pick the colour. Group pill uses data-group so
 * Bar/Cafe stay visually distinct without needing extra classes. */
.product-name { font-weight: 600; }
.product-receipt-name { font-size: 11px; color: var(--fg-dim); }
.product-price { font-family: var(--mono); }
.product-allergens { font-family: var(--mono); text-align: center; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill.ok   { background: rgba(70, 200, 90, 0.18);  color: #67c97f; }
.pill.warn { background: rgba(220, 170, 30, 0.20); color: #d4a017; }
.pill.bad  { background: rgba(220, 70, 60, 0.20);  color: #e88078; }
.pill.dim  { background: rgba(128, 128, 128, 0.20); color: var(--fg-dim); }

.product-group-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.product-group-pill[data-group="bar"]  { color: #f0a500; }
.product-group-pill[data-group="cafe"] { color: #67c97f; }

/* ----- Allergen chips in the editor ---------------------------------
 *
 * Tappable, multi-select. Selected state filled with the chip's colour
 * (sourced from the allergen lookup). Unselected has a subtle outline
 * so all 14 are visible at a glance. */
.allergen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.allergen-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
  font-family: inherit;
}
.allergen-chip:hover { border-color: var(--accent); }
.allergen-chip[data-selected="true"] {
  background: rgba(232, 93, 38, 0.16);
  border-color: var(--accent);
  color: var(--fg);
}
.allergen-chip-emoji { font-size: 16px; }
.allergen-chip-name { font-size: 12px; }

/* ----- Modal sections ------------------------------------------------ */
.modal-section {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-section h3 {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

/* =====================================================================
 * EDITOR MODAL — head + scrollable body + sticky footer
 * =====================================================================
 *
 * The login modal's `.rock-auth-modal` shell already handles
 * positioning, max-height (90vh), flex-column layout, etc. We reuse
 * that shell and add three direct children:
 *
 *   .pmodal-head   sticky title bar with optional close button
 *   .pmodal-body   scrollable content area — flex: 1 takes the
 *                  remaining height inside the modal box
 *   .pmodal-foot   sticky action-button row, always visible
 *
 * Without these, content above 90vh just gets clipped by the shell's
 * overflow:hidden — the user types a long description, scrolls down
 * looking for Save, and never finds it. Sticky footer guarantees the
 * action buttons are reachable regardless of body length.
 * =================================================================== */

.pmodal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.pmodal-head h2 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.pmodal-head .hint { margin: 0; }
.pmodal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
}
.pmodal-close:hover { background: var(--surface2); color: var(--fg); }

.pmodal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 24px;
  /* The content grid spacing — fields-2, modal-section etc — is set
   * elsewhere; this just scrolls. */
}

.pmodal-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* =====================================================================
 * ADD PRODUCT WIZARD
 * =====================================================================
 *
 * Tile picker for type/sub-type. Tiles are big tappable cards with
 * an icon, title, and description — biased for quick recognition
 * over text density. Cafe staff scan, recognise, tap.
 * =================================================================== */

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.panel-head .panel-title { margin: 0; }

.wiz-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
/* Sub-type / category step has more options that are denser by
 * description, so use a 2-column grid on wider screens. */
.wiz-tiles-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.wiz-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.wiz-tile:hover {
  border-color: var(--accent);
  background: rgba(232, 93, 38, 0.06);
}
.wiz-tile:active { transform: scale(0.98); }
.wiz-tile-icon {
  font-size: 24px;
  line-height: 1;
}
.wiz-tile-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.wiz-tile-desc {
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.4;
}

/* Per-field hint that sits directly under an input — for things like
 * "auto-calculated from another field, override if you want". */
.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 11px;
  color: var(--fg-dim);
  font-style: italic;
  line-height: 1.3;
}

/* Sub-tile in the wizard category picker — Coffee under Hot drinks,
 * etc. Slight indent + a dim parent-name prefix to read as "child of". */
.wiz-tile.wiz-tile-sub {
  padding-left: 28px;
  background: var(--surface);
  border-style: dashed;
}
.wiz-tile-prefix {
  display: block;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

/* =====================================================================
 * MODIFIER GROUPS EDITOR
 * =====================================================================
 *
 * In-modal CRUD for option groups + options. Each group is a card;
 * options inside are simple rows. Editing converts a row into a
 * compact inline form with Save/Cancel.
 * =================================================================== */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.4rem;
}
.section-head h3 { margin: 0; }

/* ----- Group card --------------------------------------------------- */
.mod-group-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.mod-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mod-group-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mod-group-name { font-family: var(--display); color: var(--accent); letter-spacing: 0.04em; font-size: 14px; }
.mod-group-meta { font-size: 11px; }
.mod-group-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ----- Option list inside a group ----------------------------------- */
.mod-option-list {
  list-style: none;
  margin: 0;
  padding: 4px 14px 0;
}
.mod-option-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dotted var(--border);
}
.mod-option-row:last-child { border-bottom: none; }
.mod-option-name { color: var(--fg); }
.mod-option-price {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}
.mod-option-actions { display: flex; gap: 2px; }
.mod-option-empty {
  list-style: none;
  padding: 6px 0;
  font-style: italic;
}

/* ----- Add-option button at the foot of each card ------------------- */
.mod-add-option {
  margin: 6px 14px 12px;
  display: inline-block;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--fg-dim);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.mod-add-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ----- Inline edit forms ------------------------------------------- */
.mod-group-form {
  padding: 12px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mod-group-form-add {
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: rgba(232, 93, 38, 0.06);
}
.mod-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.6rem;
}
.mod-form-row label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mod-form-field-grow { flex: 1 1 200px; }
.mod-form-field-narrow { flex: 0 0 70px; }
.mod-form-row input,
.mod-form-row select {
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 4px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  font-family: inherit;
}
.mod-form-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ----- Inline option edit form ------------------------------------- */
.mod-option-form {
  display: grid;
  grid-template-columns: 1fr auto 90px auto;
  gap: 0.5rem;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dotted var(--border);
}
.mod-option-form input {
  padding: 4px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.mod-form-currency {
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 12px;
}
.mod-form-actions-inline {
  display: flex;
  gap: 0.3rem;
}

/* ----- Compact icon buttons ---------------------------------------- */
.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--fg-dim);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.icon-btn:hover {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
.icon-btn-danger:hover {
  background: rgba(220, 70, 60, 0.10);
  color: #e88078;
  border-color: rgba(220, 70, 60, 0.30);
}

/* ----- Small-button modifier shared with ghost/primary -------------- */
.ghost.small,
.primary.small {
  padding: 4px 10px;
  font-size: 12px;
}

/* ----- Hint variations --------------------------------------------- */
.hint.dim { opacity: 0.7; }

/* =====================================================================
 * COPY MODIFIERS PICKER (sub-modal)
 * =================================================================== */

.section-head-actions {
  display: flex;
  gap: 0.4rem;
}

.cm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.6rem 0;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cm-toolbar input[type="search"] {
  flex: 1 1 200px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.cm-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
}
.cm-toolbar .hint { margin-left: auto; }

.cm-target-list {
  max-height: 50vh;
  overflow-y: auto;
}
.cm-cat-section { margin-bottom: 0.75rem; }
.cm-cat-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 4px 4px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.cm-target-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0 0 4px 4px;
  background: var(--surface2);
}
.cm-target-row {
  border-bottom: 1px solid var(--border);
}
.cm-target-row:last-child { border-bottom: none; }
.cm-target-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 8px 10px;
  cursor: pointer;
}
.cm-target-label:hover { background: var(--bg); }
.cm-target-name { color: var(--fg); }
.cm-target-meta { font-size: 11px; }

/* =====================================================================
 * TAP PILLS (products list)
 * =================================================================== */
.tap-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(232, 93, 38, 0.10);
  color: var(--accent);
  border: 1px solid rgba(232, 93, 38, 0.30);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tap-pill-off {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px dashed var(--border);
  font-weight: normal;
  letter-spacing: 0.02em;
}
.pill.tap-pill.warn {
  background: rgba(245, 158, 11, 0.10);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.30);
}

/* =====================================================================
 * WIZARD — Untappd lookup row (cask/keg/box_cider/bottle/can forms)
 * =================================================================== */
.wiz-utfb-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.2rem;
}
.wiz-utfb-row button.primary {
  min-width: 220px;
}

/* =====================================================================
 * THE BAR — dashboard tile grids
 * =================================================================== */

.bar-bank-card { margin-bottom: 1rem; padding: 0.7rem 1rem 1rem; }
.bar-bank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.6rem;
}
.bar-bank-head-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.bar-bank-import-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
}

/* ---- Products panel header — multi-button row ---------------- */
.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---- Generic dropdown (used by 'Import from UTFB ▾') -------- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 200px;
  background: var(--c-bg, #1a1a1a);
  border: 1px solid var(--c-border, #2a2a2a);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0;
  z-index: 600;
}
.dropdown-menu[hidden] { display: none; }
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--c-bg-soft, #252525);
  outline: none;
}
.bar-bank-title {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.04em;
  color: var(--accent);
  font-size: 16px;
}
.bar-bank-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

/* Tile: a button styled like a card. Three states + ghost. */
.bar-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  min-height: 84px;
}
.bar-tile:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.bar-tile:active { transform: scale(0.98); }

.bar-tile-position {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}
.bar-tile-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  /* clamp long beer names */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bar-tile-price { font-size: 11px; }
.bar-tile-note {
  font-size: 11px;
  font-style: italic;
  margin-top: auto;
  border-top: 1px dashed var(--border);
  padding-top: 4px;
}
.bar-tile-empty .bar-tile-name { font-style: italic; }
.bar-tile-cleaning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.30);
}
.bar-tile-cleaning .bar-tile-name {
  color: #fbbf24;
  font-style: italic;
}
.bar-tile-active {
  border-color: rgba(232, 93, 38, 0.40);
  background: rgba(232, 93, 38, 0.05);
}
.bar-tile-ghost {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}

/* =====================================================================
 * THE BAR — slot action menu (sub-modal)
 * =================================================================== */

.bar-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bar-action-list li { margin: 0; }
.bar-action-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 0.4rem;
}
.bar-action-row:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.bar-pick-search {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 0.7rem;
}

.bar-pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.bar-pick-row { margin-bottom: 0.4rem; }
.bar-pick-btn {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: inherit;
  cursor: pointer;
  gap: 0.2rem;
}
.bar-pick-btn:hover { border-color: var(--accent); }
.bar-pick-name { font-weight: 600; font-size: 14px; }
.bar-pick-meta { font-size: 12px; }

/* Tap-assignment modal (shown after Rebuild from UTFB). One row per
   beer, name on the left, tap dropdown on the right. */
.bar-assign-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 55vh;
  overflow-y: auto;
}
.bar-assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  margin-bottom: 0.4rem;
}
.bar-assign-info { min-width: 0; }
.bar-assign-name { font-weight: 600; font-size: 14px; }
.bar-assign-tap {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 0.45rem 0.6rem;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  cursor: pointer;
}
.bar-assign-tap:hover { border-color: var(--accent); }
.bar-assign-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.bar-note-text {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

/* =====================================================================
 * THE BAR — bank editor (count adjustment)
 * =================================================================== */

.bank-editor {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.bank-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bank-editor-label strong {
  font-family: var(--display);
  letter-spacing: 0.04em;
  color: var(--accent);
  font-size: 14px;
}
.bank-editor-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bank-editor-input {
  width: 60px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  font-family: inherit;
}

/* Tile-corner UTFB sync dot (Bar dashboard) */
.bar-tile { position: relative; }   /* ensure abs positioning anchors */
.bar-tile-utfb {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bar-tile-utfb.utfb-ok      { background: #22c55e; }
.bar-tile-utfb.utfb-pending { background: #f59e0b; }
.bar-tile-utfb.utfb-error   { background: #ef4444; }

/* =====================================================================
 * REPORTS → DASHBOARD (Ship 3a)
 * =====================================================================
 * Big-number cards in a responsive grid + per-till breakdown row.
 * Values use a display font for legibility from a distance —
 * managers might be glancing at this from across the office.
 */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.dash-card {
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-card-headline {
  border-color: var(--accent, #d4a017);
  background: var(--accent-soft, rgba(212,160,23,0.06));
}
.dash-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.dash-value {
  font-family: var(--display, "DM Serif Display", Georgia, serif);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--fg);
  margin: 4px 0;
}
.dash-card-headline .dash-value {
  color: var(--accent, #d4a017);
  font-size: 44px;
}
.dash-meta {
  font-size: 12px;
  color: var(--fg-dim);
}
.dash-yoy {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 8px;
}
.dash-yoy-up   { color: var(--tip-green, #4caf50); }
.dash-yoy-down { color: var(--danger, #c44); }

.dash-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin: 24px 0 12px;
}

.dash-by-till {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.dash-till-card {
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-till-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.dash-till-icon  { font-size: 18px; }
.dash-till-value {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent, #d4a017);
}
.dash-till-meta {
  font-size: 11px;
  color: var(--fg-dim);
}

.dash-asof {
  margin-top: 24px;
  font-size: 11px;
  color: var(--fg-dim);
  text-align: right;
}

/* =====================================================================
 * REPORTS → CASHUP HISTORY (Ship 3b)
 * =====================================================================
 * Filter bar collapses to a 1-col grid on narrow screens (admin is
 * sometimes opened on a tablet). The table uses the existing .grid
 * styles plus per-cell classes for variance colour-coding.
 */
.ch-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
  align-items: end;
}
.ch-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ch-field input,
.ch-field select {
  font-size: 13px;
  font-family: var(--mono, ui-monospace, monospace);
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  text-transform: none;
  letter-spacing: 0;
}
.ch-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.ch-summary {
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 12px;
}

.ch-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--fg-dim);
}
.ch-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Variance colouring on the list — green = surplus, red = short,
   muted = within rounding. */
.ch-var-zero { color: var(--fg-dim); }
.ch-var-pos  { color: var(--tip-green, #4caf50); }
.ch-var-neg  { color: var(--danger, #c44); }

/* Type badges */
.ch-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ch-type-cashup { background: rgba(76,175,80,0.15);  color: #4caf50; }
.ch-type-float  { background: rgba(212,160,23,0.15); color: var(--accent, #d4a017); }
.ch-type-change { background: rgba(120,120,120,0.15); color: var(--fg-dim); }
.ch-type-unknown { background: rgba(120,120,120,0.15); color: var(--fg-dim); }

/* Detail modal */
.modal-cashup-detail {
  max-width: 720px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
.ch-detail-meta {
  font-size: 12px;
  color: var(--fg-dim);
  margin: 8px 0 16px;
}
.ch-detail-report {
  background: var(--surface2, rgba(0,0,0,0.2));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--fg);
}
.ch-detail-subtitle {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin: 16px 0 8px;
}
.grid-compact td, .grid-compact th { padding: 6px 10px; font-size: 12px; }
.grid-empty { text-align: center; color: var(--fg-dim); padding: 20px; }
.grid-error { text-align: center; color: var(--danger, #c44); padding: 20px; }
.btn-sm { font-size: 11px; padding: 4px 10px; }

/* Generic modal — used by Ship 3b cashup detail; keeping it simple
   since admin doesn't have a modal pattern yet and we want to avoid
   pulling in heavy CSS framework deps. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop .modal,
.modal-backdrop > .modal,
.modal-backdrop > div[class^="modal"] {
  background: var(--bg, #1a1a1a);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--fg-dim);
  cursor: pointer;
}
.modal-close:hover { color: var(--fg); }

/* =====================================================================
 * REPORTS → WEEKLY REPORT (Ship 3c)
 * =====================================================================
 * Week navigator, summary cards, per-till × per-day matrix with
 * bar visualisation per cell.
 */
.wr-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 20px;
}
.wr-nav .wr-range {
  flex: 1;
  text-align: center;
  font-family: var(--display, "DM Serif Display", Georgia, serif);
  font-size: 22px;
  color: var(--accent, #d4a017);
}

.wr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.wr-summary-card {
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wr-summary-card-headline {
  border-color: var(--accent, #d4a017);
  background: var(--accent-soft, rgba(212,160,23,0.06));
}
.wr-summary-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.wr-summary-value {
  font-family: var(--display, "DM Serif Display", Georgia, serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.1;
  margin-top: 2px;
}
.wr-summary-card-headline .wr-summary-value {
  color: var(--accent, #d4a017);
  font-size: 32px;
}
.wr-summary-meta {
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: auto;
}
/* Variance summary card colour-codes via the value class */
.wr-summary-value.wr-var-zero { color: var(--fg-dim); }
.wr-summary-value.wr-var-pos  { color: var(--tip-green, #4caf50); }
.wr-summary-value.wr-var-neg  { color: var(--danger, #c44); }

/* Matrix table: bar visualisation lives at the bottom of each cell */
.wr-matrix-card { padding: 0; overflow: hidden; }
.wr-matrix th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.wr-matrix td.wr-cell {
  position: relative;
  padding-bottom: 14px;        /* room for the bar */
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
}
.wr-matrix td.wr-cell-empty { color: var(--fg-dim); }
.wr-cell-value { display: block; }
.wr-cell-bar {
  position: absolute;
  bottom: 4px;
  left: 8px;
  right: 8px;
  height: 4px;
  background: var(--accent, #d4a017);
  border-radius: 2px;
  opacity: 0.6;
  /* width set inline */
}
.wr-cell.wr-var-pos  .wr-cell-bar { background: var(--tip-green, #4caf50); }
.wr-cell.wr-var-neg  .wr-cell-bar { background: var(--danger, #c44); }
.wr-cell.wr-var-zero .wr-cell-bar { background: var(--fg-dim); opacity: 0.3; }

.wr-row-label   { font-weight: 600; font-size: 13px; }
.wr-row-total   { font-family: var(--mono, ui-monospace, monospace); font-weight: 600; }
.wr-total-row td {
  border-top: 2px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.wr-row-total.wr-var-pos  { color: var(--tip-green, #4caf50); }
.wr-row-total.wr-var-neg  { color: var(--danger, #c44); }
.wr-row-total.wr-var-zero { color: var(--fg-dim); }

/* =====================================================================
 * REPORTS → SALES REPORTS (Ship 3d)
 * =====================================================================
 * Date-range bar with presets + custom range, headline cards, sub-tabs
 * for breakdowns, ascii-bar timeline.
 */
.sr-range-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
}
.sr-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sr-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.sr-summary {
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 16px;
}

.sr-headline-grid { margin-top: 12px; }

.sr-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 24px 0 0;
}
.sr-subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.sr-subtab:hover { color: var(--fg); }
.sr-subtab.active {
  color: var(--accent, #d4a017);
  border-bottom-color: var(--accent, #d4a017);
}

.sr-breakdown-card {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

/* Timeline ascii-bar */
.sr-tl-bar {
  height: 6px;
  background: var(--accent, #d4a017);
  border-radius: 3px;
  opacity: 0.6;
}

/* =====================================================================
 * SALES REPORTS → STAFF DRILLDOWN MODAL (Ship 3d follow-up)
 * =====================================================================
 * Modal hosts hand-built SVG charts for hour-of-day, daily timeline,
 * and a day×hour heatmap. No charting library — keeps the page lean.
 */

/* Clickable rows in the byStaff breakdown */
.sr-row-clickable {
  cursor: pointer;
  transition: background 0.1s;
}
.sr-row-clickable:hover {
  background: var(--accent-soft, rgba(212, 160, 23, 0.08));
}
.sr-row-clickable td:first-child::after {
  content: ' →';
  color: var(--fg-dim);
  font-size: 11px;
  margin-left: 4px;
}

/* Drilldown modal — wider than the cashup-detail modal because the
   charts need horizontal real estate */
.modal-staff-drilldown {
  max-width: 920px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}
.sr-staff-headline {
  margin: 16px 0 24px;
}
.sr-chart-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin: 24px 0 4px;
}
.sr-chart-host {
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

/* SVG chart shared styles */
.sr-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--mono, ui-monospace, monospace);
}
.sr-axis-label {
  font-size: 11px;
  fill: var(--fg-dim);
}
.sr-gridline {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

/* Hour-of-day bar chart */
.sr-bar {
  fill: var(--accent, #d4a017);
  opacity: 0.85;
  transition: opacity 0.1s;
}
.sr-bar:hover {
  opacity: 1;
}

/* Daily line chart */
.sr-line {
  fill: none;
  stroke: var(--accent, #d4a017);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.sr-area {
  fill: var(--accent, #d4a017);
  fill-opacity: 0.12;
  stroke: none;
}
.sr-dot {
  fill: var(--accent, #d4a017);
  stroke: var(--bg, #1a1a1a);
  stroke-width: 1.5;
  cursor: pointer;
}
.sr-dot:hover {
  r: 5;
}

/* Heatmap */
.sr-heatmap-svg {
  /* Heatmap can grow taller than the line/bar charts; let it scroll
     vertically inside the host. */
  max-height: 480px;
}
.sr-heat-cell {
  fill: var(--accent, #d4a017);
  cursor: pointer;
  transition: fill-opacity 0.1s;
}
.sr-heat-cell:hover {
  fill-opacity: 1 !important;
  stroke: var(--fg);
  stroke-width: 1;
}
.sr-heat-empty {
  fill: var(--surface2, rgba(0, 0, 0, 0.2));
  fill-opacity: 0.3;
}

/* =====================================================================
   Drag-reorder for the products table
   =====================================================================
   Vanilla HTML5 d&d; the .product-reorder-cell renders ⋮⋮ in muted
   foreground when interactive, and at very-dim opacity when not.
   ===================================================================== */
.product-reorder-cell {
  text-align: center;
  user-select: none;
  font-family: var(--mono, monospace);
  font-size: 0.85em;
  letter-spacing: -1px;
  color: var(--fg-muted, #888);
  width: 1.8rem;
}
.product-reorder-cell.on {
  cursor: grab;
  color: var(--accent, #d4a017);
}
.product-reorder-cell.on:active {
  cursor: grabbing;
}
.product-reorder-cell.off {
  opacity: 0.25;
  cursor: not-allowed;
}
.reorder-th {
  text-align: center;
  color: var(--fg-muted, #888);
  font-weight: normal;
  font-family: var(--mono, monospace);
  cursor: help;
}

/* Row being dragged */
#products-table tbody tr.dragging {
  opacity: 0.3;
  background: var(--surface2, rgba(0, 0, 0, 0.05));
}

/* Drop target — strong top-border so the manager sees "row will land
   above this one". 3px so it's not lost in the existing table border;
   matches accent so it's clearly an interactive cue, not chrome. */
#products-table tbody tr.drop-target-above {
  border-top: 3px solid var(--accent, #d4a017) !important;
}


/* =====================================================================
   ROTAS v2 — slider-always-present, by-day + by-staff views
   ===================================================================== */

/* Toolbar — week navigator on the left, copy + publish on the right. */
.rota-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.rota-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rota-week-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg, #f5f5f5);
  min-width: 280px;
  text-align: center;
}
.rota-today-btn { margin-left: 12px; }
.rota-actions { display: flex; gap: 8px; }

.rota-status-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
}
.rota-status-chip[data-status="draft"] {
  background: rgba(212, 160, 23, 0.15);
  color: #d4a017;
  border: 1px solid #d4a017;
}
.rota-status-chip[data-status="published"] {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid #34d399;
}

/* =====================================================================
   View controls — toggle (by-day | by-staff) + picker for current view
   ===================================================================== */
.rota-view-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.rota-view-toggle {
  display: inline-flex;
  background: var(--surface, #1a2438);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 3px;
}
.rota-view-btn {
  background: transparent;
  color: var(--fg-dim, #94a3b8);
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 6px;
}
.rota-view-btn[data-active="true"] {
  background: var(--accent, #d4a017);
  color: #1a1a1a;
}

/* By-day picker — 7 day buttons */
.rota-picker {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
}
.rota-day-btn {
  background: var(--surface, #1a2438);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
}
.rota-day-btn:hover { border-color: var(--fg-dim, #94a3b8); }
.rota-day-btn[data-today="true"] { border-color: var(--accent, #d4a017); }
.rota-day-btn[data-selected="true"] {
  background: var(--accent, #d4a017);
  border-color: var(--accent, #d4a017);
  color: #1a1a1a;
}
.rota-day-btn-name { font-weight: 700; font-size: 13px; }
.rota-day-btn-date { font-size: 10px; opacity: 0.8; }

/* By-staff picker — prev/next + dropdown */
.rota-staff-prev, .rota-staff-next {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rota-staff-select {
  background: var(--surface, #1a2438);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  min-width: 200px;
}
.rota-staff-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
}
.rota-staff-summary-role {
  color: var(--fg-dim, #94a3b8);
  text-transform: capitalize;
  font-size: 13px;
}

/* Default-role chip — used in staff summary and (TBD) row labels */
.rota-default-role-chip {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid var(--border, #334155);
  color: var(--fg-dim, #94a3b8);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.rota-default-role-chip.role-bar     { background: rgba(212,160,23,0.2);  color: #d4a017; border-color: #d4a017; }
.rota-default-role-chip.role-cafe    { background: rgba(52,211,153,0.2);  color: #34d399; border-color: #34d399; }
.rota-default-role-chip.role-kitchen { background: rgba(248,113,113,0.2); color: #f87171; border-color: #f87171; }

/* =====================================================================
   Body — list of shift rows (one per staff in by-day, one per day in by-staff)
   ===================================================================== */
.rota-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rota-loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--fg-dim, #94a3b8);
}

.rota-shift-row {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 12px;
  align-items: stretch;
  background: var(--surface, #1a2438);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 72px;
}

.rota-shift-row-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid var(--border, #334155);
}
.rota-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg, #f5f5f5);
}
.rota-row-sub {
  font-size: 11px;
  color: var(--fg-dim, #94a3b8);
  text-transform: capitalize;
}
.rota-row-today { color: var(--accent, #d4a017); font-weight: 600; }

/* The slider track — much taller than v1 (60px) so dragging is comfortable */
.rota-slider-track {
  position: relative;
  height: 56px;
  background: rgba(15, 20, 25, 0.4);
  border-radius: 6px;
  border: 1px solid var(--border, #334155);
  overflow: hidden;
}

.rota-slider-axis {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rota-axis-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(100, 116, 139, 0.12);
}
.rota-axis-mark.major { background: rgba(100, 116, 139, 0.35); }
.rota-axis-label {
  position: absolute;
  bottom: 2px;
  left: 3px;
  font-size: 9px;
  color: rgba(100, 116, 139, 0.6);
  user-select: none;
  pointer-events: none;
}

/* The PILL — when expanded, this is the visible shift on the track */
.rota-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  background: rgba(100, 116, 139, 0.25);
  border: 1px solid #94a3b8;
  border-radius: 5px;
  display: grid;
  grid-template-columns: 10px 1fr 10px;
  align-items: stretch;
  font-size: 11px;
  color: var(--fg, #f5f5f5);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.rota-pill.role-bar     { background: rgba(212,160,23,0.3);  border-color: #d4a017; }
.rota-pill.role-cafe    { background: rgba(52,211,153,0.3);  border-color: #34d399; }
.rota-pill.role-kitchen { background: rgba(248,113,113,0.3); border-color: #f87171; }
.rota-pill.role-unset   { background: rgba(100,116,139,0.3); border-color: #94a3b8; }
.rota-pill.dragging {
  z-index: 10;
  cursor: grabbing;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0.92;
}

.rota-pill-thumb {
  background: rgba(255, 255, 255, 0.4);
  cursor: ew-resize;
  border-radius: 4px 0 0 4px;
  transition: background 80ms ease;
}
.rota-pill-thumb-end { border-radius: 0 4px 4px 0; }
.rota-pill-thumb:hover { background: rgba(255, 255, 255, 0.7); }

.rota-pill-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 6px;
  overflow: hidden;
  cursor: grab;
}
.rota-pill.dragging .rota-pill-body { cursor: grabbing; }
.rota-pill-time { font-weight: 700; font-size: 13px; line-height: 1.2; }
.rota-pill-hours { font-size: 10px; opacity: 0.85; line-height: 1.2; }

/* COLLAPSED state — the slider in "no shift" mode. A narrow marker
   at the left edge of the track with a fat thumb on its right that
   you drag outward to create a shift. The thumb is wider than the
   pill itself in this state so it's an obvious "grab me" affordance. */
.rota-pill-collapsed {
  width: 22px !important;
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  cursor: default;
}
.rota-pill-collapsed .rota-pill-handle {
  width: 4px;
  height: 60%;
  background: rgba(148, 163, 184, 0.4);
  margin-left: 2px;
  border-radius: 2px;
}
.rota-pill-collapsed .rota-pill-thumb-end {
  width: 16px;
  height: 100%;
  background: rgba(212, 160, 23, 0.4);
  border-radius: 0 4px 4px 0;
  margin-left: auto;
  position: relative;
}
.rota-pill-collapsed .rota-pill-thumb-end::after {
  content: '›';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #d4a017;
}
.rota-pill-collapsed:hover .rota-pill-thumb-end {
  background: rgba(212, 160, 23, 0.6);
}

/* Total cell on the right of each row */
.rota-shift-row-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px;
  border-left: 1px solid var(--border, #334155);
  gap: 4px;
}
.rota-row-hours {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #d4a017);
}
.rota-row-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.rota-row-role.role-bar     { color: #d4a017; }
.rota-row-role.role-cafe    { color: #34d399; }
.rota-row-role.role-kitchen { color: #f87171; }
.rota-row-off {
  font-size: 12px;
  color: var(--fg-dim, #94a3b8);
  font-style: italic;
}

/* Absence marking (rota visibility only — not payroll). */
.rota-mark-off {
  margin-top: 4px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px dashed var(--border, #334155);
  background: transparent;
  color: var(--fg-dim, #94a3b8);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s;
}
.rota-shift-row:hover .rota-mark-off { opacity: 1; }
.rota-mark-off:hover { border-style: solid; color: var(--accent, #d4a017); }
.rota-absent-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(212, 160, 23, 0.18);
  color: var(--accent, #d4a017);
  white-space: nowrap;
}
.rota-absent-badge[data-kind="sick"]        { background: rgba(248,113,113,0.18); color: #f87171; }
.rota-absent-badge[data-kind="unavailable"] { background: rgba(148,163,184,0.18); color: #94a3b8; }
.rota-absent-kind {
  margin-top: 4px;
  font-size: 11px;
  max-width: 110px;
  background: var(--bg, #0f172a);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 5px;
}
.rota-absent-clear {
  margin-top: 2px;
  font-size: 11px;
  background: transparent;
  border: none;
  color: var(--fg-dim, #94a3b8);
  cursor: pointer;
}
.rota-absent-clear:hover { color: #f87171; }
/* An absent row dims its slider — you don't schedule someone who's off. */
.rota-shift-row-absent .rota-slider-track { opacity: 0.35; }

/* Sticky footer with grand totals */
.rota-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg, #0f1419);
  border-top: 2px solid var(--accent, #d4a017);
  padding: 12px 16px;
  margin: 16px -16px -16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.rota-grand-totals {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: baseline;
}
.rota-grand-total { font-size: 15px; }
.rota-grand-total strong { color: var(--accent, #d4a017); font-size: 18px; }
.rota-grand-role { font-size: 12px; }
.rota-grand-role.role-bar strong     { color: #d4a017; }
.rota-grand-role.role-cafe strong    { color: #34d399; }
.rota-grand-role.role-kitchen strong { color: #f87171; }
.rota-grand-label { color: var(--fg-dim, #94a3b8); margin-right: 4px; }
.rota-saved-indicator { font-size: 12px; color: var(--fg-dim, #94a3b8); }
.rota-saved-indicator[data-level="error"] { color: #f87171; }

/* Narrow screens */
@media (max-width: 900px) {
  .rota-shift-row { grid-template-columns: 100px 1fr 80px; gap: 8px; padding: 8px; }
  .rota-row-name { font-size: 13px; }
  .rota-pill-time { font-size: 11px; }
  .rota-pill-hours { display: none; }
}

/* =====================================================================
   COMPLIANCE PANEL — refusal log + ID check log
   ===================================================================== */
.compliance-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.compliance-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
  font-weight: 600;
}
.compliance-filter input,
.compliance-filter select {
  background: var(--surface, #1a2438);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  min-width: 140px;
}
.compliance-filter input:focus,
.compliance-filter select:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}

.compliance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.compliance-summary-card {
  background: var(--surface, #1a2438);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 14px 16px;
}
.compliance-summary-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent, #d4a017);
  line-height: 1.1;
}
.compliance-summary-label {
  font-size: 13px;
  color: var(--fg-dim, #94a3b8);
  margin-top: 4px;
}
.compliance-summary-sub {
  font-size: 11px;
  color: var(--fg-dim, #94a3b8);
  margin-top: 6px;
}

.compliance-section-title {
  margin: 24px 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
}

.compliance-reason-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(207, 92, 92, 0.18);
  color: var(--danger, #cf5c5c);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.compliance-outcome {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.compliance-outcome-served  { background: rgba(52,211,153,0.18);  color: #34d399; }
.compliance-outcome-refused { background: rgba(207,92,92,0.18);   color: var(--danger, #cf5c5c); }
.compliance-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(100, 116, 139, 0.2);
  color: var(--fg-dim, #94a3b8);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

/* =====================================================================
   FACTORY RESET PANEL
   ===================================================================== */
.factory-reset-warning {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 8%, var(--surface, #1a2438));
  border-left: 4px solid var(--danger, #cf5c5c);
}
.factory-reset-warning h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
}
.factory-reset-warning h3 + ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.factory-reset-warning li {
  margin: 3px 0;
  color: var(--fg, #f5f5f5);
  font-size: 14px;
}
.factory-reset-safety {
  background: rgba(52, 211, 153, 0.1);
  border-left: 3px solid #34d399;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--fg, #f5f5f5);
}
.factory-reset-safety code {
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.factory-reset-option {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface, #1a2438);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  cursor: pointer;
  align-items: flex-start;
}
.factory-reset-option input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.factory-reset-option span {
  font-size: 13px;
  color: var(--fg, #f5f5f5);
  line-height: 1.5;
}
.factory-reset-option strong { font-weight: 700; }

.factory-reset-confirm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.factory-reset-confirm span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
  font-weight: 600;
}
.factory-reset-confirm code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent, #d4a017);
}
.factory-reset-confirm input {
  background: var(--bg, #0f1419);
  color: var(--fg, #f5f5f5);
  border: 1.5px solid var(--border, #334155);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
}
.factory-reset-confirm input:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}

.factory-reset-go {
  background: var(--danger, #cf5c5c);
  color: #fff;
  border: 2px solid var(--danger, #cf5c5c);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}
.factory-reset-go:hover:not(:disabled) { filter: brightness(1.08); }
.factory-reset-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.factory-reset-result { margin-top: 18px; }
.factory-reset-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid #34d399;
  border-radius: 8px;
  padding: 16px 20px;
}
.factory-reset-success h3 {
  margin: 0 0 8px;
  color: #34d399;
}
.factory-reset-error {
  background: rgba(207, 92, 92, 0.12);
  border: 1px solid var(--danger, #cf5c5c);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--danger, #cf5c5c);
  font-size: 14px;
}
.factory-reset-backup-note {
  font-size: 12px;
  color: var(--fg-dim, #94a3b8);
  margin: 8px 0;
}
.factory-reset-backup-note code {
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}
.factory-reset-counts {
  margin-top: 8px;
  width: 100%;
}
.factory-reset-counts code {
  font-size: 12px;
  background: transparent;
  color: var(--fg-dim, #94a3b8);
}

/* =====================================================================
   DAILY SUMMARY admin panel
   ===================================================================== */
.card-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
  border-bottom: 1px solid var(--border, #334155);
  padding-bottom: 6px;
}

.ds-toggle-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  cursor: pointer;
}
.ds-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.ds-toggle-row span {
  font-size: 13px;
  color: var(--fg, #f5f5f5);
  line-height: 1.5;
}
.ds-toggle-row strong { font-weight: 700; }

.ds-recipients-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
  font-weight: 600;
  margin: 14px 0 6px;
}

#ds-recipients, #ds-override {
  width: 100%;
  background: var(--bg, #0f1419);
  color: var(--fg, #f5f5f5);
  border: 1.5px solid var(--border, #334155);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}
#ds-recipients:focus, #ds-override:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}

.ds-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}
.ds-saved-indicator,
.ds-send-result {
  font-size: 12px;
  color: var(--fg-dim, #94a3b8);
}
.ds-saved-indicator[data-level="error"],
.ds-send-result[data-level="error"]   { color: #cf5c5c; }
.ds-saved-indicator[data-level="warning"],
.ds-send-result[data-level="warning"] { color: #d4a017; }
.ds-saved-indicator[data-level="success"],
.ds-send-result[data-level="success"] { color: #34d399; }

.ds-preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ds-preview-controls label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim, #94a3b8);
  font-weight: 600;
}
.ds-preview-controls input[type="date"] {
  background: var(--surface, #1a2438);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

/* =====================================================================
   KIOSK LICENSING HOURS editor
   ===================================================================== */
.kh-status-line {
  font-size: 16px;
  padding: 12px;
  background: var(--bg, #0f1419);
  border-radius: 6px;
  color: var(--fg, #f5f5f5);
}
.kh-status-line.kh-open   { border-left: 4px solid #34d399; }
.kh-status-line.kh-closed { border-left: 4px solid #cf5c5c; }
.kh-status-dot { margin-right: 6px; }

.kh-day-rows { display: flex; flex-direction: column; gap: 8px; }

.kh-day-row {
  display: grid;
  grid-template-columns: 110px 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--bg, #0f1419);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
}
.kh-day-row.kh-day-closed { opacity: 0.55; }

.kh-day-label {
  font-weight: 700;
  color: var(--fg, #f5f5f5);
  font-size: 14px;
}

.kh-closed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-dim, #94a3b8);
  cursor: pointer;
  user-select: none;
}
.kh-closed-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  margin: 0;
  cursor: pointer;
}

.kh-sessions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.kh-session {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-dim, #94a3b8);
}
.kh-session-label {
  min-width: 70px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}
.kh-time {
  background: var(--surface, #1a2438);
  color: var(--fg, #f5f5f5);
  border: 1px solid var(--border, #334155);
  border-radius: 4px;
  padding: 5px 8px;
  font: inherit;
  font-size: 13px;
  width: 90px;
}
.kh-time:disabled { opacity: 0.4; cursor: not-allowed; }
.kh-time-sep { color: var(--fg-dim, #94a3b8); font-weight: 600; }

.kh-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.kh-saved-indicator { font-size: 12px; color: var(--fg-dim, #94a3b8); }
.kh-saved-indicator[data-level="error"]   { color: #cf5c5c; }
.kh-saved-indicator[data-level="warning"] { color: #d4a017; }
.kh-saved-indicator[data-level="success"] { color: #34d399; }

/* Narrow viewports — stack rows vertically */
@media (max-width: 720px) {
  .kh-day-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* =====================================================================
   MEMBER EMAIL-RECEIPTS toggle
   ===================================================================== */
.email-receipts-toggle {
  background: transparent;
  border: 1px solid var(--border, #334155);
  color: var(--fg-dim, #94a3b8);
  padding: 4px 10px;
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.email-receipts-toggle:hover { transform: scale(1.02); }
.email-receipts-toggle.on {
  background: rgba(52, 211, 153, 0.15);
  border-color: #34d399;
  color: #34d399;
}
.email-receipts-toggle.off:hover {
  border-color: var(--accent, #d4a017);
  color: var(--accent, #d4a017);
}

/* =====================================================================
   READER BINDINGS (Till Companion)
   ===================================================================== */
.rb-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.rb-field { display: flex; flex-direction: column; gap: 5px; }
.rb-field > span { font-size: 13px; font-weight: 600; color: var(--fg-dim, #94a3b8); }
.rb-field input, .rb-field select {
  background: var(--bg, #0f1419);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  color: var(--fg, #f5f5f5);
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
}
.rb-field input:focus, .rb-field select:focus { outline: none; border-color: var(--accent, #d4a017); }
.rb-actions { display: flex; align-items: center; gap: 12px; }

.rb-unbound-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border, #1f2937);
}
.rb-unbound-row:last-child { border-bottom: none; }
.rb-unbound-row code {
  background: var(--bg, #0f1419);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 13px;
}

.link-danger {
  background: none;
  border: none;
  color: #cf5c5c;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
}
.link-danger:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .rb-form { grid-template-columns: 1fr; }
}

/* =====================================================================
   Rota — weekly OVERVIEW grid (all staff × 7 days at a glance).
   Click a row to drill into that staff's week (by-staff editor).
   ===================================================================== */
.rota-ov { display: flex; flex-direction: column; gap: 4px; }
.rota-ov-row {
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(0, 1fr)) 88px;
  gap: 4px;
  align-items: stretch;
}
.rota-ov-head { font-size: 11px; color: var(--fg-dim, #94a3b8); padding: 0 4px 2px; }
.rota-ov-head .rota-ov-day { flex-direction: column; gap: 0; font-weight: 600; }
.rota-ov-head .rota-ov-day span { font-size: 9px; opacity: 0.7; font-weight: 400; }
.rota-ov-head .rota-ov-total { justify-content: flex-end; align-items: flex-end; }

.rota-ov-row[data-staff-idx] {
  background: var(--surface, #1a2438);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.rota-ov-row[data-staff-idx]:hover { border-color: var(--accent, #d4a017); }
.rota-ov-row[data-staff-idx]:focus-visible { outline: 2px solid var(--accent, #d4a017); outline-offset: 1px; }

.rota-ov-staff { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding-left: 4px; }
.rota-ov-name { font-size: 13px; font-weight: 600; color: var(--fg, #f5f5f5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rota-ov-role { font-size: 10px; color: var(--fg-dim, #94a3b8); text-transform: capitalize; }

.rota-ov-day { display: flex; align-items: center; justify-content: center; font-size: 11px; }
.rota-ov-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 34px; border-radius: 6px; }
.rota-ov-cell.rota-ov-today, .rota-ov-day.rota-ov-today { background: color-mix(in srgb, var(--accent, #d4a017) 12%, transparent); }
.rota-ov-empty { color: var(--fg-dim, #94a3b8); opacity: 0.4; font-size: 13px; }
.rota-ov-shift {
  font-size: 12px; font-weight: 600; color: var(--fg, #f5f5f5); line-height: 1.25;
  border-left: 3px solid var(--fg-dim, #94a3b8); padding: 1px 5px; border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--fg-dim, #94a3b8) 12%, transparent); white-space: nowrap;
}
.rota-ov-shift.role-bar { border-left-color: #d4a017; }
.rota-ov-shift.role-cafe { border-left-color: #1f8a7c; }
.rota-ov-shift.role-kitchen { border-left-color: #cf6818; }
.rota-ov-abs { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.rota-ov-abs.kind-holiday { background: color-mix(in srgb, #2f7fd1 24%, transparent); color: #9ec5f0; }
.rota-ov-abs.kind-sick { background: color-mix(in srgb, #cf6818 24%, transparent); color: #f0b27a; }
.rota-ov-abs.kind-training { background: color-mix(in srgb, #8a5cd1 24%, transparent); color: #c4a6ea; }
.rota-ov-abs.kind-unavailable, .rota-ov-abs.kind-other { background: color-mix(in srgb, var(--fg-dim, #94a3b8) 22%, transparent); color: var(--fg-dim, #94a3b8); }
.rota-ov-total { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-right: 6px; border-left: 1px solid var(--border, #334155); }
.rota-ov-hours { font-size: 16px; font-weight: 700; color: var(--accent, #d4a017); }
.rota-ov-hours-sub { font-size: 9px; color: var(--fg-dim, #94a3b8); text-transform: uppercase; letter-spacing: 0.5px; }

@media (max-width: 720px) {
  .rota-ov-row { grid-template-columns: 110px repeat(7, minmax(0,1fr)) 64px; }
  .rota-ov-name { font-size: 12px; }
  .rota-ov-shift { font-size: 11px; padding: 1px 3px; }
}

/* Overview total — actual vs rostered colouring */
.rota-ov-hours.rota-ov-over  { color: #5dcaa5; }
.rota-ov-hours.rota-ov-under { color: #f0b27a; }

/* Actuals panel (drill-in) — precise worked-time entry per rostered shift */
.rota-actuals { margin-top: 14px; border-top: 1px solid var(--border, #334155); padding-top: 12px; }
.rota-actuals-head { font-size: 13px; font-weight: 600; color: var(--fg, #f5f5f5); margin-bottom: 8px; }
.rota-actuals-head span { font-weight: 400; color: var(--fg-dim, #94a3b8); font-size: 12px; }
.rota-actual-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; flex-wrap: wrap; }
.rota-actual-day { width: 84px; font-size: 13px; font-weight: 600; color: var(--fg, #f5f5f5); }
.rota-actual-bar { position: relative; flex: 1 1 240px; height: 22px; min-width: 160px; background: color-mix(in srgb, var(--fg-dim, #94a3b8) 10%, transparent); border-radius: 5px; touch-action: none; }
.rota-actual-bar-ros { position: absolute; top: 0; height: 100%; border: 1px dashed var(--fg-dim, #94a3b8); border-radius: 4px; box-sizing: border-box; pointer-events: none; }
.rota-actual-bar-act { position: absolute; top: 3px; height: 16px; background: #1f8a7c; border-radius: 4px; cursor: grab; touch-action: none; }
.rota-actual-dragging .rota-actual-bar-act { cursor: grabbing; }
.rota-actual-thumb { position: absolute; top: 50%; transform: translateY(-50%); width: 14px; height: 22px; border-radius: 4px; background: #2bb39c; border: 1px solid rgba(0,0,0,0.3); cursor: ew-resize; touch-action: none; }
.rota-actual-thumb[data-side="start"] { left: -7px; }
.rota-actual-thumb[data-side="end"] { right: -7px; }
.rota-actual-readout { font-size: 12px; color: var(--fg-dim, #94a3b8); min-width: 96px; font-variant-numeric: tabular-nums; }
.rota-actual-delta { font-size: 12px; font-weight: 600; min-width: 54px; text-align: right; color: var(--fg-dim, #94a3b8); }
.rota-actual-delta.over { color: #5dcaa5; }
.rota-actual-delta.under { color: #f0b27a; }
.rota-actual-reset { font-size: 11px; padding: 2px 8px; }

/* Hour ruler above the rota sliders — lines up with the track column so
   you can read the time while dragging. Mirrors .rota-shift-row's grid. */
.rota-ruler-row { display: grid; grid-template-columns: 160px 1fr 120px; gap: 12px; padding: 0 12px; align-items: end; margin-bottom: 3px; }
.rota-ruler { position: relative; height: 22px; }
.rota-ruler-tick { position: absolute; bottom: 0; width: 1px; background: rgba(100,116,139,0.30); transform: translateX(-0.5px); }
.rota-ruler-tick.quarter { height: 3px; }
.rota-ruler-tick.half { height: 5px; background: rgba(100,116,139,0.5); }
.rota-ruler-tick.hour { height: 8px; background: rgba(148,163,184,0.85); }
.rota-ruler-label { position: absolute; bottom: 10px; font-size: 9.5px; line-height: 1; color: var(--fg-dim, #94a3b8); white-space: nowrap; user-select: none; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .rota-ruler-row { grid-template-columns: 100px 1fr 80px; gap: 8px; padding: 0 8px; }
  .rota-ruler-label { font-size: 9px; }
}

/* Bright/Deep grouping in the 30-colour picker */
.staff-color-ring-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim, #a8998a);
  width: 100%;
  margin-top: 6px;
}
.staff-color-ring-label:first-of-type { margin-top: 0; }
.staff-color-ring { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }

/* v1.5.189: no cafe till at this site — the wizard doesn't ask which till. */
html.no-cafe-till .wiz-till-choice { display: none !important; }

/* v1.5.189: Untappd search on the bottle / can form. */
.wiz-utfb-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 40vh; overflow: auto; }
.wiz-utfb-tier { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-dim, #999); margin-top: 4px; }
.wiz-utfb-hit { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 8px 10px;
  border: 1px solid var(--border, #333); border-radius: 10px; background: var(--surface, #1a1a22); color: var(--fg, #eee); cursor: pointer; }
.wiz-utfb-hit img, .wiz-utfb-noimg { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--bg, #111); }
.wiz-utfb-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
