/* ==========================================================================
   MAMAN & MAESTRO — DASHBOARD DESIGN SYSTEM (INSPIRED BY SCHULE/TEACHER DASHBOARD)
   Periwinkle Tinted Glass, Deep Navy Sidebar, Rounded Cards & Timetable Grid
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Periwinkle & Royal Blue Palette (Matching Reference Image) */
    --bg-outer: #DCE4F7;         /* Outer lavender-periwinkle container background */
    --bg-dashboard: #F4F6FF;     /* Dashboard window background */
    
    --sidebar-bg: #0F172A;       /* Deep Royal Navy Sidebar */
    --sidebar-active: #3B82F6;   /* Electric Blue active tab */
    --sidebar-active-glow: rgba(59, 130, 246, 0.4);

    --primary: #2563EB;          /* Royal Indigo */
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    
    --secondary: #4F46E5;        /* Deep Violet Blue */
    --accent: #F59E0B;           /* Sun Amber */
    --success: #10B981;          /* Emerald Green */

    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    
    --text-title: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;

    --font-main: 'Outfit', 'Fredoka', system-ui, -apple-system, sans-serif;
    --font-heading: 'Fredoka', sans-serif;
    --font-dys: 'OpenDyslexic', 'Outfit', sans-serif;

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 9999px;

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dyslexic & High Contrast Accessibility Modes */
body.mode-dys {
    font-family: var(--font-dys) !important;
    letter-spacing: 0.06em;
    word-spacing: 0.16em;
    line-height: 1.8;
}

body.mode-high-contrast {
    --bg-outer: #E2E8F0;
    --bg-dashboard: #FFFFFF;
    --card-bg: #FFFFFF;
    --card-border: #000000;
    --text-title: #000000;
    --text-body: #000000;
}

/* Global Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-main);
    background: var(--bg-outer);
    color: var(--text-body);
    overflow-x: hidden;
    line-height: 1.5;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    max-width: 1600px;
    min-height: calc(100vh - 32px);
    background: var(--bg-dashboard);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   LEFT VERTICAL SIDEBAR (NAVBAR MATCHING REFERENCE IMAGE)
   ========================================================================== */
.left-sidebar-vertical {
    width: 110px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 12px;
    flex-shrink: 0;
    z-index: 10;
}

/* Top App Brand Icon Badge */
.sidebar-brand-badge {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    margin-bottom: 12px;
}

/* Vertical Nav List */
.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.nav-item-v {
    width: 86px;
    height: 68px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    transition: var(--transition);
}

.nav-item-v .nav-icon {
    font-size: 1.35rem;
}

.nav-item-v:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.nav-item-v.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #FFFFFF;
    box-shadow: var(--sidebar-active-glow);
}

/* Bottom Accessibility Toggles in Left Sidebar */
.sidebar-bottom-acc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item-v-acc {
    width: 86px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 700;
    transition: var(--transition);
}

.nav-item-v-acc .nav-icon {
    font-size: 1.1rem;
}

.nav-item-v-acc:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.nav-item-v-acc.active {
    background: #3B82F6;
    border-color: #60A5FA;
    color: #FFFFFF;
}

/* ==========================================================================
   MAIN DASHBOARD AREA (TOP HEADER & CONTENT GRID)
   ========================================================================== */
.dashboard-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

/* Top Bar / Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: transparent;
}

/* Date Switcher Widget */
.date-navigator {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--card-shadow);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-title);
}

.date-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #F1F5F9;
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.date-nav-btn:hover {
    background: #E2E8F0;
    color: var(--primary);
}

/* Right Header Actions */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.subject-pill-active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-bar-header {
    background: #FFFFFF;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--card-shadow);
    border: 1px solid transparent;
}

.search-bar-header input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-title);
    width: 140px;
}

.stat-chip-dashboard {
    background: #FFFFFF;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--card-shadow);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-switcher-dashboard {
    display: flex;
    background: #E2E8F0;
    padding: 4px;
    border-radius: var(--radius-full);
}

.role-btn-dash {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    transition: var(--transition);
}

.role-btn-dash.active {
    background: #FFFFFF;
    color: var(--text-title);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   MAIN DASHBOARD GRID LAYOUT (CARDS, CENTER & RIGHT TIMETABLE)
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 0 32px 32px 32px;
}

/* Section Title */
.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 14px;
}

/* Matières / Classes Cards Row */
.classes-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.subject-card-dash {
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
    color: white;
    padding: 16px 14px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(30, 27, 75, 0.2);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 115px;
}

.subject-card-dash:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(30, 27, 75, 0.3);
}

.subject-card-dash.card-maths {
    background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
}

.subject-card-dash.card-sci {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

.subject-card-dash.card-hist {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
}

.subject-card-dash.card-add {
    background: #EAEFFE;
    border: 2px dashed #93C5FD;
    color: #2563EB;
    box-shadow: none;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.subject-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.25rem;
}

.subject-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* Two-Column Middle Grid (Notifications & Tasks) */
.middle-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Active Live Banner */
.active-session-banner {
    background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 100%);
    color: white;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    gap: 16px;
}

.banner-icon-badge {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Task Cards */
.task-item-card {
    background: #FFFFFF;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.task-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #EEF2FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #4F46E5;
}

.task-details {
    flex: 1;
}

.task-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-title);
}

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

/* Central Dynamic Content Area */
.center-content-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

/* ==========================================================================
   RIGHT SIDEBAR: STUNDENPLAN / TIMETABLE & ASSISTANTS
   ========================================================================== */
.right-sidebar-dash {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timetable-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.timetable-header {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 16px;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-row {
    display: flex;
    gap: 12px;
}

.timeline-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 45px;
    padding-top: 6px;
}

.timeline-content {
    flex: 1;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-title);
}

.timeline-content.active-now {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    padding: 14px;
}

.timeline-content .sub-time {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.8;
}

.timeline-act-btn {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* General Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: white;
    color: var(--text-title);
    border: 2px solid #E2E8F0;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

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

/* Glass Card Helper */
.glass-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--card-shadow);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
