/* =========================================================================
   ENT du collège — feuille de style unique, sans dépendance externe.
   Couleurs et espacements dans les variables ci-dessous.
   ========================================================================= */

:root {
    --primaire: #1f4e8c;
    --primaire-fonce: #163a69;
    --primaire-clair: #e8f0fb;
    --primaire-degrade: #4b71a3;
    --accent: #e0752d;
    --succes: #1d7a4c;
    --succes-fond: #e6f5ed;
    --danger: #b42318;
    --danger-fond: #fdecea;
    --info-fond: #eef4fc;
    --attente: #9a6700;
    --attente-fond: #fff6db;

    --texte: #1d2433;
    --texte-doux: #5b6475;
    --fond: #f4f6fa;
    --surface: #ffffff;
    --bordure: #dde2eb;

    --rayon: 10px;
    --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --largeur-nav: 240px;
    --hauteur-entete: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: var(--police);
    font-size: 16px;
    line-height: 1.5;
    color: var(--texte);
    background: var(--fond);
}

a { color: var(--primaire); }
a:hover { color: var(--primaire-fonce); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; background: var(--fond); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--fond); padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: .85rem; }

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

.visuellement-cache {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lien-evitement { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--surface); padding: .5rem 1rem; }
.lien-evitement:focus { left: 1rem; top: .5rem; }

/* ---------- En-tête ---------- */
.entete {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 1rem;
    height: var(--hauteur-entete);
    padding: 0 1.25rem;
    background: var(--primaire);
    color: #fff;
    box-shadow: var(--ombre);
}
.entete__logo { display: flex; align-items: center; gap: .6rem; min-width: 0; color: #fff; text-decoration: none; font-size: 1.05rem; }
.entete__logo > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete__logo:hover { color: #fff; }
.entete__utilisateur { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.entete__identite { display: flex; flex-direction: column; line-height: 1.2; }
.entete__identite small { opacity: .8; }
.entete .bouton--discret { color: #fff; border-color: rgba(255, 255, 255, .35); }
.entete .bouton--discret:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.entete__menu { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.entete__menu { color: #fff; }
.entete__menu .ico { width: 26px; height: 26px; }

.logo-pastille {
    display: inline-grid; place-items: center; flex: none;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--accent); color: #fff; font-weight: 700;
}
.logo-pastille--grand { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; }

.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primaire-clair); color: var(--primaire);
    font-weight: 600; font-size: .85rem;
}
.avatar--petit { width: 30px; height: 30px; font-size: .75rem; }

/* ---------- Mise en page ---------- */
.cadre { display: flex; min-height: calc(100vh - var(--hauteur-entete)); }

.navigation {
    flex: none; width: var(--largeur-nav);
    padding: 1rem .75rem;
    background: var(--surface);
    border-right: 1px solid var(--bordure);
}
.navigation ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.navigation a {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .75rem; border-radius: 8px;
    color: var(--texte); text-decoration: none; font-weight: 500;
}
.navigation a:hover { background: var(--fond); }
.navigation a[aria-current="page"] { background: var(--primaire-clair); color: var(--primaire); }
.navigation .ico { width: 1.25rem; height: 1.25rem; }
.navigation .pastille, .navigation .etiquette { margin-left: auto; }
.navigation__titre { margin: 1rem .75rem .35rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); }

.contenu { flex: 1; min-width: 0; padding: 1.75rem 2rem 3rem; max-width: 1200px; }

.page-titre { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-titre h1 { margin: 0; }
.page-titre__sous { margin: .25rem 0 0; color: var(--texte-doux); }
.lien-retour { display: inline-block; margin-bottom: .35rem; font-size: .9rem; text-decoration: none; }
.compteur { font-size: .9rem; font-weight: 500; color: var(--texte-doux); background: var(--surface); border: 1px solid var(--bordure); border-radius: 999px; padding: .1rem .6rem; vertical-align: middle; }

/* ---------- Composants ---------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.carte--liste { padding: 0; overflow: hidden; }
.carte__entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.carte__entete h2 { margin: 0; }
.carte__titre-liste { padding: 1rem 1.25rem 0; }

.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem 1rem; min-height: 40px;
    border: 1px solid var(--bordure); border-radius: 8px;
    background: var(--surface); color: var(--texte);
    font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.bouton:hover { background: var(--fond); color: var(--texte); }
.bouton--principal { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.bouton--principal:hover { background: var(--primaire-fonce); border-color: var(--primaire-fonce); color: #fff; }
.bouton--danger { color: var(--danger); }
.bouton--danger:hover { background: var(--danger-fond); color: var(--danger); border-color: var(--danger); }
.bouton--discret { background: transparent; min-height: 34px; padding: .3rem .7rem; }
.bouton--large { width: 100%; padding: .7rem; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }

.pastille { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; }
.etiquette { display: inline-block; padding: .05rem .45rem; border-radius: 6px; background: var(--fond); border: 1px solid var(--bordure); color: var(--texte-doux); font-size: .7rem; font-weight: 500; vertical-align: middle; }

.etat { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 500; }
.etat--ok { background: var(--succes-fond); color: var(--succes); }
.etat--off { background: var(--danger-fond); color: var(--danger); }
.etat--attente { background: var(--attente-fond); color: var(--attente); }

.alerte { padding: .85rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; border: 1px solid transparent; }
.alerte ul { margin: 0; padding-left: 1.2rem; }
.alerte--succes { background: var(--succes-fond); border-color: #b5e0c8; color: #14553a; }
.alerte--erreur { background: var(--danger-fond); border-color: #f5c2bd; color: #8a1c13; }
.alerte--info { background: var(--info-fond); border-color: #c9dbf3; color: #1b3d6b; }

.vide { padding: 2rem 1.25rem; text-align: center; color: var(--texte-doux); }
.vide--grand { padding: 3rem 1.5rem; }
.vide__icone { margin: 0; color: var(--texte-doux); }
.vide__icone .ico { width: 48px; height: 48px; stroke-width: 1.4; }

/* ---------- Formulaires ---------- */
.formulaire { display: flex; flex-direction: column; gap: 1rem; }
.formulaire--etroit { max-width: 480px; }
.formulaire + .carte, .formulaire + section { margin-top: 1.25rem; }
.champ { display: flex; flex-direction: column; gap: .35rem; margin: 0; border: 0; padding: 0; min-width: 0; }
.champ legend, .champ label, .champ summary { font-weight: 600; }
.champ legend { padding: 0; margin-bottom: .35rem; }
.champ__aide { margin: 0; font-size: .85rem; color: var(--texte-doux); }
.champ__mdp { display: flex; gap: .5rem; }
.champ__mdp input { flex: 1; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="file"], select, textarea {
    width: 100%; padding: .55rem .75rem; min-height: 42px;
    border: 1px solid var(--bordure); border-radius: 8px;
    background: var(--surface); color: var(--texte); font: inherit;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--primaire); outline: 3px solid var(--primaire-clair); outline-offset: 0; }

.case { display: flex; align-items: center; gap: .5rem; font-weight: 400 !important; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--primaire); }
.cases-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .35rem .75rem; }

.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.grille-2--large { gap: 1.25rem; align-items: start; }
.grille-2--large > .carte { margin: 0; }

.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.filtres .champ { flex: 1 1 180px; }

.en-ligne { display: flex; gap: .5rem; align-items: center; margin: 0; }
.champ-court { max-width: 140px; }

.groupes { border: 1px solid var(--bordure); border-radius: 8px; padding: .75rem 1rem; }
.groupes summary { cursor: pointer; }
.groupes__grille { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .75rem; }
.groupes__titre { margin: 0 0 .35rem; font-size: .85rem; font-weight: 600; color: var(--texte-doux); }

/* ---------- Sélecteur de destinataires ---------- */
.selecteur { position: relative; border: 1px solid var(--bordure); border-radius: 8px; padding: .35rem; background: var(--surface); }
.selecteur:focus-within { border-color: var(--primaire); outline: 3px solid var(--primaire-clair); }
.selecteur input[data-selecteur-saisie] { border: 0; outline: 0; min-height: 36px; padding: .3rem .4rem; }
.selecteur__choix { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.jeton { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .25rem .2rem .65rem; border-radius: 999px; background: var(--primaire-clair); color: var(--primaire-fonce); font-size: .9rem; }
.jeton small { color: var(--texte-doux); }
.jeton__retirer { border: 0; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.jeton__retirer:hover { background: rgba(0, 0, 0, .08); }
.selecteur__suggestions {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10;
    list-style: none; margin: 0; padding: .35rem;
    background: var(--surface); border: 1px solid var(--bordure); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
    max-height: 300px; overflow-y: auto;
}
.selecteur__suggestions li { padding: .5rem .65rem; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; }
.selecteur__suggestions li small { color: var(--texte-doux); }
.selecteur__suggestions li[aria-selected="true"], .selecteur__suggestions li:hover { background: var(--primaire-clair); }
.selecteur__suggestions .vide { padding: .5rem; cursor: default; background: none; }

/* ---------- Barre d'outils, onglets, recherche ---------- */
.barre-outils { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.onglets { display: flex; gap: .25rem; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; padding: .25rem; }
.onglets a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem; border-radius: 7px; color: var(--texte-doux); text-decoration: none; font-weight: 500; }
.onglets a[aria-current="page"] { background: var(--primaire); color: #fff; }
.onglets a[aria-current="page"] .pastille { background: #fff; color: var(--primaire); }
.recherche { display: flex; gap: .5rem; }
.recherche input { min-width: 220px; }

/* ---------- Liste de conversations ---------- */
.liste-messages { list-style: none; margin: 0; padding: 0; }
.liste-messages__ligne + .liste-messages__ligne { border-top: 1px solid var(--bordure); }
.liste-messages__ligne a {
    display: grid; grid-template-columns: auto 200px 1fr auto; align-items: center; gap: .9rem;
    padding: .8rem 1.25rem; color: var(--texte); text-decoration: none;
}
.liste-messages__ligne a:hover { background: var(--fond); }
.liste-messages__auteur, .liste-messages__sujet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-messages__date { color: var(--texte-doux); font-size: .85rem; }
.est-non-lu a { font-weight: 700; }
.est-non-lu a { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- Fil de conversation ---------- */
.participants { margin-bottom: 1rem; color: var(--texte-doux); }
.participants summary { cursor: pointer; }
.participants ul { margin: .5rem 0 0; }
.fil { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.fil__message { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1rem 1.25rem; max-width: 820px; box-shadow: var(--ombre); }
.fil__message--moi { margin-left: auto; background: var(--primaire-clair); border-color: #c9dbf3; }
.fil__entete { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.fil__entete time { margin-left: auto; color: var(--texte-doux); font-size: .85rem; }
.fil__contenu { overflow-wrap: anywhere; }
.reponse label { font-weight: 600; }

/* ---------- Tableau de bord ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tuile {
    display: flex; flex-direction: column; gap: .3rem;
    padding: 1.25rem; border-radius: var(--rayon);
    background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre);
    color: var(--texte); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.tuile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 24, 40, .1); color: var(--texte); }
.tuile__icone { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primaire-clair); color: var(--primaire); margin-bottom: .4rem; }
.tuile__icone .ico { width: 24px; height: 24px; }
.tuile__titre { font-weight: 700; font-size: 1.05rem; }
.tuile__texte { color: var(--texte-doux); font-size: .9rem; }
.tuile--messagerie { border-top: 4px solid var(--primaire); }
.tuile--inactive { opacity: .7; }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau th { background: var(--fond); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: #fafbfd; }
.tableau form { margin: 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--texte-doux); }

.chiffres { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.chiffre { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1rem 1.25rem; display: flex; flex-direction: column; }
.chiffre strong { font-size: 1.8rem; color: var(--primaire); }
.chiffre span { color: var(--texte-doux); }

.fiche-identifiants { max-width: 520px; }
.fiche-identifiants__nom { font-weight: 700; font-size: 1.1rem; }
.fiche-identifiants dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; }
.fiche-identifiants dt { color: var(--texte-doux); }
.fiche-identifiants dd { margin: 0; }
.mdp { font-size: 1.15rem; letter-spacing: .08em; }

/* ---------- Connexion & erreurs ---------- */
.page-connexion { background: linear-gradient(135deg, var(--primaire) 0%, var(--primaire-degrade, #3b82c4) 100%); }
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.connexion__carte { width: 100%; max-width: 410px; background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.connexion__carte--centre { text-align: center; }
.connexion__marque { text-align: center; margin-bottom: 1.5rem; }
.connexion__marque h1 { margin: .75rem 0 .15rem; font-size: 1.5rem; }
.connexion__marque h1 span { color: var(--primaire); }
.connexion__marque p { margin: 0; color: var(--texte-doux); }
.connexion__aide { margin: 1.25rem 0 0; font-size: .85rem; color: var(--texte-doux); text-align: center; }
.code-erreur { font-size: 3.5rem; font-weight: 800; color: var(--primaire); margin: 0; }

/* =========================================================================
   Logo personnalisé
   ========================================================================= */
.logo-image { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; flex: none; }
.logo-image--grand { width: 72px; height: 72px; border-radius: 14px; padding: 4px; box-shadow: var(--ombre); }
.connexion__marque .logo-image--grand { margin: 0 auto; display: block; }
.logo-actuel { display: flex; align-items: center; gap: 1rem; }

/* =========================================================================
   Documents
   ========================================================================= */
.espaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.espace-carte {
    display: flex; gap: 1rem; align-items: flex-start; position: relative;
    padding: 1.25rem; border-radius: var(--rayon);
    background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre);
    color: var(--texte); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.espace-carte:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 24, 40, .1); color: var(--texte); }
.espace-carte > .etiquette { position: absolute; top: .9rem; right: .9rem; }
.espace-carte__icone { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--primaire-clair); color: var(--primaire); }
.espace-carte__icone .ico { width: 24px; height: 24px; }
.espace-carte--personnel .espace-carte__icone { background: var(--primaire); color: #fff; }
.espace-carte--equipe .espace-carte__icone { background: #fff3e6; color: #a34d12; }
.espace-carte--etablissement .espace-carte__icone { background: #e9f6ef; color: #1d7a4c; }
.espace-carte__corps { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1; }
.espace-carte__titre { font-weight: 700; font-size: 1.05rem; }
.espace-carte__texte { color: var(--texte-doux); font-size: .9rem; }

.jauge { display: flex; flex-direction: column; gap: .25rem; min-width: 200px; margin-top: .35rem; }
.jauge meter { width: 100%; height: 8px; border-radius: 999px; }
.jauge__texte { font-size: .82rem; color: var(--texte-doux); margin: 0; }
meter { -webkit-appearance: none; appearance: none; background: var(--fond); border: 0; }
meter::-webkit-meter-bar { background: #e6e9f0; border: 0; border-radius: 999px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--primaire); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: #d68a00; border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--primaire); border-radius: 999px; }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: #d68a00; }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); }

.fil-ariane { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .35rem; font-size: .9rem; color: var(--texte-doux); }
.fil-ariane a { text-decoration: none; }
.fil-ariane [aria-current] { color: var(--texte); font-weight: 500; }

.barre-documents { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.zone-depot {
    flex: 1 1 420px; display: flex; align-items: center; gap: 1rem;
    padding: .75rem 1rem; border: 2px dashed #b9c4d6; border-radius: var(--rayon); background: var(--surface);
    transition: border-color .15s, background .15s;
}
.zone-depot.est-survolee { border-color: var(--primaire); background: var(--primaire-clair); }
/* Champ fichier masqué (le libellé sert de bouton). Sélecteur renforcé pour
   l'emporter sur la règle générale input[type="file"] (largeur 100 %). */
.zone-depot { position: relative; }
.zone-depot input.zone-depot__champ {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0;
    padding: 0; border: 0; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none;
}
.zone-depot__champ:focus-visible + .zone-depot__libelle { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.zone-depot__libelle { flex: 1; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; cursor: pointer; }
.zone-depot__libelle small { color: var(--texte-doux); width: 100%; margin-left: 2.6rem; margin-top: -.6rem; }
.zone-depot__icone { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primaire-clair); color: var(--primaire); }
.zone-depot__icone .ico { width: 20px; height: 20px; }

.menu-action { position: relative; }
.menu-action > summary { list-style: none; cursor: pointer; }
.menu-action > summary::-webkit-details-marker { display: none; }
.menu-action__panneau {
    position: absolute; z-index: 12; top: calc(100% + 6px); left: 0; min-width: 300px;
    display: flex; flex-direction: column; gap: .6rem; padding: 1rem; margin: 0;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
}
.menu-action--droite .menu-action__panneau { left: auto; right: 0; }
.menu-action__panneau .bouton { justify-content: flex-start; }
.menu-action__panneau .en-ligne input { flex: 1; min-width: 0; }

.carte--documents { overflow: visible; }
.tableau--documents td { vertical-align: middle; }
.element { display: flex; align-items: center; gap: .75rem; color: var(--texte); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.element:hover { color: var(--primaire); }
.col-taille, .col-date { white-space: nowrap; color: var(--texte-doux); }
.col-auteur { color: var(--texte-doux); }
.col-actions { width: 1%; text-align: right; }
.col-jauge { min-width: 240px; }

.type-fichier {
    display: inline-grid; place-items: center; flex: none;
    width: 38px; height: 38px; border-radius: 8px;
    font-size: .62rem; font-weight: 800; letter-spacing: .02em;
    background: #eef1f6; color: #5b6475;
}
.type-fichier--dossier { background: #fff3d6; color: #b7791f; }
.type-fichier .ico { width: 21px; height: 21px; }
.type-fichier--depot { background: #e6f5ed; color: #1d7a4c; }
.type-fichier--pdf { background: #fdecea; color: #b42318; }
.type-fichier--texte { background: #e8f0fb; color: #1f4e8c; }
.type-fichier--tableur { background: #e6f5ed; color: #1d7a4c; }
.type-fichier--presentation { background: #fff1e6; color: #c2571a; }
.type-fichier--image { background: #f3e8fb; color: #6b2fa3; }
.type-fichier--audio, .type-fichier--video { background: #e6f4f7; color: #0f6f80; }
.etiquette--depot { background: #e6f5ed; border-color: #b5e0c8; color: #1d7a4c; }
.tuile--documents { border-top: 4px solid var(--accent); }

/* =========================================================================
   Formulaires d'administration
   ========================================================================= */
.champ--ligne { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
.champ--ligne label { font-weight: 500; }
.champ-unite { display: flex; align-items: center; gap: .5rem; }
.champ-unite input { width: 120px; text-align: right; }
.champ-unite span { color: var(--texte-doux); min-width: 1.8rem; }
.carte__entete--liste { padding: 1rem 1.25rem 0; }

.grille-apparence { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.apercu-colonne { position: sticky; top: calc(var(--hauteur-entete) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.champ-couleur { display: flex; gap: .5rem; align-items: center; }
.champ-couleur input[type="color"] { width: 48px; height: 42px; padding: 2px; border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface); cursor: pointer; }
.champ-couleur input[type="text"] { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: lowercase; }
.palettes { display: flex; flex-wrap: wrap; gap: .5rem; }
.palette { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .4rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); font: inherit; font-size: .88rem; cursor: pointer; }
.palette:hover { border-color: var(--primaire); }
.palette__pastilles { display: inline-flex; }
.palette__pastilles span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.palette__pastilles span + span { margin-left: -6px; }
.contraste-ok { color: var(--succes); }
.contraste-ko { color: var(--danger); font-weight: 600; }

.apercu { border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; background: var(--fond); box-shadow: var(--ombre); font-size: .85rem; }
.apercu__entete { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: var(--primaire); color: #fff; }
.apercu__entete .logo-pastille { width: 26px; height: 26px; border-radius: 7px; font-size: .8rem; }
.apercu__corps { display: grid; grid-template-columns: 132px 1fr; min-height: 150px; }
.apercu__menu { background: var(--surface); border-right: 1px solid var(--bordure); padding: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.apercu__lien { display: flex; align-items: center; gap: .3rem; padding: .35rem .45rem; border-radius: 6px; white-space: nowrap; font-size: .78rem; }
.apercu__lien--actif { background: var(--primaire-clair); color: var(--primaire); font-weight: 600; }
.apercu__lien .ico { width: 14px; height: 14px; }
.apercu__lien .pastille { margin-left: auto; min-width: 1.1rem; height: 1.1rem; font-size: .65rem; }
.apercu__contenu { padding: .75rem; display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.apercu__contenu p { margin: 0; }
.apercu__titre { font-weight: 700; font-size: 1rem; }
.apercu__contenu .bouton { min-height: 30px; padding: .3rem .7rem; font-size: .8rem; }
.apercu--connexion { background: linear-gradient(135deg, var(--primaire) 0%, var(--primaire-degrade) 100%); padding: 1.25rem; }
.apercu__carte { background: var(--surface); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }
.apercu__nom { color: var(--primaire); }
.apercu__carte small { color: var(--texte-doux); }

@media (max-width: 1100px) {
    .grille-apparence { grid-template-columns: 1fr; }
    .apercu-colonne { position: static; }
}
@media (max-width: 900px) {
    .col-auteur, .col-date { display: none; }
    .tableau.tableau--documents { display: table; white-space: normal; overflow: visible; }
    .tableau--documents th, .tableau--documents td { padding: .6rem .5rem; }
    .tableau--documents td:first-child { padding-left: .75rem; }
    .zone-depot { flex-direction: column; align-items: stretch; }
    .zone-depot__libelle small { margin: 0; }
    .menu-action__panneau { min-width: 260px; }
    .champ--ligne { flex-direction: column; align-items: stretch; gap: .35rem; }
}

/* =========================================================================
   Icônes (public/icones/sprite.svg)
   ========================================================================= */
.ico {
    display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.2em;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ico--petit { width: 1em; height: 1em; }
.bouton .ico { width: 18px; height: 18px; }
.bouton--icone { width: 38px; padding: 0; }
.lien-retour { display: inline-flex; align-items: center; gap: .3rem; }
.onglets a .ico { width: 16px; height: 16px; }

/* =========================================================================
   Chargement
   ========================================================================= */
@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes avancer { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
@keyframes balayer { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Barre fine en haut de page pendant le passage à la page suivante */
.barre-chargement {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 3px;
    background: var(--accent); transform-origin: left; transform: scaleX(0); opacity: 0;
    pointer-events: none; transition: opacity .2s;
}
body.est-en-chargement .barre-chargement { opacity: 1; animation: avancer 6s cubic-bezier(.1, .7, .2, 1) forwards; }

/* Bouton en cours : roue à la place de l'icône */
.bouton.est-en-cours { cursor: progress; opacity: .9; }
.bouton.est-en-cours .ico { display: none; }
.bouton.est-en-cours::before {
    content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: tourner .7s linear infinite;
}

/* Roue autonome (recherche de destinataires…) */
.roue {
    display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--primaire); border-right-color: transparent;
    animation: tourner .7s linear infinite; vertical-align: -3px;
}
.selecteur__suggestions .chargement { display: flex; align-items: center; gap: .6rem; color: var(--texte-doux); cursor: default; background: none; justify-content: flex-start; }

/* Progression d'un envoi de fichiers */
.progression { flex-basis: 100%; display: flex; align-items: center; gap: .75rem; }
.progression progress {
    flex: 1; height: 8px; border: 0; border-radius: 999px; overflow: hidden;
    -webkit-appearance: none; appearance: none; background: #e6e9f0;
}
.progression progress::-webkit-progress-bar { background: #e6e9f0; border-radius: 999px; }
.progression progress::-webkit-progress-value { background: var(--primaire); border-radius: 999px; transition: width .2s; }
.progression progress::-moz-progress-bar { background: var(--primaire); border-radius: 999px; }
.progression__texte { font-size: .85rem; color: var(--texte-doux); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progression--erreur .progression__texte { color: var(--danger); font-weight: 600; white-space: normal; }
.zone-depot.est-en-envoi { border-style: solid; border-color: var(--primaire); }
.zone-depot { flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
    body.est-en-chargement .barre-chargement { animation: none; transform: scaleX(.6); }
    .bouton.est-en-cours::before, .roue { animation-duration: 2s; }
}

/* =========================================================================
   Assistant d'installation (public/installation.php)
   ========================================================================= */
.page-installation { background: var(--fond); }
.page-installation .entete__logo { color: #fff; }
.page-installation .entete { position: static; }
.installation { max-width: 860px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.installation > .carte, .installation .formulaire > .carte { margin: 0; }
.installation__carte h1 { font-size: 1.5rem; }
.installation__carte h2 { display: flex; align-items: center; gap: .5rem; }
.installation__carte h2 .ico { width: 22px; height: 22px; color: var(--primaire); }
.installation__actions { align-items: center; gap: 1rem; }
.bouton--grand { min-height: 48px; padding: .7rem 1.4rem; font-size: 1.05rem; }
.champ-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.35rem !important; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.consignes { margin: 0 0 1rem; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .45rem; }
.installation-carte { max-width: 620px; }

.etapes { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; counter-reset: etape; }
.etapes__etape { flex: 1; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--bordure); color: var(--texte-doux); font-weight: 500; }
.etapes__numero { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fond); border: 1px solid var(--bordure); font-weight: 700; font-size: .85rem; }
.etapes__numero .ico { width: 16px; height: 16px; }
.etapes__etape.est-active { border-color: var(--primaire); color: var(--texte); box-shadow: var(--ombre); }
.etapes__etape.est-active .etapes__numero { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.etapes__etape.est-faite .etapes__numero { background: var(--succes-fond); border-color: #b5e0c8; color: var(--succes); }

.verifications { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; }
.verification { display: flex; gap: .85rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--bordure); }
.verification:last-child { border-bottom: 0; }
.verification__icone { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; }
.verification__icone .ico { width: 17px; height: 17px; stroke-width: 2.2; }
.verification__texte { display: flex; flex-direction: column; gap: .1rem; }
.verification__texte small { color: var(--texte-doux); font-size: .88rem; }
.verification--ok .verification__icone { background: var(--succes-fond); color: var(--succes); }
.verification--attention .verification__icone { background: var(--attente-fond); color: var(--attente); }
.verification--erreur .verification__icone { background: var(--danger-fond); color: var(--danger); }
.verification--erreur .verification__texte small { color: var(--danger); }
.verification--attente .verification__icone { background: var(--fond); }

.installation__succes { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.installation__succes .consignes, .installation__succes h2, .installation__succes .alerte { text-align: left; align-self: stretch; }
.installation__medaille { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--succes-fond); color: var(--succes); }
.installation__medaille .ico { width: 38px; height: 38px; stroke-width: 2.4; }
.details-techniques { margin: 1rem 0; }
.details-techniques summary { cursor: pointer; color: var(--texte-doux); }
.details-techniques pre { max-height: 320px; overflow: auto; font-size: .8rem; white-space: pre-wrap; }

@media (max-width: 700px) {
    .etapes__etape span:last-child { display: none; }
    .etapes__etape { justify-content: center; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .entete { gap: .5rem; padding: 0 .75rem; }
    .entete__menu { display: block; flex: none; }
    .entete__utilisateur { flex: none; gap: .5rem; }
    .entete__identite { display: none; }
    /* Texte masqué à l'écran mais lu par les lecteurs d'écran */
    .entete .bouton__texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .entete .bouton--discret { padding: .3rem .5rem; }
    .navigation {
        position: fixed; top: var(--hauteur-entete); bottom: 0; left: 0; z-index: 15;
        transform: translateX(-100%); transition: transform .2s; box-shadow: var(--ombre);
    }
    .navigation.est-ouverte { transform: none; }
    .contenu { padding: 1.25rem 1rem 2.5rem; }
    .grille-2, .groupes__grille { grid-template-columns: 1fr; }
    .liste-messages__ligne a { grid-template-columns: auto 1fr auto; grid-template-areas: "av auteur date" "av sujet sujet"; gap: .15rem .75rem; }
    .liste-messages__ligne .avatar { grid-area: av; }
    .liste-messages__auteur { grid-area: auteur; }
    .liste-messages__sujet { grid-area: sujet; color: var(--texte-doux); }
    .liste-messages__date { grid-area: date; }
    .tableau { display: block; overflow-x: auto; white-space: nowrap; }
    .recherche input { min-width: 0; }
}

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

@media print {
    .entete, .navigation, .actions, .alerte, .lien-retour { display: none !important; }
    body, .page-connexion { background: #fff; }
    .carte { box-shadow: none; border: 1px solid #999; }
}
