/* ═══════════════════════════════════════════
   PICKLO DESIGN SYSTEM
   Single CSS for all pages — dark/light theme
   ═══════════════════════════════════════════ */

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

/* ── Variables: Dark (default) ── */
:root {
    --lime:       #c8ff00;
    --lime-dk:    #a8d800;
    --lime-dim:   rgba(200,255,0,0.12);
    --lime-dim2:  rgba(200,255,0,0.06);

    --bg:         #0a0a0a;
    --bg2:        #111111;
    --bg3:        #1a1a1a;
    --bg4:        #242424;
    --card:       #161616;
    --card2:      #1e1e1e;

    --fg:         #f4f4f4;
    --fg2:        #a0a0a0;
    --fg3:        #6a6a6a;

    --border:     rgba(255,255,255,0.08);
    --border2:    rgba(255,255,255,0.14);

    --red:        #ef4444;
    --red-dim:    rgba(239,68,68,0.12);
    --green:      #22c55e;
    --green-dim:  rgba(34,197,94,0.12);
    --yellow:     #eab308;
    --yellow-dim: rgba(234,179,8,0.12);
    --blue:       #3b82f6;
    --blue-dim:   rgba(59,130,246,0.12);

    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full:9999px;

    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:  0 8px 48px rgba(0,0,0,0.5);

    --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

    --transition: 0.18s ease;
    --nav-h:      64px;
    --sidebar-w:  220px;
}

/* ── Variables: Light ── */
[data-theme="light"] {
    --bg:         #f8f8f8;
    --bg2:        #ffffff;
    --bg3:        #f0f0f0;
    --bg4:        #e8e8e8;
    --card:       #ffffff;
    --card2:      #f5f5f5;

    --fg:         #0a0a0a;
    --fg2:        #444444;
    --fg3:        #888888;

    --border:     rgba(0,0,0,0.08);
    --border2:    rgba(0,0,0,0.14);

    --lime:       #7ab800;
    --lime-dk:    #5a9000;
    --lime-dim:   rgba(122,184,0,0.1);
    --lime-dim2:  rgba(122,184,0,0.05);

    --red-dim:    rgba(239,68,68,0.08);
    --green-dim:  rgba(34,197,94,0.08);
    --yellow-dim: rgba(234,179,8,0.08);
    --blue-dim:   rgba(59,130,246,0.08);

    --shadow:     0 2px 16px rgba(0,0,0,0.08);
    --shadow-lg:  0 4px 32px rgba(0,0,0,0.12);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); }

/* ── Typography ── */
h1, h2, h3, h4, h5 { line-height: 1.15; letter-spacing: -0.02em; }

.text-lime  { color: var(--lime); }
.text-muted { color: var(--fg2); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.775rem; }
.mono       { font-family: var(--font-mono); font-size: 0.8rem; }

/* ── Navbar ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 5vw, 48px);
    background: rgba(10,10,10,0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    gap: 16px;
}

[data-theme="light"] .nav {
    background: rgba(248,248,248,0.9);
}

/* ── Owner announcement bar ── */
.announce {
    display: block;
    position: sticky; top: var(--nav-h); z-index: 40;
    overflow: hidden;
    background: var(--lime); color: #0a0a0a;
    font-size: 0.8rem; font-weight: 700; text-decoration: none;
    padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,0.18);
}
/* Two identical segments; the track is twice the message width and slides
   exactly one segment, so the text is on screen continuously — no dead gap. */
.announce-track {
    display: flex; width: max-content;
    animation: announce-marquee 18s linear infinite;
    will-change: transform;
}
.announce-seg { white-space: nowrap; padding-right: 4rem; }
.announce:hover .announce-track { animation-play-state: paused; }
@keyframes announce-marquee {
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .announce { text-align: center; padding: 7px 14px; }
    .announce-track { display: block; width: auto; animation: none; }
    .announce-seg { white-space: normal; padding-right: 0; }
    .announce-seg[aria-hidden] { display: none; }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav-brand .accent { color: var(--lime); }

/* ── Brand logo image (replaces the plain "PICKLO●" text) ── */
/* Two real files, swapped per theme via CSS `content: url()` — no filter/invert
   (the lime ball is a real brand color, not black, so invert() turned it an
   ugly purple; that was the bug). All <img class="brand-logo"> tags keep a
   plain src="assets/logo.png" for non-CSS contexts; CSS overrides what's
   actually painted. logo-dark.png is Akash's asset with the wordmark
   recolored white and the lime ball left untouched — INTERIM until he sends
   a proper hand-made dark version to replace it. */
.brand-logo { height: 28px; width: auto; display: block; content: url("logo-dark.png"); }
[data-theme="light"] .brand-logo { content: url("logo-light.png"); }
.sidebar-brand .brand-logo { height: 24px; margin-bottom: 4px; }
.footer-brand .brand-logo { height: 26px; margin-bottom: 8px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-links a {
    color: var(--fg2);
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--fg); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--fg2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover { background: var(--bg4); color: var(--fg); }

/* Theme toggle now lives inside .nav-links — a small circle on desktop, a
   labelled row inside the mobile hamburger menu. The label is ::after generated
   content so picklo.js's updateThemeIcon() (which rewrites the button's
   innerHTML) can't wipe it. */
.nav-theme-toggle { gap: 8px; }
@media (max-width: 640px) {
    .nav-links.open .nav-theme-toggle {
        width: 100%; height: auto; border: 0; background: none; border-radius: 0;
        padding: 12px 0 4px; margin-top: 6px; border-top: 1px solid var(--border);
        justify-content: center;
        color: var(--fg2); font-size: 0.875rem; font-weight: 500;
    }
    .nav-links.open .nav-theme-toggle:hover { background: none; color: var(--fg); }
    .nav-links.open .nav-theme-toggle::after { content: "Theme"; }
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: all 0.2s;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform var(--transition), opacity var(--transition), background var(--transition);
    white-space: nowrap;
    text-decoration: none;
    font-family: var(--font);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--lime); color: #0a0a0a; }
.btn-primary:hover { background: var(--lime-dk); }

.btn-secondary { background: var(--bg3); color: var(--fg); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--bg4); }

.btn-outline { background: transparent; color: var(--fg); border: 1.5px solid var(--border2); }
.btn-outline:hover { border-color: var(--fg2); }

.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.btn-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.btn-ghost { background: transparent; color: var(--fg2); }
.btn-ghost:hover { color: var(--fg); background: var(--bg3); }

.btn-sm { padding: 6px 14px; font-size: 0.775rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Form elements ── */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg2);
    margin-bottom: 7px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--font);
    /* ponytail: iOS Safari auto-zooms the page when a focused input's font-size
       is under 16px — every form on the site (login, register, checkout,
       profile) hit this on phones. 1rem is the fix, not a stylistic choice. */
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    color-scheme: dark;
}

[data-theme="light"] .field input,
[data-theme="light"] .field textarea,
[data-theme="light"] .field select {
    color-scheme: light;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px var(--lime-dim);
}

.field textarea { resize: vertical; min-height: 90px; }

.field-hint { font-size: 0.775rem; color: var(--fg3); margin-top: 5px; }

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fg2);
}

.card-body { padding: 18px; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-lime   { background: var(--lime-dim);   color: var(--lime); }
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-grey   { background: var(--bg4);        color: var(--fg3); }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-error   { background: var(--red-dim);   border: 1px solid rgba(239,68,68,0.25);  color: var(--red); }
.alert-success { background: var(--green-dim); border: 1px solid rgba(34,197,94,0.25);  color: var(--green); }
.alert-info    { background: var(--blue-dim);  border: 1px solid rgba(59,130,246,0.25); color: var(--blue); }
.alert-warn    { background: var(--yellow-dim);border: 1px solid rgba(234,179,8,0.25);  color: var(--yellow); }

/* ── Page layouts ── */
.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.auth-card {
    width: min(100%, 400px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 { font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.auth-card .sub { color: var(--fg2); font-size: 0.875rem; margin-bottom: 28px; }
.auth-footer { text-align: center; font-size: 0.875rem; color: var(--fg2); margin-top: 20px; }
.auth-footer a { color: var(--lime); font-weight: 700; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }

/* ── Scroll reveal (opt-in: add .reveal to an element). picklo.js arms this by
   adding .js-reveal to <body> — stays fully visible with no JS and under
   prefers-reduced-motion, so the hidden state only ever applies on top of it. ── */
body.js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
body.js-reveal .reveal.revealed { opacity: 1; transform: none; }
body.js-reveal .reveal:nth-child(2) { transition-delay: 0.06s; }
body.js-reveal .reveal:nth-child(3) { transition-delay: 0.12s; }
body.js-reveal .reveal:nth-child(4) { transition-delay: 0.18s; }
body.js-reveal .reveal:nth-child(5) { transition-delay: 0.24s; }
body.js-reveal .reveal:nth-child(6) { transition-delay: 0.3s; }

/* ── Icons (replaces emoji site-wide, see assets/icons.php) ── */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }

/* ── Tables ── */
/* ponytail: wide admin tables (10 cols on bookings.php) forced the whole page
   to scroll sideways on a phone with no wrapper — this scopes the scroll to
   just the table instead. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: auto; min-width: 100%; }
.table-wrap th, .table-wrap td { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg3);
    border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--lime-dim2); }

.empty-row td { text-align: center; padding: 40px; color: var(--fg3); }

/* ── Footer ── */
.footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 48px clamp(16px,5vw,48px) 28px;
}

.footer-grid {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 36px;
}

.footer-brand .name { font-size: 1.3rem; font-weight: 900; margin-bottom: 8px; }
.footer-brand .name span { color: var(--lime); }
.footer-brand p { color: var(--fg2); font-size: 0.875rem; line-height: 1.7; max-width: 280px; }

.footer-col h4 {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg3); margin-bottom: 14px;
}

.footer-col a { display: block; color: var(--fg2); font-size: 0.875rem; margin-bottom: 10px; transition: color var(--transition); }
.footer-col a:hover { color: var(--lime); }

.footer-bottom {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.775rem;
    color: var(--fg3);
}

/* ── Stat grid ── */
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 20px; } /* ponytail: down from 4 — only 2 stat cards left after the pending-cancellations tile was removed */
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.stat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg3); margin-bottom: 8px; }
.stat-value { font-size: 1.75rem; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.stat-sub { font-size: 0.75rem; color: var(--fg3); }

/* Admin dashboard — court utilisation bar */
.util-bar { height: 8px; border-radius: var(--radius-full); background: var(--bg4); overflow: hidden; }
.util-bar span { display: block; height: 100%; background: var(--lime); border-radius: var(--radius-full); }

/* ── Day strip (booking dashboard) ── */
.booking-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.booking-head h2 { font-size: 1.15rem; font-weight: 800; }
.booking-head .sub { font-size: 0.85rem; color: var(--fg3); }

.day-nav {
    display: flex; gap: 8px; min-width: 0; margin-bottom: 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;                      /* swipe to scroll, no visible bar */
}
.day-nav::-webkit-scrollbar { display: none; }
.day-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center;
    min-width: 58px; padding: 8px 12px;
    border: 1px solid var(--border2); border-radius: var(--radius);
    background: var(--card); color: var(--fg2);
    font-size: 0.82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background var(--transition), border-color var(--transition);
}
.day-chip small { font-size: 0.64rem; font-weight: 500; color: var(--fg3); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.day-chip:hover { border-color: var(--fg3); }
.day-chip.active { background: var(--lime); border-color: var(--lime); color: #0a0a0a; }
.day-chip.active small { color: rgba(0,0,0,0.6); }

.slot-empty {
    text-align: center; padding: 44px 20px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    color: var(--fg3);
}
.slot-empty .icon { margin: 0 auto 10px; display: block; }
.slot-empty p { margin-bottom: 16px; font-size: 0.9rem; }

/* ── Slot grid (booking dashboard) ── */
.slot-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 6px;
    overflow: hidden;
}

.slot-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg2);
}

.court-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 10px; }

/* Each court is its own tile: bordered, filled, ≥56px tall, with a real
   pressed state — so it reads as tappable with no hover (mobile). The tile
   colour carries the state (matches the legend), text stays dark for contrast. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.court-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 12px 8px;
    /* After a slot tap the page reloads with #s-<court>-<time>; leave room for
       the sticky nav (64px) + announcement bar (~34px) so the tapped slot and
       its time label aren't hidden under the header. */
    scroll-margin-top: calc(var(--nav-h) + 72px);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    background: var(--bg3);
    cursor: pointer;
    width: 100%;
    font-family: var(--font);
    appearance: none;
    -webkit-appearance: none;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.court-cell { text-decoration: none; color: inherit; } /* also used as an <a> when signed out */
.court-cell[aria-busy="true"] { opacity: .5; pointer-events: none; } /* fetch-swap in flight */
.court-cell .court-name { font-size: 0.7rem; font-weight: 600; color: var(--fg3); text-transform: uppercase; letter-spacing: 0.05em; }
.court-cell .court-action { font-size: 0.9rem; font-weight: 800; color: var(--fg); }

.court-cell.available { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.35); }
.court-cell.available:hover { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.55); }
.court-cell.available:active { transform: scale(0.97); background: rgba(34,197,94,0.28); }

.court-cell.in-cart { background: rgba(234,179,8,0.16); border-color: rgba(234,179,8,0.5); }
.court-cell.in-cart:hover { background: rgba(234,179,8,0.24); }
.court-cell.in-cart:active { transform: scale(0.97); }

.court-cell.booked { cursor: not-allowed; background: var(--red-dim); border-color: rgba(239,68,68,0.3); }
.court-cell.booked .court-action { color: var(--red); }

.court-cell.blocked { cursor: not-allowed; opacity: 0.5; }
.court-cell.blocked .court-action { color: var(--fg3); }

/* newest-day slot that hasn't reached its staggered open time yet */
.court-cell.notyet { cursor: not-allowed; opacity: 0.55; border-style: dashed; }
.court-cell.notyet .court-action { color: var(--fg3); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }

.court-cell:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ── Cart sidebar ── */
.booking-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    max-width: 960px;
    margin: 20px auto 48px;
    padding: 0 clamp(12px,4vw,32px);
}
/* Let the day-strip scroll inside its column instead of forcing the page wide
   on mobile — grid items default to min-width:auto and won't shrink otherwise. */
.booking-layout > * { min-width: 0; }

.cart-sidebar { position: sticky; top: calc(var(--nav-h) + 12px); align-self: start; }

.cart-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg3); border-bottom: 1px solid var(--border); font-size: 0.875rem; font-weight: 700; }
.cart-body { padding: 12px 16px; }
.cart-empty { text-align: center; color: var(--fg3); font-size: 0.825rem; padding: 24px 0; }

.cart-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.825rem; }
.cart-item:last-of-type { border-bottom: none; }
.cart-item-meta { font-size: 0.75rem; color: var(--fg2); margin-top: 2px; line-height: 1.5; }
.cart-remove { background: none; border: none; color: var(--red); font-size: 1.1rem; cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0; }

.cart-total { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-weight: 800; font-size: 0.875rem; }
.cart-checkout { display: block; text-align: center; padding: 12px; background: var(--lime); color: #0a0a0a; font-weight: 800; font-size: 0.875rem; border-top: 1px solid var(--border); transition: background var(--transition); }
.cart-checkout:hover { background: var(--lime-dk); }

/* Mobile: the cart sidebar drops below the grid, so a fixed bar tells people
   it's there and jumps them to it. Hidden on desktop (sidebar is visible). */
.cart-fab {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 195;
    align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px clamp(14px, 5vw, 24px);
    background: var(--lime); color: #0a0a0a;
    font-weight: 800; font-size: 0.85rem; text-decoration: none;
    box-shadow: var(--shadow-lg);
}
.cart-fab span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .cart-fab { display: flex; } }

/* ── My bookings ── */
.booking-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; }
.booking-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px; }
.booking-info h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.booking-meta { font-size: 0.825rem; color: var(--fg2); line-height: 1.7; }
.booking-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.refund-strip { padding: 8px 16px; background: var(--lime-dim2); border-top: 1px solid var(--border); font-size: 0.775rem; color: var(--fg2); }
.cancel-panel { padding: 16px; border-top: 1px solid var(--border); background: var(--bg3); }
.cancel-panel p { font-size: 0.825rem; color: var(--fg2); margin-bottom: 10px; }

/* ── PWA install banner ── */
#pwa-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    width: min(calc(100vw - 32px), 380px);
    display: none;
}

#pwa-banner .pwa-icon { font-size: 1.6rem; flex-shrink: 0; }
#pwa-banner .pwa-text strong { display: block; font-weight: 700; margin-bottom: 2px; }
#pwa-banner .pwa-text span { color: var(--fg2); font-size: 0.8rem; }
#pwa-banner .pwa-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Legal pages ── */
.legal-wrap { max-width: 740px; margin: 0 auto; padding: 56px clamp(16px,5vw,48px) 96px; }
.legal-wrap h1 { font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 900; margin-bottom: 6px; }
.legal-wrap .updated { color: var(--fg3); font-size: 0.825rem; margin-bottom: 40px; }
.legal-wrap h2 { font-size: 1rem; font-weight: 800; margin: 32px 0 10px; color: var(--lime); }
.legal-wrap p  { color: var(--fg2); font-size: 0.9rem; line-height: 1.8; margin-bottom: 12px; }
.legal-wrap ul { color: var(--fg2); font-size: 0.9rem; line-height: 1.8; padding-left: 18px; margin-bottom: 12px; }
.legal-wrap ul li { margin-bottom: 5px; }
.legal-wrap a { color: var(--lime); }

/* ── Admin sidebar layout ── */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); min-height: 100vh; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.sidebar-brand { padding: 18px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-brand .name { font-size: 1.05rem; font-weight: 900; }
.sidebar-brand .name span { color: var(--lime); }
.sidebar-brand .sub { font-size: 0.68rem; color: var(--fg3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 2px; }
/* Only the nav list scrolls — brand header and footer (Logout, Install) stay
   on screen without needing a scroll gesture to reach them, on any height. */
.sidebar-nav { flex: 1; min-height: 0; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.nav-section-label { padding: 12px 10px 5px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg3); }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; color: var(--fg2); text-decoration: none; transition: background var(--transition), color var(--transition); }
.nav-item:hover { background: var(--bg3); color: var(--fg); }
.nav-item.nav-active { background: var(--lime-dim); color: var(--lime); font-weight: 700; }
.nav-icon { font-size: 0.95rem; width: 18px; text-align: center; }
.sidebar-footer { padding: 10px 8px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: var(--bg3); border-radius: 8px; margin-bottom: 6px; }
.user-avatar { width: 30px; height: 30px; background: var(--lime-dim); border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; color: var(--lime); flex-shrink: 0; }
.user-name { font-size: 0.8rem; font-weight: 700; }
.user-role { font-size: 0.68rem; color: var(--fg3); }
.logout-link { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: var(--fg3); text-decoration: none; transition: color var(--transition), background var(--transition); }
.logout-link:hover { color: var(--red); background: var(--red-dim); }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-topbar h1 { font-size: 1.1rem; font-weight: 800; }
.admin-content { flex: 1; padding: 20px 22px; }
/* ponytail: same "form next to its list" shape as .booking-layout, own class
   since block_slots.php's ratio (1fr 1.4fr) differs — stacks on mobile below. */
.block-slots-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }

/* ── Filter bar ── */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input, .filter-bar select {
    padding: 8px 12px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--font);
    font-size: 1rem; /* ponytail: same iOS auto-zoom fix as .field above */
    outline: none;
    color-scheme: dark;
}
[data-theme="light"] .filter-bar input,
[data-theme="light"] .filter-bar select { color-scheme: light; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--lime); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .booking-layout { grid-template-columns: 1fr; padding-bottom: 88px; }  /* clear the fixed .cart-fab */
    .block-slots-layout { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2,1fr); }
    /* ponytail: admin sidebar becomes an off-canvas panel instead of vanishing —
       reuses the public nav's #hamburger/#nav-links toggle JS (picklo.js), no new script. */
    .sidebar { position: fixed; top: 0; left: 0; z-index: 200; transform: translateX(-101%); transition: transform var(--transition); box-shadow: 0 0 24px rgba(0,0,0,0.4); }
    .sidebar.open { transform: translateX(0); }
    .admin-topbar .nav-hamburger { display: flex; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg2); padding: 16px clamp(16px,5vw,48px); gap: 14px; border-bottom: 1px solid var(--border); z-index: 199; }
    .nav-hamburger { display: flex; }
    .court-grid { gap: 6px; padding: 8px; }
    .court-cell { padding: 10px 4px; min-height: 52px; }
    /* Tighten the 7 day chips so most of the week fits without an awkward
       half-clipped chip; the strip still swipes for the last day or two. */
    .day-nav { gap: 6px; }
    .day-chip { min-width: 48px; padding: 7px 8px; font-size: 0.78rem; }
    .day-chip small { font-size: 0.6rem; }
    .court-cell .court-action { font-size: 0.78rem; }
    .booking-main { flex-direction: column; }
    .booking-right { flex-direction: row; align-items: center; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
    .stat-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
}
