/* ============================================================
   Kids FunZone – Admin Console Stylesheet
   Simple, high-contrast, large-touch-target UI for staff/manager/admin.
   No gradients, no decorative animation, no horizontal scrolling.
   ============================================================ */

:root {
  --adm-bg:          #f4f6f8;
  --adm-surface:     #ffffff;
  --adm-card:        #ffffff;
  --adm-border:      #d7dde3;

  --adm-accent:      #2563eb;
  --adm-accent-soft: #e8f0fe;
  --adm-green:       #15803d;
  --adm-green-soft:  #dcfce7;
  --adm-yellow:      #92400e;
  --adm-yellow-soft: #fef3c7;
  --adm-red:         #b91c1c;
  --adm-red-soft:    #fee2e2;

  --adm-text-primary:   #111827;
  --adm-text-secondary: #4b5563;
  --adm-text-muted:     #9ca3af;

  --adm-font: 'Segoe UI', Inter, system-ui, sans-serif;

  --adm-sidebar-width: 240px;
  --adm-r: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

.admin-page {
  font-family: var(--adm-font);
  background: var(--adm-bg);
  color: var(--adm-text-primary);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}
.admin-page a { color: var(--adm-accent); text-decoration: none; }

/* ── Layout ────────────────────────────────────────────────── */
.adm-layout { display: flex; min-height: 100vh; }

/* Reveal-gate: base.html's <body> starts with .adm-pending, hiding page
   content until admin-auth-guard.js confirms the session and role are valid
   for this page. Without this, a disallowed role's page (reached via a
   stale link, direct URL, or a leftover session from another account on a
   shared computer) would render and paint in full before the async role
   check redirects it away. Only admin-auth-guard.js's revealPage() removes
   this class — never via inline style, so there's no gap where it could be
   half-hidden. */
.adm-pending .adm-main { visibility: hidden; }

/* ── Sidebar ───────────────────────────────────────────────── */
.adm-sidebar {
  width: var(--adm-sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 1000;
}
.adm-sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--adm-border);
  flex-shrink: 0;
}
.adm-logo-text { font-weight: 700; font-size: 1.15rem; color: var(--adm-text-primary); }
.adm-logo-text span { color: var(--adm-accent); }
.adm-logo-img { width: 34px; height: 34px; margin-right: 10px; flex-shrink: 0; }
.adm-logo-banner { height: 46px; width: auto; max-width: 100%; object-fit: contain; }
.adm-sidebar-logo { display: flex; align-items: center; }

/* Active fun zone, directly under the logo — the one thing that must be true on
   every page, since acting on the wrong branch's books is the mistake this whole
   feature makes possible. */
.adm-firm-block {
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--adm-border);
  flex-shrink: 0;
}
.adm-firm-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--adm-accent);
  line-height: 1.25;
}
.adm-firm-strip i { flex: 0 0 auto; }
.adm-firm-switch {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--adm-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.adm-firm-switch:hover,
.adm-firm-switch:focus-visible {
  background: var(--adm-accent-soft);
  border-color: var(--adm-accent);
  color: var(--adm-accent);
  outline: none;
}

.adm-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adm-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border-radius: var(--adm-r);
  color: var(--adm-text-secondary);
  font-weight: 600;
  font-size: 1rem;
  border-left: 4px solid transparent;
}
.adm-nav-link:hover { background: #f1f5f9; color: var(--adm-text-primary); }
.adm-nav-link.active {
  background: var(--adm-accent-soft);
  color: var(--adm-accent);
  border-left-color: var(--adm-accent);
  font-weight: 700;
}
.adm-nav-link.active:hover { background: var(--adm-accent-soft); color: var(--adm-accent); }
.adm-nav-link i { font-size: 1.2rem; width: 22px; text-align: center; flex-shrink: 0; }

/* Section label above a group of nav links in the Admin sidebar (e.g. "Operations") —
   not clickable, just groups the flat link list into scannable sections. */
.adm-nav-section {
  padding: 16px 14px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--adm-text-secondary);
}
.adm-nav-section:first-child { padding-top: 8px; }

.adm-sidebar-footer { padding: 12px; border-top: 1px solid var(--adm-border); flex-shrink: 0; }
.adm-user-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.adm-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--adm-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.adm-avatar-manager { background: var(--adm-green); }
.adm-user-info { min-width: 0; flex: 1; }
.adm-user-name { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-role { font-size: 0.78rem; color: var(--adm-text-secondary); }
.adm-logout-btn {
  background: transparent; border: none; color: var(--adm-text-secondary);
  cursor: pointer; font-size: 1.2rem; padding: 6px;
}
.adm-logout-btn:hover { color: var(--adm-red); }

/* !important is deliberate: this is a visibility utility class applied
   alongside layout classes like .adm-filter-row (display: flex) further
   down this file — without !important, cascade order (not role) would
   decide which display value wins, silently un-hiding role-gated elements
   regardless of the logged-in role. */
.adm-role-gate { display: none !important; }

/* ── Main content ──────────────────────────────────────────── */
.adm-main {
  flex: 1;
  /* Without this, a flex item's default automatic minimum size is its
     content's intrinsic width — so a wide table (even one meant to scroll
     inside its own .adm-table-wrap) forced this whole column, and the
     fixed-position sidebar's margin-left offset with it, wider than the
     viewport instead of just scrolling the table. That showed up as the
     entire page gaining a horizontal scrollbar on a tablet-width screen. */
  min-width: 0;
  margin-left: var(--adm-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.adm-topbar {
  min-height: 64px;
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.adm-topbar-title { font-size: 1.4rem; font-weight: 700; flex: 1; padding: 14px 0; }
.adm-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; }
.adm-back-btn { flex-shrink: 0; }

/* Greeting + live-clock pills, shown on every admin page's topbar. */
/* The active fun zone, stated more firmly than the greeting beside it — it is the
   one thing on the topbar you can act wrongly on. */
.adm-firm-pill {
  border-color: rgba(37, 99, 235, 0.45) !important;
  background: rgba(37, 99, 235, 0.16) !important;
  font-weight: 700;
}

.adm-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1e3a8a;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.adm-clock-pill { font-variant-numeric: tabular-nums; }

.adm-content { padding: 24px; flex: 1; min-width: 0; }
.adm-content-narrow { max-width: 640px; }
.adm-center { margin-left: auto; margin-right: auto; }

.adm-kid-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-kid-chip {
  display: inline-block;
  background: var(--adm-green-soft);
  color: var(--adm-green);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.95rem;
}
.adm-kid-entry {
  border: 1px dashed var(--adm-border);
  border-radius: var(--adm-r);
  padding: 14px;
  margin-bottom: 12px;
}

/* ── Filter bar (Manager & Super Admin list views) ─────────────
   A bordered toolbar card, every control labeled the same way (small
   caps label above the field) and bottom-aligned, so search/date/
   dropdown fields never sit at mismatched heights. */
.adm-filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 16px;
}
/* Kept compact on purpose: rows with the most controls (Search + From + To +
   Staff + Export CSV, e.g. Platform History) need to fit on one line at
   ordinary laptop widths without Export CSV overflowing onto its own row —
   the widths below are the tightest that still comfortably fit each
   control's placeholder/value. */
.adm-filter-row .adm-form-select,
.adm-filter-row input[type="date"] {
  max-width: 150px;
}
.adm-filter-row input[type="text"] {
  max-width: 220px;
}
.adm-filter-row .adm-filter-spacer { flex: 1; }
.adm-filter-row label.adm-inline-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--adm-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Every control that can sit in a filter row — text/date/select inputs, the
   Payment pill-button group, and any bare .adm-btn (Search, Export CSV) —
   gets the SAME fixed `height` (not min-height). min-height alone doesn't
   work here: each control type has different padding (buttons use 10px,
   inputs/pills use 12px), so its natural content-driven size can exceed a
   shared min-height and the row still renders uneven. An explicit height +
   box-sizing: border-box makes every control exactly 44px regardless of its
   own padding, so bottoms truly line up under align-items: flex-end. */
.adm-filter-row .adm-form-control,
.adm-filter-row .adm-form-select,
.adm-filter-row .adm-btn,
.adm-filter-row .adm-choice-group,
.adm-filter-row .adm-choice-btn {
  height: 44px;
  box-sizing: border-box;
}
.adm-filter-row .adm-btn { flex-shrink: 0; }
.adm-filter-row .adm-choice-group { align-items: stretch; }
/* Wraps the Search input on pages with a live suggestions dropdown (the
   dropdown is absolutely positioned off this). Without an explicit height,
   this wrapper's own auto height could come out a hair different from a
   plain <select>/<input> sitting directly in a label, which is what made
   Search sit slightly lower than Payment/Staff on pages that use it —
   Currently Playing has no suggestions dropdown and was never wrapped, which
   is why it never showed the offset. */
.adm-search-wrap { position: relative; }
.adm-filter-row .adm-search-wrap { height: 44px; }
.adm-filter-row .adm-choice-btn { display: flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  .adm-filter-row .adm-form-select,
  .adm-filter-row input[type="date"],
  .adm-filter-row input[type="text"] { max-width: none; width: 100%; }
}

/* Small phones (most 5-6" devices in portrait) — the 640px rule above already
   makes filter inputs full-width; this tightens spacing further and makes
   Export CSV a full-width row of its own instead of a small end-aligned
   button that can feel cramped/hard to tap next to other controls. */
@media (max-width: 480px) {
  .adm-filter-row { gap: 10px; padding: 12px; }
  .adm-filter-row .adm-btn { width: 100%; }
  .adm-filter-spacer { display: none; }
  .adm-form-grid, .adm-kid-grid, .adm-summary-grid { grid-template-columns: 1fr; }
  .adm-topbar-title { font-size: 1.05rem; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--adm-r);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  min-height: 44px;
}
.adm-btn-primary { background: var(--adm-accent); color: #fff !important; }
.adm-btn-primary:hover { background: #1d4ed8; color: #fff !important; }
.adm-btn-secondary { background: #ffffff; color: var(--adm-text-primary) !important; border-color: var(--adm-border); }
.adm-btn-secondary:hover { background: #f1f5f9; }
.adm-btn-danger { background: var(--adm-red-soft); color: var(--adm-red) !important; border-color: var(--adm-red); }
.adm-btn-danger:hover { background: #fecaca; }
.adm-btn-accent { background: var(--adm-accent-soft); color: var(--adm-accent) !important; border-color: #bfdbfe; }
.adm-btn-accent:hover { background: #dbeafe; }
.adm-btn-solid-danger { background: var(--adm-red); color: #fff !important; border-color: var(--adm-red); }
.adm-btn-solid-danger:hover { background: #991b1b; }
.adm-btn-link { background: transparent; color: var(--adm-accent) !important; border: none; font-weight: 600; }
.adm-btn-lg { min-height: 52px; font-size: 1.1rem; padding: 12px 24px; }
.adm-btn-sm { min-height: 38px; padding: 6px 10px; font-size: 0.85rem; }
.adm-btn { white-space: nowrap; }

/* Big green check-in button — the single most important action on the
   Register Kid screen, so it gets its own unmissable style. */
.adm-btn-checkin {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 20px;
  background: var(--adm-green);
  color: #fff;
  border: none;
  border-radius: var(--adm-r);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.adm-btn-checkin:hover { background: #14632f; }

/* ── Cards ─────────────────────────────────────────────────── */
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 20px;
  margin-bottom: 20px;
}
.adm-card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.adm-step-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
  background: var(--adm-accent-soft); color: var(--adm-accent);
}
.adm-step-icon.adm-step-icon-green { background: var(--adm-green-soft); color: var(--adm-green); }
.adm-step-icon.adm-step-icon-yellow { background: var(--adm-yellow-soft); color: var(--adm-yellow); }
.adm-mt { margin-top: 18px; }
.adm-info-line { font-size: 1.1rem; margin-bottom: 6px; }

/* ── Forms ─────────────────────────────────────────────────── */
.adm-form-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--adm-text-secondary); margin-bottom: 6px; }
.adm-form-control, .adm-form-select {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 12px 14px;
  color: var(--adm-text-primary);
  font-size: 1rem;
  min-height: 48px;
}
.adm-form-control:focus, .adm-form-select:focus {
  border-color: var(--adm-accent);
  outline: none;
}
.adm-form-control-lg { font-size: 1.2rem; padding: 16px; min-height: 56px; }
.adm-form-group { margin-bottom: 16px; }

/* Inline field validation (e.g. Register Kid's mobile number) — shown next
   to the field itself instead of a blocking alert(), and only once the user
   has actually left the field or tried to submit, so it can't complain about
   an entry still mid-typing. */
.adm-form-control.adm-input-invalid { border-color: var(--adm-red); }
.adm-field-error { color: var(--adm-red); font-size: 0.82rem; margin-top: 6px; display: none; }
.adm-field-error.visible { display: block; }

.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.adm-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-search-row .adm-form-control { flex: 1; min-width: 220px; }
.adm-search-row { position: relative; }

/* Live phone-search suggestion dropdown (Register Kid) */
.adm-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--adm-surface);
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-r);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
}
.adm-search-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--adm-border);
  background: none;
  font-size: 1rem;
  color: var(--adm-text-primary);
  cursor: pointer;
}
.adm-search-suggestion:last-child { border-bottom: none; }
/* .is-active marks the row the arrow keys have moved to — focus stays in the
   search input while navigating, so :focus can't show it. */
.adm-search-suggestion:hover, .adm-search-suggestion:focus, .adm-search-suggestion.is-active { background: var(--adm-accent-soft); }
.adm-search-suggestion strong { display: block; }
.adm-search-suggestion span { font-size: 0.85rem; color: var(--adm-text-secondary); }

/* ── Choice buttons — replaces <select> for Gender / Payment Method /
   Cancellation Reason: a handful of fixed, mutually-exclusive options. ── */
.adm-choice-group { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-choice-btn {
  flex: 1;
  min-width: 110px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-r);
  background: #ffffff;
  color: var(--adm-text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.adm-choice-btn:hover { border-color: var(--adm-accent); }
.adm-choice-btn.active {
  background: var(--adm-accent);
  border-color: var(--adm-accent);
  color: #fff;
}

/* ── Text helpers ──────────────────────────────────────────── */
.adm-text-secondary { color: var(--adm-text-secondary); }
.adm-text-muted { color: var(--adm-text-muted); }
.adm-fw-600 { font-weight: 600; }
/* Dates in the history tables (Platform History / My History) — a distinct
   dark navy so a date reads as its own kind of value, not just body text. */
.adm-text-date { color: var(--adm-accent); font-weight: 600; }

/* Wrapper around a disabled Receipt button (still playing / not checked out
   yet). The button itself is a real disabled="" element so it truly can't be
   clicked; the wrapping span still gets hover/tap events so we can surface a
   toast explaining why, instead of a silent do-nothing button. */
.adm-receipt-disabled { display: inline-block; cursor: not-allowed; }
.adm-receipt-disabled .adm-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ── Toast (non-blocking notification) ────────────────────────
   Replaces alert() for messages that don't need to stop the user in their
   tracks (e.g. "receipt available after check-out") — appears bottom-center,
   auto-dismisses, never blocks the page the way a native alert() does. */
.adm-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--adm-r);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(90vw, 420px);
  text-align: center;
}
.adm-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Table ─────────────────────────────────────────────────
   overflow-x is harmless at desktop widths (every table here already fits,
   so no scrollbar appears) but is what lets a tablet-width viewport scroll
   instead of crushing columns — see the tablet-and-below override below,
   which is where the actual floor gets applied. */
.adm-table-wrap { width: 100%; overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.adm-table th, .adm-table td {
  padding: 12px 14px;
  font-size: 0.95rem;
  text-align: left;
  word-break: break-word;
}
.adm-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid var(--adm-border);
  font-weight: 700;
  color: var(--adm-text-secondary);
}
.adm-table tbody tr { border-bottom: 1px solid var(--adm-border); }
.adm-table-empty { text-align: center; padding: 32px !important; color: var(--adm-text-muted); }

/* Date-group header row inside a table body (My History, Platform History) —
   a plain sub-heading row, not a clickable/selectable data row. */
.adm-table-group-header {
  padding: 10px 12px !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--adm-accent);
  background: var(--adm-bg);
  border-bottom: 1px solid var(--adm-border);
}

/* A column holding one action button (Receipt, Edit, Checkout) needs a
   guaranteed minimum width — table-layout:fixed otherwise splits every
   column dead-equal, which can squeeze the button's own label into an
   ugly mid-word wrap on a narrower screen. */
.adm-col-action { width: 130px; }

/* A column holding several stacked action buttons (Extend / Cancel-Refund /
   Checkout on Currently Playing) — wider than .adm-col-action, and the
   buttons stack full-width instead of wrapping inline (which, at 130px,
   made buttons overflow the fixed-width cell and effectively disappear). */
.adm-col-actions-wide { width: 190px; }
.adm-action-stack { display: flex; flex-direction: column; gap: 6px; }
.adm-action-stack .adm-btn { width: 100%; white-space: normal; }

/* ── Comfortable table (Staff / Managers accounts, and other
   staff-facing lists) — bigger rows, bigger text, easy to scan quickly. */
.adm-table-comfortable th, .adm-table-comfortable td { padding: 14px 12px; font-size: 0.98rem; }
.adm-row-avatar {
  display: flex; align-items: center; gap: 12px;
}
.adm-row-avatar .adm-avatar { width: 34px; height: 34px; font-size: 0.85rem; }

/* ── Status pills / row tints (green / yellow / red) ─────────
   Used for the Currently Playing timer and any other status column. */
.adm-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.status-green, .adm-status-pill.status-green { color: var(--adm-green); background: var(--adm-green-soft); }
.status-yellow, .adm-status-pill.status-yellow { color: var(--adm-yellow); background: var(--adm-yellow-soft); }
.status-red, .adm-status-pill.status-red { color: var(--adm-red); background: var(--adm-red-soft); }
.adm-status-pill.status-muted { color: var(--adm-text-secondary); background: #f1f5f9; }

tr.status-green { background: var(--adm-green-soft); }
tr.status-yellow { background: var(--adm-yellow-soft); }
tr.status-red { background: var(--adm-red-soft); }

/* ── Status cell: badge + inline toggle (Staff / Managers accounts) ──
   Flips Active/Inactive right from the row, without opening Edit. Same
   PATCH the Edit form already sends, so no new permission is created. */
.adm-status-cell { display: flex; align-items: center; gap: 10px; }
.adm-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.adm-toggle input { opacity: 0; width: 0; height: 0; }
.adm-toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--adm-border);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.adm-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.adm-toggle input:checked + .adm-toggle-slider { background: var(--adm-green); }
.adm-toggle input:checked + .adm-toggle-slider::before { transform: translateX(18px); }
.adm-toggle input:disabled + .adm-toggle-slider { opacity: 0.5; cursor: not-allowed; }
.adm-toggle input:focus-visible + .adm-toggle-slider { outline: 2px solid var(--adm-accent); outline-offset: 2px; }

/* ── Kid selection cards (Register Kid screen) ───────────────
   Selecting a kid reads unmistakably as "confirmed": green fill + border. */
.adm-kid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.adm-kid-card {
  text-align: left;
  background: #ffffff;
  border: 2px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 14px;
  cursor: pointer;
  min-height: 60px;
}
.adm-kid-card:hover { border-color: var(--adm-accent); }
.adm-kid-card.selected { background: var(--adm-green-soft); border-color: var(--adm-green); }
.adm-kid-card.is-disabled { opacity: 0.5; cursor: not-allowed; }
.adm-kid-card-name { font-weight: 700; font-size: 1.05rem; }
.adm-kid-card-meta { font-size: 0.85rem; color: var(--adm-text-secondary); margin-top: 4px; }

/* ── Price display ────────────────────────────────────────── */
.adm-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.adm-price-value { font-size: 1.6rem; font-weight: 800; color: var(--adm-accent); }

/* ── Count tiles (Dashboard) ─────────────────────────────────── */
.adm-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.adm-count-tile {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 24px;
  text-align: center;
}
.adm-count-value { font-size: 2.2rem; font-weight: 800; color: var(--adm-accent); }
.adm-count-label { font-size: 0.95rem; color: var(--adm-text-secondary); margin-top: 6px; }
.adm-count-tile-link {
  display: block;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.adm-count-tile-link:hover {
  border-color: var(--adm-accent);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.14);
  transform: translateY(-2px);
}

/* ── Dashboard charts ─────────────────────────────────────────── */
.adm-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}
.adm-chart-card { margin-bottom: 0; }
.adm-chart-subtitle { font-size: 0.85rem; margin-top: -8px; margin-bottom: 16px; }
.adm-chart-wrap { position: relative; height: 260px; }
.adm-chart-wrap-donut { height: 280px; }
.adm-chart-empty {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ── Dashboard hero card (big "today" summary) ───────────────── */
.adm-hero-card {
  background: var(--adm-accent-soft);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 28px;
  text-align: center;
}
.adm-hero-pill {
  display: inline-block;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 700;
  color: var(--adm-accent);
  margin-bottom: 14px;
}
.adm-hero-value { font-size: 2.6rem; font-weight: 800; color: var(--adm-accent); }
.adm-hero-meta { display: flex; justify-content: center; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.adm-hero-meta-item { font-size: 0.95rem; color: var(--adm-text-secondary); }
.adm-hero-meta-item strong { display: block; color: var(--adm-text-primary); font-size: 1.05rem; }

.adm-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.adm-summary-tile {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 18px;
}
.adm-summary-tile-label { font-size: 0.85rem; color: var(--adm-text-secondary); font-weight: 600; }
.adm-summary-tile-value { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }

.adm-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--adm-border);
  gap: 12px;
}
.adm-list-row:last-child { border-bottom: none; }
.adm-list-row-name { font-weight: 700; }
.adm-list-row-meta { font-size: 0.85rem; color: var(--adm-text-secondary); }

/* ── Expandable cards (Monthly Report — By Manager) ───────────
   Each row reads as a tappable card: a chevron + hover shading on the
   header signal "more detail on tap" before the user ever clicks. */
.adm-cancel-list { display: flex; flex-direction: column; gap: 10px; }
.adm-cancel-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  overflow: hidden;
}
.adm-cancel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.adm-cancel-card-header:hover { background: #f8fafc; }
.adm-cancel-meta { font-size: 0.85rem; color: var(--adm-text-secondary); margin-top: 3px; }
.adm-cancel-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.adm-cancel-amount { font-weight: 800; color: var(--adm-red); font-size: 1.05rem; white-space: nowrap; }
.adm-cancel-chevron { color: var(--adm-text-muted); font-size: 1rem; transition: transform 0.2s ease; }
.adm-cancel-card.expanded .adm-cancel-chevron { transform: rotate(180deg); }
.adm-cancel-detail { display: none; padding: 0 16px 14px; border-top: 1px solid var(--adm-border); }
.adm-cancel-card.expanded .adm-cancel-detail { display: block; padding-top: 12px; }
.adm-cancel-detail .adm-list-row { padding: 10px 0; }

/* ── Cancelled Bill Kid Item with Expandable Details ── */
.adm-cancel-item {
  border-bottom: 1px solid var(--adm-border);
  transition: background 0.15s ease;
}
.adm-cancel-item:last-child {
  border-bottom: none;
}
.adm-cancel-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  cursor: pointer;
  border-radius: var(--adm-r-sm);
  transition: background 0.15s ease;
  user-select: none;
}
.adm-cancel-item-header:hover {
  background: #f1f5f9;
}
.adm-cancel-item-chevron {
  color: var(--adm-text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
  width: 16px;
  display: inline-block;
  text-align: center;
}
.adm-cancel-item.expanded .adm-cancel-item-chevron {
  transform: rotate(180deg);
  color: var(--adm-primary);
}
.adm-cancel-item-amount {
  font-weight: 700;
  color: var(--adm-text-secondary);
  font-size: 0.95rem;
}
.adm-cancel-item-body {
  display: none;
  padding: 12px 14px 14px 28px;
  background: #f8fafc;
  border-radius: var(--adm-r-sm);
  margin: 2px 0 8px 0;
  border: 1px solid var(--adm-border);
}
.adm-cancel-item.expanded .adm-cancel-item-body {
  display: block;
}
.adm-cancel-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 16px;
}
.adm-cancel-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-cancel-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.adm-cancel-field-value {
  font-size: 0.875rem;
  color: var(--adm-text);
  font-weight: 500;
  word-break: break-word;
}
.adm-cancel-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--adm-border);
  align-items: center;
  flex-wrap: wrap;
}
.adm-btn-outline-danger {
  background: transparent;
  color: var(--adm-red);
  border: 1px solid var(--adm-red);
}
.adm-btn-outline-danger:hover {
  background: var(--adm-red);
  color: #ffffff;
}


/* ── Danger zone ──────────────────────────────────────────── */
.adm-danger-card { border-color: var(--adm-red); }

/* ── Overlay modals (receipt / confirmation) ─────────────────
   Plain fixed-position overlay — same pattern for every confirm-style
   popup so staff learn one interaction, not several. */
.adm-overlay-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.adm-receipt-card, .adm-confirm-card {
  background: #ffffff;
  border-radius: var(--adm-r);
  padding: 28px;
  width: 100%;
  max-width: 420px;
}
.adm-receipt-title, .adm-confirm-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.adm-receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--adm-border);
  font-size: 1rem;
}
.adm-confirm-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 1.05rem; }
.adm-confirm-actions { display: flex; gap: 12px; margin-top: 20px; }
.adm-confirm-actions .adm-btn { flex: 1; }

/* ── Modal (Bootstrap) ────────────────────────────────────── */
.adm-modal .modal-content { border-radius: var(--adm-r); }
.adm-modal .modal-header { border-bottom: 1px solid var(--adm-border); }
.adm-modal .modal-body { padding: 24px; }

/* ── Login page ───────────────────────────────────────────── */
.adm-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.adm-login-card {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-r);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}
.adm-login-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; }
.adm-mb { margin-bottom: 20px; }

/* ── Responsive ───────────────────────────────────────────── */
/* Tablet (portrait ~768px through landscape ~1024px). The sidebar and its
   nav labels stay exactly as they are on desktop at this width — it's the
   wide, many-column tables (Cancelled Bills, Platform History, Today's
   Checked Out) that broke here: table-layout:fixed forces every column
   dead-equal with no floor, which on a ~700-900px content area squeezed
   headers like "Cancelled By" into one letter per line instead of ever
   scrolling. table-layout:auto lets columns size to their content again,
   min-width stops any single column being crushed below that, and once a
   row genuinely needs more room than the viewport has, .adm-table-wrap's
   overflow-x scrolls it horizontally instead. */
@media (max-width: 1024px) {
  .adm-table { table-layout: auto; }
  .adm-table th, .adm-table td { min-width: 130px; }
}

@media (max-width: 768px) {
  .adm-sidebar { width: 72px; }
  .adm-sidebar .adm-nav-link span,
  .adm-sidebar .adm-logo-text,
  .adm-sidebar .adm-nav-section,
  .adm-sidebar .adm-user-info,
  .adm-sidebar .adm-firm-block { display: none; }
  .adm-main { margin-left: 72px; }
  .adm-content { padding: 14px; }
  .adm-topbar { padding: 0 14px; }
}

/* ---------- Password fields ---------- */

/* Edge (and old IE) inject their own reveal/clear controls into every password
   input. Alongside our own toggle that renders as *two* eye buttons side by
   side, which is what reception was seeing on the login screen. Ours stays,
   because the native one is absent in Chrome and Firefox. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.adm-password-wrap { position: relative; }
/* Room for the button, so a long password never runs underneath it. */
.adm-password-wrap .adm-form-control { padding-right: 46px; }
.adm-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--adm-text-secondary, #64748b);
  cursor: pointer;
  line-height: 0;
}
.adm-password-toggle:hover { color: var(--adm-text-primary); background: #f1f5f9; }
.adm-password-toggle:focus-visible {
  outline: 2px solid var(--adm-accent);
  outline-offset: 1px;
}
