/* =========================================================================
   Milltown Prep Portal: shared styles for parent and admin pages
   ========================================================================= */

:root {
    --bg: #0b1320;
    --surface: #131e29;
    --surface-2: #1a2836;
    --surface-3: #22323f;
    --border: rgba(226, 232, 240, 0.12);
    --border-strong: rgba(226, 232, 240, 0.22);
    --accent: #cc7a00;
    --accent-hover: #a36200;
    --accent-soft: rgba(204, 122, 0, 0.15);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-lg: 18px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
}

a {
    color: var(--accent);
}

/* ---------- Header & tabs ---------- */

.portal-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    background: var(--accent);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-link {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.phone-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    padding: 0.4rem 0.95rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.phone-pill:hover {
    background: rgba(255, 255, 255, 0.08);
}

.phone-pill-edit {
    color: var(--accent);
    margin-left: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.tabs {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.25rem;
    border-top: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

/* Authoring `display: flex` above clobbers the HTML `hidden` attribute that
   admin.js toggles on the tab nav. Re-assert hidden so the login page shows
   nothing above the form. */
.tabs[hidden] {
    display: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ---------- Main content ---------- */

.tab-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.rollover-line {
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.4;
}

.rollover-line strong {
    color: var(--text);
    font-weight: 700;
}

.rollover-line #rollover-countdown {
    font-family: 'Outfit', sans-serif;
    color: var(--accent);
    font-weight: 800;
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    margin-left: 0.25rem;
}

@media (max-width: 600px) {
    .rollover-line {
        font-size: 0.92rem;
    }
    .rollover-line #rollover-countdown {
        font-size: 1.2rem;
    }
}

.week-header {
    margin-bottom: 1.5rem;
}

.week-header h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.85rem;
}

/* ---------- Week grid: class-cards layout ---------- */

.class-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.time-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.time-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--border-strong);
}

.time-section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-size: 1.05rem;
    color: var(--text);
}

.class-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.class-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.class-card-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.2;
}

.class-card-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.class-card-dot {
    opacity: 0.5;
}

.class-card-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.day-tile {
    flex: 1 1 130px;
    min-width: 110px;
    max-width: 180px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 0.6rem 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}


.day-tile.is-bookable {
    cursor: pointer;
}

/* Keyboard focus state always applies. */
.day-tile.is-bookable:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    outline: none;
    transform: translateY(-2px);
}

/* Hover state only on real-pointer devices. Without this gate, tapping a
   tile on a touchscreen leaves it stuck in the orange hover state until the
   user taps elsewhere - which looks like a phantom "booked" tile. */
@media (hover: hover) {
    .day-tile.is-bookable:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
        transform: translateY(-2px);
    }
}

.day-tile.is-past {
    opacity: 0.4;
    cursor: default;
}

/* Parent has at least one athlete booked into this slot. */
.day-tile.is-mine {
    background: var(--accent-soft);
    border-color: var(--accent);
    border-width: 2px;
    padding: calc(0.9rem - 1px) calc(0.6rem - 1px) calc(0.75rem - 1px);
}

.day-tile.is-mine .day-tile-label,
.day-tile.is-mine .day-tile-status {
    color: var(--accent);
}

.day-tile.is-mine .day-tile-status {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.day-tile.is-mine .day-tile-cta {
    color: var(--accent);
    font-weight: 700;
}

.day-tile.is-mine.is-bookable:focus-visible {
    background: rgba(204, 122, 0, 0.25);
    border-color: var(--accent);
}

@media (hover: hover) {
    .day-tile.is-mine.is-bookable:hover {
        background: rgba(204, 122, 0, 0.25);
        border-color: var(--accent);
    }
}

.day-tile.is-full {
    cursor: default;
    background: repeating-linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.08),
        rgba(239, 68, 68, 0.08) 8px,
        rgba(239, 68, 68, 0.14) 8px,
        rgba(239, 68, 68, 0.14) 16px
    );
    border-color: rgba(239, 68, 68, 0.35);
}

.day-tile.is-unavailable {
    background: transparent;
    border-style: dashed;
    opacity: 0.4;
    cursor: default;
}

.day-tile-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
}

.day-tile-date {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text);
    line-height: 1;
    margin: 0.1rem 0 0.3rem;
}

.day-tile-age {
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
    margin: 0 0 0.3rem;
}

.day-tile.is-past .day-tile-age,
.day-tile.is-unavailable .day-tile-age {
    color: var(--text-muted);
}

.day-tile-status {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    margin-top: 0.15rem;
}

.day-tile.is-full .day-tile-status {
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-tile.is-past .day-tile-status,
.day-tile.is-unavailable .day-tile-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.day-tile.is-full .day-tile-cta {
    color: var(--text-muted);
    font-weight: 600;
}

.day-tile-cta {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 0.35rem;
    font-weight: 600;
}

.day-tile.is-bookable .day-tile-cta {
    color: var(--accent);
    font-weight: 700;
}

/* ---------- My Schedule (grouped by date) ---------- */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.schedule-day-section {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.schedule-day-header {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--border-strong);
}

.schedule-day-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-size: 1.05rem;
    color: var(--text);
}

.schedule-day-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.schedule-day-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.schedule-day-rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.schedule-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.schedule-row-time {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent);
    min-width: 78px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.schedule-row-info {
    flex: 1;
    min-width: 0;
}

.schedule-row-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    color: var(--text);
}

.schedule-row-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.schedule-row-meta strong {
    color: var(--text);
    font-weight: 600;
}

.schedule-row-meta .dot {
    opacity: 0.5;
}

.schedule-row-status {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 0.25rem;
}

.btn-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.25rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-color: rgba(148, 163, 184, 0.4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.btn-cancel:hover {
    color: var(--text);
    text-decoration-color: var(--text);
}

/* ---------- My Athletes list ---------- */

.athletes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.athlete-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.athlete-row-name {
    font-weight: 600;
}

.athlete-row-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.athlete-row-remove:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* ---------- Buttons ---------- */

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s ease;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ---------- Modals ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 100;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow);
    position: relative;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.modal-card h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.modal-card p {
    margin-bottom: 1rem;
}

.close-btn {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.close-btn:hover {
    color: var(--text);
}

/* ---------- Inputs ---------- */

.text-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.text-input.is-error {
    border-color: var(--danger);
}

/* ---------- Search results ---------- */

/* "Added this session" chip list at the bottom of the add-athlete modal. */
.just-added-list {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.just-added-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.just-added-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.just-added-chip {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(204, 122, 0, 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    animation: chip-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.just-added-chip::before {
    content: '\2713'; /* check mark */
    font-weight: 800;
}

@keyframes chip-in {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* "Adding to (XXX) XXX-XXXX  ·  Wrong number?" strip inside the add-athlete modal. */
.add-athlete-phone-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid rgba(204, 122, 0, 0.35);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.phone-strip-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.phone-strip-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 700;
}

.phone-strip-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.phone-strip-change {
    background: none;
    border: 1px solid rgba(204, 122, 0, 0.45);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.phone-strip-change:hover {
    background: rgba(204, 122, 0, 0.2);
}

.search-results {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.search-results li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    font-size: 0.95rem;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.search-results li.empty {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.search-results li.empty:hover {
    background: transparent;
    color: var(--text-muted);
}

/* ---------- Manage-booking modal list ---------- */

.manage-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.manage-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid rgba(204, 122, 0, 0.35);
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
}

.manage-list-name {
    font-weight: 600;
    color: var(--text);
    min-width: 0;
}

.manage-list-name::before {
    content: '\2713';
    color: var(--accent);
    font-weight: 800;
    margin-right: 0.5rem;
}

/* ---------- Checkbox list (booking modal) ---------- */

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}

@media (hover: hover) {
    .checkbox-row:hover {
        background: var(--surface-3);
        border-color: var(--border-strong);
    }
}

.checkbox-row input {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-row.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.checkbox-row.is-disabled input {
    cursor: not-allowed;
}

.checkbox-row-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.checkbox-row-name {
    font-weight: 600;
}

.checkbox-row-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Friendly explanation shown in the booking modal when a parent has a child who
   cannot take an age-restricted class on the chosen day. */
.book-age-note {
    background: var(--accent-soft);
    border: 1px solid rgba(204, 122, 0, 0.35);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text);
}

/* ---------- Toasts ---------- */

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

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow);
    max-width: 360px;
    animation: toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    font-size: 0.9rem;
}

.toast.is-error {
    border-left-color: var(--danger);
}

.toast.is-success {
    border-left-color: var(--success);
}

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

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ---------- Loading skeleton ---------- */

.skeleton {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
    height: 240px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================================================
   Responsive (tablet -> mobile)
   ========================================================================= */

@media (max-width: 768px) {
    .portal-header-inner {
        padding: 0.85rem 1rem;
    }
    .brand-text {
        font-size: 0.85rem;
    }
    /* On mobile, header is: [Brand]  [Admin ─ ─ ─ Phone].
       Push Admin to the left of the actions group and Phone to the far right
       so they read as two matched rectangular buttons. */
    .header-actions {
        flex: 1;
        justify-content: space-between;
        margin-left: 0.75rem;
    }
    /* Pin both buttons to the same fixed height so the visual baseline matches
       no matter how their content (text vs text+sub-label) lays out. */
    .admin-link,
    .phone-pill {
        display: inline-flex;
        align-items: center;
        height: 36px;
        padding: 0 0.9rem;
        border-radius: 6px;
        font-size: 0.72rem;
        line-height: 1;
        letter-spacing: 0.4px;
    }
    /* Drop the "change" sub-label on mobile so the number has room to breathe.
       The button itself is still tappable and shows the change/sign-out prompt. */
    .phone-pill-edit {
        display: none;
    }
    .tabs {
        padding: 0 1rem;
    }
    .tab-content {
        padding: 1rem;
    }
    /* Time-of-day section headers compress on mobile. */
    .time-section { gap: 0.55rem; }
    .time-section-header { padding-bottom: 0.4rem; }
    .time-section-header h2 { font-size: 0.92rem; letter-spacing: 1px; }
    /* Class cards: tighter padding, smaller name + meta. */
    .class-card {
        padding: 0.85rem;
        gap: 0.7rem;
    }
    .class-card-name { font-size: 0.95rem; letter-spacing: 0.5px; }
    .class-card-meta { font-size: 0.76rem; gap: 0.3rem; }
    /* Day tiles render as a single horizontal row (like desktop), so the whole
       week is visible in one strip with vertical scrolling between classes. */
    .class-card-days {
        gap: 0.3rem;
        flex-wrap: nowrap;
    }
    .day-tile {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        padding: 0.55rem 0.25rem 0.45rem;
        gap: 0.12rem;
        border-radius: 8px;
    }
    .day-tile.is-mine {
        padding: calc(0.55rem - 1px) calc(0.25rem - 1px) calc(0.45rem - 1px);
    }
    .day-tile-label {
        font-size: 0.6rem;
        letter-spacing: 0.4px;
    }
    .day-tile-date {
        font-size: 1.05rem;
        margin: 0 0 0.1rem;
    }
    .day-tile-age {
        font-size: 0.66rem;
        letter-spacing: 0;
        white-space: nowrap;
        margin: 0 0 0.1rem;
    }
    .day-tile-status {
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.05;
    }
    .day-tile.is-mine .day-tile-status { font-size: 0.7rem; }
    .day-tile.is-full .day-tile-status { font-size: 0.7rem; }
    .day-tile.is-past .day-tile-status,
    .day-tile.is-unavailable .day-tile-status { font-size: 0.65rem; }
    /* CTA hint ("Tap to book", etc.) is verbose for the compact tiles; the
       click affordance is obvious from the orange status text. */
    .day-tile-cta { display: none; }
    .week-header h1 {
        font-size: 1.25rem;
    }
    .modal-card {
        padding: 1.5rem;
    }
    .schedule-row {
        gap: 0.65rem;
        padding: 0.75rem 0.85rem;
    }
    .schedule-row-time {
        min-width: 64px;
        font-size: 0.9rem;
    }
    .schedule-day-header {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .schedule-day-count {
        margin-left: 0;
    }
}

/* =========================================================================
   Admin-only styles
   ========================================================================= */

/* Admin tab panels: hidden until the user is signed in AND the tab is active.
   Without the .is-active requirement, every admin tab would render at once. */
.admin-only {
    display: none;
}

body.is-admin .admin-only.is-active {
    display: block;
}

/* Admin "This Week" / Archive: nested accordion (class > date > bookings). */

.admin-class-accordions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.admin-class-accordion {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-class-summary,
.admin-day-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.15s ease;
}

.admin-class-summary::-webkit-details-marker,
.admin-day-summary::-webkit-details-marker {
    display: none;
}

.admin-class-summary {
    padding: 1.25rem 1.5rem;
}

.admin-class-summary:hover {
    background: var(--surface-2);
}

.admin-class-summary-main {
    flex: 1;
    min-width: 0;
}

.admin-class-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 1.35rem;
    color: var(--text);
    line-height: 1.15;
}

.admin-class-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 0.3rem;
}

.admin-class-week-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    line-height: 1.15;
}

.admin-class-week-stats strong {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.accordion-chevron {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-muted);
    font-size: 1.4rem;
    transition: transform 0.18s ease;
    flex-shrink: 0;
    line-height: 1;
}

.accordion-chevron.is-disabled {
    visibility: hidden;
}

details[open] > .admin-class-summary .accordion-chevron,
details[open] > .admin-day-summary .accordion-chevron {
    transform: rotate(90deg);
}

.admin-class-body {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.admin-day-accordion {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.admin-day-accordion.is-empty {
    background: transparent;
    border-style: dashed;
    opacity: 0.55;
}

.admin-day-summary {
    padding: 0.7rem 0.95rem;
}

.admin-day-summary:hover {
    background: var(--surface-3);
}

.admin-day-accordion.is-empty .admin-day-summary {
    cursor: default;
}

.admin-day-accordion.is-empty .admin-day-summary:hover {
    background: transparent;
}

.admin-day-summary-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-day-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-size: 0.85rem;
    color: var(--accent);
}

.admin-day-date {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.admin-day-summary-stats-line {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
}

.admin-day-summary-stats-line.is-full {
    color: var(--danger);
}

.admin-day-body {
    border-top: 1px solid var(--border);
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
}

.admin-day-body-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--border);
}

.cap-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.cap-readonly {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.admin-day-stats {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.admin-day-stats.is-full {
    color: var(--danger);
}

.copy-phones-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.25rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: underline;
    text-decoration-color: rgba(148, 163, 184, 0.4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.copy-phones-btn::before {
    content: '\29C9'; /* two joined squares — quiet copy glyph */
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    display: inline-block;
}

.copy-phones-btn:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.admin-day-bookings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-day-bookings-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.2rem 0.45rem;
}

.admin-booking-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    padding: 0.3rem 0.45rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-booking-row.is-absent {
    opacity: 0.55;
    text-decoration: line-through;
}

.admin-booking-row.is-cancelled {
    opacity: 0.4;
    text-decoration: line-through;
}

.admin-booking-info {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.admin-booking-name {
    font-weight: 600;
    color: var(--text);
    line-height: 1.15;
}

.admin-booking-phone {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.admin-booking-row button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 0.18rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-booking-row button:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.admin-booking-row.is-absent button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-strong);
}

.admin-capacity-input {
    width: 50px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.2rem 0.4rem;
    color: var(--text);
    font-size: 0.78rem;
    text-align: center;
}

.admin-capacity-input:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-table {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--surface-2);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

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

.admin-table tr.is-inactive {
    opacity: 0.55;
}

.admin-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.admin-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    font-size: 0.78rem;
    cursor: pointer;
}

.admin-actions button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-actions button.is-danger {
    color: var(--danger);
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-toolbar h2,
.admin-toolbar-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.05rem;
    color: var(--text);
}

.admin-toolbar-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Reports tab ---------- */

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.summary-num {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--accent);
    line-height: 1;
}

.summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.report-section {
    margin-bottom: 2rem;
}

.report-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.report-section-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    color: var(--text);
}

.report-athlete-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.athlete-detail-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.athlete-detail-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-size: 1.1rem;
    color: var(--text);
}

.athlete-detail-summary {
    margin-bottom: 0;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.athlete-detail-section h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

/* Athlete picker (search + picked chip) on the Reports tab */
.athlete-picker {
    margin-bottom: 1rem;
}

.picked-athlete-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid rgba(204, 122, 0, 0.35);
    border-radius: 999px;
    padding: 0.55rem 0.9rem 0.55rem 1rem;
    flex-wrap: wrap;
}

.picked-athlete-chip .picked-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: var(--text-muted);
}

.picked-athlete-chip strong {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.3px;
    flex: 1;
    min-width: 0;
}

.picked-athlete-chip button {
    background: none;
    border: 1px solid rgba(204, 122, 0, 0.45);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.picked-athlete-chip button:hover {
    background: rgba(204, 122, 0, 0.2);
}


/* Status labels (admin tables): just colored text, no chip background.
   Reads like a hand-set word in the table rather than a templated pill. */
.status-pill {
    display: inline;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: 0;
    text-transform: none;
}

.status-pill.is-active {
    color: var(--accent);
}

.status-pill.is-inactive {
    color: var(--text-muted);
    font-style: italic;
}

/* Linked-phones reads as a quiet text link in the admin Roster tab. */
.phones-pill {
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-style: italic;
}

.phones-pill.is-clickable {
    cursor: pointer;
    color: var(--text);
    font-style: normal;
    text-decoration: underline;
    text-decoration-color: rgba(148, 163, 184, 0.4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.phones-pill.is-clickable:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* CSV bulk-add preview list */
.bulk-preview-list {
    list-style: none;
    margin: 0;
    padding: 0.75rem 1rem;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bulk-preview-list li {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.3;
}

.bulk-preview-list li::before {
    content: '+';
    color: var(--accent);
    font-weight: 800;
    margin-right: 0.5rem;
}

.bulk-preview-list .bulk-preview-more {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border);
}

.bulk-preview-list .bulk-preview-more::before {
    content: '';
    margin-right: 0;
}

/* Phones-list modal */
.phones-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.phones-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.92rem;
}

.phones-list li.empty {
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.phones-list .unlink-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.phones-list .unlink-btn:hover {
    background: rgba(239, 68, 68, 0.18);
}
