:root {
    --primary-color: #5C5CEE;
    --primary-light: #EEF2FF;
    --primary-hover: #4A4ACD;
    --bg-color: #F8F9FA;
    --sidebar-bg: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #6C757D;
    --border-color: #E9ECEF;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --sidebar-width: 280px;
    --top-bar-height: 70px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.sidebar-header {
    padding: 24px;
}

.week-navigation {
    margin-top: 24px;
}

.header-top-row {
    display: contents;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-main);
}

.logo-text .subtext {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 0 12px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.sidebar-nav li.active .nav-item {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.sidebar-filters {
    padding: 24px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label.section-title,
.filter-group summary.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background-color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    outline: none;
}

.filter-group summary.section-title::-webkit-details-marker {
    display: none;
}

details[open] summary.section-title .fa-chevron-down {
    transform: rotate(180deg);
}

summary.section-title .fa-chevron-down {
    transition: transform 0.3s ease;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-list.scrollable {
    max-height: 35vh;
    overflow-y: auto;
    padding-right: 8px;
}

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Custom Radio Button Styling */
.checkbox-item {
    position: relative;
}

.checkbox-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    background-color: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
    background-color: var(--badge-bg, #eee);
    color: var(--badge-color, #333);
}

.checkbox-item input[type="radio"]:checked + label .item-badge {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.checkbox-item label:hover {
    background-color: #F1F5F9;
}

/* Active/Checked State */
.checkbox-item input[type="radio"]:checked + label {
    background-color: var(--item-color);
    color: white;
    font-weight: 600;
}

/* Hide the color dot when the whole background is colored to keep it clean */
.checkbox-item input[type="radio"]:checked + label .color-dot {
    box-shadow: 0 0 0 2px white;
}

/* Add a subtle indicator for the active item */
.checkbox-item input[type="radio"]:checked + label::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: 3px;
    background-color: white;
    border-radius: 4px;
}

.sidebar-footer {
    padding: 20px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.top-bar {
    height: var(--top-bar-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-color);
    padding: 8px 16px;
    border-radius: 8px;
    width: 300px;
}

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

.search-container input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Body */
.content-body {
    padding: 32px;
    flex-grow: 1;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.title-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

.action-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Calendar Card */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.calendar-container {
    height: calc(100vh - 250px);
}

#calendar {
    height: 100%;
}



/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.info-row i {
    color: var(--primary-color);
    margin-top: 4px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    outline: none;
    margin-bottom: 12px;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
}

.help-text a {
    color: var(--primary-color);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #CBD5E0;
}

/* Mobile View Toggle */
.mobile-view-toggle {
    display: none;
    margin-top: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.toggle-btn i {
    font-size: 12px;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #7C7CFF);
    color: white;
    box-shadow: 0 3px 12px rgba(92, 92, 238, 0.3);
}

.toggle-btn:not(.active):hover {
    background: #E8E8F0;
    color: var(--text-main);
}

/* Daily View */
.daily-view-container {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #F0F2F8 0%, var(--bg-color) 100%);
}

.daily-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: white;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.daily-navigation .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.daily-navigation .icon-btn:active {
    transform: scale(0.92);
    background: var(--primary-color);
    color: white;
}

.current-day-text {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.sessions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 30px;
}

/* ── Session Card ── */
.session-card {
    --card-accent: var(--primary-color);
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.session-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.session-card__accent {
    height: 4px;
    background: var(--card-accent);
    width: 100%;
}

.session-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.session-card__top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.session-card__number {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}

.session-card__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.session-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.2px;
    word-break: break-word;
}

.session-card__title--empty {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
}

.session-card__time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.session-card__time i {
    font-size: 12px;
    color: var(--card-accent);
}

.session-card__time-separator {
    color: #CBD5E0;
    font-size: 12px;
    margin: 0 1px;
}

.session-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #F1F3F5;
}

.session-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #F3F4F8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5A6070;
    white-space: nowrap;
}

.session-chip i {
    font-size: 10px;
    color: var(--card-accent);
}

/* Empty State */
.session-card--empty {
    border: 1px dashed #D0D5DD;
    box-shadow: none;
}

.session-card__empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 22px;
    color: #B0B8C4;
}

.session-card__subtitle {
    font-size: 13px;
    color: #9CA3AF;
    font-weight: 500;
    margin-top: 4px;
}

/* ── Session Count Badge ── */
.session-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), #7C7CFF);
    color: white;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(92, 92, 238, 0.3);
    animation: badgeFadeIn 0.4s ease-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.session-badge--warning {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.session-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(92, 92, 238, 0.4);
}

.session-badge--warning:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}

.badge-count {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

/* --- IDLE SNOW EFFECT --- */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 1s ease-out;
}

.snowflake {
    position: absolute;
    top: -30px;
    user-select: none;
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

@keyframes snowfall {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
    }
    50% {
        transform: translateY(50vh) translateX(30px) rotate(180deg);
    }
    100% {
        transform: translateY(100vh) translateX(-20px) rotate(360deg);
    }
}

body.winter-mode {
    transition: background-color 2s ease;
}

.badge-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.85;
    line-height: 1;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes badgePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.session-badge--updated {
    animation: badgePulse 0.35s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-view-toggle {
        display: flex;
        width: 100%;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0;
    }

    .sidebar-header {
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .header-top-row .week-navigation {
        flex: 1;
        max-width: 180px;
    }

    .week-navigation {
        margin-top: 0;
        padding: 6px 10px !important;
        border-radius: 10px !important;
    }

    .sidebar-filters {
        padding: 16px;
        flex-direction: column;
        overflow-y: auto;
        gap: 16px;
    }

    .filter-group {
        width: 100%;
    }

    .checkbox-list.scrollable {
        max-height: 200px;
    }

    #week-number-display {
        top: 8px;
        right: 8px;
        padding: 4px 12px;
        font-size: 12px;
    }

    .daily-view-container {
        padding: 12px;
    }

    .daily-navigation {
        margin-bottom: 14px;
        padding: 12px 14px;
    }

    /* Smaller badge on mobile */
    .session-badge {
        padding: 4px 10px;
        gap: 5px;
    }

    .badge-count {
        font-size: 14px;
    }

    .badge-label {
        font-size: 8px;
    }
}

/* ══════════════════════════════════════════
   DASHBOARD — Desktop Only
══════════════════════════════════════════ */

/* Sidebar button */
.dashboard-btn-wrapper {
    padding: 12px 16px 20px;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.dashboard-open-btn {
    background: linear-gradient(135deg, #5C5CEE, #7B7BFF) !important;
    box-shadow: 0 4px 14px rgba(92,92,238,0.28);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(92,92,238,0.38) !important;
}

/* Overlay */
.dashboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,30,0.52);
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    backdrop-filter: blur(3px);
}

.dashboard-panel {
    width: min(100%, 1100px);
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dashSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 48px rgba(0,0,0,0.18);
}

@keyframes dashSlideIn {
    from { transform: translateX(36px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #5C5CEE 0%, #7B7BFF 100%);
    color: white;
    flex-shrink: 0;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-title i { font-size: 18px; opacity: 0.85; }
.dashboard-title h2 { font-size: 18px; font-weight: 700; margin: 0; }

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-header-actions .btn-secondary {
    background: rgba(255,255,255,0.18) !important;
    border-color: rgba(255,255,255,0.35) !important;
    color: white !important;
    font-size: 13px;
    padding: 8px 14px;
}

.dashboard-header-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.28) !important;
}

.dashboard-close-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.dashboard-close-btn:hover { background: rgba(255,255,255,0.32); }

/* Filters bar */
.dashboard-filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 14px 24px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-field label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.filter-field input[type="month"],
.filter-field select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: white;
    outline: none;
    min-width: 148px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-field input[type="month"]:focus,
.filter-field select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(92,92,238,0.1);
}

/* Body / scrollable area */
.dashboard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    padding: 60px 0;
}

.dashboard-placeholder i { font-size: 48px; opacity: 0.22; }
.dashboard-placeholder p { font-size: 14px; font-weight: 500; }

/* Stat cards row */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--card-shadow);
}

.stat-card--primary {
    background: linear-gradient(135deg, #5C5CEE, #7B7BFF);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(92,92,238,0.28);
}

.stat-card__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-muted);
}

.stat-card--primary .stat-card__label { color: rgba(255,255,255,0.75); }

.stat-card__value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--text-main);
    margin: 4px 0;
}

.stat-card--primary .stat-card__value { color: white; }

.stat-card__sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card--primary .stat-card__sub { color: rgba(255,255,255,0.7); }

/* Chart card */
.dash-chart-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.dash-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-card-title i { color: var(--primary-color); }

/* Table card */
.dash-table-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    padding: 20px 0 0;
    box-shadow: var(--card-shadow);
}

.dash-table-card .dash-card-title {
    padding: 0 20px;
    margin-bottom: 12px;
}

.table-scroll-wrap { overflow-x: auto; }

.workload-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.workload-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: #F9FAFB;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.workload-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #F1F3F5;
    vertical-align: middle;
}

.workload-table tr:last-child td { border-bottom: none; }
.workload-table tbody tr:hover td { background: #FAFBFF; }

.trainer-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.trainer-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.sessions-bar-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.sessions-num {
    font-weight: 700;
    min-width: 24px;
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 6px;
    background: #EEF0F6;
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.hours-cell { font-weight: 600; }

.leave-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #FEF2F2;
    color: #DC2626;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.no-leave { color: #C8CDD8; font-size: 14px; }

.avg-cell { font-weight: 600; }

.overload-cell {
    font-weight: 700;
    color: #DC2626;
}

.dash-report-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0 8px;
}

/* Firebase status chip */
.firebase-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    margin-left: auto;
}

.firebase-status--ok   { background: #ECFDF5; color: #059669; }
.firebase-status--off  { background: #F3F4F6; color: #9CA3AF; }
.firebase-status--cache { background: #EFF6FF; color: #3B82F6; }

/* ── Print styles ── */
@media print {
    .sidebar,
    .main-content,
    #snow-container,
    .dashboard-btn-wrapper {
        display: none !important;
    }

    body {
        overflow: visible !important;
        background: white !important;
    }

    #dashboard-overlay {
        position: static !important;
        background: none !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    .dashboard-panel {
        box-shadow: none !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        overflow: visible !important;
        animation: none !important;
    }

    .dashboard-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #5C5CEE !important;
    }

    .dashboard-header-actions { display: none !important; }
    .dashboard-filters { display: none !important; }

    .dashboard-body {
        overflow: visible !important;
        padding: 16px !important;
    }

    .stat-card--primary {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #5C5CEE !important;
    }

    .bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .dash-chart-card canvas {
        max-height: 260px !important;
    }

    .dash-stats-row {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Hide dashboard on mobile */
@media (max-width: 768px) {
    .dashboard-btn-wrapper { display: none !important; }
    #dashboard-overlay     { display: none !important; }
}

/* ── Filter action row ── */
.dash-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* ── Firebase status badge ── */
.fb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: #F3F4F6;
    color: #9CA3AF;
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
    align-self: flex-end;
    white-space: nowrap;
    cursor: default;
}

.fb-status-badge.fb-connected {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}

.fb-status-badge.fb-cached {
    background: #EFF6FF;
    color: #3B82F6;
    border-color: #BFDBFE;
}

.fb-status-badge.fb-live {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
    animation: fbLivePulse 2s ease infinite;
}

.fb-status-badge.fb-offline {
    background: #F3F4F6;
    color: #9CA3AF;
    border-color: #E5E7EB;
}

.fb-status-badge.fb-error {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

@keyframes fbLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0.2); }
    50%       { box-shadow: 0 0 0 5px rgba(5,150,105,0); }
}

.fb-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.fb-status-badge.fb-live .fb-dot {
    animation: fbDotBlink 1.4s ease infinite;
}

@keyframes fbDotBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Toast notifications ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1E1E3A;
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast--success { border-left: 3px solid #10B981; }
.toast--info    { border-left: 3px solid #3B82F6; }
.toast--warning { border-left: 3px solid #F59E0B; }
.toast--error   { border-left: 3px solid #EF4444; }

.toast i { font-size: 14px; flex-shrink: 0; }
.toast--success i { color: #10B981; }
.toast--info    i { color: #3B82F6; }
.toast--warning i { color: #F59E0B; }
.toast--error   i { color: #EF4444; }

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

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

.toast.removing { animation: toastOut 0.3s ease forwards; }

/* ── Live update banner ── */
.live-update-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #059669;
    animation: bannerIn 0.3s ease;
}

@keyframes bannerIn {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Cache info strip ── */
.dash-cache-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    background: #F8F9FF;
    border: 1px solid #E0E4FF;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.dash-cache-info strong { color: var(--primary-color); }
