/* ============================================================
   CHICOback Design System
   Inspired by: CHICO venue branding (sage, purple, magenta)
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Brand palette — from CHICO flyers */
    --chico-purple: #2d1b4e;
    --chico-purple-light: #3d2a6e;
    --chico-magenta: #e84393;
    --chico-magenta-soft: #fd79a8;
    --chico-sage: #6b8f71;
    --chico-sage-light: #81a88a;

    /* Surface colors */
    --bg-body: #111114;
    --bg-surface: #1a1a1f;
    --bg-surface-raised: #222228;
    --bg-sidebar: #16121e;
    --bg-glass: rgba(30, 27, 40, 0.65);
    --bg-glass-hover: rgba(40, 36, 55, 0.75);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-glass: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-primary: #f0eef5;
    --text-secondary: rgba(240, 238, 245, 0.6);
    --text-muted: rgba(240, 238, 245, 0.4);

    /* Semantic */
    --color-success: var(--chico-sage);
    --color-danger: #e85d75;
    --color-warning: #f0b429;
    --color-info: #6c8aec;

    /* Event status colors */
    --status-hold: #f0b429;
    --status-confirmed: #6c8aec;
    --status-contracted: var(--chico-sage);
    --status-advanced: #4ecdc4;
    --status-settled: rgba(255, 255, 255, 0.35);
    --status-cancelled: var(--color-danger);

    /* Spacing */
    --sidebar-width: 240px;
    --content-padding: 2rem;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(232, 67, 147, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* --- Typography — Google Fonts loaded in base.html --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6, .heading {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.mono, .money {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}


/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: background var(--transition-base);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand h5 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-brand .brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chico-magenta);
    box-shadow: 0 0 8px var(--chico-magenta);
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 0.5rem 0.75rem;
    flex: 1;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: all var(--transition-fast);
    position: relative;
    background: transparent;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.sidebar-nav .nav-link:hover i {
    opacity: 1;
}

.sidebar-nav .nav-link.active {
    color: var(--chico-magenta-soft);
    background: rgba(232, 67, 147, 0.08);
}

.sidebar-nav .nav-link.active i {
    opacity: 1;
    color: var(--chico-magenta);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--chico-magenta);
    box-shadow: 0 0 8px rgba(232, 67, 147, 0.4);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-footer .user-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-footer .btn-logout {
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.sidebar-footer .btn-logout:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: rgba(232, 93, 117, 0.08);
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
    margin-left: var(--sidebar-width);
    padding: var(--content-padding);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}


/* ============================================================
   GLASS CARDS
   ============================================================ */
.card, .glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover, .glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-body {
    padding: 1.25rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
    font-weight: 600;
}


/* ============================================================
   STAT CARDS (dashboard-style metrics)
   ============================================================ */
.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: rgba(232, 67, 147, 0.2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
}

.stat-card .stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn-chico {
    background: var(--chico-magenta);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.15rem;
    transition: all var(--transition-fast);
    box-shadow: 0 0 0 0 rgba(232, 67, 147, 0);
}

.btn-chico:hover {
    background: #d63384;
    color: #fff;
    box-shadow: 0 0 16px rgba(232, 67, 147, 0.3);
    transform: translateY(-1px);
}

.btn-chico:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success, .btn-outline-success {
    --bs-btn-bg: var(--chico-sage);
    --bs-btn-border-color: var(--chico-sage);
    --bs-btn-hover-bg: var(--chico-sage-light);
    --bs-btn-hover-border-color: var(--chico-sage-light);
}


/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-surface);
    border-color: var(--chico-magenta);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15);
}

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

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.78rem;
}

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

.search-input {
    background: var(--bg-surface);
    border-color: var(--border-default);
    color: var(--text-primary);
}


/* ============================================================
   TABLES
   ============================================================ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-subtle);
    --bs-table-hover-bg: var(--bg-glass-hover);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    font-size: 0.875rem;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom-width: 1px;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}


/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge-status {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3em 0.7em;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-hold {
    background: rgba(240, 180, 41, 0.12);
    color: var(--status-hold);
}
.badge-hold::before { background: var(--status-hold); }

.badge-confirmed {
    background: rgba(108, 138, 236, 0.12);
    color: var(--status-confirmed);
}
.badge-confirmed::before { background: var(--status-confirmed); }

.badge-contracted {
    background: rgba(107, 143, 113, 0.12);
    color: var(--chico-sage-light);
}
.badge-contracted::before { background: var(--chico-sage); }

.badge-advanced {
    background: rgba(78, 205, 196, 0.12);
    color: var(--status-advanced);
}
.badge-advanced::before { background: var(--status-advanced); }

.badge-settled {
    background: rgba(255, 255, 255, 0.06);
    color: var(--status-settled);
}
.badge-settled::before { background: var(--status-settled); }

.badge-cancelled {
    background: rgba(232, 93, 117, 0.12);
    color: var(--status-cancelled);
}
.badge-cancelled::before { background: var(--status-cancelled); }


/* ============================================================
   FILTER PILLS
   ============================================================ */
.filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-pill {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.filter-pill:hover {
    border-color: var(--chico-magenta);
    color: var(--text-primary);
    background: rgba(232, 67, 147, 0.06);
}

.filter-pill.active, .filter-pill[aria-pressed="true"] {
    background: rgba(232, 67, 147, 0.12);
    border-color: var(--chico-magenta);
    color: var(--chico-magenta-soft);
}


/* ============================================================
   TABS
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(255, 255, 255, 0.15);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--chico-magenta-soft);
    border-bottom-color: var(--chico-magenta);
    background: transparent;
}


/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid;
}

.alert-danger {
    background: rgba(232, 93, 117, 0.1);
    border-color: rgba(232, 93, 117, 0.2);
    color: var(--color-danger);
}

.alert-success {
    background: rgba(107, 143, 113, 0.1);
    border-color: rgba(107, 143, 113, 0.2);
    color: var(--chico-sage-light);
}

.alert-warning {
    background: rgba(240, 180, 41, 0.1);
    border-color: rgba(240, 180, 41, 0.2);
    color: var(--color-warning);
}


/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h4, .page-header h3, .page-header h2 {
    margin: 0;
}

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

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}


/* ============================================================
   CALENDAR (FullCalendar overrides)
   ============================================================ */
.fc {
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--bg-surface);
    --fc-neutral-text-color: var(--text-primary);
    --fc-border-color: var(--border-subtle);
    --fc-today-bg-color: rgba(232, 67, 147, 0.05);
}

.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-subtle);
}

.fc .fc-toolbar-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

.fc .fc-button-primary {
    background: var(--bg-surface);
    border-color: var(--border-default);
    color: var(--text-secondary);
    text-transform: capitalize;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.fc .fc-button-primary:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--chico-magenta) !important;
    border-color: var(--chico-magenta) !important;
    color: #fff !important;
}

.fc .fc-daygrid-day {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.fc .fc-daygrid-day:hover {
    background: rgba(255, 255, 255, 0.02);
}

.fc .fc-event {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-subtle);
}

.fc .fc-daygrid-day-number {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.fc .fc-col-header-cell-cushion {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ============================================================
   CALENDAR LEGEND
   ============================================================ */
.calendar-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.calendar-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Calendar card fills remaining viewport height */
.calendar-card {
    height: calc(100vh - 220px);
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.calendar-card #calendar {
    flex: 1;
    min-height: 0;
}


/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--chico-magenta-soft);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}


/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(45, 27, 78, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(232, 67, 147, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 380px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
}

.login-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-btn {
    background: var(--chico-magenta);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem;
    width: 100%;
    transition: all var(--transition-fast);
}

.login-btn:hover {
    background: #d63384;
    box-shadow: 0 0 20px rgba(232, 67, 147, 0.3);
    transform: translateY(-1px);
}


/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}


/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-magenta { color: var(--chico-magenta-soft); }
.text-sage { color: var(--chico-sage-light); }
.text-muted { color: var(--text-muted) !important; }
.bg-surface { background: var(--bg-surface); }
.border-subtle { border-color: var(--border-subtle) !important; }

.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5rem 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Selection color */
::selection {
    background: rgba(232, 67, 147, 0.3);
    color: #fff;
}


/* ============================================================
   MOBILE HAMBURGER TOGGLE
   ============================================================ */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-topbar .brand-mobile {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mobile-topbar .brand-mobile .brand-dot {
    width: 6px;
    height: 6px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    padding: 0.25rem;
    cursor: pointer;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 992px) {
    :root {
        --content-padding: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Show mobile topbar, hide desktop sidebar */
    .mobile-topbar {
        display: flex;
    }

    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 150;
        width: var(--sidebar-width);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: calc(52px + 1rem); /* topbar height + spacing */
    }

    /* Responsive tables: horizontal scroll */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 500px;
    }

    /* Stack page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Stack stat cards */
    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    /* Filter pills: scrollable */
    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .filter-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Tabs: scrollable */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Touch-friendly form elements */
    .form-control, .form-select {
        padding: 0.65rem 0.85rem;
        font-size: 1rem; /* prevents iOS zoom */
    }

    /* Touch-friendly buttons */
    .btn-chico, .btn-ghost {
        padding: 0.6rem 1.15rem;
        font-size: 0.9rem;
    }

    /* Calendar: smaller text */
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc .fc-button-primary {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .fc .fc-event {
        font-size: 0.68rem;
        padding: 1px 4px;
    }

    /* Calendar: fill remaining mobile viewport */
    .calendar-card {
        height: calc(100vh - 240px);
        min-height: 400px;
    }

    /* Calendar legend: scrollable */
    .calendar-legend {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.75rem;
    }

    .calendar-legend .legend-item {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Detail page: stack columns */
    .col-md-8, .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Login card: full width on small screens */
    .login-card {
        width: calc(100% - 2rem);
        max-width: 380px;
        padding: 2rem 1.5rem;
    }

    /* Event detail info bar: wrap */
    .card-body .row.g-3.text-center {
        justify-content: flex-start;
    }
}

/* Small phones */
@media (max-width: 400px) {
    #main-content {
        width: 100%;
        padding: 0.75rem;
        padding-top: calc(52px + 0.75rem);
    }

    .page-header h4, .page-header h3 {
        font-size: 1.1rem;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
}
