/* assets/css/style.css — Netball Kids brand palette */

:root {
  --c-bg:        #fbfaff;
  --c-surface:   #ffffff;
  --c-ink:       #1f1530;
  --c-ink-soft:  #534760;
  --c-muted:     #8a8090;
  --c-line:      #ece6f2;
  --c-line-2:    #d8cfe1;

  /* Brand — primary purple from the Netball Kids logo (#733290).
     Dark variant is used for hovers and on-light text;
     Light variant is used for subtle backgrounds (table headers,
     stat pills, hover tints on white surfaces). */
  --c-purple:    #733290;
  --c-purple-d:  #4d2261;
  --c-purple-l:  #f4ebf7;
  --c-orange:    #f47920;
  --c-orange-d:  #d6651a;
  --c-orange-l:  #fff0e0;
  --c-green:     #37b44a;
  --c-green-d:   #2a8c39;
  --c-green-l:   #e3f6e6;

  /* Primary CTA = orange (high contrast against purple, draws the eye) */
  --c-accent:      var(--c-orange);
  --c-accent-d:    var(--c-orange-d);
  --c-accent-soft: var(--c-orange-l);

  --c-ok:        var(--c-green-d);
  --c-ok-soft:   var(--c-green-l);
  --c-warn:      #92400e;
  --c-warn-soft: #fef3c7;
  --c-err:       #991b1b;
  --c-err-soft:  #fee2e2;
  --c-info:      #1e3a8a;
  --c-info-soft: #dbeafe;

  --radius:      12px;
  --radius-sm:   8px;
  --shadow-sm:   0 1px 2px rgba(31, 21, 48, 0.06);
  --shadow:      0 4px 20px rgba(115, 50, 144, 0.10);

  /* Type — Poppins everywhere (loaded via Google Fonts in the layouts).
     Body sits at 400; headings/buttons/wordmark go to 600–700 for weight. */
  --font-body:    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-purple-d); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--c-ink);
}
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* Layout */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
/* Mobile padding hierarchy:
   - 720px and below: 1.5rem (24px) — comfortable breathing room
   - 380px and below: 1.25rem (20px) — preserve content width on smallest phones
   Previously sat at 1rem on mobile which felt cramped against viewport edges,
   especially in the hero and on form pages. */
@media (max-width: 720px) {
  .container { padding: 0 1.5rem; }
}
@media (max-width: 380px) {
  .container { padding: 0 1.25rem; }
}

/* Header — solid brand purple bar that sits above every page (admin + public).
   White text + lightened nav links. The "Log out" / other secondary buttons
   are re-skinned within this scope so they read on a dark background. */
header.site {
  background: var(--c-purple);
  border-bottom: none;
  color: #fff;
}
header.site .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem;
  max-width: 1100px; margin: 0 auto;
}
header.site .brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none;
}
header.site .brand img {
  height: 48px; width: 48px; display: block;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
header.site .brand .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.01em;
}
header.site nav a {
  color: rgba(255, 255, 255, 0.88);
  margin-left: 1.25rem; font-size: .95rem;
  text-decoration: none;
  font-weight: 500;
}
header.site nav a:hover { color: #fff; text-decoration: underline; }
header.site nav span { color: rgba(255, 255, 255, 0.7) !important; }
header.site nav .btn { margin-left: 1rem; }

/* Secondary buttons inside the purple header — re-skinned so the text and
   border show against the dark surface. The same .btn.secondary on a
   normal white card keeps its original ink-on-light look. */
header.site .btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
header.site .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* =============================================================
   MOBILE NAVIGATION — burger + off-canvas drawer
   =============================================================
   Two drawers share this machinery:
     - .admin-sidebar (slides from the LEFT, used by /admin and /superadmin)
     - .public-drawer (slides from the RIGHT, used by the parent / coach
       layout via app/views/layouts/public.php)
   Both are off-screen by default on mobile; tapping the burger toggles the
   `is-open` class on the wrapping <body>. The same class also fades the
   shared backdrop. ESC and backdrop-click close — wired up in nk-nav.js.

   The burger buttons themselves are hidden on desktop (display:none) and
   only revealed under 960px (admin) / 720px (public). Existing top-bar
   nav links flip to display:none in the public layout under 720px so we
   don't get duplicate navigation. */

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: .35rem .55rem;
  border-radius: 8px;
  margin-right: .25rem;
}
.nav-toggle:hover  { background: rgba(255,255,255,0.12); }
.nav-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.nav-toggle svg { display: block; width: 26px; height: 26px; }

/* Backdrop is shared by both drawers. Rendered once in the layout (or
   injected by nk-nav.js if missing) and toggled with `.is-visible`. */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 12, 40, 0.55);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Body locks scroll behind an open drawer so the page doesn't slide. */
body.nav-open { overflow: hidden; }

footer.site {
  margin-top: 4rem; padding: 2rem 1.25rem;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted); font-size: .9rem; text-align: center;
}

/* Hero — bold purple block, white text, orange CTA */
.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  background: linear-gradient(140deg, var(--c-purple) 0%, var(--c-purple-d) 70%, #2e1340 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* subtle bouncing decorative spots — uses radial gradients, no image needed */
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 8px at 12% 28%, rgba(244,121,32,0.55) 100%, transparent 100%),
    radial-gradient(circle 6px at 88% 22%, rgba(55,180,74,0.55) 100%, transparent 100%),
    radial-gradient(circle 5px at 18% 78%, rgba(255,255,255,0.35) 100%, transparent 100%),
    radial-gradient(circle 9px at 84% 76%, rgba(244,121,32,0.45) 100%, transparent 100%);
}
.hero h1 { font-size: 2.85rem; margin-bottom: .5rem; color: #fff; }
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 38rem;
  margin: 0 auto 1.75rem;
}
.hero .btn { box-shadow: 0 4px 14px rgba(214, 101, 26, 0.4); }

/* Hero call-to-action row — primary "Find a class" plus secondary
   Log in / Sign up so logged-out visitors have an obvious path into
   the booking system right from the landing page. Centered on
   desktop, stacks to full-width on mobile. */
.hero .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .85rem;
  margin-top: 1.75rem;
}
.hero .hero-actions .btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.hero .hero-actions .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}

/* Buttons */
.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: var(--radius-sm);
  background: var(--c-accent); color: #fff; border: none;
  font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--c-accent-d); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  background: transparent; color: var(--c-purple-d);
  border: 1px solid var(--c-line-2);
}
.btn.secondary:hover { background: #fff; border-color: var(--c-purple); color: var(--c-purple-d); }
.btn.purple { background: var(--c-purple); }
.btn.purple:hover { background: var(--c-purple-d); }
.btn.danger { background: var(--c-err); }
.btn.danger:hover { background: #7f1d1d; }
.btn.small { padding: .35rem .8rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards / sections */
/* `.section` adds vertical breathing room on top/bottom. We DELIBERATELY
   use `padding-top` + `padding-bottom` (not the shorthand `padding: 3rem 0`)
   because `.section` is almost always combined with `.container`, and the
   container's side padding must keep applying so content doesn't butt
   against the viewport edge on mobile. Using the shorthand would reset
   left/right to 0 and re-introduce the "edge-to-edge content" bug. */
.section { padding-top: 3rem; padding-bottom: 3rem; }
.section h2 { margin-bottom: 1.5rem; }

/* Auth pages (login, register, forgot, reset). The wrapper has its own
   max-width so the form doesn't stretch on desktop, but on mobile the
   .container padding still applies — fixes the previous "form fields
   flush to viewport edge" issue where an inline `max-width:480px` was
   overriding everything.

   Use as: <div class="container section auth-page"> ... </div>  */
.auth-page {
  max-width: 480px;
}
.auth-page h1 { margin-bottom: 1rem; }
@media (max-width: 720px) {
  .auth-page { padding-top: 1.5rem; }
  /* Same rule as .section above — top/bottom only, never the shorthand. */
  .section.auth-page { padding-top: 1.5rem; padding-bottom: 2rem; }
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.card h3 { margin-top: 0; color: var(--c-purple-d); }
.card .meta { color: var(--c-ink-soft); font-size: .9rem; margin-bottom: .5rem; }
.card .price { font-weight: 700; color: var(--c-orange-d); margin: .5rem 0 1rem; font-size: 1.05rem; }
.card .actions { margin-top: auto; display: flex; gap: .5rem; }

/* Filters */
.filters {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
}
.filters .field { flex: 1 1 180px; }

/* Forms
   ----------------------------------------------------------------------------
   The selector below uses :not(...) to catch inputs that have no `type`
   attribute (which default to text per HTML spec) AND inputs with a text-y
   type. This avoids the gotcha of <input> without type="text" looking
   unstyled. Don't add explicit type="text" everywhere — let this rule do
   the work.
   ---------------------------------------------------------------------------- */
form .field { margin-bottom: 1rem; }
form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; color: var(--c-ink-soft); }
form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]),
form select,
form textarea {
  width: 100%; padding: .55rem .7rem; font: inherit;
  background: var(--c-surface); color: var(--c-ink);
  border: 1px solid var(--c-line-2); border-radius: var(--radius-sm);
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--c-purple);
  box-shadow: 0 0 0 3px var(--c-purple-l);
}
form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
form .row .field { flex: 1 1 200px; }
form .actions { display: flex; gap: .5rem; margin-top: 1rem; }
form .help { font-size: .85rem; color: var(--c-muted); margin-top: .25rem; }

/* Field-scoped fallbacks. These mirror the form-scoped rules above so a
   .field block + label/input combo also picks up the standard styling
   when rendered OUTSIDE a <form> ancestor. Needed since v98, where the
   wages page detaches some inputs from their <form> using the HTML5
   form="..." attribute — the inputs work functionally but don't inherit
   `form input` styles. */
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; color: var(--c-ink-soft); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]),
.field select,
.field textarea {
  width: 100%; padding: .55rem .7rem; font: inherit;
  background: var(--c-surface); color: var(--c-ink);
  border: 1px solid var(--c-line-2); border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-purple);
  box-shadow: 0 0 0 3px var(--c-purple-l);
}

/* iOS Safari renders <input type="date">, "time", "datetime-local" with its
   own oversized centered styling that ignores width/padding from our normal
   input rules — the value text inflates to roughly 1.5x and sits centered,
   which overflows the field's apparent box.

   Force them to render like a normal text input: left-aligned, our standard
   line-height, and explicit text-align so the value reads from the same
   baseline as adjacent labels. -webkit-appearance:none removes Safari's
   custom paint. min-height keeps the field tall enough to be tappable. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  min-height: 2.55rem;
  line-height: 1.4;
  font-family: inherit;
  font-size: 1rem;
}
/* Make the calendar/clock indicator readable in our purple focus state. */
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

/* Standard width for all admin/public form bodies.
   Used as `<form class="form">` so we don't need inline max-width per-page. */
form.form { max-width: 640px; }
form.form-narrow { max-width: 460px; }

/* Inputs for codes (promo codes, slugs, etc.) — uppercased + monospace. */
input.code-input {
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/* Tables */
.table-wrap {
  /* Position + background gradients create scroll-shadow indicators: a
     subtle white->transparent fade on each side that hides when the
     table is scrolled all the way to that side. Tells the user there's
     more content off-screen without having to notice a scrollbar. */
  overflow-x: auto;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background:
    /* Shadow left  — fades in from the left edge unless scrolled right */
    linear-gradient(to right, var(--c-surface) 20%, rgba(255,255,255,0)) left  center / 40px 100% no-repeat,
    /* Shadow right — fades in on right edge unless scrolled left */
    linear-gradient(to left,  var(--c-surface) 20%, rgba(255,255,255,0)) right center / 40px 100% no-repeat,
    /* Shadow indicators (grey) — behind the fade so they show when there's more content */
    radial-gradient(farthest-side at 0%   50%, rgba(0,0,0,.12), rgba(0,0,0,0)) left  center / 14px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.12), rgba(0,0,0,0)) right center / 14px 100% no-repeat,
    var(--c-surface);
  background-attachment: local, local, scroll, scroll, local;
  /* Force a visible horizontal scrollbar on macOS (where overflow scrollbars
     are hidden until actively scrolled by default). Mouse users with no
     touchpad can now see and grab it. */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.3) transparent;
}
.table-wrap::-webkit-scrollbar {
  height: 10px;
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.28);
  border-radius: 5px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.4);
}

/* Floating horizontal scrollbar for long tables. Mirrors any .table-wrap
   that overflows so mouse-only desktop users don't have to scroll to the
   bottom of a 200-row table just to grab the native scrollbar.
   Auto-hides via JS when the wrap's native scrollbar is already visible. */
.nk-sticky-scrollbar {
  position: fixed;
  bottom: 0;
  height: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 90;
  display: none;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--c-line);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .35) transparent;
}
.nk-sticky-scrollbar::-webkit-scrollbar {
  height: 12px;
  background: transparent;
}
.nk-sticky-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .32);
  border-radius: 6px;
}
.nk-sticky-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, .48);
}
.nk-sticky-scrollbar-inner {
  height: 1px;
}
@media print {
  .nk-sticky-scrollbar { display: none !important; }
}
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--c-line); }
table.data th { background: var(--c-purple-l); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-purple-d); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafaff; }

/* Flash messages */
.flashes { margin-bottom: 1.5rem; }
.flash {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: .5rem; font-size: .95rem;
}
.flash > p { margin: .25rem 0; }
.flash > p:first-child { margin-top: 0; }
.flash > p:last-child { margin-bottom: 0; }
.flash.warn    { background: var(--c-warn-soft); color: var(--c-warn); }
.flash.success { background: var(--c-green-l); color: var(--c-green-d); }
.flash.error   { background: var(--c-err-soft); color: var(--c-err); }
.flash.warning { background: var(--c-warn-soft); color: var(--c-warn); }
.flash.info    { background: var(--c-info-soft); color: var(--c-info); }

/* Badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eef0f4; color: var(--c-ink-soft); }
.badge.ok     { background: var(--c-green-l);  color: var(--c-green-d); }
.badge.warn   { background: var(--c-warn-soft); color: var(--c-warn); }
.badge.accent { background: var(--c-orange-l); color: var(--c-orange-d); }
.badge.purple { background: var(--c-purple-l); color: var(--c-purple-d); }

/* Admin layout — sidebar is a solid brand-purple rail. White-ish links,
   white-alpha hover tint, and an ORANGE left-edge indicator on the active
   item (purple-on-purple would disappear). */
.admin-shell { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--c-purple);
  border-right: none;
  color: #fff;
  padding: 1.5rem 0;
}
.admin-sidebar h4 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: rgba(255, 255, 255, 0.6); padding: 0 1.25rem; margin: 1rem 0 .5rem;
  font-weight: 600;
}
.admin-sidebar nav a {
  display: block; padding: .55rem 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none; border-left: 3px solid transparent;
  font-size: .95rem;
  font-weight: 500;
}
.admin-sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.admin-sidebar nav a.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-left-color: var(--c-orange);
  font-weight: 600;
}
/* Collapsible nav groups (details/summary) — keeps the sidebar compact for day-to-day
   activities while keeping less-used pages one click away. */
.admin-sidebar nav details {
  margin: 0;
}
.admin-sidebar nav details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  list-style: none;          /* hide default disclosure triangle */
  user-select: none;
}
.admin-sidebar nav details > summary::-webkit-details-marker { display: none; }
.admin-sidebar nav details > summary::after {
  content: '›';
  font-size: 1.1rem;
  line-height: 1;
  transition: transform .15s ease;
  color: rgba(255, 255, 255, 0.55);
}
.admin-sidebar nav details[open] > summary::after {
  transform: rotate(90deg);
}
.admin-sidebar nav details > summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.admin-sidebar nav details a {
  padding-left: 2.25rem;       /* indent group children */
  font-size: .9rem;
}
/* When a child link is active, also tint the group header so the user can
   see at a glance which group they're inside. */
.admin-sidebar nav details:has(a.active) > summary {
  color: #fff;
  font-weight: 600;
}
.admin-sidebar .franchise-switcher {
  padding: 0 1.25rem .75rem;
}
.admin-sidebar .franchise-switcher select {
  width: 100%;
  padding: .45rem .6rem;
  font: inherit;
  font-size: .9rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.admin-sidebar .franchise-switcher select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
/* Dropdown <option> elements appear in their own native panel — force back
   to the normal ink-on-white so they're readable when the select opens. */
.admin-sidebar .franchise-switcher select option {
  background: #fff;
  color: var(--c-ink);
}
/* Version pill at the foot of the sidebar — uses a class set on the element
   so we can style it (the previous inline styles assumed a white sidebar). */
.admin-sidebar .sidebar-version {
  margin-top: 2rem;
  padding: .75rem 1.25rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: .75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.admin-main { flex: 1; padding: 2rem; min-width: 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-header h1 { margin: 0; }

/* =============================================================
   ADMIN: tablet/mobile drawer (under 960px)
   =============================================================
   Above 960px: sidebar is a permanent left rail (as before).
   Below 960px: sidebar slides off-screen and is summoned by the burger
   inside the admin layout. Burger lives inside header.site (added in
   app/views/layouts/admin.php) — it's display:none on desktop, shown
   here. The header itself becomes sticky so the burger is always one
   tap away when scrolling a long list. */
@media (max-width: 960px) {
  /* Show the admin burger (only present in the admin layout). */
  .nav-toggle.admin { display: inline-flex; align-items: center; }

  /* Sticky header so burger is always reachable. */
  header.site {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Slide the sidebar off-canvas and turn it into a drawer. */
  .admin-shell { flex-direction: column; min-height: 0; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 1rem 0;
    border-right: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  body.nav-open .admin-sidebar { transform: translateX(0); }

  /* Drawer nav reverts to vertical layout (the desktop default already is
     vertical, but the previous mobile rules turned items horizontal — we
     undo that here so the drawer reads as a normal vertical menu). */
  .admin-sidebar nav a {
    display: block;
    border-left: 3px solid transparent;
    border-bottom: none;
    padding: .65rem 1.25rem;
  }
  .admin-sidebar nav a.active {
    border-left-color: var(--c-orange);
    border-bottom-color: transparent;
  }

  /* Main content takes the full width once the sidebar is off-canvas. */
  .admin-main { padding: 1.25rem 1rem; min-width: 0; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; }
  .admin-header h1 { font-size: 1.6rem; }
}

/* =============================================================
   PUBLIC LAYOUT: tablet/mobile drawer (under 720px)
   =============================================================
   At desktop sizes the top-bar nav is in-line. On phones we hide the
   inline links, show a burger, and pop the same links inside a
   right-side drawer (.public-drawer, injected by layouts/public.php).
   Drawer style mirrors the admin sidebar for visual consistency. */
.public-drawer {
  display: none; /* hidden until media query enables it */
}
@media (max-width: 720px) {
  /* Hide inline desktop nav links and the user-name <span>, show burger.
     Only applies to the public/parent/coach header where the right-side
     drawer is the mobile pattern. The admin layout has its own 960px
     breakpoint and keeps its top-bar contents. */
  body:not(.is-admin) header.site nav > a,
  body:not(.is-admin) header.site nav > span,
  body:not(.is-admin) header.site nav > form {
    display: none;
  }
  body:not(.is-admin) .nav-toggle.public { display: inline-flex; align-items: center; }

  /* In the admin layout the user-name span runs out of room next to
     "Log out" on narrow phones — hide it here. The same name is
     visible inside the drawer's existing markup, so the user never
     loses sight of who they are. */
  body.is-admin header.site nav > span { display: none; }

  /* Sticky header on mobile for the parent/coach pages too. */
  header.site {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Right-side drawer for parent/coach navigation. */
  .public-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 320px);
    background: var(--c-purple);
    color: #fff;
    z-index: 999;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 1.25rem 0 1.5rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  }
  body.nav-open .public-drawer { transform: translateX(0); }

  .public-drawer .drawer-user {
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: .9rem;
  }
  .public-drawer .drawer-user strong { color: #fff; display: block; font-size: 1.05rem; }
  .public-drawer .drawer-user .role { color: rgba(255, 255, 255, 0.65); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

  .public-drawer nav { display: flex; flex-direction: column; padding: .5rem 0; }
  .public-drawer nav a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: .75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
  }
  .public-drawer nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
  .public-drawer nav a.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-left-color: var(--c-orange);
    font-weight: 600;
  }
  .public-drawer .drawer-logout {
    margin: .5rem 1.25rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .public-drawer .drawer-logout button {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: .65rem 1rem;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
  }
  .public-drawer .drawer-logout button:hover { background: rgba(255, 255, 255, 0.22); }

  /* Hero + headings tighten on mobile. */
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }
  header.site .brand .wordmark { display: none; }
  header.site .brand img { height: 40px; width: 40px; }

  /* Hero CTA row stacks naturally and centers; primary CTA full-width
     so it's an obvious tap target. */
  .hero .hero-actions { flex-direction: column; align-items: stretch; gap: .65rem; }
  .hero .hero-actions .btn { width: 100%; }

  /* Larger touch targets for primary actions — Apple HIG minimum 44px. */
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn.small { min-height: 36px; }

  /* ===========================================================
     My bookings: side-scrolling table becomes a stack of cards
     ===========================================================
     Same markup, no PHP change. The <table> stops behaving like a
     table and each <tr> becomes a card; each <td> gets its <th>
     label injected via the data-label attribute (set in the view).
     Label sits as a small caption above its value. Tight spacing
     keeps the card compact and scannable. */
  .table-wrap.cards-on-mobile { border: none; background: transparent; overflow: visible; }
  .table-wrap.cards-on-mobile table.data,
  .table-wrap.cards-on-mobile table.data thead,
  .table-wrap.cards-on-mobile table.data tbody,
  .table-wrap.cards-on-mobile table.data tr,
  .table-wrap.cards-on-mobile table.data td { display: block; width: 100%; box-sizing: border-box; }
  .table-wrap.cards-on-mobile table.data thead { display: none; }
  .table-wrap.cards-on-mobile table.data tr {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    margin-bottom: .85rem;
    padding: .35rem 0;
    box-shadow: var(--shadow-sm);
  }
  .table-wrap.cards-on-mobile table.data tr:hover td { background: transparent; }

  /* Each cell: label as a small uppercase caption, value below it,
     left-aligned. No more inline text-align hacks; the card always
     reads left-to-right top-to-bottom. */
  .table-wrap.cards-on-mobile table.data td {
    border: none;
    padding: .45rem 1rem;
    text-align: left !important;     /* override inline text-align:right
                                        from desktop table cells           */
    white-space: normal;
    font-size: .95rem;
  }
  .table-wrap.cards-on-mobile table.data td::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted);
    font-weight: 600;
    margin-bottom: .1rem;
    line-height: 1.4;
  }

  /* Empty-label cells (action buttons) — Edit/Delete row at bottom.
     No caption; buttons centered with comfortable spacing. */
  .table-wrap.cards-on-mobile table.data td[data-label=""] {
    padding: .55rem 1rem .65rem;
    border-top: 1px solid var(--c-line);
    margin-top: .25rem;
    text-align: center !important;
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  .table-wrap.cards-on-mobile table.data td[data-label=""]::before { content: none; }
  .table-wrap.cards-on-mobile table.data td[data-label=""] .btn,
  .table-wrap.cards-on-mobile table.data td[data-label=""] form .btn {
    flex: 1;
    min-width: 100px;
    margin: 0;
  }
  .table-wrap.cards-on-mobile table.data td[data-label=""] form {
    display: inline-flex; flex: 1; margin: 0;
  }

  /* Stat-pill grid on the dashboard collapses to single column with
     comfortable spacing, instead of getting squashed into 2 narrow
     columns on a 380px viewport. */
  .stats-grid { grid-template-columns: 1fr !important; gap: .75rem !important; }

  /* Card padding tightens slightly so margins read right on phones. */
  .card { padding: 1rem; }

  /* Forms: full-width buttons on phones for easier tap. */
  form .btn[type="submit"]:not(.btn.small) { width: 100%; }

  /* Form action rows (Log in / Sign up, Save / Cancel) — stack the
     buttons vertically so neither is squashed to two lines. Each one
     gets full width and full tap target. */
  form .actions {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
  }
  form .actions .btn { width: 100%; }
}

/* Below ~480px the postcode / age dual-input on Find-a-class stacks. */
@media (max-width: 480px) {
  .find-class-form .row {
    grid-template-columns: 1fr !important;
  }
  .find-class-form .btn { width: 100%; }
  /* Find-a-class filters: postcode + age + button stack to full width
     so the age input isn't a 100px squeeze and the search button is
     properly tappable. Existing `.filters` is flex-wrap; here we force
     each field to a full row. */
  .filters .field {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
  .filters .field input { width: 100% !important; }
  .filters .field > div { width: 100%; }
  .filters .field > div .btn { flex: 1; }
}

/* Modal — generic confirm/info dialog */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 12, 40, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 9999;
  animation: nk-modal-fade .15s ease-out;
}
@keyframes nk-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--c-surface); color: var(--c-ink);
  border-radius: var(--radius-md, 12px);
  max-width: 520px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  overflow: hidden;
  animation: nk-modal-pop .18s ease-out;
}
@keyframes nk-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.modal-header {
  padding: 1rem 1.25rem;
  background: var(--c-warn-soft);
  color: var(--c-warn);
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 1.25rem; line-height: 1.5; }
.modal-body ul { margin: .5rem 0 .75rem 1.25rem; padding: 0; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-footer {
  padding: .75rem 1.25rem 1rem;
  display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap;
}

/* Inline UI icons — used by nk_icon() in PHP. Sized via the parent. */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

/* Info-row list used on class cards (and reusable elsewhere). Each row is a
   single line: icon + label : value. The .info-row itself is a flex line so
   the icon, label, and value all sit on the same baseline. */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.5rem 0 1rem;
}
.info-list .info-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.3;
}
.info-list .info-icon {
  color: var(--c-purple);
  font-size: 1.05rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.info-list .info-label {
  color: var(--c-ink-soft);
  font-weight: 600;
  flex-shrink: 0;
}
.info-list .info-label::after { content: ':'; }
.info-list .info-value {
  color: var(--c-ink);
}
.info-list .info-value strong { font-weight: 700; }
.info-list .info-meta {
  color: var(--c-ink-soft);
  font-size: 0.85em;
  margin-left: 0.25rem;
}

/* Class card layout — two columns on desktop, one on mobile. The card
   itself is a flex container so the buttons stick to the bottom regardless
   of how much content the info-list takes up. */
.class-card {
  display: flex;
  flex-direction: column;
}
.class-card .info-list { flex: 1; }
.class-card .actions { margin-top: auto; }

/* Two-up grid specifically for class cards (vs the broader .grid which
   targets venues / browse). Wider min-width since each card has more on
   each row now. */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

/* Venue cards on the Find a Class page. Auto-fit equal-height grid. */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.venue-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.venue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 45, 145, .12);
}
.venue-card .venue-head { margin-bottom: .25rem; }
.venue-card .info-list  { flex: 1; }
.venue-card .actions    { margin-top: auto; padding-top: .25rem; }

/* Town name as the card heading, with a small location pin in brand purple. */
.venue-card .venue-area {
  margin: 0 0 .15rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.venue-card .venue-area .icon {
  color: var(--c-purple);
  width: 1em; height: 1em;
}
.venue-card .venue-name-sub {
  margin: 0;
  font-size: .95rem;
  color: var(--c-ink-soft);
  font-weight: 500;
}
.venue-card .venue-address {
  margin: .25rem 0 0;
  font-size: .85rem;
}

/* Home page — extend the hero's purple to the bottom of the page so
   "How it works" + footer all sit on the same colour. Triggered by
   <body class="home"> (set in app/controllers/home.php). */
body.home {
  background: linear-gradient(180deg, var(--c-purple) 0%, var(--c-purple-d) 60%, #2e1340 100%);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
}

/* Header on the home page keeps its solid purple — already that everywhere
   now, but explicitly noted in case future changes diverge. */
body.home header.site { background: var(--c-purple); }

/* Hero loses its own background since the body is already purple. */
body.home .hero { background: transparent; padding-bottom: 1.5rem; }

/* "How it works" — transparent so body purple shows through.
   Cards are translucent white panels with light text. */
body.home .home-steps { background: transparent; text-align: center; }
body.home .home-steps h2 {
  color: #fff;
  text-align: center;
}
body.home .home-steps .grid {
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}
body.home .home-steps .card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
}
body.home .home-steps .card h3 {
  color: #fff;
}
body.home .home-steps .card .meta {
  color: rgba(255, 255, 255, 0.78);
}

/* Footer on the home page sits on the purple too, no border, light text. */
body.home footer.site {
  background: transparent;
  border-top: none;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2rem;
}

/* ============================================================
   NK confirm modal (replacement for native window.confirm)
   See /assets/js/nk-confirm.js for the wiring.
   ============================================================ */
.nk-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 45, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: nk-fade-in .12s ease-out;
}
.nk-confirm-backdrop.open { display: flex; }
.nk-confirm-dialog {
  background: #fff;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 20px 60px rgba(20, 14, 45, 0.3), 0 4px 16px rgba(20, 14, 45, 0.15);
  font-family: var(--font-body);
  animation: nk-pop-in .15s ease-out;
}
.nk-confirm-title {
  margin: 0 0 .75rem;
  font-family: var(--font-display, var(--font-body));
  font-size: 1.2rem;
  color: var(--c-ink, #140e2d);
  line-height: 1.3;
}
.nk-confirm-message {
  color: var(--c-ink-soft, #4a435f);
  font-size: .95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.nk-confirm-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.nk-confirm-actions .btn { margin: 0; }
/* When the modal is open, prevent page scroll behind it. */
body.nk-confirm-locked { overflow: hidden; }

@keyframes nk-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes nk-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

@media (max-width: 480px) {
  .nk-confirm-dialog { padding: 1.25rem; }
  .nk-confirm-actions { flex-direction: column-reverse; }
  .nk-confirm-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   /account page layout — 2-column on desktop, stacks on mobile.
   Left (2fr): Profile · Right (1fr): Password + Marketing stacked.
   ============================================================ */
.account-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.account-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
@media (max-width: 720px) {
  .account-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   Stat pills — 4-across summary metrics, used on /admin/wages
   and (planned) /admin/coaches/reports. Each pill is a tinted
   block with label / big value / optional subtitle.
   ============================================================ */
.stat-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.stat-pill {
  background: var(--c-purple-l);
  border: 1px solid #e6dcfa;
  border-radius: 10px;
  padding: .85rem 1rem;
  min-width: 0;                  /* allow content to shrink */
}
.stat-pill-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-ink-soft, #4a435f);
  margin-bottom: .2rem;
}
.stat-pill-value {
  font-family: var(--font-display, inherit);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--c-purple-d, #5b2c91);
  line-height: 1.1;
  word-break: break-word;        /* "3h 45m" can be long with narrow sidebar */
}
.stat-pill-sub {
  font-size: .75rem;
  color: var(--c-ink-soft, #4a435f);
  margin-top: .1rem;
}

/* Drop to 2 columns under ~720px (typical tablet), 1 column under ~440px. */
@media (max-width: 720px) {
  .stat-pills { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .stat-pills { grid-template-columns: 1fr; }
}

/* Stat pill colour variants — used on reports for status totals. */
.stat-pill-ok     { background: #e9f7ec; border-color: #c6e6cf; }
.stat-pill-ok     .stat-pill-value { color: #1f6a32; }
.stat-pill-warn   { background: #fff5e6; border-color: #ffd9a8; }
.stat-pill-warn   .stat-pill-value { color: var(--c-accent-d, #f47820); }
.stat-pill-danger { background: #fdecea; border-color: #f4c1ba; }
.stat-pill-danger .stat-pill-value { color: #7a1f1f; }
