/* ==========================================================================
   EVERYDAY CALENDAR™ — MODERN DESIGN SYSTEM & COMPLETE LIGHT/DARK THEME
   Applies across Calendar Studio (index.php), all Modals/Popups, Settings,
   Rooms, Team Round-Robin, 2-Way Sync, Public Booking, AI, Payments & SMS.
   ========================================================================== */

:root {
    --cal-bg: #070b14;
    --cal-sidebar-surface: #0b111e;
    --cal-surface: #0f172a;
    --cal-surface-2: #131e35;
    --cal-surface-subtle: rgba(15, 23, 42, 0.65);
    --cal-surface-hover: rgba(255, 255, 255, 0.055);
    --cal-border: rgba(148, 163, 184, 0.14);
    --cal-border-subtle: rgba(148, 163, 184, 0.08);
    --cal-grid-line: rgba(148, 163, 184, 0.10);
    --cal-text: #f8fafc;
    --cal-text-secondary: #cbd5e1;
    --cal-text-muted: #94a3b8;
    --cal-text-faint: #64748b;
    --cal-accent: #f59e0b;
    --cal-accent-hover: #fbbf24;
    --cal-accent-text: #fbbf24;
    --cal-info-text: #38bdf8;
    --cal-input-bg: #0d1526;
    --cal-input-border: rgba(148, 163, 184, 0.22);
    --cal-modal-bg: #0d1526;
    --cal-modal-header: #101a2e;
    --cal-cell-bg: #090e1a;
    --cal-cell-weekend: #070c16;
    --cal-cell-other: #060a12;
    --cal-cell-hover: #10192d;
    --cal-shadow-card: 0 12px 32px -8px rgba(0, 0, 0, 0.5);
    --cal-shadow-modal: 0 28px 70px -12px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html.light-mode,
body.light-mode,
html[data-theme="light"],
body[data-theme="light"] {
    --cal-bg: #f4f6fb;
    --cal-sidebar-surface: #ffffff;
    --cal-surface: #ffffff;
    --cal-surface-2: #f8fafc;
    --cal-surface-subtle: #f8fafc;
    --cal-surface-hover: #f1f5f9;
    --cal-border: rgba(15, 23, 42, 0.10);
    --cal-border-subtle: rgba(15, 23, 42, 0.06);
    --cal-grid-line: #e2e8f0;
    --cal-text: #0f172a;
    --cal-text-secondary: #334155;
    --cal-text-muted: #64748b;
    --cal-text-faint: #94a3b8;
    --cal-accent: #d97706;
    --cal-accent-hover: #b45309;
    --cal-accent-text: #b45309;
    --cal-info-text: #0284c7;
    --cal-input-bg: #ffffff;
    --cal-input-border: #cbd5e1;
    --cal-modal-bg: #ffffff;
    --cal-modal-header: #f8fafc;
    --cal-cell-bg: #ffffff;
    --cal-cell-weekend: #fafbfd;
    --cal-cell-other: #f4f6fa;
    --cal-cell-hover: #f0f6ff;
    --cal-shadow-card: 0 8px 24px -6px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    --cal-shadow-modal: 0 28px 64px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   1. UNIVERSAL THEME TOGGLE BUTTON & MODERN TOAST NOTIFICATIONS
   ========================================================================== */
.cal-theme-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cal-border);
    color: var(--cal-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
    font-size: 0.88rem;
}
.cal-theme-toggle-btn:hover {
    background: var(--cal-surface-hover);
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, 0.4);
}
html.light-mode body .cal-theme-toggle-btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0284c7;
}
html.light-mode body .cal-theme-toggle-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.cal-modern-toast-stack {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 10000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}
.cal-modern-toast {
    pointer-events: auto;
    background: var(--cal-modal-bg);
    color: var(--cal-text);
    border: 1px solid var(--cal-border);
    border-radius: 14px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: var(--cal-shadow-modal);
    animation: calToastIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.cal-modern-toast.cal-toast-hide {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
}
.cal-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.cal-toast-success .cal-toast-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.cal-toast-info .cal-toast-icon { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.cal-toast-warning .cal-toast-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cal-toast-danger .cal-toast-icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.cal-toast-body { flex: 1; min-width: 0; }
.cal-toast-title { font-size: 0.84rem; font-weight: 700; color: var(--cal-text); line-height: 1.3; }
.cal-toast-sub { font-size: 0.74rem; color: var(--cal-text-muted); margin-top: 2px; }
.cal-toast-close {
    background: transparent;
    border: none;
    color: var(--cal-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
}
@keyframes calToastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   2. MODAL / POPUP COMPONENTS (COLOR SWATCHES, TABS, CHIPS, BRACKETS)
   Fixes missing widget styles & makes all popups sleek in Dark & Light Mode
   ========================================================================== */
.color-swatches-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.swatch-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}
html.light-mode body .swatch-btn {
    border-color: rgba(15, 23, 42, 0.16);
}
.swatch-btn:hover {
    transform: scale(1.14);
}
.swatch-btn.active {
    transform: scale(1.14);
    border-color: #ffffff !important;
    box-shadow: 0 0 0 2.5px var(--cal-accent), 0 4px 10px rgba(0, 0, 0, 0.25);
}
html.light-mode body .swatch-btn.active {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 2.5px #0f172a, 0 3px 8px rgba(15, 23, 42, 0.18);
}
.swatch-btn.active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.62rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-tab-pill {
    padding: 7px 14px;
    border-radius: 9px;
    border: 1px solid var(--cal-border);
    background: transparent;
    color: var(--cal-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
}
.modal-tab-pill:hover {
    background: var(--cal-surface-hover);
    color: var(--cal-text);
}
.modal-tab-pill.active {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: var(--cal-accent-text);
}
html.light-mode body .modal-tab-pill.active {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
}

.icon-picker-chip {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--cal-border);
    background: var(--cal-input-bg);
    color: var(--cal-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.88rem;
}
.icon-picker-chip:hover {
    border-color: var(--cal-accent);
    color: var(--cal-text);
    transform: translateY(-1px);
}
.icon-picker-chip.active {
    background: rgba(245, 158, 11, 0.16);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
html.light-mode body .icon-picker-chip.active {
    background: #fffbeb;
    border-color: #d97706;
    color: #b45309;
}

.bracket-preset-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid var(--cal-border);
    background: var(--cal-input-bg);
    color: var(--cal-text);
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.bracket-preset-btn:hover {
    border-color: rgba(245, 158, 11, 0.45);
    background: var(--cal-surface-hover);
}
.bracket-preset-btn.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
html.light-mode body .bracket-preset-btn.active {
    background: #fffbeb;
    border-color: #d97706;
}

.bracket-day-chip {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--cal-border);
    background: var(--cal-input-bg);
    color: var(--cal-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.14s ease;
}
.bracket-day-chip:hover {
    border-color: var(--cal-accent);
    color: var(--cal-text);
}
.bracket-day-chip.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #090e17;
}

/* ==========================================================================
   3. COMPLETE POPUP / MODAL LIGHT MODE & MODERNIZATION OVERRIDES
   High-specificity selectors (html.light-mode body ...) guarantee priority
   over inline dark styles and global footer stylesheets.
   ========================================================================== */
.modal-backdrop.show {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
html.light-mode body .modal-backdrop.show {
    background-color: rgba(15, 23, 42, 0.42) !important;
    opacity: 1 !important;
}

html.light-mode body .modal-content,
html.light-mode body .modal-content[style] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
    box-shadow: 0 28px 64px -12px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(15, 23, 42, 0.06) !important;
}

html.light-mode body .modal-header,
html.light-mode body .modal-header[style] {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode body .modal-footer,
html.light-mode body .modal-footer[style] {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode body .modal-body {
    background: #ffffff !important;
    color: #0f172a !important;
}

html.light-mode body .modal-content .modal-title,
html.light-mode body .modal-content h4,
html.light-mode body .modal-content h5,
html.light-mode body .modal-content h6,
html.light-mode body .modal-content .text-white:not(.badge):not(.btn-primary):not(.btn-danger):not(.btn-success),
html.light-mode body .modal-content .text-light {
    color: #0f172a !important;
}

html.light-mode body .modal-content .text-white-50,
html.light-mode body .modal-content .form-label,
html.light-mode body .modal-content label:not(.slot-btn):not(.btn) {
    color: #475569 !important;
}

html.light-mode body .modal-content .btn-close,
html.light-mode body .modal-content .btn-close-white {
    filter: none !important;
    opacity: 0.6 !important;
}
html.light-mode body .modal-content .btn-close:hover {
    opacity: 1 !important;
}

/* Fix Cancel / Secondary / Outline buttons inside Light Mode modals & pages */
html.light-mode body .btn-outline-secondary,
html.light-mode body .btn-outline-secondary.text-white,
html.light-mode body .btn-outline-secondary.text-white-50 {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}
html.light-mode body .btn-outline-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Readable semantic accent colors on white surfaces in Light Mode */
html.light-mode body .modal-content .text-warning,
html.light-mode body .cal-sidebar .text-warning,
html.light-mode body .agenda-card .text-warning,
html.light-mode body .glass-card .text-warning,
html.light-mode body .settings-content-pane .text-warning {
    color: #b45309 !important;
}

html.light-mode body .modal-content .text-info,
html.light-mode body .cal-sidebar .text-info,
html.light-mode body .agenda-card .text-info,
html.light-mode body .glass-card .text-info,
html.light-mode body .settings-content-pane .text-info {
    color: #0284c7 !important;
}

html.light-mode body .modal-content .btn-outline-warning,
html.light-mode body .glass-card .btn-outline-warning,
html.light-mode body .public-booking-topbar .btn-outline-warning {
    color: #b45309 !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
    background: rgba(245, 158, 11, 0.06) !important;
}
html.light-mode body .modal-content .btn-outline-warning:hover,
html.light-mode body .glass-card .btn-outline-warning:hover,
html.light-mode body .public-booking-topbar .btn-outline-warning:hover,
html.light-mode body .modal-content .btn-outline-warning.active {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #0f172a !important;
}

html.light-mode body .modal-content .btn-outline-info,
html.light-mode body .glass-card .btn-outline-info,
html.light-mode body .settings-content-pane .btn-outline-info {
    color: #0369a1 !important;
    border-color: rgba(2, 132, 199, 0.4) !important;
    background: rgba(14, 165, 233, 0.06) !important;
}
html.light-mode body .modal-content .btn-outline-info:hover,
html.light-mode body .glass-card .btn-outline-info:hover,
html.light-mode body .settings-content-pane .btn-outline-info:hover,
html.light-mode body .modal-content .duration-chip.active {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Inner tinted cards inside modals in Light Mode */
html.light-mode body .cal-modal-section,
html.light-mode body .modal-content .bg-dark,
html.light-mode body .modal-content [style*="background:#0c1322"],
html.light-mode body .modal-content [style*="background:#090f1d"],
html.light-mode body .modal-content [style*="background:rgba(15,23,42"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode body .modal-content [style*="rgba(245,158,11,0.04)"] {
    background: #fffbeb !important;
    border-color: rgba(245, 158, 11, 0.32) !important;
}

html.light-mode body .modal-content [style*="rgba(56,189,248,0.08)"],
html.light-mode body .modal-content [style*="rgba(56,189,248,0.1)"] {
    background: #f0f9ff !important;
    border-color: rgba(2, 132, 199, 0.28) !important;
}

html.light-mode body .modal-content [style*="rgba(168,85,247,0.08)"] {
    background: #faf5ff !important;
    border-color: rgba(147, 51, 234, 0.25) !important;
}

html.light-mode body .input-group-text {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

/* Form Controls & Selects in Light Mode */
html.light-mode body .form-control,
html.light-mode body .form-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
html.light-mode body .form-control::placeholder {
    color: #94a3b8 !important;
}
html.light-mode body .form-control:focus,
html.light-mode body .form-select:focus {
    background-color: #ffffff !important;
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18) !important;
    color: #0f172a !important;
}
html.light-mode body .form-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
html.light-mode body input[type="time"]::-webkit-calendar-picker-indicator,
html.light-mode body input[type="date"]::-webkit-calendar-picker-indicator,
html.light-mode body input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none !important;
}

/* Live Place Search Autocomplete Dropdown in Light Mode */
html.light-mode body .place-autocomplete-dropdown,
html.light-mode body #placeSearchResults {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 18px 40px -8px rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
}
html.light-mode body #placeSearchResults .text-white {
    color: #0f172a !important;
}
html.light-mode body #placeSearchResults .text-white-50 {
    color: #64748b !important;
}

/* Upcoming Meeting Radar Toast in Light Mode */
html.light-mode body #everydayToastContainer > div {
    background: #ffffff !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
}

/* ==========================================================================
   4. MAIN CALENDAR STUDIO (index.php) LIGHT MODE & MODERNIZATION
   ========================================================================== */
html.light-mode body {
    background: var(--cal-bg) !important;
    color: var(--cal-text) !important;
}

/* Sidebar & Mini Calendar */
html.light-mode body .cal-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}
html.light-mode body .mini-cal-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}
html.light-mode body .mini-cal-title {
    color: #0f172a !important;
}
html.light-mode body .mini-cal-dayname {
    color: #64748b !important;
}
html.light-mode body .mini-cal-cell {
    color: #1e293b !important;
    font-weight: 600;
}
html.light-mode body .mini-cal-cell:hover {
    background: #fef3c7 !important;
    color: #b45309 !important;
}
html.light-mode body .mini-cal-cell.other-month {
    color: #94a3b8 !important;
    opacity: 0.7 !important;
}
html.light-mode body .mini-cal-cell.today-marker {
    border-color: #d97706 !important;
    color: #b45309 !important;
    background: rgba(245, 158, 11, 0.1) !important;
}
html.light-mode body .mini-cal-cell.active-day {
    background: #f59e0b !important;
    color: #0f172a !important;
}

/* Clean Calendar Category List Items (No bulky amber boxes!) */
html.light-mode body .cal-category-item {
    background: transparent !important;
    border-color: transparent !important;
    color: #1e293b !important;
}
html.light-mode body .cal-category-item:hover {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html.light-mode body .cal-category-item .text-white {
    color: #1e293b !important;
}
html.light-mode body .category-count-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}
html.light-mode body .cal-actions-cluster {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}
html.light-mode body .cal-action-btn {
    color: #475569 !important;
}
html.light-mode body .cal-action-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode body .sidebar-link-item {
    color: #475569 !important;
}
html.light-mode body .sidebar-link-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Top Sub-Toolbar (Today button, Arrows, AI Omnibar, View Switcher) */
html.light-mode body .cal-sub-topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode body .btn-today {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
html.light-mode body .btn-today:hover {
    background: #fffbeb !important;
    border-color: #f59e0b !important;
    color: #b45309 !important;
}
html.light-mode body .btn-nav-arrow {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}
html.light-mode body .btn-nav-arrow:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode body .current-date-title {
    color: #0f172a !important;
}

/* AI Quick-Schedule Omnibar in Light Mode */
html.light-mode body .cal-ai-prompt-box input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}
html.light-mode body .cal-ai-prompt-box input::placeholder {
    color: #64748b !important;
}
html.light-mode body .cal-ai-prompt-box input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14) !important;
}
html.light-mode body .cal-ai-prompt-box .ai-icon-left {
    color: #0284c7 !important;
}
html.light-mode body .cal-ai-prompt-box .ai-btn-submit {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border-color: #7dd3fc !important;
}
html.light-mode body .cal-ai-prompt-box .ai-btn-submit:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
}

/* Segmented View Switcher in Light Mode */
html.light-mode body .view-switcher-group {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
html.light-mode body .view-btn {
    color: #475569 !important;
}
html.light-mode body .view-btn:hover {
    color: #0f172a !important;
}
html.light-mode body .view-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10) !important;
}

/* Month Matrix Grid in Light Mode (Fixes dark translucent other-month cells!) */
html.light-mode body .month-days-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
html.light-mode body .month-grid {
    background: #e2e8f0 !important;
}
html.light-mode body .month-cell {
    background: #ffffff !important;
    color: #0f172a !important;
    opacity: 1 !important;
}
html.light-mode body .month-cell.is-weekend {
    background: #fafbfd !important;
}
html.light-mode body .month-cell:hover {
    background: #f8fbff !important;
}
html.light-mode body .month-cell.other-month {
    background: #f4f6fa !important;
    opacity: 1 !important;
}
html.light-mode body .month-cell.other-month .month-day-number {
    color: #94a3b8 !important;
}
html.light-mode body .month-cell.is-today {
    background: #fffdf5 !important;
    box-shadow: inset 0 0 0 1.5px rgba(245, 158, 11, 0.55) !important;
}
html.light-mode body .month-cell.is-today .month-day-number {
    background: #f59e0b !important;
    color: #0f172a !important;
}
html.light-mode body .event-chip {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
    font-weight: 700 !important;
}

/* Week, Day & Agenda Views in Light Mode */
html.light-mode body .week-schedule-container {
    background: #ffffff !important;
}
html.light-mode body .week-header-row {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode body .week-header-cell {
    border-left-color: #e2e8f0 !important;
}
html.light-mode body .week-header-dayname {
    color: #64748b !important;
}
html.light-mode body .week-header-daynum {
    color: #0f172a !important;
}
html.light-mode body .week-header-cell.today-col .week-header-daynum {
    color: #d97706 !important;
}
html.light-mode body .time-col {
    border-left-color: #e2e8f0 !important;
}
html.light-mode body .time-slot-row {
    border-bottom-color: #f1f5f9 !important;
}
html.light-mode body .time-slot-row.off-hours {
    background: rgba(241, 245, 249, 0.45) !important;
}
html.light-mode body .time-slot-row:hover {
    background: rgba(2, 132, 199, 0.04) !important;
}
html.light-mode body .timed-event-block {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}
html.light-mode body .agenda-day-header {
    color: #b45309 !important;
    border-bottom-color: #e2e8f0 !important;
}
html.light-mode body .agenda-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}
html.light-mode body .agenda-card:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}
html.light-mode body .mobile-day-agenda-section {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* ==========================================================================
   5. STANDALONE CALENDAR PAGES LIGHT MODE (Settings, Rooms, Team, Sync,
      Public Booking, AI Optimizer, Paid Appointments, SMS Reminders)
   ========================================================================== */
html.light-mode body .cal-topbar,
html.light-mode body .public-booking-topbar,
html.light-mode body header.bg-dark {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
html.light-mode body .cal-topbar .page-title,
html.light-mode body .public-booking-topbar .brand-name,
html.light-mode body header.bg-dark h5 {
    color: #0f172a !important;
}
html.light-mode body .cal-topbar .brand-title {
    color: #475569 !important;
}
html.light-mode body .cal-topbar .brand-title:hover {
    color: #0f172a !important;
}
html.light-mode body .cal-topbar .breadcrumb-chevron {
    color: #94a3b8 !important;
}
html.light-mode body .suite-launcher-btn,
html.light-mode body .topbar-nav-pill {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}
html.light-mode body .suite-launcher-btn:hover,
html.light-mode body .topbar-nav-pill:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode body .topbar-search-wrap input {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode body .topbar-search-wrap input:focus {
    background: #ffffff !important;
    border-color: #d97706 !important;
}
html.light-mode body .edition-pill {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fcd34d !important;
}

/* Cards, Settings Panes, Room Cards, Stat Pills & Public Booking */
html.light-mode body .glass-card,
html.light-mode body .settings-section-card,
html.light-mode body .stat-pill-card,
html.light-mode body .room-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: var(--cal-shadow-card) !important;
    color: #0f172a !important;
}
html.light-mode body .room-card:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12) !important;
}
html.light-mode body .settings-nav-pane {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}
html.light-mode body .settings-content-pane {
    background: var(--cal-bg) !important;
}
html.light-mode body .settings-nav-item {
    color: #475569 !important;
}
html.light-mode body .settings-nav-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode body .settings-nav-item.active {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fcd34d !important;
}

/* Typography & Badges on Standalone Pages in Light Mode */
html.light-mode body .glass-card h3,
html.light-mode body .glass-card h4,
html.light-mode body .glass-card h5,
html.light-mode body .glass-card h6,
html.light-mode body .glass-card .text-white:not(.badge):not(.btn),
html.light-mode body .stat-pill-card .text-white,
html.light-mode body .room-card .text-white,
html.light-mode body .settings-content-pane h3,
html.light-mode body .settings-content-pane h5,
html.light-mode body .settings-content-pane h6,
html.light-mode body .settings-content-pane .text-white:not(.badge):not(.btn),
html.light-mode body .settings-nav-pane .text-white {
    color: #0f172a !important;
}

html.light-mode body .glass-card .text-white-50,
html.light-mode body .stat-pill-card .text-white-50,
html.light-mode body .room-card .text-white-50,
html.light-mode body .settings-content-pane .text-white-50,
html.light-mode body .settings-nav-pane .text-white-50,
html.light-mode body .public-booking-topbar .text-white-50,
html.light-mode body .form-label,
html.light-mode body label:not(.slot-btn):not(.btn) {
    color: #475569 !important;
}

html.light-mode body .badge.bg-dark,
html.light-mode body [style*="background:#0c1322"],
html.light-mode body [style*="background:#060a10"] {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

html.light-mode body .code-block-box {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0369a1 !important;
}

/* Public Booking Time Slots & Duration Pills in Light Mode */
html.light-mode body .slot-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode body .slot-btn:hover,
html.light-mode body .btn-check:checked + .slot-btn {
    background: #fffbeb !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.18) !important;
}
html.light-mode body .duration-pill {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html.light-mode body .duration-pill.active,
html.light-mode body .duration-pill:hover {
    background: #fffbeb !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
}

/* Tables in Light Mode */
html.light-mode body .table-dark {
    --bs-table-bg: #ffffff !important;
    --bs-table-color: #0f172a !important;
    --bs-table-hover-bg: #f8fafc !important;
    --bs-table-hover-color: #0f172a !important;
    --bs-table-border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html.light-mode body .table-dark th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode body .table-dark td {
    color: #1e293b !important;
    border-bottom-color: #f1f5f9 !important;
}
html.light-mode body .status-badge-success {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
}


/* ==========================================================================
   6. MODERN UX ENHANCEMENTS (Notion Calendar / Linear / Fantastical Polish)
   ========================================================================== */

/* Sleek Sidebar Calendar Rows (Dark & Light Mode — No cluttered amber boxes) */
body .cal-category-item,
body .cal-category-item.active-filter {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    padding: 5px 8px !important;
    margin-bottom: 2px !important;
    transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}
body .cal-category-item:not(.active-filter) {
    opacity: 0.62;
}
body .cal-category-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.055) !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}
html.light-mode body .cal-category-item:hover {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
body .cal-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    box-shadow: none !important;
}

/* Collapsible Sidebar Section Headers */
.cal-sidebar-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.14s ease;
}
.cal-sidebar-section-hdr:hover {
    background: var(--cal-surface-hover);
}
.cal-sidebar-section-label {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--cal-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cal-sidebar-chevron {
    font-size: 0.58rem;
    transition: transform 0.18s ease;
    opacity: 0.7;
}
.cal-sidebar-section-hdr.collapsed .cal-sidebar-chevron {
    transform: rotate(-90deg);
}

/* Compact Scrollable Teammate Availability List + Filter */
.cal-teammate-scroll {
    max-height: 175px;
    overflow-y: auto;
    padding-right: 2px;
}
.cal-teammate-filter-input {
    width: 100%;
    font-size: 0.75rem !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    margin-bottom: 6px;
}

/* Everyday Tasks Sidebar Card in Light Mode */
html.light-mode body .cal-tasks-toggle-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html.light-mode body .cal-tasks-toggle-card .text-white {
    color: #0f172a !important;
}

/* Mini Calendar Event Indicator Dots */
.mini-cal-cell {
    position: relative;
}
.mini-cal-has-events::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cal-accent);
}
.mini-cal-cell.active-day.mini-cal-has-events::after {
    background: #090e17;
}

/* Sub-Topbar Action Pills (AI Best Time, Sync/.ics, Theme Toggle) */
.cal-toolbar-pill {
    height: 30px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}
.cal-toolbar-pill:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.20);
}
.cal-toolbar-pill.pill-ai {
    background: rgba(56, 189, 248, 0.10);
    border-color: rgba(56, 189, 248, 0.28);
    color: #38bdf8;
}
.cal-toolbar-pill.pill-ai:hover {
    background: rgba(56, 189, 248, 0.20);
    color: #7dd3fc;
}
html.light-mode body .cal-toolbar-pill {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
html.light-mode body .cal-toolbar-pill:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode body .cal-toolbar-pill.pill-ai {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    color: #0284c7 !important;
}
html.light-mode body .cal-toolbar-pill.pill-ai:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #0369a1 !important;
}
html.light-mode body .topbar-icon-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.light-mode body .topbar-icon-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Month Cell Hover Quick-Add (+) Button & "+N more" Pill */
.month-cell-add-btn {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.14s ease;
    cursor: pointer;
}
.month-cell:hover .month-cell-add-btn {
    opacity: 1;
    transform: scale(1);
}
.month-cell-add-btn:hover {
    background: #f59e0b !important;
    color: #090e17 !important;
}
html.light-mode body .month-cell-add-btn {
    background: #f1f5f9;
    color: #475569;
}
.month-more-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--cal-text-muted);
    padding: 2px 6px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    transition: background 0.14s ease, color 0.14s ease;
}
.month-more-pill:hover {
    background: var(--cal-surface-hover);
    color: var(--cal-accent-text);
}

/* Live Current Time Indicator Line in Week & Day Views */
.cal-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 12;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}
.cal-now-line::before {
    content: "";
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}

/* Compact, Scroll-Safe Modal Sizing (Eliminates vertical overflow on laptops) */
@media (min-width: 768px) {
    #eventModal .modal-dialog,
    #createCalendarModal .modal-dialog,
    #eventDetailModal .modal-dialog {
        max-height: 90vh;
    }
    #eventModal .modal-body,
    #createCalendarModal .modal-body,
    #eventDetailModal .modal-body {
        max-height: calc(90vh - 138px);
        overflow-y: auto;
    }
}
.form-control-hero {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    padding: 11px 14px !important;
}
html.light-mode body .btn-outline-light,
html.light-mode body .modal-content .btn-outline-light {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}
html.light-mode body .btn-outline-light:hover,
html.light-mode body .modal-content .btn-outline-light:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode body .cal-sidebar .bg-dark {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}
html.light-mode body .cal-sidebar .text-white-50 {
    color: #64748b !important;
}
