:root {
    --bleu: #1f4e79;
    --bleu-fonce: #16395a;
    --bleu-clair: #eaf1f8;
    --bordure: #e2e8f0;
    --bordure-forte: #cbd5e1;
    --texte: #1c2733;
    --gris: #5b6b7b;
    --fond: #f1f4f8;
    --vert: #2e7d32;
    --rouge: #b3261e;
    --or: #b9871f;
    --ombre: 0 1px 2px rgba(16, 33, 51, 0.04), 0 4px 16px rgba(16, 33, 51, 0.06);
    --rayon: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--texte);
    background: var(--fond);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- En-tête + navigation ---- */
.entete {
    background: linear-gradient(180deg, var(--bleu) 0%, var(--bleu-fonce) 100%);
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.entete .marque { font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; }
.entete .compte { font-size: 0.85rem; opacity: 0.9; margin-right: 0.6rem; }
.entete form { display: inline; }

.nav {
    background: var(--bleu-fonce);
    padding: 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    box-shadow: var(--ombre);
}
.nav a {
    color: #c6d6e6;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.06); }
.nav a.actif { color: #fff; border-bottom-color: var(--or); font-weight: 600; }

main { max-width: 1120px; margin: 1.75rem auto; padding: 0 1.5rem; }

/* ---- Titres ---- */
h1 { font-size: 1.5rem; margin: 0 0 1.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 0.98rem; margin: 0 0 0.5rem; }

/* ---- Cartes ---- */
.carte {
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--ombre);
}
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }

/* ---- Cartes accordéon (dépliables — même esprit que le CA mensuel) ---- */
details.carte > summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
details.carte > summary::-webkit-details-marker { display: none; }
details.carte > summary::before {
    content: '▸';
    display: inline-block;
    color: var(--gris);
    font-size: 0.85em;
    transition: transform 0.15s;
}
details.carte[open] > summary::before { transform: rotate(90deg); }
details.carte[open] > summary { margin-bottom: 1rem; }
details.carte > summary:hover { color: var(--bleu); }

/* ---- Tableaux ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--bordure); }
thead th {
    color: var(--gris);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f8fafc;
    border-bottom: 2px solid var(--bordure-forte);
}
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f7fafd; }

/* ---- Formulaires ---- */
label { display: block; font-size: 0.83rem; color: var(--gris); margin: 0.7rem 0 0.25rem; font-weight: 500; }
input, select, textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--bordure-forte);
    border-radius: 8px;
    font-size: 0.92rem;
    background: #fff;
    color: var(--texte);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bleu);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.14);
}
input[type="file"] { padding: 0.4rem; background: #f8fafc; }
.ligne { display: flex; gap: 1rem; flex-wrap: wrap; }
.ligne > div { flex: 1; min-width: 150px; }

/* ---- Boutons (｟button｠ ET liens .bouton) ---- */
button, .bouton {
    display: inline-block;
    background: var(--bleu);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    margin-top: 0.6rem;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
button:hover, .bouton:hover { background: var(--bleu-fonce); text-decoration: none; box-shadow: var(--ombre); }
button:active, .bouton:active { transform: translateY(1px); }

button.secondaire, .bouton.secondaire {
    background: #eef2f7;
    color: var(--texte);
    border-color: var(--bordure-forte);
}
button.secondaire:hover, .bouton.secondaire:hover { background: #e2e8f0; }

button.danger, .bouton.danger { background: var(--rouge); }
button.danger:hover, .bouton.danger:hover { background: #8f1d17; }

button.petit, .bouton.petit { padding: 0.32rem 0.7rem; font-size: 0.8rem; margin: 0; border-radius: 7px; }

/* ---- Badges ---- */
.badge { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 0.18rem 0.55rem; border-radius: 999px; }
.badge.ok { background: #e3f2e4; color: var(--vert); }
.badge.ase { background: #fdf2dc; color: var(--or); }
.badge.ferme { background: #f7e3e1; color: var(--rouge); }
.badge.instable { background: #e7eef7; color: var(--bleu); }   /* distinct du signalement (rouge) */
/* États du jeune : couleurs distinctes (présent / attendu / départ programmé / parti) */
.badge.present { background: #e3f2e4; color: var(--vert); }
.badge.attendu { background: #e7eef7; color: var(--bleu); }
.badge.depart  { background: #fdecd8; color: #b25b00; }
.badge.parti   { background: #eceff3; color: var(--gris); }

/* ---- Alertes ---- */
.alerte { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid transparent; }
.alerte.succes { background: #e3f2e4; color: var(--vert); border-color: #bfe0c1; }
.alerte.info { background: var(--bleu-clair); color: var(--bleu); border-color: #c8dcef; }
.alerte.erreur { background: #f7e3e1; color: var(--rouge); border-color: #eebfba; }
.alerte > div + div { margin-top: 0.2rem; }

/* ---- Divers ---- */
.muet { color: var(--gris); font-size: 0.85rem; }
details > summary { cursor: pointer; padding: 0.3rem 0; color: var(--bleu); }
details[open] > summary { margin-bottom: 0.5rem; }

/* ---- Écrans d'authentification (login, 2FA) ---- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--bleu) 0%, var(--bleu-fonce) 100%);
}
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.auth-marque {
    text-align: center;
    font-weight: 700;
    color: var(--bleu);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.auth-card h1 { font-size: 1.2rem; text-align: center; margin: 0.2rem 0 1.2rem; }
.auth-card button { width: 100%; margin-top: 1rem; padding: 0.65rem; }
.auth-card .case { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem; font-size: 0.85rem; color: var(--gris); }
.auth-card .case input { width: auto; }
.auth-pied { text-align: center; margin-top: 1.1rem; }

/* ---- Tableau de bord (cartes chiffres) ---- */
.stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.stats .carte { flex: 1; min-width: 160px; text-align: center; }
.stats .nombre { font-size: 2.1rem; font-weight: 700; color: var(--bleu); }
.stats .nombre a { color: inherit; }
