/* ═══════════════════════════════════════════════════════════════
   PUBLIC FACING — Professional UI System
   Aesthetic: Terracotta × Warm Beige
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
    color-scheme: light;
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;

    /* Content palette — warm beige */
    --bg: #EDE8D0;
    --surface: #f7f4e8;
    --surface-raised: #f2eed9;
    --surface-strong: #eae5cc;
    --border-subtle: #ddd8be;
    --border: #cac4a8;
    --border-strong: #cac4a8;

    /* Brand */
    --primary: #7A2E23;
    --brand-accent: #b85a4a;
    --brand-gradient: linear-gradient(135deg, #7A2E23 0%, #9e3d2e 55%, #b85a4a 100%);
    --brand-glow: rgba(122, 46, 35, 0.20);

    /* Text */
    --text: #1a1916;
    --text-primary: #1a1916;
    --text-secondary: #6b6560;
    --muted: #9c9690;
    --text-inverse: #ffffff;

    /* Status */
    --success: #14532d;
    --warning: #78350f;
    --danger: #881337;
    --slate: #475569;
    --status-success-bg: #f0fdf4;
    --status-success-text: #14532d;
    --status-success-border: #bbf7d0;
    --status-error-bg: #fff1f2;
    --status-error-text: #881337;
    --status-error-border: #fecdd3;
    --status-warning-bg: #fffbeb;
    --status-warning-text: #78350f;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26, 25, 22, 0.06), 0 1px 2px rgba(26, 25, 22, 0.04);
    --shadow: 0 4px 16px rgba(26, 25, 22, 0.08), 0 2px 6px rgba(26, 25, 22, 0.05);
    --shadow-md: 0 4px 16px rgba(26, 25, 22, 0.08), 0 2px 6px rgba(26, 25, 22, 0.05);
    --shadow-lg: 0 12px 40px rgba(26, 25, 22, 0.10), 0 4px 12px rgba(26, 25, 22, 0.06);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 380ms;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;
}

/* Dark mode */
:root.dark {
    color-scheme: dark;
    --bg: #1a1208;
    --surface: #241a0d;
    --surface-raised: #2a1f10;
    --surface-strong: #302415;
    --border-subtle: #3a2d18;
    --border: #4a3a22;
    --border-strong: #4a3a22;
    --text: #ede8d0;
    --text-primary: #ede8d0;
    --text-secondary: #a89880;
    --muted: #7a6a55;
    --primary: #e8a598;
    --success: #86efac;
    --warning: #facc15;
    --danger: #fca5a5;
    --slate: #7a6a55;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.24), 0 1px 2px rgba(0, 0, 0, 0.16);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.18);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.40), 0 4px 12px rgba(0, 0, 0, 0.22);
    --status-success-bg: rgba(34, 197, 94, 0.10);
    --status-success-text: #86efac;
    --status-success-border: rgba(34, 197, 94, 0.20);
    --status-error-bg: rgba(239, 68, 68, 0.10);
    --status-error-text: #fca5a5;
    --status-error-border: rgba(239, 68, 68, 0.20);
    --status-warning-bg: rgba(250, 204, 21, 0.10);
    --status-warning-text: #facc15;
}

/* ── Base Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Site Header & Footer ──────────────────────────────────────── */
.site-header,
.site-footer {
    align-items: center;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 16px clamp(16px, 4vw, 48px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-footer {
    border-bottom: 0;
    border-top: 1px solid var(--border-subtle);
    color: var(--muted);
    flex-wrap: wrap;
    font-size: 13px;
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface-raised);
}

.brand,
.admin-brand {
    color: var(--primary);
    font-weight: 750;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.site-nav,
.admin-nav {
    display: flex;
    gap: 4px;
}

.site-nav a,
.admin-nav a {
    align-items: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    min-height: 38px;
    padding: 9px 12px;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.site-nav a.active,
.site-nav a:hover,
.admin-nav a.active,
.admin-nav a:hover {
    background: var(--surface-strong);
    color: var(--text-primary);
}

.site-nav a.active {
    background: var(--brand-glow);
    color: var(--primary);
    font-weight: 600;
}

/* ── Page Shell ───────────────────────────────────────────────── */
.page-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 32px clamp(16px, 4vw, 48px);
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
    align-items: center;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--primary) 14%, var(--surface)) 0%,
            color-mix(in srgb, var(--primary) 5%, var(--surface)) 60%,
            var(--surface) 100%
        );
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    min-height: 520px;
    overflow: hidden;
    padding: 48px;
    position: relative;
}

.hero::after {
    background:
        radial-gradient(circle 160px at 90% 50%, color-mix(in srgb, var(--brand-accent) 14%, transparent), transparent),
        radial-gradient(circle 80px at 80% 20%, color-mix(in srgb, var(--primary) 20%, transparent), transparent);
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1;
    margin: 8px 0 18px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.6;
    max-width: 680px;
}

.eyebrow {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.10em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

/* ── Actions & Buttons ────────────────────────────────────────── */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.button,
button {
    align-items: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    gap: 6px;
    justify-content: center;
    line-height: 1;
    min-height: 42px;
    padding: 10px 18px;
    text-decoration: none;
    transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.button-primary {
    background: var(--brand-gradient);
    box-shadow: 0 2px 8px var(--brand-glow), 0 1px 2px rgba(0,0,0,0.10);
    color: #ffffff;
    letter-spacing: -0.01em;
}

.button-primary:hover {
    box-shadow: 0 4px 18px var(--brand-glow), 0 2px 6px rgba(0,0,0,0.12);
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.button-primary:active {
    filter: brightness(0.96);
    transform: translateY(0);
}

.button-muted {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.button-muted:hover {
    background: var(--border-subtle);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.icon-button {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    min-height: 36px;
    padding: 0;
    transition: all var(--duration-fast) ease;
    width: 36px;
}

.icon-button:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── Panels & Cards ───────────────────────────────────────────── */
.panel,
.card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.panel::before,
.card::before {
    background: var(--brand-gradient);
    content: '';
    height: 2px;
    left: 0;
    opacity: 0.6;
    position: absolute;
    right: 0;
    top: 0;
}

/* ── Grid ─────────────────────────────────────────────────────── */
.grid {
    display: grid;
    gap: 16px;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── Schedule Table ───────────────────────────────────────────── */
.table-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.schedule-table {
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 760px;
    width: 100%;
}

.schedule-table th {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.07em;
    padding: 11px 16px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.schedule-table td {
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 13px 16px;
    vertical-align: middle;
    white-space: nowrap;
}

.schedule-table tbody tr:last-child td {
    border-bottom: none;
}

.schedule-table tbody tr {
    transition: background var(--duration-fast) ease;
}

.schedule-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 4%, transparent);
}

/* ── Status Badges ────────────────────────────────────────────── */
.status {
    border-radius: var(--radius-full);
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    text-transform: uppercase;
}

.status-available {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border: 1px solid var(--status-success-border);
}

.status-booked {
    background: var(--status-error-bg);
    color: var(--status-error-text);
    border: 1px solid var(--status-error-border);
}

.status-blocked,
.status-closed {
    background: rgba(156, 150, 144, 0.12);
    color: var(--muted);
}

.status-free {
    background: rgba(122, 46, 35, 0.10);
    color: var(--primary);
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    color: var(--text-secondary);
    display: grid;
    font-size: 12.5px;
    font-weight: 600;
    gap: 6px;
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    min-height: 42px;
    padding: 9px 12px;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    width: 100%;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
    outline: none;
}

input::placeholder {
    color: var(--muted);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239c9690' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    padding-right: 36px;
}

/* ── Notices ──────────────────────────────────────────────────── */
.notice {
    background: var(--status-success-bg);
    border: 1px solid var(--status-success-border);
    border-radius: var(--radius-md);
    color: var(--status-success-text);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    margin: 14px 0;
    padding: 12px 16px;
}

/* ── Quote Box ────────────────────────────────────────────────── */
.quote-box {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: grid;
    gap: 8px;
    padding: 16px 20px;
    transition: border-color var(--duration-base) ease, background var(--duration-base) ease;
}

.quote-box strong {
    color: var(--text-primary);
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.quote-box span {
    color: var(--text-secondary);
    font-size: 13px;
}

.quote-box ul {
    border-top: 1px solid var(--border-subtle);
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 4px 0 0;
    padding: 12px 0 0;
}

.quote-box li {
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    font-size: 13px;
    justify-content: space-between;
    padding-top: 6px;
}

.quote-box li strong {
    display: inline;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.quote-ok {
    background: var(--status-success-bg);
    border-color: var(--status-success-border);
}

.quote-ok strong { color: var(--status-success-text); }

.quote-bad {
    background: var(--status-error-bg);
    border-color: var(--status-error-border);
}

.quote-bad strong { color: var(--status-error-text); }

.quote-wait {
    background: var(--status-warning-bg);
    border-color: color-mix(in srgb, var(--status-warning-text) 20%, transparent);
}

/* ── Autocomplete ─────────────────────────────────────────────── */
.autocomplete-field {
    position: relative;
}

.suggestion-list {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    left: 0;
    max-height: 260px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
}

.suggestion-list button {
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    color: var(--text-primary);
    cursor: pointer;
    display: block;
    font-size: 13.5px;
    font-weight: 400;
    padding: 11px 14px;
    text-align: left;
    transition: background var(--duration-fast) ease;
    width: 100%;
}

.suggestion-list button:last-child {
    border-bottom: none;
}

.suggestion-list button:hover {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.suggestion-list strong {
    color: var(--text-primary);
    display: block;
    font-weight: 650;
}

.suggestion-list span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

/* ── Calendar ─────────────────────────────────────────────────── */
.calendar-toolbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 18px 0;
}

.calendar-toolbar div {
    display: grid;
    gap: 2px;
    text-align: center;
}

.calendar-toolbar strong {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.calendar-toolbar span {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
}

.calendar-panel {
    padding: 0;
}

.calendar-panel::before {
    display: none;
}

.calendar-legend {
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
}

.calendar-legend span {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    gap: 7px;
}

.legend-dot {
    border-radius: var(--radius-full);
    display: inline-block;
    height: 10px;
    width: 10px;
}

.legend-open {
    background: var(--success);
}

.legend-full {
    background: var(--danger);
}

.legend-closed {
    background: var(--slate);
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.07em;
    padding: 12px;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1.08;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    display: grid;
    gap: 6px;
    grid-template-rows: auto auto 1fr;
    min-height: 112px;
    padding: 12px;
    position: relative;
    transition: background var(--duration-base) ease, transform var(--duration-base) ease, border-color var(--duration-base) ease;
}

.calendar-day:hover {
    background: var(--surface-strong);
    transform: translateY(-1px);
}

.calendar-empty {
    background: var(--surface-raised);
    opacity: 0.55;
}

.calendar-number {
    align-items: center;
    background: var(--surface-strong);
    border-radius: var(--radius-full);
    display: inline-flex;
    font-weight: 700;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.calendar-marker {
    align-self: end;
    border-radius: var(--radius-full);
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.calendar-subtext {
    color: var(--muted);
    font-size: 12px;
}

.calendar-day.is-full {
    background: var(--status-error-bg);
}

.calendar-day.is-full .calendar-number {
    background: rgba(220, 38, 38, 0.16);
    color: var(--danger);
}

.calendar-day.is-full .calendar-marker {
    color: var(--danger);
}

.calendar-day.is-closed {
    background: rgba(156, 150, 144, 0.10);
}

.calendar-day.is-closed .calendar-marker,
.calendar-day.is-closed .calendar-number {
    color: var(--slate);
}

.calendar-day.is-selected {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-day.is-today .calendar-number {
    background: var(--brand-gradient);
    color: #ffffff;
}

/* ── Utility ───────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 20px 0;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { height: 6px; width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Page transition ───────────────────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-shell > * {
    animation: fade-up var(--duration-slow) var(--ease-out) both;
}

.page-shell > *:nth-child(1) { animation-delay: 0ms; }
.page-shell > *:nth-child(2) { animation-delay: 50ms; }
.page-shell > *:nth-child(3) { animation-delay: 90ms; }
.page-shell > *:nth-child(4) { animation-delay: 120ms; }
.page-shell > *:nth-child(5) { animation-delay: 150ms; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 820px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        flex-wrap: wrap;
    }

    .hero,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 24px;
        min-height: auto;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .month-calendar {
        min-width: 760px;
    }

    .calendar-panel {
        overflow-x: auto;
    }

    .page-shell {
        padding: 16px;
    }
}

@media (max-width: 1100px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .panel,
    .card {
        padding: 18px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   SCROLL FIXES — Mobile Horizontal Scroll
   ═══════════════════════════════════════════════════════════════ */

/* Fix table-wrap to allow horizontal scroll */
.table-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow-x: auto !important; /* Changed from hidden to auto */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    max-width: 100%;
}

/* Ensure tables have minimum width to trigger scroll */
.schedule-table,
table {
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 760px; /* Force horizontal scroll on mobile */
    width: 100%;
}

/* Allow horizontal scroll in panels and cards */
.panel,
.card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 0; /* Allow shrinking */
    overflow-x: auto; /* Changed from hidden to auto */
    overflow-y: visible;
    padding: 28px;
    position: relative;
}

/* Allow page shell to scroll horizontally if needed */
.page-shell {
    margin: 0 auto;
    max-width: 1180px;
    min-width: 0; /* Allow shrinking */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 32px clamp(16px, 4vw, 48px);
}

/* Prevent body from horizontal scroll, let containers handle it */
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 100vw;
    overflow-x: hidden; /* Changed from visible to hidden */
}

/* Ensure images and media don't overflow */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Fix for pre and code blocks */
pre,
code {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ensure form inputs don't overflow */
input,
select,
textarea {
    max-width: 100%;
}

/* Grid items should be scrollable if needed */
.grid {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
}

/* Quick actions grid */
.quick-actions {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-width: 0;
}

/* Calendar panel specific scroll */
.calendar-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-width: 760px; /* Force horizontal scroll on mobile */
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 820px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        flex-wrap: wrap;
    }

    .hero,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 24px;
        min-height: auto;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .month-calendar {
        min-width: 760px;
    }

    .calendar-panel {
        overflow-x: auto;
    }

    .page-shell {
        padding: 16px;
    }

    /* Ensure table wrapper scrolls on mobile */
    .table-wrap {
        margin: 0 -16px;
        padding: 0;
        width: calc(100% + 32px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* Add some padding back to the table cells */
    .table-wrap .schedule-table th:first-child,
    .table-wrap .schedule-table td:first-child {
        padding-left: 16px;
    }
    
    .table-wrap .schedule-table th:last-child,
    .table-wrap .schedule-table td:last-child {
        padding-right: 16px;
    }
    
    /* Panels and cards should allow full-width scrolling on mobile */
    .panel,
    .card {
        padding: 16px;
        overflow-x: auto;
    }
}

@media (max-width: 1100px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .panel,
    .card {
        padding: 18px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .table-wrap {
        margin: 0 -12px;
        width: calc(100% + 24px);
    }
    
    .table-wrap .schedule-table th:first-child,
    .table-wrap .schedule-table td:first-child {
        padding-left: 12px;
    }
    
    .table-wrap .schedule-table th:last-child,
    .table-wrap .schedule-table td:last-child {
        padding-right: 12px;
    }
}

/* ── Print Styles ───────────────────────────────────────────────── */
@media print {
    .table-wrap {
        overflow-x: visible !important;
    }
    
    .schedule-table,
    table {
        min-width: auto;
    }
    
    .month-calendar {
        min-width: auto;
    }
}



/* open play css */

.unlimited-play-banner {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unlimited-event {
    background: linear-gradient(135deg, var(--surface-raised) 0%, var(--surface-card) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.unlimited-icon {
    font-size: 32px;
}

.unlimited-info {
    flex: 1;
}

.unlimited-info strong {
    display: block;
    color: var(--primary);
    font-size: 16px;
}

.unlimited-info span {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 15px;
}

.unlimited-price {
    color: var(--primary) !important;
    font-weight: 600;
}

.unlimited-book-btn {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 16px;
}

.unlimited-summary {
    background: var(--surface-raised);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.unlimited-summary p {
    margin: 8px 0;
}

@media (max-width: 768px) {
    .unlimited-event {
        flex-direction: column;
        text-align: center;
    }
    .unlimited-book-btn {
        width: 100%;
    }
}



.unlimited-total-row {
    background: var(--primary);
    color: white;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    text-align: center;
}

.unlimited-total-amount {
    font-size: 20px;
    font-weight: bold;
}

.unlimited-note-modal {
    font-size: 12px;
    color: #22c55e;
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
}


.unlimited-event-cell {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-left: 3px solid #22c55e;
    padding: 12px 16px !important;
}

.unlimited-event-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.unlimited-icon-small {
    font-size: 28px;
}

.unlimited-info-inline {
    flex: 1;
}

.unlimited-info-inline strong {
    display: block;
    color: #22c55e;
    font-size: 14px;
}

.unlimited-info-inline span {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 10px;
}

.unlimited-price {
    color: #22c55e !important;
    font-weight: 600;
}

.unlimited-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-subtle);
    text-align: center;
}

.status-unlimited {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
}

.legend-dot.legend-unlimited {
    background: #22c55e;
}

/* Brand with logo */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.brand span {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .brand-logo {
        width: 28px;
        height: 28px;
    }
    .brand span {
        font-size: 16px;
    }
}