/* =====================================================================
   CMBG – Feuille de styles
   Identité : vert institutionnel profond, orange ivoirien réservé aux
   signaux (élément actif, alertes, chiffres), fond papier légèrement vert.
   ===================================================================== */
:root {
    /* Palette tirée du logo du collège :
       brun du livre #D06A00, orange de l'anneau #F19200, vert des feuilles #8BBE45, rouge de la devise #E3141B */
    --vert: #D06A00;          /* couleur principale (brun du logo) */
    --vert-fonce: #A85400;    /* brun profond : barres, menus, bandeaux */
    --vert-clair: #FDF1DF;    /* crème orangée : fonds doux, survols */
    --orange: #B05F00;        /* orange lisible pour les textes */
    --orange-vif: #F19200;    /* orange du logo : accents, filets */
    --feuille: #8BBE45;       /* vert du logo */
    --feuille-fonce: #4C7F1A; /* vert lisible pour les textes */
    --rouge: #E3141B;         /* rouge de la devise */
    --encre: #2C2420;
    --gris: #6E6259;
    --ligne: #E9E1D6;
    --papier: #FBF8F3;
    --blanc: #FFFFFF;
    --rayon: 10px;
    --barre-haut: 64px;
    --largeur-menu: 260px;
    --bs-body-font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--encre);
    --bs-link-color: var(--vert);
    --bs-link-color-rgb: 208, 106, 0;
    --bs-link-hover-color: var(--orange);
}

body { font-family: var(--bs-body-font-family); background: var(--papier); color: var(--encre); }

:focus-visible { outline: 3px solid var(--orange-vif); outline-offset: 2px; }

.lien-evitement {
    position: absolute; left: -999px; top: .5rem; z-index: 2000;
    background: var(--blanc); padding: .5rem 1rem; border-radius: 6px;
}
.lien-evitement:focus { left: .5rem; }

/* ---------- Boutons ---------- */
.btn-principal { background: var(--vert); border-color: var(--vert); color: var(--blanc); font-weight: 600; }
.btn-principal:hover, .btn-principal:focus { background: var(--vert-fonce); border-color: var(--vert-fonce); color: var(--blanc); }
.btn-principal:disabled { background: var(--gris); border-color: var(--gris); }
.btn-icone { width: 44px; height: 44px; display: inline-grid; place-items: center; font-size: 1.35rem; color: var(--encre); border: 0; }
.btn-icone:hover { background: var(--vert-clair); }
.form-control:focus, .form-select:focus { border-color: var(--vert); box-shadow: 0 0 0 .2rem rgba(208, 106, 0, .18); }
.form-label { font-weight: 600; }

/* ---------- Marque ---------- */
.marque { display: flex; align-items: center; gap: .65rem; color: var(--encre); text-decoration: none; min-width: 0; }
.marque-sceau {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--vert); color: var(--blanc);
    font-weight: 800; font-size: .72rem; letter-spacing: .02em;
    box-shadow: inset 0 0 0 3px var(--vert), inset 0 0 0 4px rgba(255,255,255,.55);
}
.marque-texte { font-weight: 700; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================
   ESPACE PRIVÉ
   ===================================================================== */
.barre-haut {
    position: sticky; top: 0; z-index: 1030;
    height: var(--barre-haut); padding: 0 1rem;
    display: flex; align-items: center; gap: .75rem;
    background: var(--blanc); border-bottom: 1px solid var(--ligne);
}
.annee-courante {
    font-size: .82rem; font-weight: 600; color: var(--vert);
    background: var(--vert-clair); padding: .2rem .65rem; border-radius: 999px;
}
.barre-haut-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.pastille {
    position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--orange); color: var(--blanc); border-radius: 9px;
    font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.btn-utilisateur { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .5rem; }
.btn-utilisateur:hover { background: var(--vert-clair); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
    background: var(--orange); color: var(--blanc); font-weight: 700; font-size: .85rem;
}
.nom-utilisateur { font-weight: 600; font-size: .9rem; line-height: 1.1; }
.role-utilisateur { font-size: .75rem; color: var(--gris); }

.cadre { display: flex; min-height: calc(100vh - var(--barre-haut)); }

/* Bootstrap 5.3 force « background-color: transparent !important » sur .offcanvas-lg
   en grand écran : on rétablit explicitement le fond vert du menu. */
.barre-laterale,
.barre-laterale.offcanvas-lg { background-color: var(--vert-fonce) !important; color: rgba(255,255,255,.9); }
.barre-laterale .offcanvas-body { background-color: transparent !important; }
@media (min-width: 992px) {
    .barre-laterale {
        width: var(--largeur-menu); flex-shrink: 0;
        position: sticky; top: var(--barre-haut); height: calc(100vh - var(--barre-haut)); overflow-y: auto;
    }
}
@media (max-width: 991.98px) {
    .barre-laterale.offcanvas-lg { --bs-offcanvas-width: 290px; background: var(--vert-fonce); color: var(--blanc); }
}
.barre-laterale .offcanvas-body { padding: 1rem .75rem 2rem; display: flex; }
.menu-section {
    margin: 1.1rem .75rem .35rem; font-size: .76rem; font-weight: 600;
    color: rgba(255,255,255,.55);
}
.menu-section:first-child { margin-top: 0; }
.menu-liste { list-style: none; margin: 0; padding: 0; }
.menu-lien {
    position: relative; display: flex; align-items: center; gap: .7rem;
    min-height: 44px; padding: .45rem .75rem; border-radius: 8px;
    color: rgba(255,255,255,.88); text-decoration: none; font-size: .94rem;
}
.menu-lien i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.menu-lien:hover { background: rgba(255,255,255,.08); color: var(--blanc); }
.menu-lien.actif { background: rgba(255,255,255,.12); color: var(--blanc); font-weight: 600; }
.menu-lien.actif::before {
    content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--orange-vif);
}
.menu-bientot {
    margin-left: auto; font-size: .66rem; font-weight: 600;
    padding: .05rem .4rem; border-radius: 999px;
    background: rgba(255,255,255,.12); color: rgba(255,255,255,.7);
}

.contenu { flex: 1; min-width: 0; padding: 1.5rem 1rem 1rem; display: flex; flex-direction: column; }
@media (min-width: 768px) { .contenu { padding: 2rem 2rem 1rem; } }
.pied-prive { margin-top: auto; padding-top: 2rem; font-size: .8rem; color: var(--gris); }

.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.entete-date { margin: 0; color: var(--gris); font-size: .9rem; }
.entete-titre { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 800; letter-spacing: -.01em; }
.entete-sous-titre { margin: .25rem 0 0; color: var(--gris); }

.panneau { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.25rem; }
@media (min-width: 768px) { .panneau { padding: 1.5rem; } }
.panneau-etroit { max-width: 34rem; }
.panneau-titre { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }

/* Chiffres clés : une bande continue plutôt qu'une grille de cartes */
.grille-chiffres {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden;
}
.chiffre { padding: 1.1rem 1.25rem; display: grid; grid-template-columns: auto 1fr; column-gap: .75rem; align-items: center; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); margin: 0 -1px -1px 0; }
.chiffre i { grid-row: span 2; font-size: 1.4rem; color: var(--vert); }
.chiffre-valeur { font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre-libelle { font-size: .85rem; color: var(--gris); }

.liste-services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.liste-services a {
    display: flex; align-items: center; gap: .7rem; min-height: 52px; padding: .6rem .85rem;
    border: 1px solid var(--ligne); border-radius: 8px; color: var(--encre); text-decoration: none; font-weight: 500;
}
.liste-services a:hover { border-color: var(--vert); background: var(--vert-clair); }
.liste-services i { color: var(--vert); font-size: 1.15rem; }
.liste-services .menu-bientot { background: var(--papier); color: var(--gris); }

.liste-journal { list-style: none; margin: 0; padding: 0; }
.liste-journal li { display: flex; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--ligne); font-size: .9rem; }
.liste-journal li:first-child { border-top: 0; }
.journal-point { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; flex-shrink: 0; background: var(--gris); }
.journal-point.ok { background: var(--vert); }
.journal-point.ko { background: var(--orange); }
.journal-meta { display: block; font-size: .78rem; color: var(--gris); }

.etat-vide { text-align: center; padding: 3rem 1.5rem; }
.etat-vide > i { font-size: 2.6rem; color: var(--vert); }
.etat-vide h2 { font-size: 1.3rem; font-weight: 700; margin: .75rem 0 .5rem; }
.etat-vide p { max-width: 32rem; margin: 0 auto 1.25rem; color: var(--gris); }

.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 2rem; margin-bottom: 1.25rem; }
.fiche dt { font-size: .82rem; font-weight: 600; color: var(--gris); }
.fiche dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.encart-info { display: flex; gap: .65rem; padding: .85rem 1rem; border-left: 4px solid var(--vert); background: var(--vert-clair); border-radius: 0 8px 8px 0; font-size: .9rem; }
.encart-info i { color: var(--vert); }

/* =====================================================================
   PAGES DE CONNEXION
   ===================================================================== */
.page-auth { background: var(--blanc); }
.auth-grille { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-grille { grid-template-columns: minmax(380px, 5fr) 6fr; } }
.auth-identite {
    position: relative; background: var(--vert-fonce); color: var(--blanc);
    padding: 2rem 1.5rem 2rem 2.25rem; display: flex; flex-direction: column; gap: 1.5rem;
}
@media (min-width: 992px) { .auth-identite { padding: 3.5rem 3rem 3rem 3.75rem; justify-content: space-between; } }
.drapeau { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; display: flex; flex-direction: column; }
.drapeau span { flex: 1; }
.drapeau span:nth-child(1) { background: var(--orange-vif); }
.drapeau span:nth-child(2) { background: var(--blanc); }
.drapeau span:nth-child(3) { background: #5E9F2C; }
.auth-sigle { font-size: clamp(3rem, 2rem + 4vw, 5.5rem); font-weight: 800; line-height: .9; margin: 0 0 1rem; letter-spacing: -.03em; color: var(--orange-vif); }
.auth-nom { font-size: clamp(1.3rem, 1rem + 1.2vw, 2rem); font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; max-width: 22ch; }
.auth-adresse { margin: 0; color: rgba(255,255,255,.75); }
.auth-mention { margin: 0; font-size: .9rem; color: rgba(255,255,255,.65); }
@media (max-width: 991.98px) { .auth-mention { display: none; } }
.auth-panneau { display: grid; place-items: center; padding: 2rem 1.25rem 3rem; }
.auth-boite { width: 100%; max-width: 26rem; }
.auth-titre { font-size: 1.7rem; font-weight: 800; margin: 0 0 .35rem; }
.auth-intro { color: var(--gris); margin-bottom: 1.5rem; }
.auth-retour { margin-top: 2rem; font-size: .9rem; }
.auth-retour a { color: var(--gris); text-decoration: none; }
.auth-retour a:hover { color: var(--vert); }

/* =====================================================================
   SITE PUBLIC
   ===================================================================== */
.site-public { background: var(--blanc); }
.site-bande-haut { background: var(--encre); color: rgba(255,255,255,.85); font-size: .8rem; }
.site-bande-haut-ligne { display: flex; align-items: center; min-height: 32px; gap: 1rem; }
.site-bande-haut a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-bande-haut strong { color: var(--orange-vif); }

.site-entete { background: var(--blanc); }
.site-identite { display: flex; align-items: center; justify-content: center; gap: 1rem; padding-top: 1.1rem; padding-bottom: .6rem; }
.site-logos { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.site-logo { height: 64px; width: auto; max-width: 90px; object-fit: contain; }
.marque-sceau-grand { width: 64px; height: 64px; font-size: .95rem; }
.site-titres { display: flex; flex-direction: column; min-width: 0; }
.site-sigle { color: var(--orange); font-weight: 800; font-size: 1.35rem; line-height: 1.1; text-decoration: none; letter-spacing: .01em; }
.site-nom-complet { color: var(--vert-fonce); font-weight: 600; font-size: .95rem; line-height: 1.25; }
.site-lieu { color: var(--gris); font-size: .8rem; }
@media (max-width: 575.98px) {
    .site-identite { justify-content: flex-start; }
    .site-logo { height: 48px; }
    .marque-sceau-grand { width: 48px; height: 48px; font-size: .72rem; }
}

.site-nav { position: sticky; top: 0; z-index: 1030; background: var(--blanc); border-bottom: 1px solid var(--ligne); padding: .25rem 0; }
.site-nav .nav-link { color: var(--encre); font-weight: 500; font-size: .93rem; padding: .55rem .7rem !important; }
.site-nav .nav-link:hover { color: var(--vert); }
.site-nav .nav-link.active { color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.site-nav .dropdown-menu { border-color: var(--ligne); border-top: 3px solid var(--orange); border-radius: 0 0 8px 8px; }
.site-nav .dropdown-item { padding: .5rem 1rem; }
.site-nav .dropdown-item:active { background: var(--vert); }
.btn-connexion { background: var(--orange); color: var(--blanc); border-radius: 999px; font-weight: 700; padding: .45rem 1.2rem; }
.btn-connexion:hover { background: #8A4A00; color: var(--blanc); }
@media (max-width: 1199.98px) {
    .site-nav .navbar-collapse { padding-bottom: .75rem; }
    .site-nav .nav-link.active { box-shadow: inset 3px 0 0 var(--orange); }
}

/* Bandeau défilant */
.bandeau-defilant { background: var(--vert); color: var(--blanc); overflow: hidden; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.bandeau-piste { display: inline-flex; animation: defilement 40s linear infinite; padding: .45rem 0; }
.bandeau-defilant:hover .bandeau-piste { animation-play-state: paused; }
.bandeau-groupe { display: inline-flex; }
.bandeau-item { padding: 0 2.5rem; position: relative; }
.bandeau-item::before { content: ""; position: absolute; left: 1.05rem; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--orange-vif); transform: translateY(-50%); }
@keyframes defilement { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .bandeau-piste { animation: none; white-space: normal; }
    .bandeau-groupe[aria-hidden] { display: none; }
}

/* Diaporama */
.diaporama .carousel-item { height: clamp(190px, 26vw, 360px); background: var(--vert-fonce); }
.diaporama-image { object-position: center 35%; }
.diaporama-image { width: 100%; height: 100%; object-fit: cover; }
.diaporama-legende {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.5rem 1.4rem;
    background: linear-gradient(to top, rgba(10, 30, 20, .88), rgba(10, 30, 20, 0));
}
@media (min-width: 992px) { .diaporama-legende { padding-left: 3rem; padding-right: 30%; } }
.diaporama-date { color: var(--orange-vif); font-weight: 700; font-size: .9rem; margin: 0 0 .35rem; }
.diaporama-titre { margin: 0; font-size: clamp(1rem, .85rem + .8vw, 1.5rem); font-weight: 800; line-height: 1.2; }
.diaporama-titre a { color: var(--blanc); text-decoration: none; }
.diaporama-titre a:hover { text-decoration: underline; }
.diaporama .carousel-indicators { justify-content: flex-end; margin-right: 1.5rem; margin-bottom: 1rem; }
.diaporama .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; }

.accueil-hero { background: var(--vert-fonce); color: var(--blanc); padding: 4rem 0; position: relative; }
.accueil-lieu { color: rgba(255,255,255,.7); margin-bottom: .75rem; }
.accueil-nom { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.6rem); font-weight: 800; line-height: 1.05; margin: 0; max-width: 18ch; }
.accueil-slogan { font-size: 1.15rem; color: var(--orange-vif); font-weight: 600; margin: 1rem 0 0; }

/* Citation */
.bande-citation { background: #FDE5BC; color: var(--encre); }
.bande-citation p { margin: 0; padding: 1.4rem 0; text-align: center; font-style: italic; font-weight: 600; font-size: clamp(.95rem, .85rem + .4vw, 1.15rem); }

/* Blocs */
.bloc-site { padding-top: 3rem; padding-bottom: 1rem; }
.titre-bloc { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.titre-bloc h2 { font-size: 1.45rem; font-weight: 800; color: var(--vert-fonce); margin: 0; }
.titre-bloc h2 i { color: var(--orange); margin-right: .35rem; }
.titre-bloc a { font-weight: 600; }
.vide-site { color: var(--gris); padding: 1.5rem; background: var(--papier); border-radius: var(--rayon); }

.grille-actus { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte-actu { display: flex; flex-direction: column; background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.carte-actu-image { display: block; aspect-ratio: 16 / 9; background: var(--vert-clair); overflow: hidden; }
.carte-actu-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.carte-actu:hover .carte-actu-image img { transform: scale(1.04); }
.carte-actu-vide { display: grid; place-items: center; height: 100%; font-weight: 800; font-size: 1.6rem; color: var(--vert); opacity: .5; }
.carte-actu-corps { padding: 1rem 1.1rem 1.25rem; }
.carte-actu-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; font-size: .8rem; }
.carte-actu-date { color: var(--orange); font-weight: 700; }
.carte-actu-titre { font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin-bottom: .4rem; }
.carte-actu-titre a { color: var(--encre); text-decoration: none; }
.carte-actu-titre a:hover { color: var(--vert); }
.carte-actu-resume { color: var(--gris); font-size: .88rem; margin: 0; }
.etiquette { padding: .1rem .5rem; border-radius: 999px; font-weight: 600; background: var(--vert-clair); color: var(--vert); }
.etiquette-info_urgente { background: #FDE2DF; color: #B42318; }
.etiquette-communique { background: #FCEBD7; color: #8A4A00; }

/* Mot du chef */
.bloc-mot-chef { margin-top: 3rem; padding: 3rem 0; background: var(--papier); }
.mot-chef-grille { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .mot-chef-grille { grid-template-columns: 240px 1fr; } }
.mot-chef-photo img, .mot-chef-initiales { width: 220px; height: 260px; object-fit: cover; border-radius: var(--rayon); border-bottom: 6px solid var(--orange); }
.mot-chef-initiales { display: grid; place-items: center; background: var(--vert); color: var(--blanc); font-size: 3rem; font-weight: 800; }
.bloc-mot-chef h2 { font-weight: 800; color: var(--vert-fonce); }
.mot-chef-texte { font-size: 1.05rem; line-height: 1.7; border-left: 4px solid var(--orange-vif); padding-left: 1rem; margin: 1rem 0; }
.mot-chef-signature { margin: 1rem 0; }

.bande-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 0; background: var(--vert-fonce); color: var(--blanc); border-radius: var(--rayon); padding: 1.5rem; }
.bande-chiffres div { text-align: center; }
.bande-chiffres dd { margin: 0; font-size: 2.4rem; font-weight: 800; color: var(--orange-vif); font-variant-numeric: tabular-nums; }
.bande-chiffres dt { font-weight: 500; }

.liste-evenements { list-style: none; margin: 0; padding: 0; }
.liste-evenements li { display: flex; gap: 1rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--ligne); }
.liste-evenements a { font-weight: 600; color: var(--encre); text-decoration: none; }
.liste-evenements a:hover { color: var(--vert); }
.date-badge { flex-shrink: 0; width: 58px; text-align: center; border: 2px solid var(--vert); border-radius: 8px; color: var(--vert); font-size: .75rem; font-weight: 600; line-height: 1.1; padding: .35rem 0; }
.date-badge strong { display: block; font-size: 1.35rem; font-weight: 800; }
.date-badge-grand { width: 72px; }
.evt-meta { display: block; font-size: .82rem; color: var(--gris); }

.acces-rapides { display: grid; gap: .5rem; }
.acces-rapides a { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border-radius: 8px; background: var(--papier); color: var(--encre); text-decoration: none; font-weight: 600; }
.acces-rapides a:hover { background: var(--vert-clair); color: var(--vert-fonce); }
.acces-rapides i { font-size: 1.3rem; color: var(--orange); }

.mosaique { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.mosaique a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--papier); }
.mosaique img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mosaique a:hover img { transform: scale(1.05); }
.mosaique-album { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Pages internes */
.entete-site { background: var(--vert-fonce); color: var(--blanc); padding: 2rem 0 2.25rem; }
.entete-site nav { font-size: .85rem; color: rgba(255,255,255,.7); margin-bottom: .5rem; }
.entete-site nav a { color: rgba(255,255,255,.85); }
.entete-site h1 { font-weight: 800; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.6rem); margin: 0; }
.entete-site p { margin: .5rem 0 0; color: rgba(255,255,255,.8); max-width: 60ch; }
.sommaire { list-style: none; padding: 0; position: sticky; top: 80px; border-left: 3px solid var(--ligne); }
.sommaire a { display: block; padding: .4rem 1rem; color: var(--gris); text-decoration: none; }
.sommaire a:hover { color: var(--vert); }
.section-texte { margin-bottom: 3rem; scroll-margin-top: 80px; }
.section-texte h2 { font-weight: 800; color: var(--vert-fonce); font-size: 1.5rem; padding-bottom: .4rem; border-bottom: 3px solid var(--orange-vif); display: inline-block; margin-bottom: 1rem; }
.section-image { max-width: 100%; border-radius: var(--rayon); margin-bottom: 1rem; }
.texte-riche { font-size: 1.04rem; line-height: 1.75; max-width: 72ch; }
.texte-riche ul { padding-left: 1.25rem; }
.panneau-site { background: var(--papier); border-radius: var(--rayon); padding: 1.25rem; }
.titre-groupe { font-weight: 800; font-size: 1.3rem; color: var(--vert-fonce); margin-bottom: 1rem; }
.titre-groupe span { font-size: .85rem; background: var(--vert-clair); color: var(--vert); border-radius: 999px; padding: .1rem .6rem; vertical-align: middle; }

.grille-agents { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.carte-agent { text-align: center; }
.carte-agent img, .carte-agent-initiales { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto .6rem; display: grid; place-items: center; border: 3px solid var(--vert-clair); }
.carte-agent-initiales { background: var(--vert); color: var(--blanc); font-weight: 800; font-size: 1.8rem; }
.carte-agent-nom { display: block; font-weight: 700; }
.carte-agent-fonction { display: block; font-size: .85rem; color: var(--gris); }

.filtres-site { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filtres-site a { padding: .4rem .9rem; border: 1px solid var(--ligne); border-radius: 999px; color: var(--encre); text-decoration: none; font-size: .9rem; }
.filtres-site a.actif, .filtres-site a:hover { background: var(--vert); border-color: var(--vert); color: var(--blanc); }

.fil-ariane { font-size: .85rem; color: var(--gris); margin-bottom: 1rem; }
.article-titre { font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); line-height: 1.2; color: var(--vert-fonce); }
.article-chapeau { font-size: 1.15rem; color: var(--gris); }
.article-image { width: 100%; border-radius: var(--rayon); margin: 1rem 0 1.5rem; }
.liste-autres { list-style: none; padding: 0; margin: 0; }
.liste-autres li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--ligne); }
.liste-autres img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.liste-autres a { font-weight: 600; color: var(--encre); text-decoration: none; font-size: .92rem; }
.fiche-evt dt { color: var(--gris); font-size: .85rem; }
.fiche-evt dd { font-weight: 600; margin-bottom: .75rem; }

.liste-evt { list-style: none; padding: 0; }
.evt-ligne { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.25rem 0; border-bottom: 1px solid var(--ligne); }
.evt-ligne h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .25rem; }
.evt-ligne h3 a { color: var(--encre); text-decoration: none; }
.evt-vignette { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; }
.liste-evt-passes { opacity: .8; }

.grille-albums { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.carte-album { color: var(--encre); text-decoration: none; }
.carte-album-image { display: block; aspect-ratio: 4 / 3; border-radius: var(--rayon); overflow: hidden; background: var(--vert-clair); margin-bottom: .6rem; }
.carte-album-image img { width: 100%; height: 100%; object-fit: cover; }
.carte-album-titre { display: block; font-weight: 700; }

.visionneuse-contenu { background: #000; border: 0; position: relative; }
.visionneuse-image { width: 100%; max-height: 82vh; object-fit: contain; cursor: pointer; }
.visionneuse-legende { color: var(--blanc); text-align: center; padding: .5rem 1rem; margin: 0; }
.visionneuse-fermer { position: absolute; top: .75rem; right: .75rem; z-index: 2; }

.coordonnees > div { display: flex; flex-direction: column; padding: .75rem 0; border-bottom: 1px solid var(--ligne); }
.coordonnees dt { font-size: .85rem; color: var(--gris); font-weight: 600; }
.coordonnees dt i { color: var(--orange); }
.coordonnees dd { margin: 0; font-weight: 600; }
.carte-osm { width: 100%; height: 300px; border: 0; border-radius: var(--rayon); margin-top: 1rem; }
.champ-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-pied { margin-top: 4rem; background: var(--encre); color: rgba(255,255,255,.8); padding: 2.5rem 0 1.5rem; font-size: .92rem; border-top: 6px solid var(--orange); }
.site-pied a { color: var(--blanc); }
.site-pied-grille { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .site-pied-grille { grid-template-columns: 2fr 1.3fr 1fr; } }
.site-pied-nom { font-weight: 700; color: var(--blanc); margin-bottom: .25rem; }
.site-pied-titre { font-weight: 700; color: var(--orange-vif); margin-bottom: .5rem; }
.site-pied-slogan { font-style: italic; }
.site-pied p { margin-bottom: .35rem; }
.site-pied-copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.15); padding-top: 1rem; font-size: .8rem; color: rgba(255,255,255,.6); }

/* =====================================================================
   ADMINISTRATION DU SITE
   ===================================================================== */
.marque-logo { height: 42px; width: auto; max-width: 60px; object-fit: contain; }
.menu-compteur { margin-left: auto; background: var(--orange-vif); color: var(--blanc); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; }
.onglets { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--ligne); margin-bottom: 1.25rem; }
.onglets a { display: inline-flex; gap: .4rem; align-items: center; padding: .65rem 1rem; color: var(--gris); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.onglets a:hover { color: var(--vert); }
.onglets a.actif { color: var(--vert); border-bottom-color: var(--orange-vif); }
.onglets .compteur { background: var(--papier); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.barre-outils { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.barre-outils .form-control, .barre-outils .form-select { width: auto; min-width: 180px; }
.tableau th { font-size: .8rem; color: var(--gris); font-weight: 600; }
.vignette { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.vignette-vide { display: inline-grid; place-items: center; background: var(--papier); color: var(--gris); }
.btn-icone-table { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--ligne); }
.badge-statut { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-statut-ok { background: var(--vert-clair); color: var(--vert); }
.badge-statut-attente { background: #FCEBD7; color: #8A4A00; }
.badge-statut-neutre { background: var(--papier); color: var(--gris); }
.badge-une { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 4px; background: var(--orange); color: var(--blanc); font-size: .7rem; font-weight: 700; }
.ligne-passee td { opacity: .6; }
.apercu-image { display: block; max-width: 100%; max-height: 180px; border-radius: 8px; margin-bottom: .5rem; }
.apercu-logo { background: var(--papier); padding: .75rem; border-radius: 8px; margin-bottom: .5rem; text-align: center; }
.apercu-logo img { max-height: 80px; }
.grille-albums-admin { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.album-admin { display: flex; flex-direction: column; color: var(--encre); text-decoration: none; }
.album-admin-image { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--papier); display: grid; place-items: center; font-size: 2rem; color: var(--gris); margin-bottom: .4rem; }
.album-admin-image img { width: 100%; height: 100%; object-fit: cover; }
.zone-depot { border: 2px dashed var(--ligne); border-radius: var(--rayon); padding: 1rem; background: var(--papier); }
.grille-photos-admin { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo-admin { margin: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--papier); }
.photo-admin.est-couverture { border-color: var(--orange-vif); }
.photo-admin img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-admin figcaption { display: flex; justify-content: space-between; align-items: center; padding: .35rem; gap: .25rem; }
.liste-pages { list-style: none; margin: 0; padding: 0; }
.liste-pages a { display: flex; align-items: center; gap: .85rem; padding: .85rem .5rem; border-bottom: 1px solid var(--ligne); color: var(--encre); text-decoration: none; }
.liste-pages a:hover { background: var(--papier); }
.indicateur { width: 10px; height: 10px; border-radius: 50%; background: var(--ligne); flex-shrink: 0; }
.indicateur.ok { background: var(--vert); }
.liste-messages { list-style: none; margin: 0; padding: 0; }
.liste-messages > li { border-bottom: 1px solid var(--ligne); }
.liste-messages > li.nouveau { border-left: 4px solid var(--orange-vif); padding-left: .5rem; }
.liste-messages summary { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; cursor: pointer; list-style: none; }
.liste-messages summary::-webkit-details-marker { display: none; }
.message-entete { display: flex; flex-direction: column; }
.message-corps { padding: 0 0 1rem; }
.message-texte { background: var(--papier); padding: 1rem; border-radius: 8px; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   MODULES DE GESTION (v1.0)
   ===================================================================== */
.recherche-haut { align-items: center; gap: .5rem; margin-left: 1rem; background: var(--papier); border: 1px solid var(--ligne); border-radius: 999px; padding: 0 .9rem; height: 40px; flex: 0 1 360px; }
.recherche-haut input { border: 0; background: transparent; outline: none; width: 100%; font-size: .9rem; }
.recherche-haut:focus-within { border-color: var(--vert); }
.badge-statut-alerte { background: #FDE2DF; color: #B42318; }
.chiffre-lien { color: var(--encre); text-decoration: none; }
.chiffre-lien:hover, .chiffre-lien.actif { background: var(--vert-clair); }
.chiffre-alerte .chiffre-valeur, .chiffre-alerte i { color: #B42318; }
.alerte-blocage { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; background: #FCEBD7; border: 1px solid #F0C48D; border-left: 6px solid var(--orange); border-radius: var(--rayon); padding: 1rem 1.25rem; margin-bottom: 1.25rem; color: #6B3A0A; }
.alerte-blocage > i { font-size: 1.6rem; color: var(--orange); }
.alerte-blocage > div { flex: 1 1 260px; }
.bloc-indisponible { text-align: center; max-width: 42rem; margin: 0 auto; }
.bloc-indisponible > i { font-size: 2.6rem; color: var(--orange); }
.bloc-indisponible h2 { font-size: 1.3rem; font-weight: 800; margin: .75rem 0; }
.liste-simple { list-style: none; padding: 0; margin: 0; }
.liste-simple li { padding: .35rem 0; border-bottom: 1px solid var(--ligne); }
.liste-simple li:last-child { border-bottom: 0; }
.liste-puces { columns: 2 260px; padding-left: 1.1rem; margin: 0; }
.photo-fiche { width: 110px; height: 130px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.photo-vide { display: grid; place-items: center; background: var(--vert); color: var(--blanc); font-weight: 800; font-size: 2rem; }
.ligne-groupe td { background: var(--papier); font-weight: 700; font-size: .82rem; color: var(--vert-fonce); }
.matrice { max-height: 70vh; }
.matrice thead th { position: sticky; top: 0; background: var(--blanc); z-index: 1; }

/* Appel */
.liste-appel { list-style: none; padding: 0; margin: 0; }
.liste-appel li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--ligne); }
.appel-choix { display: flex; gap: .25rem; align-items: center; }
.appel-choix .btn { min-width: 72px; border: 1px solid var(--ligne); }
.btn-check:checked + .btn-appel-P { background: var(--vert); color: var(--blanc); border-color: var(--vert); }
.btn-check:checked + .btn-appel-A { background: #B42318; color: var(--blanc); border-color: #B42318; }
.btn-check:checked + .btn-appel-R { background: var(--orange); color: var(--blanc); border-color: var(--orange); }
.appel-retard { width: 70px; display: none; }
.appel-choix:has(.btn-check[value="R"]:checked) .appel-retard { display: block; }

/* Emploi du temps */
.grille-edt { min-width: 760px; table-layout: fixed; border-collapse: separate; border-spacing: 3px; }
.grille-edt thead th { text-align: center; font-size: .82rem; color: var(--gris); border: 0; }
.grille-edt tbody th { width: 72px; font-size: .82rem; font-weight: 700; border: 0; vertical-align: middle; }
.grille-edt tbody th span { display: block; font-weight: 400; color: var(--gris); }
.grille-edt td { position: relative; height: 64px; border: 1px dashed var(--ligne) !important; border-radius: 6px; font-size: .8rem; padding: .35rem; vertical-align: top; }
.grille-edt td.occupe { background: var(--vert-clair); border: 1px solid #C5DACB !important; }
.grille-edt td strong { display: block; color: var(--vert-fonce); }
.grille-edt td span { display: block; line-height: 1.2; }
.grille-edt td .salle { color: var(--orange); font-weight: 600; }
.edt-modifier { position: absolute; inset: 0; background: transparent; border: 0; border-radius: 6px; color: var(--gris); font-size: 1.2rem; }
.edt-modifier:hover, .edt-modifier:focus-visible { background: rgba(208, 106, 0, .08); }

/* Pointage */
.choix-type { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.btn-type { min-height: 56px; border: 2px solid var(--vert); color: var(--vert); font-weight: 700; background: var(--blanc); }
.btn-type:hover, .btn-type.actif { background: var(--vert); color: var(--blanc); }
.btn-type.discret { border-color: var(--ligne); color: var(--gris); }
.etapes-pointage { list-style: none; padding: 0; margin: 0 0 1rem; }
.etapes-pointage li { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 8px; background: var(--papier); margin-bottom: .4rem; }
.etape-icone { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blanc); color: var(--gris); }
.etape-etat { margin-left: auto; font-size: .85rem; color: var(--gris); }
.etapes-pointage li.en-cours .etape-icone { background: var(--orange-vif); color: var(--blanc); }
.etapes-pointage li.ok .etape-icone { background: var(--vert); color: var(--blanc); }
.etapes-pointage li.ok .etape-etat { color: var(--vert); font-weight: 700; }
.etapes-pointage li.ko .etape-icone { background: #B42318; color: var(--blanc); }
.etapes-pointage li.ko .etape-etat { color: #B42318; font-weight: 700; }
.lecteur-qr { max-width: 360px; margin: 0 auto 1rem; border-radius: var(--rayon); overflow: hidden; }
.resultat-pointage { border-radius: var(--rayon); padding: 1.25rem; text-align: center; }
.resultat-pointage.ok { background: var(--vert); color: var(--blanc); }
.resultat-pointage.ko { background: #FDE2DF; color: #8A1C12; border: 2px solid #B42318; }
.resultat-titre { font-size: 1.2rem; font-weight: 800; margin-bottom: .35rem; }
.liste-journal-pointage { list-style: none; padding: 0; margin: 0; }
.liste-journal-pointage > li { border: 1px solid var(--ligne); border-left: 5px solid var(--vert); border-radius: 8px; padding: .75rem 1rem; margin-bottom: .6rem; }
.liste-journal-pointage > li.ko { border-left-color: #B42318; }
.journal-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .25rem 1rem; margin: .5rem 0 0; font-size: .85rem; }
.journal-details dt { color: var(--gris); font-weight: 600; font-size: .75rem; }
.journal-details dd { margin: 0; }

/* Borne */
.page-borne { background: var(--vert-fonce); color: var(--blanc); min-height: 100vh; }
.borne { max-width: 720px; margin: 0 auto; padding: 1.5rem; text-align: center; }
.borne-entete { display: flex; align-items: center; gap: 1rem; text-align: left; margin-bottom: 1.5rem; }
.borne-titre { font-weight: 800; font-size: 1.3rem; margin: 0; }
.borne-lieu { margin: 0; color: rgba(255,255,255,.7); }
.borne-horloge { margin-left: auto; text-align: right; }
.borne-horloge span { display: block; font-size: .85rem; color: rgba(255,255,255,.7); }
.borne-horloge span:first-child { font-size: 2rem; font-weight: 800; color: var(--blanc); font-variant-numeric: tabular-nums; }
.borne-qr-cadre { background: var(--blanc); border-radius: 16px; padding: 24px; display: inline-block; border-bottom: 8px solid var(--orange-vif); }
.borne-qr { width: min(360px, 78vw); height: min(360px, 78vw); }
.borne-qr img, .borne-qr canvas { width: 100% !important; height: 100% !important; }
.borne-compteur { max-width: 420px; margin: 1.25rem auto .5rem; }
.borne-compteur .progress { height: 10px; background: rgba(255,255,255,.2); }
.borne-compteur .progress-bar { background: var(--orange-vif); transition: width 1s linear; }
.borne-restant { margin: .5rem 0 0; font-size: 1.1rem; font-weight: 600; }
.borne-consigne { font-size: 1.1rem; color: rgba(255,255,255,.85); }
.borne-etat { font-size: .9rem; }
.borne-etat.ok { color: #7CD69F; } .borne-etat.ko { color: #FFB4A8; }

/* Absences et rattrapages */
.ligne-rattrapage { border: 1px solid var(--ligne); border-radius: 8px; padding: .75rem 1rem 1rem; margin-bottom: .75rem; }
.ligne-rattrapage legend { float: none; width: auto; font-size: .95rem; font-weight: 700; padding: 0 .35rem; margin: 0; }
.ligne-rattrapage.manuelle { background: var(--papier); border-style: dashed; }
.seance-perdue { background: #FCEBD7; border-radius: 6px; padding: .4rem .6rem; font-size: .9rem; }
.frise-statut { display: flex; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: etape; }
.frise-statut li { flex: 1; text-align: center; position: relative; font-size: .85rem; color: var(--gris); padding-top: 2rem; }
.frise-statut li::before { counter-increment: etape; content: counter(etape); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--ligne); color: var(--gris); display: grid; place-items: center; font-weight: 700; z-index: 1; }
.frise-statut li:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: 50%; width: 100%; height: 3px; background: var(--ligne); }
.frise-statut li.fait::before { background: var(--vert); color: var(--blanc); }
.frise-statut li.fait::after { background: var(--vert); }
.frise-statut li.courant { color: var(--encre); font-weight: 700; }
.frise-statut li.courant::before { background: var(--orange-vif); color: var(--blanc); }

/* Actes, documents, notifications, divers */
.texte-acte { font-family: "Times New Roman", Times, serif; font-size: 1rem; line-height: 1.6; }
.liste-documents { list-style: none; padding: 0; margin: 0; }
.liste-documents li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--ligne); }
.liste-documents li > i { font-size: 1.6rem; color: var(--vert); }
.liste-notifications { list-style: none; padding: 0; margin: 0; }
.liste-notifications a { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem .5rem; border-bottom: 1px solid var(--ligne); color: var(--encre); text-decoration: none; }
.liste-notifications a:hover { background: var(--papier); }
.liste-notifications li.non-lue a { background: #F3F8F4; }
.liste-notifications i { font-size: 1.3rem; color: var(--vert); }
.liste-notifications .niveau-alerte i, .liste-notifications .niveau-urgent i { color: #B42318; }
.point-non-lu { width: 10px; height: 10px; border-radius: 50%; background: var(--orange-vif); margin-top: .4rem; }
.cadre-graphique { position: relative; height: 300px; }
.liste-rapports { list-style: none; padding: 0; margin: 0; }
.liste-rapports li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--ligne); }
.liste-referentiel { list-style: none; padding: 0; margin: 0 0 .75rem; max-height: 260px; overflow-y: auto; }
.liste-referentiel li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--ligne); font-size: .9rem; }
.liste-referentiel li.inactif span { color: var(--gris); text-decoration: line-through; }
@media (max-width: 575.98px) {
    .entete-page .d-flex { width: 100%; }
    .entete-page .btn { flex: 1 1 auto; }
    .barre-outils .form-control, .barre-outils .form-select, .d-flex > .form-control.w-auto, .d-flex > .form-select.w-auto { width: 100% !important; }
}

/* =====================================================================
   MODULES DE GESTION (v1.0)
   ===================================================================== */
.badge-statut-alerte { background: #FDE2DF; color: #B42318; }
.titre-bloc-tdb { font-size: .95rem; font-weight: 700; color: var(--gris); margin: 0 0 .5rem; }
.chiffre-lien { color: var(--encre); text-decoration: none; transition: background .15s; }
.chiffre-lien:hover, .chiffre-lien.actif { background: var(--vert-clair); color: var(--encre); }

.recherche-globale { flex: 1; max-width: 420px; margin-left: 1rem; align-items: center; gap: .5rem; background: var(--papier); border: 1px solid var(--ligne); border-radius: 999px; padding: 0 .9rem; }
.recherche-globale input { border: 0; background: transparent; padding: .5rem 0; width: 100%; outline: none; }
.recherche-globale:focus-within { border-color: var(--vert); box-shadow: 0 0 0 .2rem rgba(208, 106, 0, .15); }
.recherche-globale i { color: var(--gris); }

.liste-simple { list-style: none; padding: 0; margin: 0; }
.liste-simple li { padding: .45rem 0; border-bottom: 1px solid var(--ligne); }
.liste-simple li:last-child { border-bottom: 0; }
.photo-fiche { width: 110px; height: 130px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.photo-vide { display: grid; place-items: center; background: var(--vert); color: var(--blanc); font-weight: 800; font-size: 1.8rem; }
.fiche-colonne { grid-template-columns: 1fr; }
.ligne-groupe td { background: var(--papier); font-weight: 700; font-size: .82rem; color: var(--vert-fonce); }
.matrice th { position: sticky; top: 0; background: var(--blanc); z-index: 1; }
.matrice { max-height: 70vh; }

/* Emplois du temps */
.grille-edt { min-width: 760px; table-layout: fixed; }
.grille-edt th { background: var(--papier); font-size: .82rem; text-align: center; }
.grille-edt tbody th { width: 70px; font-weight: 700; }
.grille-edt tbody th span { display: block; font-weight: 400; color: var(--gris); }
.grille-edt td { position: relative; height: 64px; font-size: .8rem; border: 1px solid var(--ligne); vertical-align: top; padding: .3rem .4rem; }
.grille-edt td.occupe { background: var(--vert-clair); }
.grille-edt td strong { display: block; color: var(--vert-fonce); }
.grille-edt td span { display: block; line-height: 1.2; }
.grille-edt td .salle { color: var(--gris); }
.edt-modifier { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; color: var(--gris); font-size: 1.2rem; }
.edt-modifier:hover, .edt-modifier:focus { background: rgba(232, 137, 46, .12); }

/* Appel */
.liste-appel { list-style: none; padding: 0; margin: 0; }
.liste-appel li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--ligne); }
.appel-choix { display: flex; gap: .25rem; align-items: center; }
.btn-appel-P, .btn-appel-A, .btn-appel-R { border: 1px solid var(--ligne); min-width: 72px; }
.btn-check:checked + .btn-appel-P { background: var(--vert); color: var(--blanc); border-color: var(--vert); }
.btn-check:checked + .btn-appel-A { background: #B42318; color: var(--blanc); border-color: #B42318; }
.btn-check:checked + .btn-appel-R { background: var(--orange); color: var(--blanc); border-color: var(--orange); }
.appel-retard { width: 70px; display: none; }
.appel-choix:has(input[value="R"]:checked) .appel-retard { display: inline-block; }

/* Pointage */
.etapes-pointage { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.etapes-pointage > li { padding: .9rem 0; border-bottom: 1px solid var(--ligne); }
.etape-titre { font-weight: 700; margin-bottom: .5rem; display: flex; justify-content: space-between; gap: .5rem; }
.etat-etape { font-weight: 600; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--papier); color: var(--gris); }
.etat-etape.ok { background: var(--vert-clair); color: var(--vert); }
.etat-etape.ko { background: #FDE2DF; color: #B42318; }
.etat-etape.encours { background: #FCEBD7; color: #8A4A00; }
.types-pointage { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .4rem; }
.btn-type { border: 1px solid var(--ligne); min-height: 52px; font-weight: 600; }
.btn-check:checked + .btn-type { background: var(--vert); color: var(--blanc); border-color: var(--vert); }
.lecteur-qr { width: 100%; max-width: 420px; margin: .5rem auto 0; border-radius: 10px; overflow: hidden; }
.resultat-pointage { margin-top: 1rem; padding: 1.1rem; border-radius: 10px; background: var(--papier); font-weight: 600; }
.resultat-pointage.accepte { background: var(--vert); color: var(--blanc); }
.resultat-pointage.refuse { background: #B42318; color: var(--blanc); }
.resultat-titre { font-size: 1.15rem; font-weight: 800; margin-bottom: .35rem; }
.liste-tentatives { list-style: none; padding: 0; margin: 0; }
.liste-tentatives li { padding: .75rem .9rem; border-left: 4px solid var(--vert); background: var(--papier); border-radius: 0 8px 8px 0; margin-bottom: .5rem; }
.liste-tentatives li.refusee { border-left-color: #B42318; }

/* Borne */
.page-borne { background: var(--vert-fonce); color: var(--blanc); }
.borne { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem; text-align: center; }
.borne-entete { display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 640px; text-align: left; }
.borne-logo { height: 64px; background: var(--blanc); border-radius: 50%; padding: 4px; }
.borne-sigle { font-weight: 800; font-size: 1.2rem; margin: 0; }
.borne-date { margin: 0; color: rgba(255,255,255,.75); }
.borne-heure { margin: 0 0 0 auto; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--orange-vif); }
.borne-qr { background: var(--blanc); padding: 18px; border-radius: 14px; min-width: 200px; min-height: 200px; display: grid; place-items: center; color: var(--encre); }
.borne-qr img, .borne-qr canvas { display: block; }
.borne-compteur { width: 100%; max-width: 520px; }
.borne-barre { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.borne-barre span { display: block; height: 100%; background: var(--orange-vif); transition: width .5s linear; }
.borne-consigne { max-width: 520px; font-size: 1.1rem; }
.borne-etat { font-size: .9rem; color: rgba(255,255,255,.7); }
.borne-etat.ko { color: #FFB4A9; }
.borne-quitter button { background: transparent; border: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.6); border-radius: 6px; padding: .3rem .8rem; font-size: .8rem; }

/* Absences et rattrapages */
.etat-bloque { text-align: center; padding: 2.5rem 1.5rem; }
.etat-bloque > i { font-size: 2.6rem; color: var(--orange); }
.etat-bloque h2 { font-size: 1.35rem; font-weight: 800; margin: .75rem 0; }
.etat-bloque .liste-simple { max-width: 520px; margin-bottom: 1.25rem; }
.liste-seances { display: grid; gap: .75rem; }
.seance { border: 1px solid var(--ligne); border-radius: 10px; padding: .75rem 1rem 1rem; background: var(--papier); }
.seance legend { font-size: .95rem; font-weight: 600; float: none; width: auto; padding: 0 .25rem; margin-bottom: .5rem; }
.seance-manuelle summary { cursor: pointer; font-weight: 600; color: var(--vert); }
.frise-statut { list-style: none; display: flex; padding: 0; margin: 0; counter-reset: etape; }
.frise-statut li { flex: 1; text-align: center; font-size: .8rem; font-weight: 600; color: var(--gris); position: relative; padding-top: 28px; }
.frise-statut li::before { counter-increment: etape; content: counter(etape); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--ligne); color: var(--blanc); line-height: 24px; font-size: .75rem; }
.frise-statut li::after { content: ""; position: absolute; top: 11px; left: calc(50% + 14px); width: calc(100% - 28px); height: 2px; background: var(--ligne); }
.frise-statut li:last-child::after { display: none; }
.frise-statut li.fait { color: var(--vert); }
.frise-statut li.fait::before { background: var(--vert); content: "✓"; }
.frise-statut li.courant { color: var(--orange); }
.frise-statut li.courant::before { background: var(--orange); }

/* Actes, documents, notifications, statistiques */
.texte-acte { font-family: "Times New Roman", Georgia, serif; font-size: 1.05rem; line-height: 1.6; }
.liste-categories { display: flex; flex-direction: column; padding: .5rem; }
.liste-categories a { display: flex; justify-content: space-between; padding: .55rem .75rem; border-radius: 6px; color: var(--encre); text-decoration: none; }
.liste-categories a:hover, .liste-categories a.actif { background: var(--vert-clair); color: var(--vert-fonce); font-weight: 600; }
.liste-categories span { color: var(--gris); font-size: .85rem; }
.liste-documents { list-style: none; padding: 0; margin: 0; }
.liste-documents li { display: flex; gap: .85rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--ligne); }
.liste-documents li > i { font-size: 1.7rem; color: var(--vert); }
.liste-notifications { list-style: none; padding: 0; margin: 0; }
.liste-notifications a { display: flex; gap: .85rem; padding: .85rem .5rem; border-bottom: 1px solid var(--ligne); color: var(--encre); text-decoration: none; align-items: flex-start; }
.liste-notifications a:hover { background: var(--papier); }
.liste-notifications li.non-lue a { background: #FBF6EE; }
.liste-notifications a > i { font-size: 1.3rem; color: var(--vert); margin-top: .1rem; }
.liste-notifications .niveau-alerte a > i, .liste-notifications .niveau-urgent a > i { color: #B42318; }
.point-non-lu { width: 10px; height: 10px; border-radius: 50%; background: var(--orange-vif); margin-top: .4rem; flex-shrink: 0; }
.zone-graphique { position: relative; height: 300px; }
.liste-barres { list-style: none; padding: 0; margin: 0; }
.liste-barres li { display: grid; grid-template-columns: 1fr 90px 30px; gap: .5rem; align-items: center; font-size: .85rem; padding: .3rem 0; }
.liste-barres .barre { height: 8px; background: var(--papier); border-radius: 4px; overflow: hidden; }
.liste-barres .barre span { display: block; height: 100%; background: var(--orange-vif); }
.carte-rapport { border: 1px solid var(--ligne); border-radius: 10px; padding: 1rem; height: 100%; }
.ref-code { width: 90px; } .ref-libelle { width: 180px; } .ref-ordre, .ref-capacite { width: 80px; } .ref-heure_debut, .ref-heure_fin { width: 110px; }

@media print {
    .barre-haut, .barre-laterale, .pied-prive, .btn, form { display: none !important; }
    .contenu { padding: 0; }
}
.en-cours { pointer-events: none; opacity: .75; }

/* ----- Carrousel : image par défaut et sous-titre ----- */
.diaporama-defaut { background: linear-gradient(120deg, var(--vert-fonce), var(--vert) 60%, #B05F00); }
.diaporama-defaut .diaporama-legende { background: none; top: 0; display: flex; flex-direction: column; justify-content: center; }
.diaporama-sous-titre { color: rgba(255,255,255,.85); margin: .4rem 0 0; font-weight: 500; }
.carousel-fade .carousel-item { transition-duration: .8s; }

/* ----- À propos + Cheffe d'établissement ----- */
.titre-apropos { font-weight: 800; color: var(--vert-fonce); font-size: 1.6rem; border-left: 5px solid var(--orange-vif); padding-left: .9rem; margin-bottom: 1.25rem; }
.apropos-texte { font-size: 1.05rem; line-height: 1.75; margin-bottom: .35rem; }
.lien-voir-plus { font-weight: 700; color: var(--orange); text-decoration: none; }
.lien-voir-plus:hover { text-decoration: underline; }
.encart-appel { margin-top: 1.5rem; border: 1px solid var(--ligne); border-left: 5px solid var(--orange); border-radius: 10px; padding: 1.4rem 1.5rem; background: var(--blanc); box-shadow: 0 6px 18px rgba(28, 38, 32, .06); }
.encart-appel h3 { font-size: 1.12rem; font-weight: 800; color: var(--orange); margin-bottom: .6rem; }
.encart-appel p { color: var(--gris); }
.btn-appel { background: var(--orange); color: var(--blanc); font-weight: 700; }
.btn-appel:hover { background: #8A4A00; color: var(--blanc); }
.btn-appel-contour { border: 1px solid var(--vert); color: var(--vert); font-weight: 600; }
.btn-appel-contour:hover { background: var(--vert); color: var(--blanc); }

.carte-cheffe { text-align: center; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 12px; padding: 1.75rem 1.5rem; box-shadow: 0 6px 18px rgba(28, 38, 32, .06); }
.carte-cheffe-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--orange-vif); margin: 0 auto 1rem; display: block; }
.carte-cheffe-initiales { display: grid; place-items: center; background: var(--vert); color: var(--blanc); font-size: 2.2rem; font-weight: 800; }
.carte-cheffe-nom { font-weight: 800; color: var(--orange); font-size: 1.08rem; margin-bottom: .2rem; }
.carte-cheffe-titre { color: var(--gris); font-size: .88rem; margin-bottom: 1rem; }
.carte-cheffe-mot { font-size: .95rem; line-height: 1.6; text-align: left; margin-bottom: .75rem; }

/* ----- Administration du diaporama ----- */
.diapo-admin { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--ligne); }
.diapo-admin img { width: 170px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.diapo-admin.inactive img { opacity: .4; }
@media (max-width: 575.98px) { .diapo-admin { flex-direction: column; } .diapo-admin img { width: 100%; height: 140px; } }
.bloc-parent { border: 1px solid var(--ligne); border-radius: 8px; padding: .5rem .85rem .85rem; margin-bottom: .75rem; }
.bloc-parent legend { float: none; width: auto; font-size: .95rem; font-weight: 700; padding: 0 .3rem; margin: 0; }
.etapes-import { padding-left: 1.2rem; }
.etapes-import li { margin-bottom: .35rem; }
@media print { .zone-imprimable { display: block !important; } }

/* =====================================================================
   HABILLAGE AUX COULEURS DU LOGO
   ===================================================================== */
body { background: var(--papier); }
.btn-principal { background: var(--vert); border-color: var(--vert); }
.btn-principal:hover, .btn-principal:focus { background: var(--orange); border-color: var(--orange); color: var(--blanc); }

/* Statuts : succès en vert du logo, alertes en rouge de la devise */
.badge-statut-ok { background: #EEF6E3; color: var(--feuille-fonce); }
.badge-statut-alerte { background: #FDE4E3; color: #B3110F; }
.journal-point.ok { background: var(--feuille); }
.indicateur.ok { background: var(--feuille); }
.etat-etape.ok { background: #EEF6E3; color: var(--feuille-fonce); }
.resultat-pointage.accepte { background: var(--feuille-fonce); }
.btn-check:checked + .btn-appel-P { background: var(--feuille-fonce); border-color: var(--feuille-fonce); }
.liste-tentatives li { border-left-color: var(--feuille); }
.liste-tentatives li.refusee { border-left-color: var(--rouge); }
.grille-edt td.occupe { background: #FFF6E8; }
.chiffre i, .liste-services i, .liste-documents li > i { color: var(--orange-vif); }

/* Espace privé */
.barre-haut { border-bottom: 3px solid var(--orange-vif); }
.barre-laterale, .barre-laterale.offcanvas-lg { background: linear-gradient(180deg, #A85400 0%, #8A4500 100%) !important; }
.menu-lien.actif { background: rgba(241, 146, 0, .18); }
.menu-section { color: rgba(253, 229, 188, .6); }
.avatar { background: var(--orange-vif); }
.annee-courante { background: #EEF6E3; color: var(--feuille-fonce); }
.marque-logo { height: 46px; max-width: 46px; }

/* Site public */
.site-bande-haut { background: var(--vert-fonce); }
.site-bande-haut strong { color: var(--orange-vif); }
.site-logo { height: 72px; max-width: 72px; }
.site-sigle { color: var(--vert); letter-spacing: .02em; }
.site-nom-complet { color: var(--orange); }
.site-lieu { color: var(--feuille-fonce); font-weight: 600; }
.site-nav { border-top: 1px solid var(--ligne); }
.site-nav .nav-link.active { color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange-vif); }
.site-nav .dropdown-menu { border-top-color: var(--orange-vif); }
.btn-connexion { background: var(--orange-vif); color: var(--vert-fonce); }
.btn-connexion:hover { background: var(--vert); color: var(--blanc); }
.bandeau-defilant { background: var(--vert); }
.bandeau-item::before { background: var(--feuille); }
.bande-citation { background: linear-gradient(90deg, #F19200, #F7B23C); color: #2C2420; }
.bande-citation p { font-weight: 700; }
.diaporama-defaut { background: radial-gradient(circle at 80% 30%, rgba(241, 146, 0, .55), transparent 45%), linear-gradient(120deg, #A85400, #D06A00 60%, #F19200); }
.diaporama-date { color: var(--orange-vif); }
.titre-bloc h2 { color: var(--vert); }
.titre-bloc h2 i { color: var(--orange-vif); }
.titre-apropos { color: var(--vert); border-left-color: var(--orange-vif); }
.carte-actu { box-shadow: 0 4px 14px rgba(59, 49, 43, .06); }
.carte-actu-date { color: var(--orange); }
.carte-actu-image { background: var(--vert-clair); }
.carte-cheffe-photo { border-color: var(--orange-vif); }
.carte-cheffe-nom { color: var(--orange); }
.carte-cheffe-initiales { background: var(--vert); }
.encart-appel { border-left-color: var(--feuille); }
.encart-appel h3 { color: var(--vert); }
.btn-appel { background: var(--orange-vif); color: var(--vert-fonce); }
.btn-appel:hover { background: var(--vert); color: var(--blanc); }
.btn-appel-contour { border-color: var(--feuille-fonce); color: var(--feuille-fonce); }
.btn-appel-contour:hover { background: var(--feuille-fonce); color: var(--blanc); }
.bande-chiffres { background: linear-gradient(120deg, #A85400, #D06A00); }
.bande-chiffres dd { color: var(--orange-vif); }
.date-badge { border-color: var(--orange-vif); color: var(--vert); }
.acces-rapides a { background: var(--blanc); border: 1px solid var(--ligne); }
.acces-rapides a:hover { background: var(--vert-clair); border-color: var(--orange-vif); }
.acces-rapides i { color: var(--feuille-fonce); }
.entete-site { background: linear-gradient(120deg, #A85400, #D06A00); border-bottom: 4px solid var(--orange-vif); }
.section-texte h2 { color: var(--vert); border-bottom-color: var(--orange-vif); }
.filtres-site a.actif, .filtres-site a:hover { background: var(--vert); border-color: var(--vert); }
.site-pied { background: var(--vert-fonce); border-top: 6px solid var(--orange-vif); }
.site-pied-titre { color: var(--orange-vif); }
.liste-actualites article { border-top-color: var(--orange-vif); }

/* Pages de connexion */
.auth-identite { background: linear-gradient(160deg, #A85400, #D06A00); }
.auth-sigle { color: var(--orange-vif); }
.auth-logo { width: 120px; height: 120px; margin-bottom: 1.25rem; background: var(--blanc); border-radius: 50%; padding: 4px; }

/* =====================================================================
   DOMINANTE ORANGE (le brun du logo devient la couleur d'appoint)
   ===================================================================== */
:root { --vert-clair: #FFF1DD; --brun: #5A4C43; --brun-fonce: #3B312B; --creme: #FFE2B0; }
.btn-principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn-principal:hover, .btn-principal:focus { background: var(--brun); border-color: var(--brun); }

/* Espace privé */
.barre-haut { border-bottom-color: var(--brun); }
.menu-lien.actif { background: rgba(255, 255, 255, .2); }
.menu-lien.actif::before { background: var(--creme); }
.menu-lien:hover { background: rgba(255, 255, 255, .12); }
.menu-section { color: rgba(255, 236, 205, .8); }
.menu-bientot, .menu-compteur { background: var(--brun); color: #fff; }
.avatar { background: var(--brun); }
.entete-titre, .panneau-titre { color: var(--brun-fonce); }

/* Site public */
.site-bande-haut strong { color: var(--creme); }
.site-sigle { color: var(--vert); }
.site-nom-complet { color: var(--brun); }
.site-nav .nav-link.active { color: var(--vert); box-shadow: inset 0 -3px 0 var(--vert); }
.btn-connexion { background: var(--vert); color: #fff; }
.btn-connexion:hover { background: var(--brun); color: #fff; }
.bandeau-defilant { background: var(--vert-fonce); }
.bandeau-item::before { background: var(--creme); }
.bande-citation { background: var(--brun); color: var(--creme); }
.bande-chiffres { background: linear-gradient(120deg, #A85400, #E07B00); }
.bande-chiffres dd { color: #fff; }
.bande-chiffres dt { color: var(--creme); }
.titre-bloc h2, .titre-apropos, .section-texte h2, .bloc-mot-chef h2 { color: var(--brun-fonce); }
.titre-bloc h2 i { color: var(--vert); }
.carte-cheffe-nom { color: var(--vert); }
.encart-appel { border-left-color: var(--vert); }
.encart-appel h3 { color: var(--vert); }
.btn-appel { background: var(--vert); color: #fff; }
.btn-appel:hover { background: var(--brun); }
.date-badge { border-color: var(--vert); color: var(--vert); }
.entete-site { background: linear-gradient(120deg, #A85400, #E07B00); border-bottom-color: var(--brun); }
.diaporama-defaut { background: radial-gradient(circle at 80% 30%, rgba(255, 226, 176, .45), transparent 45%), linear-gradient(120deg, #A85400, #D06A00 60%, #F19200); }
.site-pied { background: var(--brun-fonce); border-top-color: var(--vert); }
.liste-actualites article, .section-texte h2 { border-color: var(--vert); }
.filtres-site a.actif, .filtres-site a:hover { background: var(--vert); border-color: var(--vert); }

/* Connexion */
.auth-identite { background: linear-gradient(160deg, #A85400, #E07B00); }
.auth-sigle { color: #fff; }
.auth-adresse, .auth-mention { color: rgba(255, 255, 255, .85); }
.drapeau span:nth-child(1) { background: var(--brun); }

/* =====================================================================
   MENU LATÉRAL EN VERT (vert des feuilles du logo, assombri pour la lisibilité)
   ===================================================================== */
.barre-laterale,
.barre-laterale.offcanvas-lg { background: linear-gradient(180deg, #4C7F1A 0%, #3A6413 100%) !important; color: #fff; }
@media (max-width: 991.98px) { .barre-laterale.offcanvas-lg { background: #3F6C16 !important; } }
.menu-section { color: #D6EBB8; }
.menu-lien { color: rgba(255, 255, 255, .92); }
.menu-lien:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.menu-lien.actif { background: rgba(255, 255, 255, .18); color: #fff; }
.menu-lien.actif::before { background: var(--orange-vif); }
.menu-bientot { background: rgba(255, 255, 255, .18); color: #fff; }
.menu-compteur { background: var(--orange-vif); color: #3B312B; }
.barre-laterale .btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* Bande du slogan (sous le carrousel) en vert du logo */
.bande-citation { background: linear-gradient(90deg, #3A6413 0%, #4C7F1A 50%, #3A6413 100%); color: #fff; border-top: 3px solid var(--orange-vif); }
.bande-citation p { color: #fff; }
/* Signatures et compteur d'absences */
.ligne-signature { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--ligne); }
.apercu-signature { width: 180px; height: 70px; border: 1px dashed var(--ligne); border-radius: 8px; display: grid; place-items: center; background: #fff; }
.apercu-signature img { max-width: 170px; max-height: 64px; }
.compteur-absences { text-align: center; }
.compteur-valeur { font-size: 2.6rem; font-weight: 800; color: var(--vert); line-height: 1; margin: .2rem 0 .4rem; }

/* Récapitulatif des classes */
.tableau-recap .recap-niveau { color: #00843D; font-weight: 700; }
.tableau-recap tr.recap-total td { color: var(--vert-fonce, #A85400); font-weight: 700; text-transform: uppercase; font-size: .9rem; background: #FFF6EC; }
.tableau-recap tr.recap-general td { background: #FBE9D6; }
.tableau-recap sup { font-size: .6em; }
