/* ==========================================
   Design System - UDST Easy Scheduler
   Shared styles across all pages.
   Source of truth: docs/Design System.html
   ========================================== */

/* Font Import — Plus Jakarta Sans (sans) + JetBrains Mono (mono).
   The two fonts the spec allows. Never introduce a third. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* Universal Typography — applied globally so a missing font-family
   declaration on any element falls back to Plus Jakarta Sans. */
* {
    font-family: var(--font-sans);
}

/* Mono utility — apply to times, IDs, hex codes, ratios, log lines. */
.font-mono,
.text-mono,
code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
}

/* ==========================================
   Unified Navbar
   ========================================== */
.unified-navbar {
    background: var(--theme-navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    z-index: 1030;
}

.unified-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.unified-navbar .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0 0.1rem;
}

.unified-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.unified-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Section accent bottom borders for active nav links */
.unified-navbar .nav-link.active.section-accent-scheduler {
    border-bottom: 3px solid var(--accent-scheduler);
}

.unified-navbar .nav-link.active.section-accent-simulator {
    border-bottom: 3px solid var(--accent-simulator);
}

.unified-navbar .nav-link.active.section-accent-reports {
    border-bottom: 3px solid var(--accent-reports);
}

.unified-navbar .nav-link.active.section-accent-analytics {
    border-bottom: 3px solid var(--accent-analytics);
}

.unified-navbar .nav-link.active.section-accent-admin {
    border-bottom: 3px solid var(--accent-admin);
}

.unified-navbar .nav-link.active.section-accent-demand {
    border-bottom: 3px solid var(--accent-demand);
}

/* Navbar right-side controls */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-controls .btn-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-controls .btn-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.navbar-controls .btn-nav-danger {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
}

.navbar-controls .btn-nav-danger:hover {
    background: rgba(220, 53, 69, 0.4);
}

.navbar-user-info {
    font-size: 0.8rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
}

.navbar-user-info .user-name {
    font-weight: 600;
    color: white;
}

/* Navbar database status indicator */
.navbar-db-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    cursor: default;
}

.navbar-db-status .db-icon {
    font-size: 0.7rem;
}

.navbar-db-status.db-connected .db-icon {
    color: #4ade80;
}

.navbar-db-status.db-error .db-icon {
    color: #f87171;
}

.navbar-db-status.db-warning .db-icon {
    color: #fbbf24;
}

.navbar-db-status .db-update-time {
    opacity: 0.6;
    font-size: 0.7rem;
}

.navbar-term-selector {
    min-width: 180px;
}

.navbar-term-selector .form-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 2rem 0.3rem 0.5rem;
    border-radius: 6px;
}

.navbar-term-selector .form-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
    color: white;
}

.navbar-term-selector .form-select option {
    background: #1a1d21;
    color: #e9ecef;
}

/* ==========================================
   Page Title Bar
   ========================================== */
.page-title-bar {
    background: var(--theme-page-title-bg);
    padding: 0.75rem 0;
    color: white;
}

.page-title-bar h1 {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.page-title-bar p {
    opacity: 0.75;
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* ==========================================
   Unified Card
   ========================================== */
.unified-card {
    border-radius: 12px;
    background: var(--theme-surface-bg);
    box-shadow: var(--theme-shadow-sm);
    border: 1px solid var(--theme-border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.unified-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--theme-shadow-md);
}

/* ==========================================
   Inline Alert Component
   Spec: alerts attach to the thing they describe. No toasts.
   Use .inline-alert with .inline-alert--ok / --err / --warn / --info.
   Optional .inline-alert--floating positions at top center for
   transient notifications during the toast deprecation period.
   ========================================== */
.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
    margin-bottom: 12px;
    animation: inline-alert-in 0.18s ease-out;
}

.inline-alert .ic {
    flex-shrink: 0;
    font-weight: 700;
    width: 16px;
    text-align: center;
    margin-top: 1px;
}

.inline-alert .body {
    flex: 1;
    min-width: 0;
}

.inline-alert .body strong {
    display: block;
    margin-bottom: 2px;
}

.inline-alert .close {
    background: transparent;
    border: 0;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    padding: 0 4px;
    font-size: 16px;
    line-height: 1;
    align-self: flex-start;
    margin-top: 1px;
}

.inline-alert .close:hover {
    opacity: 1;
}

.inline-alert--ok {
    background: var(--alert-ok-bg);
    border-color: var(--alert-ok-border);
    color: var(--alert-ok-fg);
}

.inline-alert--err {
    background: var(--alert-err-bg);
    border-color: var(--alert-err-border);
    color: var(--alert-err-fg);
}

.inline-alert--warn {
    background: var(--alert-warn-bg);
    border-color: var(--alert-warn-border);
    color: var(--alert-warn-fg);
}

.inline-alert--info {
    background: var(--alert-info-bg);
    border-color: var(--alert-info-border);
    color: var(--alert-info-fg);
}

.inline-alert--floating {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: 480px;
    width: calc(100% - 32px);
    box-shadow: var(--theme-shadow-md);
    margin-bottom: 0;
}

.inline-alert--floating + .inline-alert--floating {
    top: 76px;
}

@keyframes inline-alert-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-alert--floating {
    animation: inline-alert-floating-in 0.22s ease-out;
}

@keyframes inline-alert-floating-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Stat tile — used in Reports and Analytics dashboards.
   The 3px left bar uses the section accent of the surface. */
.stat-tile {
    background: var(--theme-surface-bg);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--stat-accent, var(--accent-scheduler));
}

.stat-tile .stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-tile .stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--theme-text-primary);
}

.stat-tile.stat-tile--scheduler { --stat-accent: var(--accent-scheduler); }
.stat-tile.stat-tile--simulator { --stat-accent: var(--accent-simulator); }
.stat-tile.stat-tile--reports   { --stat-accent: var(--accent-reports); }
.stat-tile.stat-tile--analytics { --stat-accent: var(--accent-analytics); }
.stat-tile.stat-tile--admin     { --stat-accent: var(--accent-admin); }
.stat-tile.stat-tile--demand    { --stat-accent: var(--accent-demand); }

/* Demand surface — left-bar card variant used by overview / sync widgets. */
.demand-card {
    border-left: 3px solid var(--accent-demand);
}

/* Readiness badges — used by Advisor Mode and the demand course-demand views.
   Uses the existing status color tokens; no new hex introduced. */
.readiness-badge--ready {
    background: var(--success-color);
    color: white;
}

.readiness-badge--will-be-ready {
    background: var(--warning-color);
    color: var(--theme-text-primary);
}

.readiness-badge--blocked {
    background: var(--danger-color);
    color: white;
}

/* ==========================================
   Advisor Mode (Phase 5) — optional panel
   that sits above the simulator's existing
   controls. All colors come from theme/cap
   tokens; no raw hex introduced here.
   ========================================== */
.advisor-mode-card {
    border-left: 3px solid var(--accent-demand);
    padding: 0;
}

.advisor-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease;
}

.advisor-mode-header:hover {
    background: var(--theme-surface-secondary);
}

.advisor-mode-title {
    display: flex;
    align-items: center;
}

.advisor-mode-title i {
    color: var(--accent-demand);
}

.advisor-mode-optional {
    color: var(--theme-text-muted);
    font-weight: 400;
    font-size: 12px;
    margin-left: var(--s-2);
}

.advisor-mode-chevron {
    color: var(--theme-text-muted);
    transition: transform 0.2s ease;
    font-size: 12px;
}

.advisor-mode-card:not(.collapsed) .advisor-mode-chevron {
    transform: rotate(180deg);
}

.advisor-mode-body {
    padding: 0 12px 12px 12px;
    display: block;
}

.advisor-mode-card.collapsed .advisor-mode-body {
    display: none;
}

/* Lookup row */
.advisor-lookup-row {
    margin-bottom: var(--s-2);
}

.advisor-lookup-row .input-group-text {
    background: var(--theme-surface-secondary);
    color: var(--theme-text-muted);
    border-color: var(--theme-border-color);
}

/* Snapshot age banner */
.advisor-snapshot-banner {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 6px 10px;
    border-radius: var(--r-md);
    font-size: 12px;
    margin-bottom: var(--s-2);
    border: 1px solid transparent;
}

.advisor-snapshot-banner i {
    flex-shrink: 0;
}

.advisor-snapshot-banner--fresh {
    background: var(--alert-ok-bg);
    border-color: var(--alert-ok-border);
    color: var(--alert-ok-fg);
}

.advisor-snapshot-banner--stale {
    background: var(--alert-warn-bg);
    border-color: var(--alert-warn-border);
    color: var(--alert-warn-fg);
}

.advisor-snapshot-banner--old {
    background: var(--alert-err-bg);
    border-color: var(--alert-err-border);
    color: var(--alert-err-fg);
}

/* Profile card */
.advisor-profile {
    background: var(--theme-surface-secondary);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-md);
    padding: 10px 12px;
    margin-bottom: var(--s-2);
}

.advisor-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: 6px;
}

.advisor-profile-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--theme-text-primary);
}

.advisor-profile-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--theme-text-muted);
}

.advisor-profile-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--s-2) 12px;
    margin-top: 6px;
    font-size: 12px;
}

.advisor-profile-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.advisor-profile-field-label {
    color: var(--theme-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.advisor-profile-field-value {
    color: var(--theme-text-primary);
    font-weight: 500;
}

.advisor-profile-field-value.text-mono {
    font-family: var(--font-mono);
}

.advisor-progress {
    margin-top: var(--s-2);
    height: 6px;
    background: var(--theme-surface-tertiary);
    border-radius: var(--r-xs);
    overflow: hidden;
}

.advisor-progress-fill {
    height: 100%;
    background: var(--accent-demand);
    transition: width 0.3s ease;
}

.advisor-ctg-badge {
    display: inline-block;
    background: var(--accent-demand);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.advisor-snapshot-caption {
    font-size: 11px;
    color: var(--theme-text-muted);
    margin-top: 4px;
}

/* Tabs */
.advisor-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--theme-border-color);
    margin-bottom: var(--s-2);
}

.advisor-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.advisor-tab.active {
    color: var(--accent-demand);
    border-bottom-color: var(--accent-demand);
}

.advisor-tab-count {
    font-family: var(--font-mono);
    background: var(--theme-surface-secondary);
    color: var(--theme-text-secondary);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.advisor-tab.active .advisor-tab-count {
    background: var(--accent-demand);
    color: white;
}

/* Suggestion rows */
.advisor-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--s-2);
}

.advisor-suggestion-row {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 8px 10px;
    background: var(--theme-surface-bg);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.advisor-suggestion-row:hover {
    border-color: var(--accent-demand);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.advisor-suggestion-row.blocked {
    opacity: 0.85;
}

.advisor-suggestion-code {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-demand);
    font-size: 13px;
    min-width: 80px;
}

.section-accent-demand {
    color: var(--accent-demand);
}

.advisor-suggestion-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.advisor-suggestion-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.advisor-suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 11px;
}

.advisor-reason-chip {
    display: inline-block;
    background: var(--theme-surface-secondary);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-light);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
}

.advisor-credits-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--theme-text-secondary);
    background: var(--theme-surface-secondary);
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 600;
}

.advisor-normal-term-badge {
    background: var(--theme-surface-tertiary);
    color: var(--theme-text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--r-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.advisor-capacity-caption {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--r-xs);
}

.advisor-capacity-caption--low { color: var(--cap-low); background: rgba(40, 167, 69, 0.12); }
.advisor-capacity-caption--medium { color: var(--cap-medium); background: rgba(255, 193, 7, 0.16); }
.advisor-capacity-caption--high { color: var(--cap-high); background: rgba(253, 126, 20, 0.14); }
.advisor-capacity-caption--full { color: var(--cap-full); background: rgba(220, 53, 69, 0.12); }
.advisor-capacity-caption--over { color: var(--cap-over); background: rgba(111, 66, 193, 0.14); }
.advisor-capacity-caption--unknown { color: var(--theme-text-muted); background: var(--theme-surface-secondary); }

.advisor-suggestion-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.advisor-add-btn {
    background: var(--accent-demand);
    border: 0;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.advisor-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.advisor-add-btn:disabled {
    background: var(--theme-surface-tertiary);
    color: var(--theme-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.advisor-missing-prereqs {
    font-size: 11px;
    color: var(--theme-text-muted);
    margin-top: 2px;
}

.advisor-missing-prereqs strong {
    color: var(--theme-text-secondary);
    font-weight: 600;
}

.advisor-prereq-chip {
    display: inline-block;
    background: var(--theme-surface-secondary);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-xs);
    padding: 1px 6px;
    margin-left: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
}

/* Empty / message states */
.advisor-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--theme-text-muted);
    font-size: 12px;
}

/* Credit-hour gauge */
.advisor-load-gauge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--theme-surface-secondary);
    border-radius: var(--r-md);
    margin-bottom: var(--s-2);
    font-size: 12px;
}

.advisor-load-gauge-label {
    color: var(--theme-text-muted);
    font-weight: 500;
}

.advisor-load-gauge-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--theme-text-primary);
}

.advisor-load-gauge.warn .advisor-load-gauge-value {
    color: var(--warning-color);
}

.advisor-load-gauge.danger .advisor-load-gauge-value {
    color: var(--danger-color);
}

.advisor-load-gauge-hint {
    color: var(--theme-text-muted);
    font-size: 11px;
}

/* Baskets panel */
.advisor-baskets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.advisor-basket {
    background: var(--theme-surface-bg);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-md);
    padding: 8px 10px;
}

.advisor-basket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-primary);
    cursor: pointer;
}

.advisor-basket-progress {
    font-family: var(--font-mono);
    color: var(--theme-text-secondary);
    font-size: 11px;
}

.advisor-basket-options {
    margin-top: 6px;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
}

.advisor-basket.open .advisor-basket-options {
    display: flex;
}

.advisor-basket-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--theme-surface-secondary);
    border: 1px solid var(--theme-border-light);
    border-radius: var(--r-xs);
    padding: 2px 8px;
    font-size: 11px;
    color: var(--theme-text-secondary);
}

.advisor-basket-option.offered {
    border-color: var(--accent-demand);
    color: var(--accent-demand);
}

.advisor-basket-option-code {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 991.98px) {
    .navbar-controls {
        flex-wrap: wrap;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
        gap: 0.35rem;
    }

    .navbar-user-info {
        width: 100%;
        padding: 0.35rem 0;
    }

    .navbar-term-selector {
        min-width: 150px;
    }

    .page-title-bar {
        padding: 0.5rem 0;
    }
}

/* ==========================================
   Schedule event tooltip
   Hover preview shown when overlapping FullCalendar
   events make the underlying card hard to read.
   ========================================== */
.event-tooltip {
    position: absolute;
    background: var(--theme-surface-bg);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-color);
    border-radius: var(--r-md);
    padding: var(--s-3);
    box-shadow: var(--theme-shadow-md);
    font-size: 13px;
    line-height: 1.5;
    max-width: 320px;
    pointer-events: none;
    z-index: 9999;
}
.event-tooltip__title { font-weight: 700; font-size: 15px; margin-bottom: var(--s-1); }
.event-tooltip__subtitle { font-size: 12px; margin-bottom: var(--s-2); color: var(--theme-text-muted); font-style: italic; }
.event-tooltip__row { display: flex; align-items: center; gap: var(--s-2); margin-top: 4px; font-size: 12px; color: var(--theme-text-secondary); }
.event-tooltip__row .icon { width: 14px; text-align: center; color: var(--theme-text-muted); }
.event-tooltip__capacity { margin-top: var(--s-2); height: 4px; background: var(--theme-surface-tertiary); border-radius: var(--r-xs); overflow: hidden; }
.event-tooltip__capacity-fill { height: 100%; transition: width 0.3s ease; }
.event-tooltip__capacity-fill--low { background: var(--cap-low); }
.event-tooltip__capacity-fill--medium { background: var(--cap-medium); }
.event-tooltip__capacity-fill--high { background: var(--cap-high); }
.event-tooltip__capacity-fill--full { background: var(--cap-full); }
.event-tooltip__capacity-fill--over { background: var(--cap-over); }

/* ==========================================
   Tables — canonical, theme-aware styling
   ----
   Bootstrap 5.3 paints table cells with `color: var(--bs-table-color)`
   on a (0,1,1)-specificity selector and uses a `box-shadow: inset`
   trick for backgrounds. We override both with:
     - higher selector specificity (.table > thead > tr > th = 0,1,4)
     - explicit `--bs-table-color` reset on .table to neutralise the
       Bootstrap variable cascade for the whole element
     - explicit fg/bg from our theme tokens (defined in theme.css)
   All four .table tokens are declared in BOTH `[data-bs-theme="light"]`
   and `[data-bs-theme="dark"]` so headers stay legible in either mode.
   ========================================== */
.table {
    --bs-table-color: var(--theme-text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--theme-table-border);
    --bs-table-striped-color: var(--theme-text-primary);
    --bs-table-striped-bg: var(--theme-table-stripe-bg);
    --bs-table-hover-color: var(--theme-text-primary);
    --bs-table-hover-bg: var(--theme-table-hover-bg);
    color: var(--theme-text-primary);
    border-color: var(--theme-table-border);
}

/* Header cells. The high-specificity child combinator selector
   (0,1,4) beats both Bootstrap's `.table > :not(caption) > * > *`
   (0,1,1) and any third-party `.table thead th` (0,1,2) rule, so
   no `!important` is needed. */
.table > thead > tr > th,
.table > thead > tr > td {
    background-color: var(--theme-table-header-bg);
    color: var(--theme-table-header-fg);
    border-bottom: 1px solid var(--theme-table-header-bg);
    font-weight: 600;
    padding: 12px;
    /* Defeat Bootstrap's box-shadow overlay that would otherwise
       paint --bs-table-bg over our background. */
    --bs-table-bg-state: transparent;
    --bs-table-bg-type: transparent;
    --bs-table-accent-bg: transparent;
}

/* Muted / secondary utility classes inside header cells must use the
   header-tuned muted color, not Bootstrap's body --bs-secondary-color
   (which is a medium gray meant for light backgrounds and fades into
   our dark slate header). The same applies to plain `<small>` and
   sort-icon glyphs that pages sometimes drop into thead.
   ----
   `!important` is required here. Bootstrap 5.3 ships these utilities
   (`.text-muted`, `.text-secondary`, `.text-body-secondary`) with
   `color: var(--bs-secondary-color) !important`, so specificity alone
   does not win — the only way to override `!important` is with
   another `!important`. This is the documented exception to the
   "avoid !important" guideline because Bootstrap forces our hand. */
.table > thead > tr > th .text-muted,
.table > thead > tr > td .text-muted,
.table > thead > tr > th .text-secondary,
.table > thead > tr > td .text-secondary,
.table > thead > tr > th .text-body-secondary,
.table > thead > tr > td .text-body-secondary,
.table > thead > tr > th small,
.table > thead > tr > td small,
.table > thead > tr > th .sort-icon,
.table > thead > tr > td .sort-icon {
    color: var(--theme-table-header-muted-fg) !important;
}

/* Body cells inherit the theme text color and stripe bg from the
   variables we set on .table above. Hover row keeps things legible. */
.table > tbody > tr:hover > * {
    color: var(--theme-text-primary);
}
