/* =============================================
   Fiche Conseil de Classe — Design System
   =============================================
   Thème sombre premium avec glassmorphisme
   Optimisé tablette pour usage en conseil
   ============================================= */

/* === CSS Variables === */
:root {
    /* Palette principale */
    --bg-primary: #0c1222;
    --bg-secondary: #131c31;
    --bg-card: rgba(23, 34, 56, 0.7);
    --bg-card-hover: rgba(30, 42, 65, 0.85);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-nav: rgba(12, 18, 34, 0.92);
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    /* Couleurs */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent: #a855f7;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.15);
    
    /* Niveaux scolaires */
    --niveau-6: #3b82f6;
    --niveau-5: #22c55e;
    --niveau-4: #f59e0b;
    --niveau-3: #ef4444;
    --niveau-ulis: #a855f7;
    
    /* Texte */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #c4b5fd;
    
    /* Tailles */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--primary-glow);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Nav height */
    --nav-height: 64px;
}

/* === Mode Clair (Noir sur Blanc) === */
[data-theme="light"] {
    /* Palette claire moderne & reposante */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.95);
    
    --border-subtle: #e2e8f0;
    --border-light: #cbd5e1;
    --border-focus: rgba(79, 70, 229, 0.5);
    
    /* Couleurs */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-glow: rgba(79, 70, 229, 0.2);
    
    --accent: #9333ea;
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.12);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.12);
    
    /* Texte pour fond clair */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-accent: #4f46e5;
    
    /* Shadows adoucies */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

/* Adaptations spécifiques au Mode Clair */
[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.03) 0%, transparent 60%);
}

[data-theme="light"] .card,
[data-theme="light"] .student-card,
[data-theme="light"] .attendance-card,
[data-theme="light"] .class-summary-card,
[data-theme="light"] .history-panel,
[data-theme="light"] .stat-card {
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .class-summary-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .class-summary-textarea {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .class-summary-textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
}

[data-theme="light"] .class-summary-footer {
    border-top-color: #f1f5f9;
}

[data-theme="light"] .student-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

[data-theme="light"] .student-card.selected {
    background: #f5f3ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-md);
}

[data-theme="light"] .btn-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

[data-theme="light"] .student-comment {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .student-comment:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

[data-theme="light"] .plan-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    opacity: 0.7;
}

[data-theme="light"] .plan-btn:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
    opacity: 1;
}

[data-theme="light"] .mention-btn {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

[data-theme="light"] .mention-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .student-avatar-thumb {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .history-student-header-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .history-student-photo-wrap {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

[data-theme="light"] .period-tab {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

[data-theme="light"] .period-tab.active {
    background: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .council-tabs-nav {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .council-tab-btn {
    color: #475569;
}

[data-theme="light"] .council-tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

[data-theme="light"] .council-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .attendance-toggle-btn.absent {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

[data-theme="light"] .attendance-toggle-btn.absent:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .attendance-comment-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .attendance-progress-bar {
    background: #e2e8f0;
}

[data-theme="light"] .data-table thead tr {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

[data-theme="light"] .data-table th {
    color: #475569;
}

[data-theme="light"] .data-table td {
    border-bottom: 1px solid #f1f5f9;
}

[data-theme="light"] .data-table tr:hover td {
    background: #f8fafc;
}

[data-theme="light"] .main-nav {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-link {
    color: #475569;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dropdown-item {
    color: #334155;
}

[data-theme="light"] .dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

[data-theme="light"] .user-info {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .modal-box {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* Bouton toggle Thème Clair / Sombre */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-base);
    user-select: none;
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-light);
}
[data-theme="light"] .theme-toggle-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .theme-toggle-btn:hover {
    background: #e2e8f0;
    border-color: var(--primary);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fond avec gradient subtil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--text-primary); }

img { max-width: 100%; }

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* === Navigation === */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

.main-nav.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-logo {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-light);
    background: var(--primary-glow);
}

.nav-icon { font-size: 1rem; }

.dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 2px;
    transition: transform var(--transition-fast);
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
    z-index: 1001;
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* Nav user */
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-logout {
    opacity: 0.6;
    font-size: 1.2rem !important;
    padding: 6px 10px !important;
}
.nav-logout:hover { opacity: 1; }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* === Main Content === */
.main-content {
    padding-top: calc(var(--nav-height) + 32px);
    padding-bottom: 60px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Grids === */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === Stats Cards === */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--primary));
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.3));
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-value[style*="color"] {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-admin { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge-enseignant { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-consultation { background: rgba(34, 197, 94, 0.2); color: #86efac; }

.badge-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-secondary { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.badge-niveau-6 { background: rgba(59, 130, 246, 0.2); color: var(--niveau-6); }
.badge-niveau-5 { background: rgba(34, 197, 94, 0.2); color: var(--niveau-5); }
.badge-niveau-4 { background: rgba(245, 158, 11, 0.2); color: var(--niveau-4); }
.badge-niveau-3 { background: rgba(239, 68, 68, 0.2); color: var(--niveau-3); }
.badge-niveau-ulis { background: rgba(168, 85, 247, 0.2); color: var(--niveau-ulis); }

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
}
.btn-success:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}
.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
[data-theme="light"] .btn-outline-secondary:hover {
    background: #e2e8f0;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Tables === */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: rgba(15, 23, 42, 0.5);
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    vertical-align: middle;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* === Classe Selector (Cards grid) === */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.class-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--class-color, var(--primary));
}

.class-card:hover {
    transform: translateY(-3px);
    border-color: var(--class-color, var(--primary));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

.class-card.active {
    border-color: var(--class-color, var(--primary));
    background: var(--bg-card-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.class-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.class-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Conseil de classe interface === */
.conseil-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
}

.conseil-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all var(--transition-base);
    position: relative;
    cursor: pointer;
}

.student-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: var(--bg-card-hover);
}

.student-card textarea {
    cursor: text;
}

.student-card.saving {
    border-left-color: var(--warning);
}

.student-card.saved {
    border-left-color: var(--success);
}

.student-card.selected {
    border-color: var(--primary);
    border-left: 4px solid var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow), 0 4px 20px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.08);
}

.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-btn:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.student-name {
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-name-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Miniature photo d'élève dans la carte de classe */
.student-avatar-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border-light);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    flex-shrink: 0;
}

.student-avatar-thumb:hover {
    transform: scale(1.12);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    z-index: 2;
}

.student-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Carte en-tête de l'historique avec photo */
.history-student-header-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.history-student-photo-wrap {
    width: 74px;
    height: 90px;
    min-width: 74px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-light);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    flex-shrink: 0;
}

.history-student-photo-wrap:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.history-student-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

@media (max-width: 768px) {
    .student-avatar-thumb {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
}

.student-card.has-plan {
    border-left: 3px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.05) 0%, rgba(23, 34, 56, 0.7) 140px);
}

.student-card.selected.has-plan {
    border-left: 4px solid var(--primary);
}

.student-plans {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.plan-btn,
.plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    opacity: 0.45;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    line-height: 1.25;
    user-select: none;
    text-decoration: none;
}

.plan-btn .plan-icon,
.plan-badge .plan-icon {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.plan-btn:hover:not(:disabled),
.plan-badge:hover:not(:disabled) {
    opacity: 1;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.plan-btn:disabled,
.plan-badge:disabled {
    cursor: default;
    opacity: 0.25;
}

/* ========================================================
   DISPOSITIFS ACTIFS : Plein contraste, 100% opaque
   Texte blanc ultra-lisible, couleur vive et ombre portée
   ======================================================== */
.plan-btn.active,
.plan-badge.active {
    opacity: 1 !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    border-style: solid !important;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transform: scale(1.02);
}

.plan-btn.active:hover:not(:disabled),
.plan-badge.active:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: scale(1.05) translateY(-1px);
}

.plan-btn.active .plan-icon,
.plan-badge.active .plan-icon {
    font-weight: 900;
}

/* PPRE actif - Ambre / Orange chaleureux */
.plan-btn.plan-ppre.active,
.plan-badge.plan-ppre.active {
    background: #d97706 !important;
    border: 1px solid #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.5) !important;
}

/* PAP actif - Bleu Cyan vif */
.plan-btn.plan-pap.active,
.plan-badge.plan-pap.active {
    background: #0284c7 !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.5) !important;
}

/* PPS actif - Violet Royal profond */
.plan-btn.plan-pps.active,
.plan-badge.plan-pps.active {
    background: #7c3aed !important;
    border: 1px solid #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.5) !important;
}

/* PAI actif - Vert Émeraude vif */
.plan-btn.plan-pai.active,
.plan-badge.plan-pai.active {
    background: #059669 !important;
    border: 1px solid #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.5) !important;
}

.student-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
}

.save-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.save-indicator.visible { opacity: 1; }
.save-indicator.saving { color: var(--warning); }
.save-indicator.saved { color: var(--success); }

.student-comment {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: all var(--transition-fast);
}

.student-comment:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    min-height: 100px;
}

.student-comment:read-only {
    opacity: 0.7;
    cursor: default;
}

.mention-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.mention-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.mention-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.mention-btn.active {
    border-color: var(--mention-color, var(--primary));
    background: color-mix(in srgb, var(--mention-color, var(--primary)) 20%, transparent);
    color: var(--mention-color, var(--primary));
}

.mention-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* === History Panel === */
.history-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 60px);
    overflow-y: auto;
    transition: all var(--transition-base);
}

.history-panel::-webkit-scrollbar {
    width: 6px;
}
.history-panel::-webkit-scrollbar-track {
    background: transparent;
}
.history-panel::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.history-empty .icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.history-student-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.history-student-class {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.history-year {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.history-year:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.history-year-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-year-class {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.history-period {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-subtle);
}

.history-period-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.history-period-comment {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.history-period-comment.empty {
    color: var(--text-muted);
    font-style: italic;
}

.history-period-mentions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.history-mention-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

/* === Fiche élève page === */
.fiche-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.fiche-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.fiche-info h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.fiche-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.fiche-timeline {
    position: relative;
    padding-left: 30px;
}

.fiche-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent), transparent);
}

.timeline-year {
    position: relative;
    margin-bottom: 32px;
}

.timeline-year::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.timeline-year-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.timeline-year-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
}

.timeline-periods {
    display: grid;
    gap: 10px;
}

.timeline-period-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.timeline-period-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.timeline-period-text {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* === Import page === */
.import-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: rgba(99, 102, 241, 0.03);
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.import-dropzone .icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.import-dropzone h3 {
    margin-bottom: 8px;
}

.import-dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.import-progress {
    margin-top: 20px;
    display: none;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    width: 0%;
}

.import-results {
    margin-top: 24px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.result-item:last-child { border-bottom: none; }

.result-icon { font-size: 1.2rem; }

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
}

.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
}

.login-logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

.login-error {
    background: var(--danger-soft);
    color: var(--danger);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    font-size: 0.9rem;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-info { border-left: 3px solid var(--info); }

.toast-icon { font-size: 1.2rem; }

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

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

/* === Alerts === */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.alert-info {
    background: var(--info-soft);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-success {
    background: var(--success-soft);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-warning {
    background: var(--warning-soft);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: var(--danger-soft);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* === Period Tabs === */
.period-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.period-tab {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    font-family: inherit;
}

.period-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.period-tab.active {
    color: var(--text-primary);
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* === Search === */
.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.search-results.visible { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child { border-bottom: none; }

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.visible,
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
    pointer-events: auto;
}

.modal-overlay.visible .modal,
.modal-overlay.open .modal,
.modal-overlay.visible .modal-box,
.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 24px;
}

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

/* === Print/Export styles === */
.print-page {
    background: white;
    color: #1a1a1a;
    padding: 30px;
    font-family: 'Inter', sans-serif;
}

.print-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #333;
}

.print-header h1 {
    font-size: 1.4rem;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.print-header h2 {
    font-size: 1.1rem;
    color: #555;
    font-weight: 500;
}

.print-student {
    page-break-inside: avoid;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.print-student-header {
    background: #f3f4f6;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-student-body {
    padding: 10px 14px;
}

.print-period {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.print-period:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.print-period-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.print-comment {
    font-size: 0.88rem;
    line-height: 1.5;
}

.print-mentions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.print-mention-tag {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid currentColor;
}

.print-only {
    display: none !important;
}

@media print {
    body { background: white !important; }
    body::before { display: none; }
    .main-nav, .no-print, .toast-container { display: none !important; }
    .print-only { display: inline-block !important; }
    .main-content { padding-top: 0 !important; }
    .print-page { padding: 0; }
    .print-student { break-inside: avoid; }
}

/* === Empty States === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* === Loading spinner === */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 34, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .conseil-layout {
        grid-template-columns: 1fr;
    }
    
    .history-panel {
        position: fixed;
        top: 0;
        right: -420px;
        bottom: 0;
        width: 400px;
        max-height: 100vh;
        border-radius: 0;
        border-left: 1px solid var(--border-light);
        z-index: 1500;
        transition: right var(--transition-slow);
    }
    
    .history-panel.open {
        right: 0;
    }
    
    .history-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1400;
    }
    
    .history-backdrop.visible {
        display: block;
    }
    
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }
    
    .nav-links, .user-name, .user-role {
        display: none;
    }
    
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-nav);
        border-bottom: 1px solid var(--border-subtle);
        padding: 12px;
        gap: 4px;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-toggle { display: flex; }
    
    .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 16px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .class-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    h1, .page-title { font-size: 1.4rem; }
    
    .stat-value { font-size: 1.8rem; }
    
    .history-panel {
        width: 100%;
        right: -100%;
    }
}

/* === Scrollbar custom === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === Utility classes === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }

/* === Navigation des onglets du conseil (Émargement, Fiches élèves, Statistiques) === */
.council-tabs-nav {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.7);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.council-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}
.council-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.council-tab-btn.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow);
}
.council-tab-btn .badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 9999px;
}

/* === Section Émargement des professeurs === */
.attendance-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.attendance-progress-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
}
.attendance-progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}
.attendance-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #22c55e);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Liste des enseignants */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.attendance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attendance-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}
.attendance-card.is-present {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, rgba(23, 34, 56, 0.7) 100%);
}
.attendance-card.is-pp {
    border-color: rgba(245, 158, 11, 0.4);
}
.attendance-card.is-pp .attendance-avatar {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.attendance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.attendance-teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.attendance-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.attendance-card.is-present .attendance-avatar {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}
.attendance-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}
.attendance-disc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.attendance-toggle-btn {
    cursor: pointer;
    border: none;
    outline: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-base);
}
.attendance-toggle-btn.present {
    background: var(--success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.attendance-toggle-btn.absent {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.attendance-toggle-btn.absent:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}
.attendance-principal-badge {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
    user-select: none;
}
.attendance-principal-badge.active {
    background: var(--warning);
    color: #000;
    font-weight: 700;
}
.attendance-comment-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: border-color var(--transition-base);
}
.attendance-comment-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Modal simple (boîte compacte) */
.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

/* === Bilan général du conseil de classe === */
.class-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.class-summary-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.class-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.class-summary-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.class-summary-icon {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.class-summary-body {
    position: relative;
    width: 100%;
}

.class-summary-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 85px;
    outline: none;
    transition: all var(--transition-fast);
}

.class-summary-textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}

.class-summary-textarea:read-only {
    opacity: 0.75;
    cursor: default;
}

.class-summary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

/* Bouton afficher/masquer mot de passe */
.pwd-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 6px;
    opacity: 0.65;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.pwd-toggle-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Jauge de robustesse du mot de passe */
.pwd-strength-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pwd-strength-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
}
[data-theme="light"] .pwd-strength-bar {
    background: #e2e8f0;
}
.pwd-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 9999px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* === Correcteur orthographique & grammatical === */
.grammar-preview-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 16px;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="light"] .grammar-preview-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.grammar-err-spell {
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 2px wavy #ef4444;
    padding: 1px 3px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    color: #ef4444;
}
.grammar-err-grammar {
    background: rgba(245, 158, 11, 0.15);
    border-bottom: 2px wavy #f59e0b;
    padding: 1px 3px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    color: #f59e0b;
}
.grammar-err-typo {
    background: rgba(59, 130, 246, 0.15);
    border-bottom: 2px wavy #3b82f6;
    padding: 1px 3px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    color: #3b82f6;
}

.grammar-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--transition-fast);
}
.grammar-item-card:hover {
    border-color: var(--primary);
}
[data-theme="light"] .grammar-item-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

.grammar-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.grammar-chip:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.grammar-batch-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}
.grammar-batch-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .grammar-batch-item {
    background: #ffffff;
    border-color: #e2e8f0;
}

.grammar-batch-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
}
[data-theme="light"] .grammar-batch-nav {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.grammar-batch-toolbar {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}
[data-theme="light"] .grammar-batch-toolbar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* ========================================================
   Fiche de Renseignements Élève & Famille
   ======================================================== */

.student-info-btn {
    font-size: 0.8rem;
    padding: 4px 9px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary);
    transition: all 0.2s ease;
}
.student-info-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.info-status-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}
[data-theme="light"] .info-status-bar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.info-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-parents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (max-width: 768px) {
    .info-parents-grid {
        grid-template-columns: 1fr;
    }
}

.info-parent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color var(--transition-fast);
}
[data-theme="light"] .info-parent-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.info-parent-card.empty {
    border-style: dashed;
    background: transparent;
    opacity: 0.75;
}

.info-parent-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}
.info-parent-role {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
}
.info-parent-name {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.info-parent-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
}
.info-item-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    opacity: 0.85;
    margin-top: 1px;
}
.info-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.info-item-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}
.info-item-value {
    color: var(--text-primary);
    word-break: break-word;
}

.info-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.info-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.info-student-addr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}
[data-theme="light"] .info-student-addr {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.info-card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
[data-theme="light"] .info-card-box {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.info-card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.info-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.siblings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sibling-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
[data-theme="light"] .sibling-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.sibling-icon {
    font-size: 1.1rem;
}
.sibling-class {
    display: inline-block;
    margin-left: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Print styling */
@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    /* Éléments à masquer à l'impression */
    #mainNav, .main-nav, .class-grid, .period-tabs, .council-tabs-nav, .btn, 
    .history-panel, .history-backdrop, .attendance-comment-input, 
    #filterToolsBox, .toast-container, .no-print, select, #yearSelector,
    .attendance-toggle-btn {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Cartes & cadres */
    .card, .stat-card, .class-summary-card {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .card-header {
        background: #f8fafc !important;
        border-bottom: 1px solid #cbd5e1 !important;
    }

    /* Indicateurs statistiques clés (cartes du haut) */
    .stats-grid {
        gap: 12px !important;
        margin-bottom: 16px !important;
    }
    .stat-card {
        padding: 12px 16px !important;
    }
    .stat-value {
        background: none !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
        color: #0f172a !important;
        font-size: 1.8rem !important;
        font-weight: 800 !important;
    }
    .stat-value[style*="var(--success)"] {
        color: #166534 !important;
    }
    .stat-label {
        color: #475569 !important;
        font-weight: 600 !important;
    }
    .text-muted {
        color: #64748b !important;
    }

    /* Tableaux : texte noir net sur fond blanc */
    table, .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        color: #0f172a !important;
        background: #ffffff !important;
    }
    table th, .data-table th, thead th {
        background: #f1f5f9 !important;
        color: #1e293b !important;
        border: 1px solid #cbd5e1 !important;
        font-weight: 700 !important;
        padding: 8px 10px !important;
    }
    table td, .data-table td, tbody td {
        background: #ffffff !important;
        color: #0f172a !important;
        border: 1px solid #e2e8f0 !important;
        padding: 8px 10px !important;
    }
    table tfoot tr, .data-table tfoot tr {
        background: #f8fafc !important;
        color: #0f172a !important;
        border-top: 2px solid #94a3b8 !important;
    }

    /* Badges de taux et d'état */
    .badge {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        padding: 2px 6px !important;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
    }
    .badge.badge-success {
        background: #dcfce7 !important;
        color: #166534 !important;
        border-color: #86efac !important;
    }
    .badge.badge-warning {
        background: #fef3c7 !important;
        color: #92400e !important;
        border-color: #fcd34d !important;
    }
    .badge.badge-danger {
        background: #fee2e2 !important;
        color: #991b1b !important;
        border-color: #fca5a5 !important;
    }
    .badge.badge-secondary {
        background: #f8fafc !important;
        color: #475569 !important;
        border-color: #cbd5e1 !important;
    }

    /* Textes en gras et éléments de taux avec couleurs inline */
    strong {
        color: #0f172a !important;
    }
    strong[style*="var(--success)"] { color: #166534 !important; }
    strong[style*="var(--warning)"] { color: #b45309 !important; }
    strong[style*="var(--danger)"] { color: #b91c1c !important; }

    /* Barres de progression */
    .attendance-progress-bar {
        border: 1px solid #cbd5e1 !important;
        background: #f1f5f9 !important;
    }
    .attendance-progress-fill {
        background: #16a34a !important;
    }

    .attendance-card {
        border: 1px solid #cbd5e1 !important;
        background: #ffffff !important;
        color: #0f172a !important;
        break-inside: avoid;
    }
    .attendance-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === Affichage et Modale des Photos d'Élèves === */
.student-photo-btn {
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    transition: all var(--transition-base) !important;
}
.student-photo-btn:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: var(--primary) !important;
    color: var(--primary-light) !important;
    transform: translateY(-1px);
}
[data-theme="light"] .student-photo-btn:hover {
    background: #eef2ff !important;
    color: #4338ca !important;
}

.student-photo-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.student-photo-frame {
    position: relative;
    max-width: 280px;
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
[data-theme="light"] .student-photo-frame {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.student-photo-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
}

.student-photo-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.student-photo-img.loaded {
    opacity: 1;
}
.student-photo-img:hover {
    transform: scale(1.02);
}

.student-photo-meta {
    text-align: center;
}

/* Profil élève dans la modale de renseignements */
.info-student-profile-bar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}
[data-theme="light"] .info-student-profile-bar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.info-student-avatar-wrap {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--primary);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.info-student-avatar-wrap:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.info-student-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Fiche EBP & Aménagements pédagogiques === */
.info-ebp-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}
[data-theme="light"] .info-ebp-box {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #c4b5fd;
}

.info-ebp-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 10px;
    margin-bottom: 12px;
}
[data-theme="light"] .info-ebp-header {
    border-bottom-color: #ddd6fe;
}

.info-ebp-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--primary);
}

.ebp-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ebp-section-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.ebp-amenagements-highlight {
    background: rgba(245, 158, 11, 0.09);
    border-left: 3px solid var(--warning);
    padding: 10px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
[data-theme="light"] .ebp-amenagements-highlight {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.ebp-amenagements-highlight .ebp-section-label {
    color: #d97706;
}

.badge-ebp {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.badge-ebp:hover {
    transform: scale(1.05);
}

/* === Outils rapides de conseil (Phrases types & Options) === */
.student-quick-tools {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}
[data-theme="light"] .student-quick-tools {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.phrase-quick-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    max-width: 340px;
    cursor: pointer;
    transition: all var(--transition-base);
}
.phrase-quick-select:hover, .phrase-quick-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.future-option-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    min-width: 175px;
    cursor: pointer;
    transition: all var(--transition-base);
}
.future-option-select.has-choice {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    color: var(--primary-light);
    font-weight: 600;
}
[data-theme="light"] .future-option-select.has-choice {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
}
