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

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

/* ==========================================================================
   2. VARIABLES GLOBALES (Le socle de tous les autres CSS)
   ========================================================================== */
:root {
    /* ⚠ Note : Dans le code legacy, la couleur Orange est nommée --teal */
    --teal       : #F04E23; 
    --teal-dark  : #C43A15;
    --teal-light : #FEF0EB;
    
    /* Couleurs de fond et textes */
    --bg         : #FFFFFF;
    --white      : #ffffff;
    --text       : #1A2857;
    --text-soft  : #5B6A9A;
    --border     : #E2E4EF;
    
    /* Couleurs de statut */
    --green      : #27AE60;
    --orange     : #F5A623;
    --red        : #E8215A;

    /* Élévation et arrondis */
    --shadow     : 0 2px 12px rgba(27, 40, 87, 0.10);
    --radius     : 12px;
}

/* ==========================================================================
   3. TYPOGRAPHIE & BODY
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    /* Prévient les débordements horizontaux sur mobile */
    overflow-x: hidden; 
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   4. LAYOUT : CONTAINER GLOBAL
   ========================================================================== */
.container {
    /* Largeur max standard pour Admin, PP, Parents (Animateurs l'écrase à 1300px localement) */
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Grilles standards utilisées dans plusieurs pages */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* ==========================================================================
   5. HEADER COMMUN (Navigation du haut)
   ========================================================================== */
.header {
    background: var(--white);
    color: var(--text);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    border-bottom: 3px solid var(--teal);
    box-shadow: 0 2px 8px rgba(27, 40, 87, 0.08);
}

.header-logo {
    width: 42px; 
    height: 42px; 
    border-radius: 8px;
    background: var(--white); 
    border: 1.5px solid var(--teal);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0;
}

.header-logo img { 
    width: 34px; 
    height: 34px; 
    object-fit: contain; 
}

.header-title { 
    font-family: 'GFS Didot', serif; 
    font-size: 18px; 
    color: var(--text); 
}

.header-subtitle { 
    font-size: 11px; 
    color: var(--text-soft); 
    margin-top: 1px; 
}

.header-right { 
    margin-left: auto; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-shrink: 0; 
}

/* Badge Utilisateur (Nom + Rôle) dans le header */
#userBadge {
    padding: 5px 12px; 
    border-radius: 20px;
    background: var(--white); 
    border: 1.5px solid var(--teal);
    color: var(--teal); 
    font-size: 12px; 
    font-weight: 500;
    white-space: nowrap; 
    display: none; /* Affiché via JS une fois l'auth vérifiée */
}

/* ==========================================================================
   6. RESPONSIVE DE BASE (Header & Container)
   ========================================================================== */

/* Tablette */
@media (max-width: 768px) {
    .container { 
        padding: 14px 12px 48px; 
    }
    .header-subtitle { 
        display: none; 
    }
    #userBadge { 
        max-width: 90px; 
        font-size: 10px; 
        padding: 3px 8px;
        overflow: hidden; 
        text-overflow: ellipsis; 
        white-space: nowrap; 
    }
}

/* Mobile */
@media (max-width: 600px) {
    .header { 
        padding: 8px 10px; 
        gap: 6px; 
    }
    .header-logo { 
        width: 32px; 
        height: 32px; 
    }
    .header-logo img { 
        width: 24px; 
        height: 24px; 
    }
    .header-title { 
        font-size: 14px; 
    }
    .header-right { 
        gap: 5px; 
    }
    
    .grid-2, .grid-4 { 
        grid-template-columns: 1fr; 
    }
}