:root {
  --bg: #0f1419;             /* page background */
  --surface: #1a1f28;        /* cards */
  --surface-2: #242a35;      /* inputs, secondary buttons, list rows */
  --surface-3: #2f3642;      /* hover state */
  --border: #3a4150;         /* visible dividers + input borders */
  --border-strong: #4a5160;  /* hover / focus borders */
  --fg: #e8ecf3;
  --muted: #8b94a3;
  --accent: #5b8def;         /* primary action — clean blue */
  --accent-hover: #7aa3f3;
  --accent-fg: #ffffff;
  --ok: #34d399;
  --danger: #f87171;
  --radius: 8px;
  --maxw: 480px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem;
}
main.wide { max-width: 960px; }
main.wide .topbar { padding-bottom: 1.25rem; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem 1rem;
}
.field-grid > label { margin-bottom: 0; }

.loading {
  text-align: center;
  color: var(--muted);
  margin-top: 4rem;
}

button {
  font: inherit;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, outline 0.15s ease;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
button.secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
button.danger { background: transparent; color: var(--danger); padding: 0; border: 0; }

/* Branded OAuth buttons — follow Google & Microsoft sign-in branding guidelines.
   Class selectors override the base `button` rules. */
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}
.oauth-btn svg { flex-shrink: 0; }
.oauth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.oauth-btn--google {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}
.oauth-btn--google:hover:not(:disabled) { background: #f7f8f8; }
.oauth-btn--microsoft {
  background: #ffffff;
  color: #5e5e5e;
  border: 1px solid #8c8c8c;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.oauth-btn--microsoft:hover:not(:disabled) { background: #f3f3f3; }

/* Centered confirmation modal — replaces native window.confirm(). */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--fg);
}
.modal-message {
  margin: 0 0 1.25rem;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.modal-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.modal-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Discreet staff-access link, bottom-right of the customer login screen. */
.staff-access {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  text-decoration: none;
}
.staff-access:hover {
  color: var(--fg);
  background: var(--surface-3);
  border-color: var(--border-strong);
}
/* Back link on the staff sign-in page. */
.staff-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] {
  background: var(--bg);
  color: var(--muted);
  cursor: default;
}
input[readonly]:focus { box-shadow: none; border-color: var(--border); }
textarea { resize: vertical; min-height: 70px; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.muted { color: var(--muted); }
.muted.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.ok { color: var(--ok); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code {
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--fg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
button.small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
button.link {
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
  border: 0;
}
button.link:hover { color: var(--fg); background: transparent; }

.auth-card label,
.card label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.auth-card input { margin-top: 0.25rem; }
.auth-card .row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.auth-card .row > button { flex: 1; }
.auth-card { padding-top: 1rem; }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hero {
  padding: 1rem 0;
  text-align: center;
}
.hero h2 { margin: 0.25rem 0; }
.hero .role { color: var(--muted); margin: 0.25rem 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.card h3 { margin-top: 0; }
.card h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

/* Hub: the "pick a pass / family" chooser shown when a user has more than one
   thing to open (own pass, babysitter families, signup). */
.hub-list { display: flex; flex-direction: column; gap: 0.6rem; }
.hub-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  width: 100%; text-align: left; cursor: pointer; color: var(--fg);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1rem;
}
.hub-row:hover { border-color: var(--accent); background: var(--surface-3); }
.hub-row strong { font-size: 1rem; }

.topbar a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
}
.topbar a:not(.btn):hover { color: var(--fg); }
.topbar a.btn { color: var(--accent-fg); }
.topbar a.btn:hover { color: var(--accent-fg); }

.btn {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-fg); }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.list li:last-child { border-bottom: 0; }
.row-link {
  display: block;
  padding: 0.85rem 0.5rem;
  text-decoration: none;
  color: var(--fg);
  position: relative;
  border-radius: var(--radius);
}
.row-link:hover { background: var(--surface-2); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  color: var(--muted);
  margin-top: 0.35rem;
  border: 1px solid var(--border);
}
.badge.active { background: rgba(52, 211, 153, 0.15); color: var(--ok); border-color: transparent; }
.badge.draft  { background: var(--surface-2); color: var(--muted); }
.badge.archived { background: rgba(248, 113, 113, 0.15); color: var(--danger); border-color: transparent; }

.nav-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 1rem;
}
.nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-card:hover { border-color: var(--accent); background: var(--surface-2); }
.nav-card.disabled { opacity: 0.45; pointer-events: none; }

.selfie-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.selfie-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.selfie-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selfie-thumb.empty {
  color: var(--accent);
  font-size: 1.4rem;
  text-align: center;
  padding: 0;
  background: var(--surface-2);
  border: 2px dashed var(--border-strong);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.selfie-thumb.empty:hover { border-color: var(--accent); }
.selfie-thumb-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.selfie-thumb-img:hover { border-color: var(--accent); }

.member-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
}
.member-name { font-weight: 500; }

/* Owner-side babysitter list rows: name + status badge, action flush right.
   ID-scoped so it beats `.list li`'s padding reset. */
#babysitter-list .bsit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
}
.bsit-info { min-width: 0; }
.bsit-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
#babysitter-list .bsit-row .secondary.small { flex-shrink: 0; }

.plan-option {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.plan-option:hover { border-color: var(--border-strong); }
.plan-option input { width: auto; }
.plan-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.08);
}

#submit-btn { width: 100%; margin-top: 1rem; }

/* In-app camera overlay */
.capture-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.capture-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}
.capture-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.capture-header h3 { margin: 0; }
.capture-stage {
  position: relative;
  aspect-ratio: 1;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.capture-stage video,
.capture-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.capture-stage video { transform: scaleX(-1); }
.capture-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.capture-controls button { flex: 1; }

/* Emulator-only dev panel */
.dev-panel {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.dev-panel h4 {
  margin: 0 0 0.5rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  padding: 0;
}
.dev-badge {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dev-user-btn {
  display: block;
  width: 100%;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  text-align: left;
  margin-bottom: 0.4rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.dev-user-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-3);
}
.dev-user-btn:disabled { opacity: 0.6; cursor: progress; }
.dev-user-btn .dev-user-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: normal;
  margin-top: 0.15rem;
}

/* Daily code reveal (customer) */
.code-reveal {
  text-align: center;
  padding: 1rem 0;
}
.code-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin: 0 auto 0.5rem;
  display: block;
}
.code-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
}
.code-digits {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 3.25rem;
  letter-spacing: 0.35rem;
  font-weight: 700;
  margin: 0.75rem 0;
  color: var(--fg);
}
.code-roster {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.code-roster-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.code-roster-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Staff redemption */
.lookup-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}
.lookup-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.lookup-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
}
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
/* Staff redemption faces are bigger so they're legible on a phone. */
.roster-grid.roster-toggles {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
/* "Who's here today?" heading row with the Select all / Clear all toggle. */
.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.roster-thumb {
  margin: 0;
  text-align: center;
}
.roster-thumb img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.roster-thumb .placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  margin: 0 auto;
}
.roster-thumb figcaption {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  color: var(--fg);
}

/* Clickable roster toggles (staff redemption) */
.roster-toggles .roster-thumb {
  cursor: pointer;
  user-select: none;
  position: relative;
  outline: none;
  border-radius: 12px;
  padding: 0.25rem;
  transition: background 0.15s ease;
}
.roster-toggles .roster-thumb:focus-visible {
  background: var(--surface-2);
  outline: 2px solid var(--accent);
}
.roster-toggles .roster-thumb img,
.roster-toggles .roster-thumb .placeholder {
  width: 192px;
  height: 192px;
  border-radius: 16px;
  border-width: 3px;
  transition: border-color 0.15s ease, filter 0.15s ease;
}
.roster-toggles .roster-thumb.present img,
.roster-toggles .roster-thumb.present .placeholder {
  border-color: var(--ok);
}
.roster-toggles .roster-thumb.absent img {
  filter: grayscale(1) brightness(0.5);
  border-color: var(--border);
}
.roster-toggles .roster-thumb.absent .placeholder { border-color: var(--border); }
.roster-toggles .roster-thumb.absent figcaption {
  color: var(--muted);
  text-decoration: line-through;
}
.roster-toggles .roster-thumb.no-photo {
  cursor: not-allowed;
  opacity: 0.7;
}
.roster-toggles .roster-thumb.no-photo .placeholder {
  border: 2px dashed var(--danger);
  color: var(--danger);
  font-size: 1.5rem;
  background: var(--surface-2);
}
.roster-toggles .roster-thumb.no-photo figcaption {
  color: var(--muted);
}
.roster-toggles .roster-thumb.present::after {
  content: '✓';
  position: absolute;
  bottom: 2.1rem;
  right: 50%;
  transform: translateX(96px);
  background: var(--ok);
  color: var(--bg);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--surface);
}
/* Phase 2: adult/kid tag under a roster face */
.roster-thumb .roster-tag {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
/* Babysitter drop-off: adults can't be present, so dim + lock their faces */
.roster-toggles .roster-thumb.adult-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.roster-toggles .roster-thumb.adult-disabled img {
  filter: grayscale(1);
  border-color: var(--border);
}
/* Babysitter drop-off toggle (staff redemption) */
.babysitter-toggle {
  margin: 0.25rem 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Phase 2: customer-home "add member" control under the roster */
.add-member-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Square Web Payments card form container */
#card-container {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-height: 56px;
  margin-bottom: 0.75rem;
}

/* Data tables (admin reports + lists) */
.table-wrap { overflow-x: auto; margin: 0.5rem 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.data-table tr:hover td { background: var(--surface-2); }
.data-table code { font-size: 0.8em; }
.data-table tr.clickable-row { cursor: pointer; }

.customer-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.customer-row .badge { align-self: flex-start; }

/* Metric cards on Reports overview */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.metric .label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.metric .value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Reports: tab nav */
.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.report-tab {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.report-tab:hover { background: var(--surface-3); color: var(--fg); }
.report-tab.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* Reports: tier filter (All / Individual / Family) — applies to every tab */
.report-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}
.seg-btn {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.seg-btn:hover { background: var(--surface-3); color: var(--fg); }
.seg-btn.is-active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Reports: accounts table (search + sortable headers + drill-down link) */
.acct-search { width: 100%; margin-bottom: 0.6rem; }
.accounts-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.accounts-table th.sortable:hover { color: var(--fg); }
.accounts-table th.sortable.sorted { color: var(--accent); }
.btn.small { padding: 0.2rem 0.6rem; font-size: 0.8rem; }

/* Reports: side-by-side cards on wide screens, stacked on narrow */
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .report-cols { grid-template-columns: 1fr; } }
.card.note { background: var(--surface-2); }

/* Charts: vertical time-series bars (HTML/CSS, CSP-safe — no chart lib) */
.vbars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  padding-top: 0.5rem;
  overflow-x: auto;
}
.vbar-col {
  flex: 1 1 0;
  min-width: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.vbar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  min-height: 0;
}
.vbar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.2s ease;
}
.vbar-fill.is-max { background: var(--accent-hover); }
.vbar-x {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: top right;
  height: 1.2rem;
}

/* Charts: ranked horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.hbar-row {
  display: grid;
  grid-template-columns: minmax(80px, 30%) 1fr auto;
  align-items: center;
  gap: 0.6rem;
}
.hbar-label {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hbar-track {
  background: var(--surface-2);
  border-radius: 4px;
  height: 0.85rem;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  min-width: 2px;
}
.hbar-value { font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Today's redemptions feed (staff) */
.redemption-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.25rem;
  gap: 0.75rem;
}

/* Legal pages */
.legal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  line-height: 1.55;
}
.legal h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--fg);
}
.legal p, .legal ul { margin: 0.5rem 0; }
.legal ul { padding-left: 1.25rem; }
.legal a { color: var(--accent); }
.legal-footer {
  text-align: center;
  margin-top: 1.5rem;
}
.legal-footer a { color: var(--muted); text-decoration: underline; margin: 0 0.25rem; }
.legal-footer a:hover { color: var(--accent); }

/* Inline checkbox row */
.checkbox-row {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  margin-bottom: 0 !important;
  color: var(--fg) !important;
  font-weight: 400 !important;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* PWA install banner */
.install-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--accent);
  background: rgba(91, 141, 239, 0.08);
}
.install-banner > div { flex: 1; }
.install-banner strong { display: block; margin-bottom: 0.15rem; }
