/* ============================================================
   Making Tracks Booking System - Design System
   Self-contained CSS — no Tailwind dependency
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --bg: #ffffff;
    --fg: #1a1a1a;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --accent-dark: #1d4ed8;
    --border: #e5e7eb;
    --section-bg: #f9fafb;
    --success: #059669;
    --success-light: #d1fae5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --danger: #dc2626;
    --muted: #6b7280;
    --fade-speed: 1.2s;
    --toast-duration: 4s;
}

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

/* ---- Body ---- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.6;
    font-size: 14px;
}

/* ---- Navigation ---- */
.nav {
    background: var(--bg);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mini-map, .detail-map {
    z-index: 0;
    isolation: isolate;
}

/* Landing page nav */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}
.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.landing-logo img {
    height: 72px;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.nav-bar {
    display: flex;
    align-items: center;
    min-height: 48px;
    gap: 8px;
}

.nav-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    flex-shrink: 0;
}
.nav-brand-icon { font-size: 18px; }
.nav-brand-text { white-space: nowrap; }

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-link svg, .nav-link .icon { display: none; }
.nav-link-label { }

.nav-link:hover {
    color: var(--fg);
    background: var(--section-bg);
}

.nav-link.active {
    color: #fff;
    background: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-user {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* Hamburger toggle button (hidden on desktop) */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--fg);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Mobile nav menu */
.nav-mobile-menu {
    display: none;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}
.nav-mobile-menu .nav-link {
    padding: 10px 16px;
    display: flex;
    width: 100%;
    color: var(--muted);
}

/* ---- Utilities ---- */
.hidden { display: none !important; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---- Page Layout ---- */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* Hub grid (Admin/System dashboards) */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.hub-grid .compact-card {
    text-decoration: none;
    color: var(--fg);
}

.compact-card-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 2px;
}

.page-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
}

/* ---- Step Containers ---- */
.step-container {
    transition: opacity var(--fade-speed) ease, filter var(--fade-speed) ease;
    opacity: 1;
    filter: none;
}

.step-container.greyed {
    opacity: 0.3;
    filter: grayscale(0.6);
    pointer-events: none;
}

.step-container.pending {
    opacity: 0.15;
    filter: grayscale(1);
    pointer-events: none;
}

.step-container.revealing {
    animation: revealFade 1.8s ease forwards;
}

/* ---- Step Labels ---- */
.step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 10px;
}

.step-num {
    background: var(--accent);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background var(--fade-speed) ease;
}

.step-num.done {
    background: var(--success);
}

.step-num.waiting {
    background: #d1d5db;
}

.step-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg);
}

.step-spacer {
    flex: 1;
}

/* ---- Choice Bars ---- */
.choice-bar {
    border-radius: 4px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 38px;
    transition: background var(--fade-speed) ease,
                border-color var(--fade-speed) ease,
                color var(--fade-speed) ease,
                opacity var(--fade-speed) ease;
}

.choice-bar.empty {
    background: var(--section-bg);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 400;
    font-style: italic;
    opacity: 0.5;
}

.choice-bar.confirmed {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    color: #065f46;
    font-weight: 600;
    font-style: normal;
    opacity: 1;
}

.choice-bar .check {
    font-size: 15px;
    transition: opacity var(--fade-speed) ease;
}

.choice-bar.empty .check {
    opacity: 0;
}

.choice-bar.confirmed .check {
    opacity: 1;
    color: var(--success);
}

/* ---- Event Grid ---- */
.event-grid {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.event-card {
    background: #fff;
    padding: 12px 16px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.event-card:hover {
    background: var(--accent-light);
}

.event-card.selected {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.event-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.event-card.disabled:hover {
    background: #fff;
}

.ev-title {
    font-size: 15px;
    font-weight: 600;
}

.ev-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.ev-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.ev-badge.open {
    background: var(--success-light);
    color: #065f46;
}

.ev-badge.closed {
    background: #fee2e2;
    color: #991b1b;
}

/* ---- Event Detail ---- */
.event-detail {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: var(--section-bg);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height var(--fade-speed) ease, opacity var(--fade-speed) ease, padding var(--fade-speed) ease;
    padding: 0 16px;
}

.event-detail.open {
    max-height: 600px;
    opacity: 1;
    padding: 16px;
}

.detail-desc {
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 3px 12px;
    font-size: 13px;
}

.detail-grid dt {
    color: var(--muted);
    font-weight: 500;
}

.detail-grid dd {
    color: var(--fg);
    font-weight: 500;
}

.btn-select-event {
    margin-top: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-select-event:hover {
    background: var(--accent-dark);
}

/* ---- Mini Calendar Strip ---- */
.mini-cal-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: center;
}

.mini-cal {
    flex: 0 0 auto;
}

.mini-cal-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: center;
    margin-bottom: 4px;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    font-size: 9px;
    line-height: 1;
}

.mini-cal-hdr {
    text-align: center;
    font-weight: 600;
    color: var(--muted);
    padding: 2px 0;
    font-size: 8px;
    text-transform: uppercase;
}

.mini-cal-day {
    text-align: center;
    padding: 3px 2px;
    border-radius: 2px;
    color: #d1d5db;
    font-size: 10px;
}

.mini-cal-day.in-month {
    color: #9ca3af;
}

.mini-cal-day.event-day {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-cal-day.selected-day {
    background: var(--success);
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

/* ---- Date List ---- */
.date-list-wrap {
    position: relative;
}
.date-list-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}
.date-list-controls select {
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--fg);
}
.date-list {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.date-list.scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
}
.date-list.scrollable::-webkit-scrollbar {
    width: 6px;
}
.date-list.scrollable::-webkit-scrollbar-track {
    background: var(--section-bg);
}
.date-list.scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.date-row {
    background: #fff;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.date-row:hover {
    background: var(--accent-light);
}

.date-row.selected {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.date-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.date-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
}

.date-total {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.date-total.has-slots {
    background: var(--success-light);
    color: #065f46;
}

.date-total.few-slots {
    background: #fef3c7;
    color: #92400e;
}

.date-total.no-slots {
    background: #fee2e2;
    color: #991b1b;
}

.date-sessions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.date-session-chip {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--section-bg);
    border: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-session-chip .chip-slots {
    font-weight: 700;
}

.chip-slots.ok {
    color: var(--success);
}

.chip-slots.low {
    color: var(--warning);
}

.chip-slots.full {
    color: var(--danger);
}

/* ---- Session List ---- */
.session-list {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.session-row {
    background: #fff;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.session-row:hover {
    background: var(--accent-light);
}

.session-row.selected {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.session-row.full {
    cursor: pointer;
}

.session-row.full .sess-avail {
    font-style: italic;
}

.sess-name {
    font-size: 14px;
    font-weight: 600;
}

.sess-time {
    font-size: 12px;
    color: var(--muted);
    margin-left: 8px;
}

.sess-avail {
    font-size: 12px;
    font-weight: 600;
}

.sess-avail.ok {
    color: var(--success);
}

.sess-avail.low {
    color: var(--warning);
}

.sess-avail.full {
    color: var(--danger);
}

/* ---- Review ---- */
.review-box {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.review-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.review-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}

.review-table td:first-child {
    color: var(--muted);
    width: 100px;
    font-weight: 500;
}

.review-table td:last-child {
    font-weight: 600;
}

.review-table tr:last-child td {
    border-bottom: none;
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.terms-row input {
    margin-top: 3px;
}

/* ---- Buttons ---- */
.btn-confirm {
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 14px;
}

.btn-confirm:hover {
    background: var(--accent-dark);
}

.btn-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: var(--section-bg);
    border-color: #d1d5db;
}

.btn-secondary.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---- Success Banner ---- */
.success-banner {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    border-radius: 6px;
    padding: 24px;
    text-align: center;
}

.success-icon {
    width: 48px;
    height: 48px;
    background: var(--success);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.success-icon svg {
    width: 24px;
    height: 24px;
}

.success-title {
    font-size: 18px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 4px;
}

.success-text {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
}

.success-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.success-links a {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s;
}

.link-primary {
    background: var(--accent);
    color: #fff;
}

.link-primary:hover {
    background: var(--accent-dark);
}

.link-secondary {
    background: #fff;
    color: var(--fg);
    border: 1px solid var(--border);
}

.link-secondary:hover {
    background: var(--section-bg);
}

/* ---- Pending Message ---- */
.pending-msg {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

/* ---- Dividers ---- */
.step-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0 0;
}

/* ---- Footer ---- */
.footer {
    background: var(--bg);
    color: var(--muted);
    text-align: center;
    padding: 24px 16px;
    font-size: 11px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Animations & Keyframes
   ============================================================ */

@keyframes revealFade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* General reveal class (Rule 3: first-time content slide-up fade) */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1.8s ease, transform 1.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Utility fade-in */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Smooth page transitions */
#app-content {
    animation: fadeIn 0.2s ease;
}

/* ============================================================
   Calendar Grid (Admin Slots Page)
   ============================================================ */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-header-cell {
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-cell {
    background-color: #fff;
    min-height: 5rem;
    padding: 0.25rem;
    font-size: 0.75rem;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.calendar-cell:hover {
    background-color: var(--accent-light);
}

.calendar-cell.today {
    background-color: var(--accent-light);
}

.calendar-cell.other-month {
    background-color: var(--section-bg);
    color: #94a3b8;
}

.calendar-cell .date-number {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.calendar-cell .event-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--accent);
    margin: 0.0625rem;
}

.calendar-cell .event-label {
    display: block;
    padding: 0.0625rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    line-height: 1.2;
    margin-bottom: 0.0625rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--accent-light);
    color: var(--accent);
}

/* ============================================================
   Modal (Rule 5: backdrop opacity 0->0.5, panel scale+slide)
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: background-color 0.2s ease;
    padding: 1rem;
}

.modal-backdrop.active {
    background-color: rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
}

.modal-panel {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(8px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-backdrop.active .modal-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-panel-lg {
    max-width: 48rem;
}

.modal-panel-xl {
    max-width: 64rem;
}

/* Scrollbar for modals */
.modal-panel::-webkit-scrollbar {
    width: 6px;
}

.modal-panel::-webkit-scrollbar-track {
    background: transparent;
}

.modal-panel::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close-btn {
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.modal-close-btn:hover {
    color: #4b5563;
}

.modal-body {
    padding: 1rem 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
}

/* ============================================================
   Toast Notifications (Rule 6: slide in from right)
   ============================================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 24rem;
    width: calc(100% - 2rem);
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    animation: toast-in 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast-success {
    background-color: var(--success);
}

.toast-error {
    background-color: var(--danger);
}

.toast-info {
    background-color: var(--accent);
}

.toast-warning {
    background-color: var(--warning);
    color: #1e293b;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    margin-top: 0.0625rem;
}

.toast-message {
    flex: 1;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.7;
    transition: opacity 0.15s ease;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.4);
    animation: toast-progress var(--toast-duration) linear forwards;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
        max-height: 8rem;
        margin-bottom: 0;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
        max-height: 0;
        margin-bottom: -0.5rem;
    }
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================================
   Loading Spinner
   ============================================================ */

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

.spinner-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
    gap: 1rem;
}

.loading-overlay .loading-text {
    color: #475569;
    font-size: 0.875rem;
}

/* ============================================================
   Badge (semantic colour variants)
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-green {
    background: var(--success-light);
    color: #065f46;
}

.badge-amber {
    background: #fef3c7;
    color: #92400e;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.badge-grey {
    background: var(--section-bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* ============================================================
   Compact Card (My Bookings list items)
   ============================================================ */

.compact-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    transition: background 0.15s;
}

.compact-card:hover {
    background: var(--section-bg);
}

.compact-card + .compact-card {
    margin-top: 8px;
}

/* ============================================================
   Admin Tables (compact, no shadows, blue header)
   ============================================================ */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.admin-table thead th {
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--section-bg);
}

/* ============================================================
   Form Elements (compact inputs, labels, selects)
   ============================================================ */

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--fg);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
}

.form-group {
    margin-bottom: 12px;
}

/* ---- Find Me a Slot ---- */
.slot-finder-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    margin-bottom: 16px;
}
.slot-finder-btn:hover {
    background: var(--accent);
    color: #fff;
}

.slot-finder-panel {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: opacity var(--fade-speed) ease, max-height var(--fade-speed) ease;
}

.slot-finder-header {
    background: var(--section-bg);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.slot-finder-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}
.slot-finder-toggle input { margin: 0; }

.slot-finder-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.slot-finder-list::-webkit-scrollbar { width: 6px; }
.slot-finder-list::-webkit-scrollbar-track { background: var(--section-bg); }
.slot-finder-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.slot-finder-row {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}
.slot-finder-row:last-child { border-bottom: none; }
.slot-finder-row:hover { background: var(--accent-light); }
.slot-finder-row.waitlist-row { opacity: 0.7; }
.slot-finder-row.waitlist-row:hover { opacity: 1; background: #fef3c7; }

.slot-finder-event { font-size: 12px; color: var(--muted); }
.slot-finder-date { font-size: 14px; font-weight: 600; }
.slot-finder-session { font-size: 12px; color: var(--muted); }
.slot-finder-avail { font-size: 12px; font-weight: 600; }
.slot-finder-avail.ok { color: var(--success); }
.slot-finder-avail.low { color: var(--warning); }
.slot-finder-avail.full { color: var(--danger); font-style: italic; }

.slot-finder-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* Medium breakpoint: 768px */
@media (max-width: 767px) {
    /* Hamburger visible, desktop links hidden */
    .nav-hamburger {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .nav-mobile-menu.open {
        display: flex;
    }

    .nav-user {
        display: none;
    }

    /* Mini calendar stacks to single column */
    .mini-cal-strip {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* Admin tables scroll horizontally */
    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 600px;
    }
}

@media (min-width: 768px) {
    /* Desktop: mobile menu stays hidden, desktop nav-links are visible */
    .nav-mobile-menu {
        display: none !important;
    }

    .nav-hamburger {
        display: none;
    }
}

/* Small breakpoint: 640px */
@media (max-width: 639px) {
    .page {
        padding: 16px 12px 40px;
    }

    h1 {
        font-size: 20px;
    }

    /* Event cards stack content */
    .event-card {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Date rows: stack header elements */
    .date-row-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Session rows: stack vertically */
    .session-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Review table: labels on top */
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    /* Choice bars wrap text */
    .choice-bar {
        flex-wrap: wrap;
    }

    /* Success links stack */
    .success-links {
        flex-direction: column;
        align-items: center;
    }

    .page {
        padding: 16px 8px 40px;
    }

    /* All sections use full width on mobile */
    section[style*="padding"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* How It Works: stack to single column */
    .how-it-works-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Register form: stack name fields */
    .reg-name-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hero section: stack text + GWR logo */
    .hero-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .hero-section {
        padding: 16px 8px !important;
    }

    .hero-title {
        font-size: 14px !important;
    }

    .hero-title span {
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    .hero-inner p {
        font-size: 12px !important;
    }

    /* Hide GWR logo on narrow screens */
    .gwr-badge {
        display: none !important;
    }

    /* Landing nav: logo on top, links below */
    .landing-nav {
        flex-direction: column !important;
        padding: 6px 10px !important;
        gap: 4px;
    }
    .landing-logo img {
        height: 52px !important;
    }
    .landing-nav-links {
        gap: 2px !important;
        flex-wrap: wrap;
        justify-content: center;
    }
    .landing-nav-links .btn-primary {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }

    /* App nav: tighter on mobile */
    .nav-inner {
        padding: 0 8px !important;
    }
    .nav-actions img {
        height: 40px !important;
    }

    /* Event cards: stack map below text */
    .event-card[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Maps: full width on mobile */
    .mini-map {
        width: 100% !important;
        height: 120px !important;
    }

    .detail-map {
        width: 100% !important;
        height: 180px !important;
    }

    /* Social links: single column */
    .social-links-grid {
        grid-template-columns: 1fr !important;
    }

    /* YouTube scroll: smaller cards */
    .yt-card {
        flex: 0 0 260px !important;
    }

    .yt-card .yt-thumb {
        width: 260px !important;
        height: 146px !important;
    }

    /* CTA banner: stack */
    .cta-inner {
        flex-direction: column !important;
        text-align: center;
    }

    /* Sponsor footer: stack on mobile */
    .sponsor-row {
        flex-direction: column !important;
        text-align: center;
    }

    /* Presentation steps: single column */
    .pres-steps {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Modal: full width on mobile */
    .modal-panel {
        max-width: calc(100vw - 24px) !important;
        margin: 12px;
    }
}

/* Mobile: let header scroll away to maximise viewing area */
@media (max-width: 767px) {
    .nav, .landing-nav {
        position: static !important;
    }
}
