/* Gestion École — design system : doux, rond, un peu ludique. */
:root {
    --primary: #6d5efc;
    --primary-dark: #5747e0;
    --primary-soft: #efecff;
    /* Second arrêt du dégradé des boutons + teinte de leur ombre. Déclinés par
       thème (cf. html[data-theme="itschool"]) pour que le dégradé suive --primary. */
    --primary-lift: #8b7dff;
    --primary-shadow: rgba(109, 94, 252, .30);
    --accent: #ff8a5c;
    /* Couleur de marque iT.SCHOOL (éditeur) — utilisée en ACCENT (logo, liens,
       petits détails). Le violet reste la couleur PRINCIPALE du produit. */
    --brand: #0189d9;
    --brand-dark: #0171b5;
    --brand-soft: #e6f4fc;
    --ink: #1f2440;
    --muted: #8a90a8;
    --line: #ecedf4;
    --bg: #f6f7fb;
    --card: #ffffff;
    --ok: #1a9f63;
    --shadow: 0 10px 30px -12px rgba(45, 40, 90, .18);
    --radius: 18px;
    --radius-sm: 12px;
    --danger: #e5484d;
    --danger-soft: #fdecec;
    /* Couleurs sémantiques des icônes d'action (au repos) */
    --c-edit: #6d5efc; --c-view: #0189d9; --c-add: #1f9d63; --c-fav: #f2b705;
    --c-flag: #ef6c3b; --c-pin: #7c5cff; --c-reply: #0ea5a5; --c-set: #64748b;
}

/* === Thème iT.SCHOOL (bleu) — activé via <html data-theme="itschool"> ===========
   Réglable par le super-admin (console ▸ Apparence). Le thème « standard » (violet)
   = valeurs :root par défaut. On ne surcharge que le « mauve » : la couleur
   principale (--primary*) + les dégradés violets codés en dur. */
html[data-theme="itschool"] {
    --primary: #0189d9;
    --primary-dark: #0171b5;
    --primary-soft: #e6f4fc;
    --primary-lift: #22c1d6;
    --primary-shadow: rgba(1, 137, 217, .30);
}
html[data-theme="itschool"] .space-ecole,
html[data-theme="itschool"] .space-head.is-ecole .sh-ico {
    background: linear-gradient(135deg, #0189d9 0%, #38aae6 55%, #8fd2f3 100%);
}
html[data-theme="itschool"] .ap-hello {
    background: linear-gradient(135deg, #0189d9 0%, #3aabe7 100%);
    box-shadow: 0 14px 30px -16px rgba(28, 157, 215, .7);
}
html[data-theme="itschool"] .auth {
    background:
        radial-gradient(1200px 600px at 10% -10%, #d2ecfa 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 110%, #e1f3fc 0%, transparent 50%),
        var(--bg);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Convention : toute page connectée tient dans la fenêtre — pas de scroll de PAGE,
   le défilement vit DANS la zone de travail (.content) ou la zone interne d'un module.
   (sauf avis contraire ; mobile <900px : on relâche pour rester confortable.) */
body.app-fit { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.app-fit > .topbar { flex: none; }
@media (max-width: 900px) { body.app-fit { height: auto; overflow: visible; } }

h1, h2, h3, .brand { font-family: "Baloo 2", "Inter", system-ui, sans-serif; }
a { color: inherit; }

/* ---------- Auth / login ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(1200px 600px at 10% -10%, #d8d2ff 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 110%, #ffd9c7 0%, transparent 50%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 2.4rem 2.2rem;
}
.auth-logo {
    width: 64px; height: 64px;
    display: grid; place-items: center;
    font-size: 2rem;
    border-radius: 20px;
    background: var(--primary-soft);
    margin-bottom: 1.1rem;
}
/* Logo officiel iT.SCHOOL Educa+ sur la page de connexion. */
.auth-logo-img { display: block; width: 100%; max-width: 360px; height: auto; margin: -.4rem auto 1.2rem; }
.auth-card h1 { margin: 0 0 .2rem; font-size: 1.6rem; }
.auth-card .sub { color: var(--muted); margin: 0 0 1.6rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.input {
    width: 100%;
    padding: .8rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #fcfcff;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}
/* Champ visible flatpickr (altInput) : compact, aligné sur les champs de formulaire. */
.fp-input {
    width: 100%;
    box-sizing: border-box;
    padding: .4rem .55rem;
    font-size: .9rem;
    line-height: 1.3;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    background: #fff;
}
.fp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ── Boutons d'action ────────────────────────────────────────────────────────
   Système unique, calqué sur .jv-verif (« Vérifier et valider ») : dégradé à 135°,
   ombre TEINTÉE de la couleur du bouton, 700 à .85rem, rayon 10, léger soulèvement
   au survol. La couleur est SÉMANTIQUE — elle dit ce que fait le bouton :
     .btn            violet  action principale (Ajouter, Créer, Lancer)
     .btn-ok         vert    confirmer (Valider, Enregistrer)
     .btn-info       bleu    consulter / naviguer (Ouvrir, Entrer)
     .btn-danger     rouge   détruire (Supprimer, Retirer, Purger)
     .btn-ghost      pâle    action secondaire, sans dégradé
   Tailles : .sm (ligne de tableau) · défaut · .lg (barre d'enregistrement).
   Largeur : `auto` — un bouton fait la taille de son libellé. Le pleine-largeur
   est désormais EXPLICITE via .btn-block (formulaires de connexion, où le bouton
   est l'action unique d'une carte étroite). L'ancien défaut `width:100%` obligeait
   à l'annuler dans 27 règles CSS et 32 attributs style= : tous supprimés. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    width: auto;
    padding: .52rem 1rem;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
    color: #fff;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--btn-sh);
    transition: transform .12s, box-shadow .12s, filter .12s;
    --btn-a: var(--primary); --btn-b: var(--primary-lift); --btn-sh: var(--primary-shadow);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px var(--btn-sh); color: #fff; filter: saturate(1.06); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.4); }
.btn svg { width: 1.05em; height: 1.05em; }
/* Variantes sémantiques */
.btn-ok     { --btn-a: #16a34a; --btn-b: #0ea5a4; --btn-sh: rgba(16, 163, 74, .30); }
.btn-info   { --btn-a: #0189d9; --btn-b: #22c1d6; --btn-sh: rgba(1, 137, 217, .30); }
/* Neutre : action tertiaire type « Annuler », qui ne doit rien revendiquer.
   Comble un vrai manque — trois classes locales (pj-btn-cancel, pj-btn-ann,
   btn-light) le réinventaient chacune à leur façon. */
.btn-quiet  { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-quiet:hover { background: var(--bg); border-color: var(--primary); color: var(--primary-dark); box-shadow: none; filter: none; }
/* Tailles */
.btn.lg { padding: .72rem 1.5rem; font-size: 1rem; border-radius: 12px; }
/* Pleine largeur EXPLICITE : action unique d'une carte étroite (connexion,
   définition de mot de passe). Remplace l'ancien width:100% implicite. */
.btn-block { width: 100%; }
.btn:active { transform: scale(.98); }
/* Bouton compact (ex. Enregistrer d'une fiche) : petit, largeur au contenu. */
.btn.sm { padding: .36rem .78rem; font-size: .8rem; border-radius: 8px; gap: .3rem; }
/* Secondaire : pas de dégradé ni d'ombre portée au repos — il ne doit jamais
   rivaliser avec l'action principale posée à côté. */
.btn-ghost { background: var(--primary-soft); color: var(--primary-dark); box-shadow: none; }
.btn-ghost:hover { background: #e4e0ff; color: var(--primary-dark); box-shadow: 0 3px 10px var(--primary-shadow); filter: none; }

.alert {
    background: #fff0ec;
    color: #c0431f;
    border: 1px solid #ffd9cd;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 1rem;
}

/* Bannière d'information/attention INLINE : persistante et pleine largeur du
   conteneur (à NE PAS confondre avec les toasts .flash, fixes et éphémères). */
.banner {
    display: flex; align-items: flex-start; gap: .5rem;
    width: 100%; padding: .8rem 1.1rem; margin-bottom: 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 500; line-height: 1.45;
}
.banner-warn { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.banner-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.banner-ok   { background: #e6f7ee; color: #157a4b; border: 1px solid #b7ebcd; }
.banner a { color: inherit; text-decoration: underline; font-weight: 600; }

/* Navigation de jour compacte (pill) : ‹ [date] › + Aujourd'hui. */
.pr-daynav { display: inline-flex; align-items: center; gap: .1rem; background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 999px; padding: .15rem .3rem; }
.pr-daynav .dn-arrow { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: 1.25rem; line-height: 1; font-weight: 700; }
.pr-daynav .dn-arrow:hover { background: var(--bg, #f1f5f9); color: var(--ink, #0f172a); }
.pr-daynav .dn-date { border: none; background: transparent; font-weight: 600; font-size: .88rem; color: var(--ink, #0f172a); padding: .2rem .25rem; cursor: pointer; width: auto; }
.pr-daynav .dn-date::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.pr-daynav .dn-today { font-size: .8rem; color: var(--brand, #0189d9); text-decoration: none; font-weight: 600; padding: 0 .4rem 0 .2rem; }
.pr-daynav .dn-today:hover { text-decoration: underline; }

/* ---------- App shell ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 1.3rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    position: relative;
}

/* Onglet flèche : épingle / replie la barre (toujours visible). */
.sidebar-pin {
    position: absolute; top: 64px; right: -13px; z-index: 5;
    width: 26px; height: 44px; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-left: none;
    background: var(--card); color: var(--primary-dark);
    border-radius: 0 12px 12px 0; box-shadow: 2px 0 6px rgba(0,0,0,.06);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-pin:hover { background: var(--primary-soft); }
.sidebar-pin-ico { font-size: 1.3rem; line-height: 1; font-weight: 700; transition: transform .18s ease; }
.app.sidebar-pinned .sidebar-pin-ico { transform: rotate(180deg); }
.brand {
    display: flex; align-items: center; gap: .6rem;
    font-size: 1.25rem; font-weight: 700;
    padding: .3rem .5rem 1.1rem;
}
.brand .logo {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.2rem;
    background: var(--primary-soft);
}
/* Logo iT.SCHOOL Educa+ (fichier officiel) dans la topbar. */
.topbar .brand { padding: 0; }
.brand-logo { height: 64px; width: auto; display: block; }

.nav-group-label {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 700;
    padding: .9rem .8rem .3rem;
}
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .65rem .8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
    transition: background .12s;
}
.nav-item .ico { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-sub { margin-left: .6rem; padding-left: .6rem; border-left: 2px solid var(--line); }

.sidebar-footer { margin-top: auto; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .55rem 1.6rem;
    background: var(--card);
    border-bottom: 2px solid var(--brand);   /* fine signature de marque iT.SCHOOL */
}
.topbar .hello { font-weight: 600; }
.topbar .hello span { color: var(--muted); font-weight: 500; }

/* Bouton de retour rapide à l'accueil, présent en haut de chaque page. */
.home-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700; font-size: .9rem; text-decoration: none;
    white-space: nowrap; flex-shrink: 0;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.home-pill:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }

/* Sélecteur d'année scolaire (topbar) = contexte de navigation global.
   Pilule cohérente avec .home-pill ; l'option sélectionnée = l'année active. */
/* Sélecteur d'année (topbar) : menu maison façon <details>, comme le menu utilisateur. */
.annee-menu { position: relative; flex-shrink: 0; }
.annee-menu > summary { list-style: none; }
.annee-menu > summary::-webkit-details-marker { display: none; }
.annee-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700; font-size: .9rem; white-space: nowrap;
    transition: background .13s;
}
.annee-pill:hover { background: #e4e0ff; }
.annee-menu > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 999px; }
.annee-caret { width: 15px; height: 15px; opacity: .7; transition: transform .15s; }
.annee-menu[open] .annee-caret { transform: rotate(180deg); }
.annee-list {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 80;
    min-width: 200px; background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: 0 16px 42px rgba(20, 20, 60, .18); overflow: hidden; padding: .3rem;
}
.annee-item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .5rem .7rem; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.annee-item:hover, .annee-item.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.annee-star { width: 15px; height: 15px; color: var(--c-fav); flex-shrink: 0; }

/* Sélecteur de PÉRIMÈTRE (école ▸ implantations) — calqué sur .annee-menu.
   Radios = bascule d'école (contexte) ; cases = filtre implantations (dans l'école active). */
.scope-menu { position: relative; flex-shrink: 0; }
.scope-menu > summary { list-style: none; }
.scope-menu > summary::-webkit-details-marker { display: none; }
.scope-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .6rem .3rem .55rem; border-radius: 999px; cursor: pointer;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700; font-size: .9rem; white-space: nowrap; transition: background .13s;
}
.scope-pill:hover { background: #e4e0ff; }
.scope-menu > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 999px; }
.scope-ecole-cur { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; }
.scope-sep { opacity: .5; }
.scope-caret { width: 15px; height: 15px; opacity: .7; transition: transform .15s; }
.scope-menu[open] .scope-caret { transform: rotate(180deg); }
.scope-pop {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 80;
    min-width: 260px; background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: 0 16px 42px rgba(20, 20, 60, .18); padding: .4rem;
}
.scope-ecoles { display: flex; flex-direction: column; gap: .1rem; }
.scope-centre { margin: .3rem .5rem .1rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.scope-ecole {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .6rem; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.scope-ecole:hover { background: var(--primary-soft); }
.scope-ecole.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.scope-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; position: relative; }
.scope-ecole.is-active .scope-radio, .scope-radio.on { border-color: var(--primary); }
.scope-radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }
.scope-ecole-lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-div { height: 1px; background: var(--line); margin: .4rem .2rem; }

/* Filtre implantations (dans le menu périmètre) : cases + Appliquer. */
.impl-list { display: flex; flex-direction: column; gap: .15rem; }
.impl-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem .55rem; border-radius: 9px; color: var(--ink); font-weight: 600; cursor: pointer;
}
.impl-item:hover { background: var(--primary-soft); }
.impl-item input { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.impl-item-lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impl-apply { width: auto; margin-top: .35rem; align-self: stretch; }

/* Bandeau « brouillon retrouvé » (filet de sécurité de saisie). */
.draft-bar {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
    padding: .6rem .9rem; border-radius: 12px; margin-bottom: 1rem; font-size: .9rem;
}
.draft-bar button {
    border: none; border-radius: 8px; padding: .35rem .8rem; font-weight: 700;
    cursor: pointer; background: var(--primary); color: #fff; font-size: .85rem;
}
.draft-bar button.ghost { background: transparent; color: #9a3412; text-decoration: underline; padding: .35rem .4rem; }
.userchip { display: flex; align-items: center; gap: .6rem; }

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: .85rem; color: #fff;
    flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }

/* Pastille d'implantation (convention) : acronyme sur la couleur choisie.
   Léger ombrage du texte pour rester lisible même sur une couleur claire. */
.avatar.pastille-impl { font-size: .72rem; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .28); }
.avatar.pastille-impl.sm { font-size: .62rem; }
/* Chip d'implantation « bouton » (moins rond que la pastille) — colonnes Implantation des grids. */
.pastille-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .22rem .5rem; border-radius: 8px;
    background: var(--primary); color: #fff;
    font-weight: 700; font-size: .72rem; letter-spacing: .02em; line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .28); white-space: nowrap;
}
.pastille-btn.sm { padding: .16rem .42rem; font-size: .66rem; border-radius: 7px; }

/* Avatar SVG génératif : occupe le même gabarit que la pastille d'initiales. */
.avatar.avatar-svg { padding: 0; background: transparent; overflow: hidden; }
.avatar.avatar-svg svg { display: block; width: 100%; height: 100%; }

/* Nom de membre = pastille d'initiales + nom (dans le tableau du personnel). */
.member-name { display: inline-flex; align-items: center; gap: .6rem; }

/* Menu utilisateur de la topbar (clic sur les initiales → déconnexion…). */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary .avatar { transition: transform .12s ease, box-shadow .12s ease; }
.user-menu > summary:hover .avatar { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20, 20, 60, .22); }
.user-menu[open] > summary .avatar { box-shadow: 0 0 0 3px var(--primary-soft); }
.user-menu-pop {
    position: absolute; right: 0; top: calc(100% + .55rem); z-index: 80;
    min-width: 230px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 16px 42px rgba(20, 20, 60, .18); overflow: hidden;
}
.ump-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.ump-head .ump-id { min-width: 0; }
.ump-head strong { display: block; line-height: 1.2; }
.ump-head .ump-mail { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ump-item { display: flex; align-items: center; gap: .55rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.ump-item:hover { background: var(--primary-soft); color: var(--primary-dark); }

/* CONVENTION largeur de base : la zone de travail d'une page SANS menu occupe
   la largeur de la COLONNE DE GAUCHE de la liste du personnel = largeur totale
   moins la colonne menu (300px) et le gap (1.6rem). Calée à gauche.
   Les pages AVEC menu/colonnes (liste perso `.page-with-aside`, console `/admin`,
   dashboard `.is-home`) repassent en pleine largeur (cf. règles ci-dessous). */
.content { padding: 1.8rem; max-width: calc(100% - 300px - 1.6rem); width: 100%; flex: 1; min-height: 0; overflow-y: auto; }
.content.is-home,
.content:has(.page-with-aside),
.admin-main .content { max-width: none; }
@media (max-width: 900px) { .content { max-width: none; } }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.page-head .lead { color: var(--muted); margin: .2rem 0 0; }
.page-head-link { text-decoration: none; color: inherit; display: block; border-radius: var(--radius-sm); transition: opacity .12s; }
.page-head-link:hover { opacity: .75; }
.page-head-link:hover h1 { color: var(--primary-dark); }
.mi-identity { display: flex; align-items: center; gap: 1rem; }

/* Fiche élève — tuile droit à l'image (en-tête) */
.eleve-photo-tile {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    border-radius: 12px; padding: .45rem .9rem; line-height: 1;
}
.eleve-photo-tile .ept-pic { font-size: 1.45rem; }
.eleve-photo-tile .ept-lbl { font-size: .66rem; font-weight: 700; letter-spacing: .03em; }
.eleve-photo-tile.ok { background: #d3f9d8; color: #178037; }
.eleve-photo-tile.ko { background: #ffe3e3; color: #c92a2a; }

/* ---------- Cards / stats ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { display: flex; align-items: center; gap: 1rem; }
.stat .emoji { font-size: 2rem; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); }
.stat .num { font-size: 1.8rem; font-weight: 800; font-family: "Baloo 2", sans-serif; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* ---------- Table ---------- */
.toolbar { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; max-width: 380px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
/* Enregistrements DNS (auth de domaine) : les valeurs CNAME et les motifs d'erreur sont longs.
   On lève le overflow:hidden hérité → scroll horizontal si besoin, ET on autorise le retour à la
   ligne des valeurs/erreurs pour qu'elles soient TOUJOURS lisibles (jamais coupées). */
.dns-records { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dns-records code { word-break: break-all; overflow-wrap: anywhere; white-space: normal; }
.dns-records .dns-reason { display: inline-block; word-break: break-word; }
.dns-records td { vertical-align: top; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }

/* Liste plein écran : page-head + recherche figés, tableau scrollable, pagination toujours visible. */
.list-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.list-page .page-head, .list-page .toolbar, .list-page .pagination { flex-shrink: 0; }
.list-page .pagination { margin-bottom: .2rem; }
.list-page .table-wrap { flex: 1; min-height: 0; overflow-y: auto; }
/* En-têtes de colonnes figés pendant le scroll du tableau. */
.list-page thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfbfe; }
.cell-name { display: flex; align-items: center; gap: .7rem; font-weight: 600; }

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .6rem; border-radius: 999px;
    font-size: .8rem; font-weight: 600;
    background: var(--brand-soft); color: var(--brand-dark);   /* accent iT.SCHOOL */
}
.badge.muted { background: var(--bg); color: var(--muted); }
/* Badge de classe coloré à la couleur de son implantation (option par implantation) :
   fond + couleur posés en inline ; ombre légère pour rester lisible sur couleur claire. */
.badge-classe { text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

/* Liste des groupes virtuels : nom coloré à la couleur de l'implantation (dégradé si
   plusieurs) + pastilles d'implantation dans la colonne Implantation. */
.grp-name { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; color: inherit; }
.grp-name-col {
    padding: .28rem .6rem; border-radius: 9px; color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.grp-name-col strong { color: #fff; }
.grp-name-ac { color: var(--muted); font-weight: 500; font-size: .9em; }
.grp-name-col .grp-name-ac { color: rgba(255, 255, 255, .85); }
.grp-pastilles { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
/* Grille des groupes : centrer verticalement le contenu (icônes 34px vs pastille de nom plus haute). */
.grp-grid td { vertical-align: middle; }
/* Modale « membres d'un groupe système ». */
.grp-mem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; max-height: 55vh; overflow-y: auto; }
.grp-mem-list li { display: flex; align-items: center; gap: .6rem; padding: .35rem .3rem; border-radius: 8px; }
.grp-mem-list li:hover { background: var(--bg); }
.grp-mem-nom { font-weight: 500; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3.5rem 1.5rem; color: var(--muted); }
.empty .big { font-size: 3rem; }
.empty h3 { color: var(--ink); margin: .6rem 0 .3rem; }

/* ---------- Dropzone (import) ---------- */
.dropzone {
    border: 2px dashed #d6d8e6;
    border-radius: var(--radius);
    background: var(--card);
    padding: 2.6rem 1.5rem;
    text-align: center;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-size: 2.6rem; }
.dropzone h3 { margin: .6rem 0 .2rem; }
.dropzone p { color: var(--muted); margin: 0; }
.dropzone .fname { margin-top: .8rem; font-weight: 600; color: var(--primary-dark); }

.note { background: #f0f7ff; border: 1px solid #d8e8ff; color: #2456a6; border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .9rem; }

@media (max-width: 760px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; z-index: 30; box-shadow: var(--shadow); }
    .sidebar.open { transform: none; }
    .content { padding: 1.1rem; }
    .menu-toggle { display: inline-flex !important; }
    .sidebar-pin { display: none; }
}
.menu-toggle { display: none; background: var(--primary-soft); color: var(--primary-dark); border: none; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; cursor: pointer; }

/* ---------- Barre latérale auto-masquée (desktop) ----------
   Par défaut (non épinglée) la barre se réduit à un fin rail et se déploie
   en survol, par-dessus le contenu (sans le pousser). La flèche l'épingle. */
@media (min-width: 761px) {
    .app:not(.sidebar-pinned) .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; width: 250px;
        transform: translateX(-237px);
        transition: transform .2s ease;
        z-index: 40; box-shadow: var(--shadow);
    }
    .app:not(.sidebar-pinned) .sidebar:hover,
    .app:not(.sidebar-pinned) .sidebar:focus-within {
        transform: translateX(0);
    }
    /* Le contenu occupe presque toute la largeur ; on réserve juste le rail. */
    .app:not(.sidebar-pinned) .main { margin-left: 13px; }
    /* Indice visuel du rail (bande dégradée le long du bord). */
    .app:not(.sidebar-pinned) .sidebar::before {
        content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 3px;
        background: linear-gradient(var(--primary), var(--primary-dark)); opacity: .35;
    }
}

/* Pagination (liste des élèves) */
.pagination { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.6rem; flex-wrap: wrap; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 .65rem;
    border-radius: 12px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line);
    font-weight: 700; font-size: .95rem; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .08s;
}
.page-btn:hover { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary-soft); }
.page-btn:active { transform: scale(.95); }
.page-btn.current {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: var(--shadow); cursor: default;
}
.page-btn.nav { font-size: 1.15rem; }
.page-btn.disabled { background: var(--bg); color: var(--muted); border-color: var(--line); cursor: default; }
.page-btn.disabled:hover { background: var(--bg); color: var(--muted); }
.page-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 40px; color: var(--muted); font-weight: 700; }

/* ---------- Action en fin de ligne (liste élèves) ---------- */
.col-action { width: 1%; white-space: nowrap; text-align: right; }
.btn-row {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .8rem; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-dark);
    border: 1px solid transparent;
    font-size: .85rem; font-weight: 700; text-decoration: none;
    transition: background .15s, border-color .15s, transform .08s;
}
.btn-row:hover { background: #e4e0ff; border-color: var(--primary); }
.btn-row:active { transform: scale(.96); }

/* ---------- Fiche élève (détail) ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; align-items: start; }
.card-title { margin: 0 0 1rem; font-size: 1.05rem; }
.fields { margin: 0; display: grid; gap: .8rem; }
.fields > div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.fields dt { color: var(--muted); font-size: .85rem; margin: 0; }
.fields dd { margin: 0; font-weight: 600; text-align: right; }
.muted { color: var(--muted); font-weight: 400; }

.parents { display: grid; gap: 1rem; }
.parent { display: flex; gap: .8rem; align-items: flex-start; }
.parent-body { min-width: 0; }
.parent-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
/* Badges de relation (père/mère/responsable) sur une carte responsable groupée. */
.parent-rels { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.resp-rel { display: inline-flex; align-items: center; gap: .3rem; }
.resp-rel-x {
    border: none; background: none; cursor: pointer; padding: 0; line-height: 1;
    font-size: .8rem; color: var(--danger, #c0431f); opacity: .55; transition: opacity .12s;
}
.resp-rel:hover .resp-rel-x { opacity: 1; }
.parent-meta { display: flex; flex-direction: column; gap: .15rem; margin-top: .2rem; font-size: .88rem; color: var(--muted); }
.parent-meta a { color: var(--primary-dark); text-decoration: none; }
.parent-meta a:hover { text-decoration: underline; }

/* ---------- Dossier élève : onglets ---------- */
.flash { display: flex; align-items: center; gap: .5rem; padding: .8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; font-weight: 600; }
.flash-ok { background: #e6f7ee; color: #157a4b; }
.flash-error { background: #fdecec; color: #c0392b; }

/* Onglets du DOSSIER élève — boutons à pastille, une couleur par domaine.
   `.tabs`/`.tab` n'est utilisé QUE par la fiche élève (`eleve/show.html.twig`).
   Ce ne sont pas des onglets soulignés mais des BOUTONS : la cible est plus grande,
   l'emoji est détaché du libellé dans sa pastille, et la couleur identifie la section
   avant même qu'on la lise. Elle vient de `data-dom` (ci-dessous), jamais d'un
   `style=` inline. Chaque bouton dérive tout son décor du jeton `--c`. */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.tab {
    --c: var(--primary);
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .4rem .9rem .4rem .4rem;
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px;
    color: var(--ink); text-decoration: none; cursor: pointer;
    font-family: inherit; font-size: .9rem; font-weight: 700; line-height: 1.3;
    transition: transform .12s, box-shadow .15s, border-color .15s, background .15s, color .15s;
}
.tab .tab-ico {
    width: 30px; height: 30px; flex: none; border-radius: 9px;
    display: grid; place-items: center; font-size: 1rem; line-height: 1;
    background: color-mix(in srgb, var(--c) 15%, #fff);
    transition: background .15s;
}
.tab:hover {
    color: var(--ink); border-color: var(--c); transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 22%, transparent);
}
.tab.active, .tab.is-active {
    background: color-mix(in srgb, var(--c) 10%, #fff);
    border-color: var(--c);
    color: color-mix(in srgb, var(--c) 85%, #000);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 28%, transparent);
}
.tab.active .tab-ico, .tab.is-active .tab-ico { background: var(--c); color: #fff; }
.tab:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.tab .count {
    background: color-mix(in srgb, var(--c) 15%, #fff);
    color: color-mix(in srgb, var(--c) 85%, #000);
    border-radius: 999px; padding: 0 .45rem; font-size: .78rem;
}
.tab.active .count, .tab.is-active .count { background: #fff; }
/* Une couleur par domaine du dossier (l'ordre suit celui des onglets). */
.tab[data-dom="identite"]      { --c: #6d5efc; }
.tab[data-dom="pedagogie"]     { --c: #0189d9; }
.tab[data-dom="bulletins"]     { --c: #b45309; }
.tab[data-dom="discipline"]    { --c: #e11d48; }
.tab[data-dom="autorisations"] { --c: #15803d; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Formulaires du dossier ---------- */
.form .card-title { margin-bottom: 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.field-edit { display: flex; flex-direction: column; gap: .35rem; }
.field-edit.full { grid-column: 1 / -1; }
.field-edit > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-edit.check { flex-direction: row; align-items: center; gap: .5rem; }
.field-edit.check > span { color: var(--ink); }
.field-edit textarea.input { resize: vertical; font-family: inherit; line-height: 1.5; }
.form-actions { margin-top: 1.2rem; display: flex; justify-content: flex-end; }

/* ---------- Entretiens : historique ---------- */
.timeline { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: .9rem; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.entry-head > div { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.entry-body { margin: .6rem 0 0; white-space: pre-line; }
.link-danger { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .6; padding: .2rem; line-height: 1; }
.link-danger:hover { opacity: 1; }

@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Bulletins (grille officielle) ---------- */
.badge-ok { background: #e6f7ee; color: #157a4b; }
.badge-blue { background: #e3f2fd; color: #0b6aa2; }
.bulletin { margin-top: 1.2rem; }
.bulletin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

.bulletin-grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.bulletin-grid th, .bulletin-grid td { border: 1px solid var(--line); padding: .35rem .5rem; }
.bulletin-grid thead th { background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left; position: static; }
.bulletin-grid thead th.num, .bulletin-grid td.num { text-align: center; }
.bulletin-grid td.lib { font-weight: 500; }
.bulletin-grid td.max { color: var(--muted); white-space: nowrap; width: 3rem; }
.branche-cell { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-family: "Baloo 2", sans-serif; text-align: center; vertical-align: middle; width: 7rem; }
.pct-row { background: #fafaff; font-weight: 700; }
.pct-row .lib { font-style: italic; }
.row-appreciation td.lib, .row-absence td.lib { color: var(--ink); }

/* Cellules de saisie compactes, intégrées au tableau. */
.cell-input { width: 100%; min-width: 3rem; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: .3rem .35rem; text-align: center; font: inherit; color: inherit; }
.cell-input:hover { border-color: var(--line); }
.cell-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px var(--primary-soft); }

.legend { font-size: .8rem; margin: .6rem 0 0; }
.legend strong { color: var(--ink); }

/* Cadres séparés sous le tableau. Comportement : pleine largeur, plus grand.
   Absences / Retards : deux tableaux séparés côte à côte en dessous. */
.bulletin-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; margin-top: .9rem; }
.mini-cadre { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; }

.comportement-cadre { margin-top: 1rem; }
.comportement-cadre .mini-grid { font-size: .92rem; }
.comportement-cadre .mini-grid th, .comportement-cadre .mini-grid td { padding: .55rem .7rem; }
.comportement-cadre .mini-grid td.lib { width: 42%; }
.comportement-cadre .pastilles { gap: .55rem; }
.comportement-cadre .pastille { width: 26px; height: 26px; }
.mini-title { margin: 0 0 .5rem; font-size: .95rem; font-family: "Baloo 2", sans-serif; color: var(--primary-dark); }
.mini-grid { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mini-grid th, .mini-grid td { border: 1px solid var(--line); padding: .3rem .4rem; }
.mini-grid thead th { background: var(--bg); font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: center; }
.mini-grid td.lib { font-weight: 500; }
.mini-grid td.num { text-align: center; }

/* Comportement : sélecteur à 3 pastilles de couleur (rouge / orange / vert). */
.pastilles { display: inline-flex; gap: .35rem; justify-content: center; }
.pastille { position: relative; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; opacity: .3; transition: opacity .12s, box-shadow .12s, transform .08s; }
.pastille:hover { opacity: .65; }
.pastille input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.p-vert { background: #2ec27e; }
.p-orange { background: #f5a524; }
.p-rouge { background: #f0463f; }
.pastille.on, .pastille:has(input:checked) { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--ink); }

@media (max-width: 760px) {
    .table-wrap:has(.bulletin-grid) { overflow-x: auto; }
    .bulletin-grid { min-width: 620px; }
}

/* ---------- Administration des comptes ---------- */
.invite-box { border: 1px solid var(--primary); background: var(--primary-soft); margin-bottom: 1.1rem; }
.invite-link { font-family: ui-monospace, monospace; font-size: .85rem; cursor: pointer; }
.create-box { margin-bottom: 1.1rem; }
.create-box > summary { cursor: pointer; font-weight: 700; font-family: "Baloo 2", sans-serif; }
/* Actions de ligne : TOUJOURS sur une ligne (jamais d'icônes empilées verticalement). */
.row-actions { display: inline-flex; gap: .15rem; justify-content: flex-end; flex-wrap: nowrap; align-items: center; }
.row-actions form { display: inline; }
.btn-row.danger { background: #fdecec; color: #c0392b; }
.btn-row.danger:hover { background: #f9d9d9; border-color: #c0392b; }

/* ---------- Espace parent ---------- */
.enfant-card { text-decoration: none; transition: transform .08s, box-shadow .15s; }
.enfant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pastille-static {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    color: #fff; font-weight: 800; font-size: .8rem;
}
.create-box-open { margin-bottom: 0; }

/* ---------- Éditeur de structure de modèle ---------- */
.struct-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.struct-row:last-of-type { border-bottom: none; }
.struct-main { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.struct-inline { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.struct-inline .input { width: auto; }
.struct-inline .input.color { width: 42px; padding: .2rem; height: 38px; }
.struct-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; }
.struct-actions form { display: inline; }
.struct-actions .btn-row[disabled] { opacity: .4; cursor: default; }
.struct-edit, .struct-add { grid-column: 1 / -1; }
.struct-edit > summary, .struct-add > summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); font-size: .9rem; }

/* Ligne d'en-tête de catégorie dans le bulletin basé sur un modèle. */
.bulletin-grid .cat-row td { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-family: "Baloo 2", sans-serif; }
.bulletin-grid .gen-row td { background: #fff7ec; }

/* ---------- Apparence du modèle (éditeur) ---------- */
.apparence-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.2rem; align-items: start; }
.seuils { margin-top: .8rem; display: flex; flex-direction: column; gap: .4rem; }
.seuil-row { display: flex; align-items: center; gap: .4rem; }
.apercu-style { position: sticky; top: 0; }
.apercu-label { font-size: .8rem; margin-bottom: .35rem; }
.apercu-sheet { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.apercu-cat { padding: .4rem .7rem; font-weight: 700; font-family: "Baloo 2", sans-serif; }
.apercu-line { display: flex; justify-content: space-between; padding: .4rem .7rem; border-top: 1px solid var(--line); }
.apercu-pct { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .apparence-layout { grid-template-columns: 1fr; } }

/* ---------- Thème appliqué au bulletin (modèle) ---------- */
.bull-themed { font-family: var(--bull-font); font-size: var(--bull-size); }
.bull-themed .bulletin-grid .cat-row td { background: var(--bull-cat-bg); color: var(--bull-cat-fg); }

/* ---------- Agencement des blocs (rendu du bulletin) ---------- */
.bull-layout { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; align-items: start; }
.bull-block { grid-column: span var(--bw, 12); min-width: 0; }
.bull-block .table-wrap, .bull-block .mini-cadre { margin-top: 0; }
.bull-texte { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; white-space: pre-line; }
@media (max-width: 720px) { .bull-block { grid-column: span 12; } }

/* ---------- Constructeur d'agencement (Gridstack) ---------- */
.agencement-toolbar { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.grid-stack { background: var(--bg); border-radius: var(--radius); min-height: 320px; }
.grid-stack-item-content.blk { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; overflow: hidden; display: flex; flex-direction: column; gap: .5rem; }
.blk-title { font-weight: 700; font-family: "Baloo 2", sans-serif; color: var(--primary-dark); cursor: move; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.blk-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-weight: 700; }
.blk-remove:hover { color: #c0392b; }
.blk-text { resize: none; flex: 1; }

/* Cellule de cote verrouillée (utilisateur non affecté à la discipline). */
.cell-locked { display: inline-flex; align-items: center; gap: .25rem; color: var(--muted); }
.cell-locked .lock { font-size: .85rem; opacity: .8; }

/* ---------- Plan de pilotage (hiérarchie) ---------- */
.objectif { margin-top: 1.1rem; }
.strategie { border-left: 3px solid var(--primary-soft); margin: .8rem 0 .8rem .4rem; padding-left: .9rem; }
.pp-bar { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: .4rem; }
.pp-bar span { display: block; height: 100%; background: var(--primary); }

/* ---------- Suivi d'une action / fiches de réunion ---------- */
.suivi-group { margin: 1.1rem 0 .4rem; font-size: .95rem; font-family: "Baloo 2", sans-serif; color: var(--primary-dark); }
.suivi-champ { display: flex; flex-direction: column; gap: .15rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.suivi-champ:last-child { border-bottom: none; }
.suivi-champ dt { font-size: .8rem; font-weight: 600; color: var(--muted); }
.suivi-champ dd { margin: 0; }
.suivi-suite { background: var(--primary-soft); border-radius: var(--radius-sm); padding: .6rem .8rem; border-bottom: none; }
.reunion { margin-top: 1rem; }

/* Réunion clôturée + pied de fiche + historique. */
.reunion-cloturee { border-color: #d9d9e3; background: #fbfbfe; }
.reunion-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.reunion-hist { margin-top: .6rem; }
.reunion-hist > summary { cursor: pointer; font-size: .85rem; }
.reunion-hist ul { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }

/* ---------- Tableau de bord intelligent (pilotage) ---------- */
.pp-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.pp-indic { display: flex; align-items: center; gap: 1.3rem; }
.pp-donut {
    --taux: 0; --col: var(--ok);
    width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--col) calc(var(--taux) * 1%), var(--line) 0);
    display: grid; place-items: center; position: relative;
    transition: background .4s ease;
}
.pp-donut::after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pp-donut-center { position: relative; text-align: center; line-height: 1; }
.pp-donut-center strong { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.6rem; }
.pp-donut-center span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pp-indic-body { flex: 1; min-width: 0; }
.pp-indic-titre { font-weight: 700; }
.pp-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .45rem 0 .85rem; font-size: .85rem; color: var(--muted); }
.pp-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot-green { background: #2ec27e; } .dot-blue { background: var(--primary); } .dot-grey { background: #d6d8e6; }
.pp-avg-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.pp-avg-head strong { color: var(--ink); font-family: "Baloo 2", sans-serif; }
.pp-bar-full { width: 100%; height: 10px; }
.pp-indic-titre { font-weight: 700; }
.pp-alert h4 { margin: 0 0 .5rem; font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.pp-alert { border-left: 4px solid var(--line); }
.pp-alert-red { border-left-color: #f0463f; }
.pp-alert-orange { border-left-color: #f5a524; }
.pp-alert-blue { border-left-color: var(--primary); }
.pp-list { list-style: none; margin: 0; padding: 0; font-size: .88rem; display: flex; flex-direction: column; gap: .3rem; }
.pp-list a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
.pp-list a:hover { text-decoration: underline; }
.pp-filter { display: flex; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem; }
.pp-filter .input { width: auto; }
.pp-filter #pp-search { flex: 1; min-width: 220px; }

/* ---------- Boîtes d'objectifs (grille 2 par ligne) ---------- */
.pp-boxes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.pp-box {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: .35rem; justify-content: center;
    min-height: 120px; padding: 1.3rem 1.4rem;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; color: var(--ink);
    transition: transform .1s, box-shadow .15s, border-color .15s;
}
.pp-box:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.pp-box-num { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.25rem; }
.pp-box-meta { color: var(--muted); font-size: .85rem; }
/* Le nom de l'objectif n'apparaît qu'au survol. */
.pp-box-reveal {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 1.2rem; background: var(--primary); color: #fff;
    font-weight: 700; font-family: "Baloo 2", sans-serif; font-size: 1.05rem;
    opacity: 0; transform: scale(1.02); transition: opacity .15s, transform .15s;
}
.pp-box:hover .pp-box-reveal, .pp-box:focus-visible .pp-box-reveal { opacity: 1; transform: scale(1); }
@media (max-width: 640px) { .pp-boxes { grid-template-columns: 1fr; } }

/* ---------- Cartes cliquables (stratégies / actions) ---------- */
.pp-cards { display: flex; flex-direction: column; gap: .6rem; }
.pp-card {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .9rem 1.1rem; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--ink);
    transition: transform .08s, box-shadow .15s, border-color .15s;
}
.pp-card:hover { transform: translateX(3px); border-color: var(--primary); box-shadow: var(--shadow); }
.pp-card-main { min-width: 0; }
.pp-card-edit { display: flex; align-items: flex-start; gap: .5rem; padding: 0 0 .4rem 1.1rem; }
.pp-card-edit .struct-add { flex: 1; }
.pp-card .pp-bar { width: 90px; }

/* ---------- Icône Action (doigt + bouton, onde de pression) ---------- */
.icon-action { width: 1em; height: 1em; display: inline-block; vertical-align: -0.18em; color: var(--ink); }
.icon-action .ia-btn,
.icon-action .ia-ripple { transform-box: fill-box; transform-origin: center; }
.icon-action .ia-btn { transition: transform .12s ease; }
.icon-action .ia-ripple { animation: ia-pulse 2.1s ease-out infinite; }
@keyframes ia-pulse {
    0%   { transform: scale(.5);  opacity: .65; }
    70%  { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
}
/* Léger enfoncement quand on survole l'élément contenant l'icône. */
.pp-card:hover .icon-action .ia-btn,
.stat:hover .icon-action .ia-btn,
.btn-row:hover .icon-action .ia-btn { transform: scale(.8); }
.emoji .icon-action { width: 1.4rem; height: 1.4rem; }

/* ---------- Fiche santé : cases à cocher imagées ---------- */
.sante-pics { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.sante-pic { position: relative; cursor: pointer; }
/* On masque LA CASE À COCHER (la tuile lui sert de rendu), surtout pas tout input :
   les tuiles de repère personnalisé contiennent un champ texte visible. */
.sante-pic input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.sante-pic .pic {
    display: grid; place-items: center;
    width: 70px; height: 64px; border-radius: var(--radius-sm);
    border: 2px solid var(--line); background: var(--card);
    font-size: 1.9rem; transition: border-color .12s, background .12s, transform .08s;
}
.sante-pic .lbl { display: block; text-align: center; font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.sante-pic:hover .pic { border-color: var(--primary); }
.sante-pic input:checked + .pic { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); }
.sante-pic input:checked ~ .lbl { color: var(--primary-dark); font-weight: 700; }
.sante-soutien { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .25rem; }

/* Cadres Santé compacts : contenu sur une seule colonne, icônes plus petites.
   .sante-card est porté par le <form> qui enveloppe les DEUX cartes (🩺 Santé,
   🤝 Soutien) + le drawer — un seul formulaire, cf. eleve/_onglet_sante.html.twig.
   Le drawer, lui, garde la grille à 2 colonnes du reste de l'app. */
.sante-card .card .form-grid { grid-template-columns: 1fr; }
/* Tuiles de même largeur et libellé sur UNE ligne : sans quoi « Appareil auditif »
   passe à la ligne et sa tuile se désaligne des quatre autres. */
.sante-card .sante-pic { width: 108px; }
.sante-card .sante-pic .pic { width: 100%; height: 54px; font-size: 1.6rem; line-height: 1; }
.sante-card .sante-pic .lbl { white-space: nowrap; }
/* Repères personnalisés : tuile en pointillés tant qu'elle n'est pas nommée
   (affordance « emplacement libre »), pleine dès qu'elle l'est. Le nom se saisit
   JUSTE SOUS la tuile, dans un champ qui prend la place du libellé — même gabarit
   que les autres tuiles, donc la rangée reste alignée. */
.sante-pic-autre { position: relative; }
.sante-pic-autre .pic { border-style: dashed; }
.sante-pic-autre.is-on .pic { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
/* `position` et `opacity` explicites : filet contre la règle de masquage voisine,
   qui a déjà rendu ce champ invisible une fois. */
.sante-card .sante-pic-nom { position: static; opacity: 1; height: auto;
    display: block; width: 100%; margin-top: .25rem; padding: .1rem .2rem;
    border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; background: transparent;
    font-family: inherit; font-size: .78rem; line-height: 1.3; text-align: center; color: var(--muted); }
.sante-card .sante-pic-nom::placeholder { color: var(--muted); opacity: .75; }
.sante-card .sante-pic-nom:focus { outline: none; border-bottom-color: var(--primary); color: var(--ink); }
.sante-pic-autre.is-on .sante-pic-nom { color: var(--primary-dark); font-weight: 700; border-bottom-color: transparent; }
/* Croix de suppression, au coin de la tuile. Discrète au repos pour ne pas
   encombrer la rangée, franche au survol/focus clavier. Absente de la tuile
   vierge : il n'y a rien à y supprimer. */
.sante-pic-x { position: absolute; top: -6px; right: -6px; z-index: 1;
    display: grid; place-items: center; width: 20px; height: 20px; padding: 0;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card);
    color: var(--muted); font-size: .68rem; line-height: 1; cursor: pointer;
    opacity: 0; transition: opacity .12s, color .12s, border-color .12s; }
.sante-pic-autre:hover .sante-pic-x,
.sante-pic-x:focus-visible { opacity: 1; }
.sante-pic-x:hover { color: var(--danger); border-color: var(--danger); }
.sante-pic-autre[data-picto-vierge] .sante-pic-x { display: none; }
/* Sans survol (tactile), la croix reste visible : sinon la suppression serait
   inatteignable au doigt. */
@media (hover: none) { .sante-pic-autre.is-on .sante-pic-x { opacity: 1; } }
.sante-soutien-card { margin-top: 1.1rem; }

/* Action « Détails médicaux » : en bas à gauche du cadre Santé. Son compteur
   réutilise la pastille .pedago-n du dossier élève (rien de nouveau à définir). */
.sante-plus { margin-top: .9rem; }

/* Détails médicaux remplis : une boîte par donnée, au format du champ Allergies
   (.field-edit + .input), EMPILÉES sous lui. Pas de donnée ⇒ pas de boîte.
   La boîte est en lecture — les champs de saisie vivent dans le drawer. */
.sante-resume-item { margin-bottom: .7rem; }
.sante-box { font: inherit; font-weight: 500; color: var(--ink); text-align: left;
    white-space: pre-line; overflow-wrap: anywhere; }
button.sante-box { cursor: pointer; }
button.sante-box:hover { border-color: var(--primary); background: var(--primary-soft); }
button.sante-box:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================================
   Navigation par espaces : École → Classe → Individu
   ============================================================ */
[data-screen] { display: none; }
[data-screen].active { display: block; animation: screen-in .25s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Accueil : 3 grandes cases --- */
.spaces-hero { margin: 0 0 1.2rem; }
.spaces-hero h1 { margin: 0 0 .3rem; font-size: 1.5rem; }
.spaces-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
    margin-bottom: 1.8rem;
}
@media (max-width: 900px) { .spaces-grid { grid-template-columns: 1fr; } }

.space-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    color: #fff;
    min-height: 230px;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    text-decoration: none;
}
.space-card:hover { transform: translateY(-6px); box-shadow: 0 22px 40px -16px rgba(45, 40, 90, .4); }
.space-card:active { transform: translateY(-2px); }
.space-card .sc-art {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.6rem;
    line-height: 1;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18));
}
.space-card .sc-body { padding: 1rem 1.25rem 1.3rem; background: rgba(0, 0, 0, .14); }
.space-card .sc-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.45rem; margin: 0; }
.space-card .sc-desc { margin: .15rem 0 0; font-size: .9rem; opacity: .92; line-height: 1.35; }
.space-card .sc-go { margin-top: .55rem; font-size: .82rem; font-weight: 700; opacity: .95; }
.space-ecole    { background: linear-gradient(135deg, #6d5efc 0%, #8b7bff 55%, #b8acff 100%); }
.space-classe   { background: linear-gradient(135deg, #ff8a5c 0%, #ff6f91 60%, #ffa36c 100%); }
.space-cartable { background: linear-gradient(135deg, #18b6a4 0%, #2bd4b0 55%, #7ee8c4 100%); }

/* ============================================================
   Accueil 2 colonnes : contenu principal + panneau « assistant »
   (repris du dashboard de Pauline — mêmes tokens de design)
   ============================================================ */
/* Le tableau de bord exploite toute la largeur de l'écran (les autres pages
   restent plafonnées à 1100px via .content). */
.content.is-home { max-width: none; padding-top: 1rem; }
/* Accueil : titre remonté + écart resserré titre ↔ hero (gain de place). */
.content.is-home .page-head { margin-bottom: .5rem; }

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    align-items: start;
}
.home-main { min-width: 0; }
/* Les 3 espaces : grandes cartes côte à côte, étirées sur toute la largeur. */
.home-main .spaces-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; margin-bottom: 1.4rem; }
.home-main .space-card { min-height: 280px; }
.home-main .space-card .sc-art { font-size: 5.6rem; }
.home-main .space-card .sc-title { font-size: 1.7rem; }
.home-main .space-card .sc-desc { font-size: .98rem; }
@media (max-width: 900px) { .home-main .spaces-grid { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
    .home-grid { grid-template-columns: 1fr; }
    .assistant-panel { position: static !important; }
}

/* ===== Dashboard plein écran : zones gauche/droite à scroll indépendant =====
   Scopé à <body class="dash-split"> (seulement le tableau de bord). La topbar
   reste figée ; la zone de contenu occupe le reste de la hauteur et délègue le
   défilement aux deux colonnes (et aux écrans de tuiles). */
/* Défilement de PAGE classique (un seul scroll vertical, pas de scroll horizontal) :
   on neutralise la mise en page « plein écran » (app-fit) sur le dashboard. */
body.dash-split { height: auto; display: block; overflow: visible; }
body.dash-split .topbar { position: sticky; top: 0; z-index: 50; }   /* reste visible au défilement */
body.dash-split > .content { flex: none; min-height: 0; overflow: visible; }
body.dash-split .content.is-home { display: block; overflow: visible; }
body.dash-split [data-spaces] { display: block; }
body.dash-split [data-screen].active { display: block; overflow: visible; }
body.dash-split [data-screen="accueil"].active .home-grid { align-items: start; }
body.dash-split [data-screen="accueil"].active .home-main,
body.dash-split [data-screen="accueil"].active .assistant-panel {
    min-height: 0; max-height: none; overflow: visible; padding-right: 0;
}
/* Le panneau « assistant » reste visible pendant le défilement de la page. */
body.dash-split [data-screen="accueil"].active .assistant-panel { position: sticky; top: 4.5rem; }
body.dash-split [data-screen].active > .tiles { overflow: visible; padding-right: 0; }

/* Sous 1100px (1 colonne) : on revient à un défilement de page classique. */
@media (max-width: 1100px) {
    body.dash-split { height: auto; display: block; overflow: visible; }
    body.dash-split > .content,
    body.dash-split .content.is-home,
    body.dash-split [data-spaces],
    body.dash-split [data-screen].active,
    body.dash-split [data-screen="accueil"].active,
    body.dash-split [data-screen="accueil"].active .home-main,
    body.dash-split [data-screen="accueil"].active .assistant-panel {
        display: block;
        overflow: visible;
        min-height: 0;
        max-height: none;
        padding-right: 0;
    }
}

/* --- Placeholder « vie scolaire » (chat à intégrer plus tard) --- */
.vs-placeholder {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}
.vs-ph-ico { font-size: 1.8rem; flex: none; }
.vs-ph-title { margin: 0; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.vs-ph-desc { margin: .15rem 0 0; font-size: .88rem; }

/* --- Module « Mes équipes » embarqué dans le dashboard (sélecteur | chat) --- */
/* Titre de section « Vie scolaire » : au-dessus du hub, séparé du chat (façon Pauline). */
.vs-section-head { margin: .4rem 0 .8rem; }
.vs-section-head h2 { margin: 0; font-size: 1.4rem; }
.vs-section-head p { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; }
/* Ligne de titre : « Vie scolaire » à gauche, raccourci Chat à droite (même ligne). */
.vs-sh-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.vs-chat-link {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .85rem; border-radius: 999px;
    background: var(--card); color: var(--primary-dark);
    border: 1px solid var(--line);
    font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.vs-chat-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.vs-chat-ico { font-size: 1.05rem; line-height: 1; }
.vs-chat-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; margin-left: .1rem;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: .75rem; font-weight: 800;
}

/* Le Turbo Frame autour de la section messagerie est transparent au layout. */
#dash-msg-frame { display: contents; }
.dash-msg {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);   /* rail étroit façon Teams + fil */
    gap: 1rem;
    align-items: start;     /* hauteur auto : le fil vit sur la PAGE (pas de cadre qui scrolle) */
    margin-top: 1.2rem;
    width: 100%;            /* s'aligne à droite avec la rangée de cartes (carte verte) */
}
/* La colonne de gauche ne porte plus de carte : c'est le rail .vs-rail-mini qui
   est la carte (et qui gère son propre sticky). */
.dash-msg-nav { min-width: 0; }
/* Dans le dashboard, c'est la colonne entière qui scrolle (pas chaque liste). */
.dash-msg-nav .msg-nav-list { max-height: none; }
/* Pastille avatar (façon Teams) dans les sélecteurs de canaux/conversations. */
.msg-nav-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.msg-nav-ico .avatar { width: 26px; height: 26px; font-size: .7rem; }
.dash-msg-chat {
    min-width: 0;
    min-height: 0;
    /* Pas de panneau autour ; pas de scroll interne : le fil vit sur la page. */
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}
.dash-msg-chat .chat { height: auto; min-height: 0; }
/* Vie Scolaire : le fil défile avec la PAGE (pas de zone scrollable interne). */
.dash-msg-chat .chat.vs-hub { overflow: visible; }
.chat.vs-hub .chat-feed { flex: none; overflow: visible; max-height: none; padding: 0; background: none; }

@media (max-width: 1100px) {
    .dash-msg { grid-template-columns: 1fr; height: auto; }
    .dash-msg-nav { max-height: 40vh; }
    .dash-msg-chat { height: 70vh; }
}

/* --- Panneau assistant (sticky) --- */
.assistant-panel {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

/* En-tête : salutation + date */
.ap-hello {
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #6d5efc 0%, #8b7bff 100%);
    box-shadow: 0 14px 30px -16px rgba(109, 94, 252, .7);
}
.ap-hello-greet { margin: 0; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.3rem; }
.ap-hello-date { margin: .15rem 0 0; font-size: .85rem; opacity: .9; text-transform: capitalize; }

/* Carte générique de widget */
.ap-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .95rem 1.05rem;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 6px 18px -14px rgba(31, 36, 64, .5);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.ap-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(31, 36, 64, .55); }

.ap-card-h {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .7rem;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.ap-card-h .ap-ico { font-size: 1rem; }

.ap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .65rem; }
.ap-empty { margin: 0; color: var(--muted); font-size: .9rem; }
.ap-more { display: inline-block; margin-top: .8rem; font-size: .82rem; font-weight: 700; color: var(--primary-dark); }

/* Agenda */
.ap-agenda { border-left-color: #6d5efc; }
.ap-event { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: .55rem; }
.ap-dot { width: 9px; height: 9px; border-radius: 50%; align-self: center; flex: none; }
.ap-event-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.ap-event-body { min-width: 0; display: flex; flex-direction: column; }
.ap-event-title { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.ap-event-sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* À faire */
.ap-tasks { border-left-color: #f59e0b; }
.ap-task { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .55rem; }
.ap-task-check { color: var(--muted); font-size: .9rem; line-height: 1.3; }
.ap-task-body { min-width: 0; display: flex; flex-direction: column; }
.ap-task-title { font-weight: 600; font-size: .92rem; line-height: 1.3; color: inherit; text-decoration: none; }
.ap-task-due { font-size: .76rem; font-weight: 700; color: var(--muted); }
.ap-task.is-late .ap-task-due, .ap-task.is-late .ap-task-check { color: #dc2626; }
.ap-task.is-today .ap-task-due, .ap-task.is-today .ap-task-check { color: #ea580c; }

/* Carte « Dernière activité » (liseré) */
.ap-message { border-left-color: #18b6a4; }

/* Boîte « Dernière activité » (mini-fil des derniers messages reçus). */
.ap-feed { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.ap-feed-empty { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }
.ap-feed-item { border-radius: 10px; }
.ap-feed-link { display: flex; gap: .55rem; align-items: flex-start; padding: .5rem .55rem; border-radius: 10px; color: inherit; text-decoration: none; transition: background .15s; }
.ap-feed-link:hover { background: var(--primary-soft); }
.ap-feed-av { flex: none; margin-top: .1rem; }
.ap-feed-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .05rem; }
.ap-feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ap-feed-source { font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.ap-feed-time { font-size: .72rem; color: var(--muted); white-space: nowrap; flex: none; }
.ap-feed-title { font-size: .85rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-feed-preview { font-size: .85rem; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-feed-item.is-unread .ap-feed-link { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); }
.ap-feed-item.is-unread .ap-feed-title { font-weight: 800; }
.ap-feed-item.is-unread .ap-feed-source::before { content: "● "; color: var(--primary); font-size: .7em; }

/* En-tête de la colonne : salutation + bouton réglages. */
.ap-hello { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.ap-prefs { position: relative; flex: none; }
.ap-prefs-btn { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: .25rem; border-radius: 8px; opacity: .6; transition: opacity .15s, background .15s; }
.ap-prefs-btn:hover { opacity: 1; background: var(--primary-soft); }

/* Modale de personnalisation (hérite de dialog.modal). */
.prefs-dialog form { display: flex; flex-direction: column; gap: .8rem; padding: 1.4rem; min-width: 320px; }
.prefs-dialog h3 { margin: 0; font-family: "Baloo 2", sans-serif; }
.prefs-dialog .muted { margin: 0; }
.prefs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.prefs-item { display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border: 1px solid rgba(31,36,64,.12); border-radius: 10px; background: #fff; cursor: grab; user-select: none; }
.prefs-item:active { cursor: grabbing; }
.prefs-item.dragging { opacity: .4; }
.prefs-grip { color: var(--muted); font-size: 1.15rem; line-height: 1; }
.prefs-ico { font-size: 1.05rem; }
.prefs-label { font-weight: 600; }
.prefs-count { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-weight: 600; }
.prefs-count input { width: 4rem; padding: .35rem .5rem; border: 1px solid rgba(31,36,64,.18); border-radius: 8px; font: inherit; }
.prefs-dialog menu { display: flex; justify-content: flex-end; gap: .6rem; margin: 0; padding: 0; list-style: none; }

/* Alerte « assistant directeur » */
.ad-alert-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.ad-alert-pill { font-size: .76rem; font-weight: 700; border-radius: 999px; padding: .15rem .55rem; }
.ad-alert-pill.is-retard { background: #fee2e2; color: #dc2626; }
.ad-alert-pill.is-urgent { background: #ffedd5; color: #ea580c; }
.ad-alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ad-alert-list li { display: flex; align-items: baseline; gap: .45rem; font-size: .86rem; line-height: 1.3; }
.ad-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; }

/* Stat d'encouragement */
.ap-streak {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .88rem;
    line-height: 1.35;
}
.ap-streak-ico { font-size: 1.3rem; flex: none; }

/* Apparition en cascade des widgets */
.ap-anim { opacity: 0; animation: ap-in .5s cubic-bezier(.22, 1, .36, 1) forwards; animation-delay: calc(var(--i, 0) * .07s); }
@keyframes ap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ap-anim { animation: none; opacity: 1; } }

/* --- Fil d'Ariane --- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.2rem; font-size: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; border: none; background: none; cursor: pointer; font: inherit; font-weight: 600; padding: 0; }
.crumbs a:hover { color: var(--brand-dark); }
.crumbs .sep { color: var(--line); }
.crumbs .here { color: var(--ink); font-weight: 700; }

/* --- En-tête d'espace --- */
.space-head { display: flex; align-items: center; gap: .85rem; margin: 0 0 1.3rem; }
.space-head .sh-ico {
    width: 56px; height: 56px; border-radius: 16px;
    display: grid; place-items: center; font-size: 1.9rem; color: #fff; flex: none;
}
/* Même dégradé que les grandes cartes du dashboard (.space-ecole/classe/cartable). */
.space-head.is-ecole .sh-ico    { background: linear-gradient(135deg, #6d5efc 0%, #8b7bff 55%, #b8acff 100%); }
.space-head.is-classe .sh-ico   { background: linear-gradient(135deg, #ff8a5c 0%, #ff6f91 60%, #ffa36c 100%); }
.space-head.is-cartable .sh-ico { background: linear-gradient(135deg, #18b6a4 0%, #2bd4b0 55%, #7ee8c4 100%); }
.space-head h2 { margin: 0; font-size: 1.5rem; }
.space-head p { margin: .1rem 0 0; color: var(--muted); font-size: .92rem; }

/* --- Grille de tuiles de modules --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
/* En-tête de rubrique : occupe toute la largeur → les tuiles d'un même thème
   démarrent sur une nouvelle ligne (séparateur logique + filet). */
.tiles-group {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .6rem 0 -.3rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.tiles-group:first-child { margin-top: 0; }
.tiles-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.05rem 1.1rem;
    text-decoration: none;
    color: var(--ink);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.tile .tile-ico { font-size: 1.9rem; line-height: 1; }
.tile .tile-name { font-weight: 700; font-size: 1rem; }
.tile .tile-desc { font-size: .82rem; color: var(--muted); line-height: 1.3; }
/* Module non développé, vu par la DIRECTION : case normale + badge « Bientôt » (repère roadmap). */
.tile.is-soon { cursor: default; box-shadow: none; }
.tile.is-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
/* Module non accessible, vu par un NON-gestionnaire (prof) : case entièrement grisée, sans badge. */
.tile.is-soon.is-locked { background: var(--bg); border-color: var(--line); }
.tile.is-soon.is-locked .tile-ico { filter: grayscale(1); opacity: .45; }
.tile.is-soon.is-locked .tile-name { color: var(--muted); }
.tile.is-soon.is-locked .tile-desc { opacity: .8; }
.tile .tile-badge {
    position: absolute; top: .7rem; right: .7rem;
    font-size: .68rem; font-weight: 700; letter-spacing: .02em;
    background: var(--primary-soft); color: var(--primary-dark);
    border-radius: 999px; padding: .12rem .5rem;
}
.tile.is-soon .tile-badge { background: #eef0f6; color: var(--muted); }

/* ===== Messagerie (Mes équipes & Vie scolaire) ===== */

/* Rail vertical d'icônes (bande gauche façon Teams). */
.vs-hub { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.vs-rail-mini {
    position: sticky; top: 0; align-self: start;
    max-height: calc(100vh - 2rem);
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: .7rem .5rem;
}
.vs-rail-mini .vs-rail-list {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    overflow-y: auto; flex: 1; min-height: 0; width: 100%; padding: .25rem 0;
}
.vs-mini-sep {
    width: 100%; font-size: .62rem; font-weight: 800; letter-spacing: .05em;
    color: var(--muted); text-align: center; padding: .3rem 0 .1rem;
    border-top: 1px solid var(--line); margin-top: .2rem;
}
.vs-mini-label {
    display: block; font-size: .65rem; font-weight: 600; color: var(--muted);
    text-align: center; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-top: .2rem; line-height: 1.2;
}
.vs-mini-item {
    position: relative; display: flex; flex-direction: column; align-items: center;
    text-decoration: none; gap: 0; flex: none; border: none; background: none; cursor: pointer;
    padding: 0; font-family: inherit;
}
.vs-mini-av {
    width: 46px; height: 46px; border-radius: 16px;
    display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
    /* Couleurs personnalisables par canal (cf. modale de création) ; défaut violet. */
    background: var(--tile-bg, var(--primary-soft)); color: var(--tile-fg, var(--primary-dark));
    user-select: none; transition: border-radius .15s ease, transform .12s ease, box-shadow .15s ease;
}
.vs-mini-item:hover .vs-mini-av { border-radius: 12px; transform: translateY(-1px); box-shadow: var(--shadow, 0 4px 14px rgba(31,36,64,.12)); }
/* Tuile active : on GARDE sa couleur (cf. couleur choisie) ; l'état actif est une
   barre latérale (façon Teams), pas un écrasement de couleur. */
/* Conversation sélectionnée : la tuile garde sa couleur et est ENTOURÉE proprement. */
.vs-mini-item.is-active .vs-mini-av { border-radius: 13px; outline: 2px solid var(--primary); outline-offset: 2px; }
.vs-mini-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--card);
}
.vs-mini-add {
    width: 46px; height: 46px; border-radius: 16px; flex: none;
    display: grid; place-items: center; font-size: 1.4rem; text-decoration: none;
    color: var(--primary-dark); background: var(--primary-soft);
    border: none; cursor: pointer; font-family: inherit;   /* reset bordure native du <button> */
    transition: background .12s, color .12s;
}
.vs-mini-add:hover { background: var(--primary); color: #fff; }
.vs-mini-add:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Séparateur (trait) entre les conversations et le bouton ＋. */
.vs-mini-div { width: 56%; height: 1px; border: none; background: var(--line); margin: .35rem 0; flex: none; }

/* Modale de création Vie Scolaire : libellés de champ + choix des couleurs. */
.vs-field-label { display: block; font-weight: 700; color: var(--ink); margin: .7rem 0 .25rem; font-size: .92rem; }
.vs-field-label .muted { font-weight: 500; }
.vs-color-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.vs-color { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); cursor: pointer; }
.vs-color input[type="color"] { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; padding: 2px; }
.vs-color-preview {
    margin-left: auto; width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center; font-weight: 800; font-size: 1.15rem;
}
/* Sélection des implantations (cases à cocher) — filtre les membres. */
.vs-impl-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.vs-impl-chip {
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    border: 1px solid var(--line); border-radius: 999px; padding: .25rem .65rem; font-size: .85rem;
}
.vs-impl-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.vs-impl-chip input { margin: 0; }
/* Titre de section : « Vie scolaire — <nom> » + engrenage de modification. */
.vs-section-head .vs-sh-sep { color: var(--muted); font-weight: 400; }
.vs-section-head .vs-sh-canal { color: var(--primary); }
/* Pastille « somme » des non-lus, à côté du titre Vie scolaire. */
.vs-sh-badge {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; margin-left: .4rem;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: .8rem; font-weight: 800;
}
.vs-pane { min-width: 0; }
@media (max-width: 860px) {
    .vs-hub { grid-template-columns: 64px minmax(0, 1fr); gap: .7rem; }
    .vs-rail-mini { position: static; max-height: none; }
}

/* Volet principal (pane) */
.vs-pane .vs { margin-top: 1.2rem; padding-top: 1.2rem; }

/* ============================================================
   Vie scolaire : fil de discussion partagé (style Teams léger)
   ============================================================ */
.vs { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.vs-head { margin-bottom: 1rem; }
.vs-head h2 { margin: 0; font-size: 1.4rem; }
.vs-head p { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; }

.vs-composer { padding: 1rem; margin-bottom: 1.3rem; }
.vs-input { resize: vertical; min-height: 2.6rem; }
.vs-composer-bar { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; flex-wrap: wrap; }
.vs-attach {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .5rem .8rem; border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 600; font-size: .9rem; width: auto;
}
.vs-files-hint { font-size: .82rem; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-send { width: auto; }

.vs-feed { display: flex; flex-direction: column; gap: .8rem; }
.vs-msg { display: flex; gap: .85rem; padding: .9rem 1rem; align-items: flex-start; }
.vs-msg-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem;
}
.vs-msg-main { flex: 1; min-width: 0; }
.vs-msg-head { display: flex; align-items: center; gap: .55rem; min-height: 1.75rem; }
.vs-msg-author { font-weight: 700; }
.vs-msg-time { color: var(--muted); font-size: .8rem; }
.vs-msg-del { margin-left: auto; }
.vs-msg-del button { background: none; border: none; cursor: pointer; font-size: .95rem; padding: 0; line-height: 1; }
.vs-msg-body { margin-top: .3rem; line-height: 1.45; white-space: pre-line; word-wrap: break-word; }
.vs-attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.vs-chip {
    display: inline-flex; align-items: center; gap: .45rem; max-width: 100%;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    padding: .35rem .7rem; text-decoration: none; color: var(--ink);
    font-size: .85rem; transition: border-color .15s ease, background .15s ease;
}
.vs-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.vs-chip-ico { font-size: 1.05rem; line-height: 1; }
.vs-chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }
.vs-chip-size { color: var(--muted); font-size: .78rem; flex: none; }

/* Aperçu des images jointes (façon Teams) */
.vs-img-wrap {
    position: relative; display: inline-block; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line); line-height: 0; max-width: 100%;
}
.vs-img { display: block; max-width: 260px; max-height: 220px; width: auto; height: auto; object-fit: cover; }
.vs-img-dl {
    position: absolute; top: .4rem; right: .4rem; background: rgba(0,0,0,.55); color: #fff;
    border-radius: 999px; width: 1.7rem; height: 1.7rem; display: flex; align-items: center;
    justify-content: center; font-size: .9rem; opacity: 0; transition: opacity .15s ease;
}
.vs-img-wrap:hover .vs-img-dl { opacity: 1; }

/* Barre d'actions d'un message : j'aime + répondre */
.vs-msg-actions { display: flex; align-items: center; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.vs-like { margin: 0; }
.vs-like-btn, .vs-act-btn {
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    background: none; border: 1px solid transparent; border-radius: 999px;
    padding: .25rem .6rem; font-size: .82rem; font-weight: 600; color: var(--muted);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.vs-like-btn:hover, .vs-act-btn:hover { background: var(--primary-soft); color: var(--primary); }
.vs-like-btn.on { color: var(--primary); background: var(--primary-soft); }
.vs-like-ico { font-size: 1rem; line-height: 1; }
.vs-like-count { font-variant-numeric: tabular-nums; }
.vs-rep-count { color: var(--muted); font-size: .8rem; margin-left: .3rem; }

/* Réponses en fil */
.vs-replies {
    margin: .6rem 0 0;
    display: flex; flex-direction: column; gap: .55rem;
}
.vs-reply {
    display: flex; gap: .6rem; align-items: flex-start;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .6rem .7rem;
}
.vs-reply-avatar {
    flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700;
}
.vs-reply-main { flex: 1; min-width: 0; }
/* Corbeille « supprimer ma réponse » : poussée à droite, discrète, nette au survol. */
.vs-reply-del { margin-left: auto; }
.vs-reply-del .vs-act-btn { padding: 0 .25rem; opacity: .45; transition: opacity .12s; }
.vs-reply:hover .vs-reply-del .vs-act-btn,
.vs-reply-del .vs-act-btn:focus-visible { opacity: 1; }
.vs-reply-form { margin-top: .6rem; }
.vs-reply-form .vs-input { width: 100%; }
/* Champ de réponse rattaché au fil (dashboard) : masqué, révélé par ↩︎ via la bascule,
   s'ouvre EN BAS du message (après ses réponses). */
.vs-reply-area { display: none; margin-top: .6rem; }
.vs-reply-toggle:checked ~ .vs-reply-area { display: block; }
.vs-edit-form { margin-top: .5rem; }
.vs-edit-form .vs-input { width: 100%; }
.vs-inline-form { display: inline; margin: 0; }
.vs-edited { color: var(--muted); font-size: .78rem; font-style: italic; }
.vs-subject { font-weight: 800; font-size: 1.02rem; margin: .15rem 0 .25rem; color: var(--ink); }
.vs-subject-toggle {
    align-self: flex-start; background: none; border: none; cursor: pointer; padding: .1rem 0;
    color: var(--primary); font-weight: 600; font-size: .85rem;
}
.vs-subject-input { margin-bottom: .5rem; font-weight: 700; }
.vs-pin-badge { margin-left: .2rem; }
.vs-msg.is-pinned { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.vs-act-danger { color: var(--danger, #f0463f); }

/* Mentions */
.vs-mention { color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 0 .25rem; font-weight: 600; }
.vs-mention-box {
    position: absolute; z-index: 1000; background: var(--card, #fff); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden; max-height: 240px; overflow-y: auto;
}
.vs-mention-item { padding: .45rem .7rem; cursor: pointer; font-size: .9rem; }
.vs-mention-item.on, .vs-mention-item:hover { background: var(--primary-soft); color: var(--primary); }

/* Réactions emoji */
.vs-reacts { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.vs-react {
    display: inline-flex; align-items: center; gap: .25rem; cursor: pointer;
    border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
    padding: .12rem .5rem; font-size: .85rem; line-height: 1.3; transition: border-color .15s, background .15s;
}
.vs-react:hover { border-color: var(--primary); }
.vs-react.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.vs-react-n { font-variant-numeric: tabular-nums; font-size: .8rem; }
.vs-react-add { position: relative; display: inline-flex; }
.vs-react-add-btn {
    cursor: pointer; border: 1px dashed var(--line); background: none; border-radius: 999px;
    padding: .12rem .5rem; font-size: .85rem; color: var(--muted); line-height: 1.3;
}
.vs-react-add-btn:hover { border-color: var(--primary); color: var(--primary); }
.vs-react-pop {
    display: none; position: absolute; bottom: 130%; left: 0; z-index: 50;
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 999px;
    padding: .25rem .35rem; gap: .15rem; box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.vs-react-pop.open { display: inline-flex; }
.vs-react-pick { cursor: pointer; border: none; background: none; font-size: 1.25rem; padding: .15rem .25rem; border-radius: 8px; line-height: 1; }
.vs-react-pick:hover { background: var(--primary-soft); transform: scale(1.15); }

/* Barre d'outils : recherche + épinglés */
.vs-toolbar { display: flex; gap: .6rem; margin: 0 0 .8rem; }
.vs-search { position: relative; flex: 1; }
.vs-search-input { width: 100%; }
.vs-search-clear {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    border: none; background: none; cursor: pointer; color: var(--muted); font-size: 1rem;
}
.vs-pinned { margin-bottom: .9rem; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; background: var(--bg); }
.vs-pinned > summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.vs-pinned-feed { margin-top: .7rem; }
.vs-search-results { padding: .6rem; }
.vs-search-head { font-weight: 700; margin-bottom: .6rem; color: var(--muted); }

/* Équipes / canaux : membres et sélecteur de personnel */
.vs-members { margin-bottom: 1.3rem; }
.vs-members > summary { cursor: pointer; font-weight: 700; }
.vs-member-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.vs-member-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    padding: .25rem .7rem; font-size: .85rem; font-weight: 600;
}
.vs-member-chip .link-danger { font-size: .85rem; line-height: 1; }
.vs-roster {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .3rem .8rem; max-height: 240px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .7rem .8rem; margin-top: .3rem; background: var(--bg);
}
.vs-roster-item { display: flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; }
.vs-roster-item input { width: auto; }
.vs-add-members { margin-top: .6rem; }
.vs-member-actions { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Barre d'actions du composer (pièce jointe + envoi). */
.vs-composer-actions { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; flex-wrap: wrap; }

/* Sujet d'un message (fil général / équipe). */
.vs-msg-sujet { font-weight: 800; font-size: 1.02rem; margin: .2rem 0 .3rem; color: var(--ink); }

/* Formulaires d'action inline sur un message (supprimer / épingler / éditer). */
.vs-act-delete, .vs-act-pin, .vs-act-edit { display: inline; margin: 0; }
.vs-act-delete button, .vs-act-pin button {
    background: none; border: none; cursor: pointer; font-size: 1rem; padding: .15rem .3rem;
    border-radius: 6px; line-height: 1; color: var(--muted); transition: background .12s, color .12s;
}
.vs-act-delete button:hover { background: #fee2e2; color: #dc2626; }
.vs-act-pin button:hover { background: var(--primary-soft); color: var(--primary); }
.vs-act-edit { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.vs-act-edit input { flex: 1; min-width: 120px; }
.vs-act-edit button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: .15rem .3rem; border-radius: 6px; line-height: 1; }
.vs-act-edit button:hover { background: var(--primary-soft); color: var(--primary); }

/* Pièces jointes en pastilles. */
.vs-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.vs-file {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    padding: .25rem .65rem; font-size: .84rem; text-decoration: none; color: var(--ink);
    transition: border-color .12s, background .12s;
}
.vs-file:hover { border-color: var(--primary); background: var(--primary-soft); }

/* Zone réactions d'un message. */
.vs-msg-react { margin-top: .45rem; }
.vs-reactions-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .2rem; }
.vs-reaction {
    display: inline-flex; align-items: center; gap: .2rem; cursor: pointer;
    border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
    padding: .1rem .45rem; font-size: .85rem; line-height: 1.3;
    transition: border-color .12s, background .12s;
}
.vs-reaction:hover { border-color: var(--primary); background: var(--primary-soft); }
.vs-reaction.is-mine { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.vs-react-picker { display: flex; gap: .15rem; flex-wrap: wrap; }
.vs-react-btn {
    cursor: pointer; border: none; background: none; font-size: 1.15rem; padding: .1rem .2rem;
    border-radius: 7px; line-height: 1; transition: background .1s, transform .1s;
}
.vs-react-btn:hover { background: var(--primary-soft); transform: scale(1.18); }

/* Épinglés : élément dans le <details> (pas la bulle principale). */
.vs-pin-item {
    padding: .35rem .5rem; border-radius: 8px; font-size: .88rem; line-height: 1.4;
    border-left: 3px solid var(--primary); background: var(--primary-soft); margin-bottom: .3rem;
}

/* Modale « Nouvelle équipe » (native <dialog>). */
dialog.vs-new {
    border: none; padding: 0; border-radius: var(--radius);
    max-width: 480px; width: calc(100% - 2rem);
    box-shadow: 0 30px 80px rgba(31,36,64,.3);
    color: var(--ink); background: var(--card);
}
dialog.vs-new::backdrop { background: rgba(31,36,64,.45); }
dialog.vs-new form { display: flex; flex-direction: column; gap: .8rem; padding: 1.4rem; }
dialog.vs-new h3 { margin: 0 0 .4rem; font-family: "Baloo 2", sans-serif; }
dialog.vs-new menu { display: flex; justify-content: flex-end; gap: .6rem; margin: 0; padding: 0; list-style: none; }

/* ===================== Module Développement professionnel ===================== */
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; }
.stat-ico { font-size: 1.5rem; }
.stat-val { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat-lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.badge-danger { background: #fdecec; color: #c0392b; }

.dp-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.dp-tab { text-decoration: none; color: var(--ink); font-weight: 600; padding: .55rem .9rem; border-radius: 10px 10px 0 0; }
.dp-tab:hover { background: var(--bg); }
.dp-tab.active { background: var(--primary-soft); color: var(--primary-dark); }
.dp-intro { background: var(--primary-soft); border: none; margin-bottom: 1.2rem; }
.dp-filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.dp-add { margin: .8rem 0 1.2rem; }
.dp-add > summary { cursor: pointer; font-weight: 600; }
.dp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem .8rem; margin: .5rem 0 1rem; }
.dp-check { display: flex; align-items: center; gap: .45rem; font-size: .92rem; }
.dp-alertes { display: flex; flex-direction: column; gap: .5rem; }
.dp-alerte { padding: .6rem .9rem; border-radius: 10px; font-weight: 600; font-size: .92rem; }
.dp-al-info { background: #eef4ff; color: #1d4ed8; }
.dp-al-warn { background: #fff5e6; color: #b9770e; }
.dp-al-danger { background: #fdecec; color: #c0392b; }
.dp-histo { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.dp-objs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.dp-obj-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.dp-inline { display: inline; margin: 0; }
.dp-inline .input { margin-top: .4rem; }
.dp-signs { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .6rem; font-weight: 600; }
.dp-pdcp-list { display: flex; flex-direction: column; gap: .5rem; }
.dp-pdcp-row { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); padding: .8rem 1rem; }
.dp-pdcp-row:hover { border-color: var(--primary); }
.dp-locked { text-align: center; padding: 2.4rem 1.5rem; }
.dp-locked .big { font-size: 2.6rem; }
.dp-locked p { max-width: 60ch; margin: .6rem auto 0; color: var(--muted); }
.dp-propose { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #fff7e6; border: 1px solid #f0c060; }
.dp-propose-txt { min-width: 0; }
a.dp-propose:hover { border-color: var(--primary); }

/* ============================================================
   Doc du projet (dashboard super-admin)
   ============================================================ */
.doc-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .6rem 0;
    margin-bottom: 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.doc-nav a {
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    padding: .35rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
}
.doc-nav a:hover { color: var(--primary-dark); border-color: var(--primary); }

.doc-section { margin: 1.8rem 0 2.4rem; scroll-margin-top: 4rem; }
.doc-section > h2 { margin: 0 0 .6rem; }

.doc-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    margin: 1rem 0;
    box-shadow: 0 6px 18px -14px rgba(31, 36, 64, .5);
}
.doc-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.doc-card-head h3 { margin: 0; font-size: 1.05rem; }
.doc-card-head code { font-size: 1rem; }
.doc-entity { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

table.doc-fields { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.doc-fields th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding: .35rem .5rem;
}
table.doc-fields td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.doc-fields tr:last-child td { border-bottom: none; }
table.doc-fields tr.doc-rel { background: rgba(109, 94, 252, .035); }
table.doc-fields code { font-size: .82rem; background: var(--primary-soft); padding: .05rem .35rem; border-radius: 5px; }

.doc-constraints { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; }

.doc-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .1rem .5rem;
    background: var(--line);
    color: var(--muted);
    margin-right: .25rem;
}
.doc-badge.is-pk { background: #ede9fe; color: #6d28d9; }
.doc-badge.is-fk { background: #e0f2fe; color: #0369a1; }
.doc-badge.is-tenant { background: #fef3c7; color: #b45309; }
.doc-badge.is-req { background: #fee2e2; color: #b91c1c; }
.doc-badge.is-ok { background: #dcfce7; color: #15803d; }

.doc-prose { line-height: 1.6; }
.doc-prose ul { margin: .5rem 0; padding-left: 1.2rem; }
.doc-prose li { margin: .35rem 0; }
.doc-prose code { font-size: .85rem; background: var(--primary-soft); padding: .05rem .35rem; border-radius: 5px; }
.doc-prose a { color: var(--brand-dark); font-weight: 600; }   /* liens en accent iT.SCHOOL */

/* ============================================================
   Console super-admin : menu à gauche + contenu
   ============================================================ */
.admin-shell { display: flex; align-items: flex-start; min-height: calc(100vh - 66px); }
/* Plein écran (body.app-fit) : borner le shell à la fenêtre pour que le
   défilement vive dans .content (sinon le bas de page est rogné sans scroll,
   le body étant overflow:hidden — cf. convention « pas de scroll de page »). */
body.app-fit .admin-shell { flex: 1; min-height: 0; align-items: stretch; }
.admin-side {
    flex: none;
    width: 232px;
    align-self: stretch;
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 1.2rem .8rem;
    position: sticky;
    top: 0;
}
.admin-side-title { margin: 0 .4rem 1rem; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.05rem; }
.admin-side nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-side nav a {
    display: block;
    padding: .6rem .8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: .92rem;
    transition: background .12s ease, color .12s ease;
}
.admin-side nav a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.admin-side nav a.is-active { background: var(--primary); color: #fff; }
.admin-side-foot { margin: 1.2rem .4rem 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; }
.admin-side-foot a { color: var(--muted); text-decoration: none; }
.admin-side-foot a:hover { color: var(--brand-dark); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
/* (convention largeur de base : pas de plafond spécifique, même la console admin) */

.adm-membership { padding: .2rem 0; line-height: 1.5; }
.adm-membership + .adm-membership { border-top: 1px dashed var(--line); }

@media (max-width: 820px) {
    .admin-shell { flex-direction: column; }
    .admin-side { width: 100%; position: static; border-right: none; border-bottom: 1px solid var(--line); }
    .admin-side nav { flex-direction: row; flex-wrap: wrap; }
}

/* ============================================================
   Sélecteur de thème (console super-admin ▸ Apparence)
   ============================================================ */
.theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; max-width: 620px; }
.theme-opt {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "swatch name" "swatch desc";
    align-items: center;
    column-gap: .9rem;
    padding: 1rem 1.1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.theme-opt:hover { border-color: var(--primary); }
.theme-opt.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-opt input { grid-area: swatch / swatch / swatch / swatch; position: absolute; opacity: 0; }
.theme-swatch { grid-area: swatch; display: inline-flex; }
.theme-swatch i { width: 16px; height: 28px; display: block; }
.theme-swatch i:first-child { border-radius: 6px 0 0 6px; }
.theme-swatch i:last-child { border-radius: 0 6px 6px 0; }
/* Aperçu de la position du menu (contenu clair large + menu foncé étroit). */
.menu-pos-preview { grid-area: swatch; display: inline-flex; gap: 3px; width: 46px; height: 30px; }
.menu-pos-preview i { display: block; border-radius: 3px; }
.menu-pos-preview .mp-main { flex: 1; background: var(--primary-soft); }
.menu-pos-preview .mp-side { width: 12px; background: var(--primary); }
.theme-name { grid-area: name; font-weight: 800; font-family: "Baloo 2", sans-serif; }
.theme-desc { grid-area: desc; font-size: .85rem; color: var(--muted); line-height: 1.3; }

/* ===========================================================================
   Page avec menu latéral contextuel (à droite) — 1er usage : Équipe éducative.
   Plein écran (comme le dashboard) + menu repliable.
   =========================================================================== */
.page-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.6rem; align-items: start; }
@media (max-width: 900px) { .page-with-aside { grid-template-columns: 1fr; } }

.side-menu { position: sticky; top: 1.2rem; }
@media (max-width: 900px) { .side-menu { position: static; order: -1; } }

/* La colonne principale ne déborde pas de sa cellule de grille (tableaux larges). */
.page-with-aside .page-main { min-width: 0; }

/* Le cadre du tableau (liste du personnel) défile EN INTERNE, en-tête figé, au
   lieu d'allonger la page. max-height (pas height) → il épouse encore son contenu
   quand il y a peu de lignes. On laisse de la place SOUS le cadre pour que la
   pagination reste visible sans scroller la page. */
.page-with-aside .table-wrap { max-height: calc(100vh - 21rem); overflow-y: auto; }
.page-with-aside .table-wrap thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.page-with-aside .pagination { margin-top: .9rem; }
@media (max-width: 900px) { .page-with-aside .table-wrap { max-height: none; } }

/* Tableau plus serré (lignes plus denses) pour la liste du personnel. */
.page-with-aside table th { padding: .55rem 1.1rem; }
.page-with-aside table td { padding: .45rem 1.1rem; }

/* ---------- Bouton d'action ICÔNE SEULE unifié (macro _partials/actions.html.twig) ---------- */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    border: none; border-radius: 10px;
    background: transparent; color: var(--muted);
    cursor: pointer; text-decoration: none;
    transition: background .14s, color .14s, transform .07s;
}
.icon-btn svg { width: 19px; height: 19px; display: block; }
/* Couleur AU REPOS par action (légèrement adoucie via l'opacité) ; halo teinté au survol. */
.icon-btn { opacity: .88; }
.icon-btn.ic-edit { color: var(--c-edit); }
.icon-btn.ic-view, .icon-btn.ic-classer { color: var(--c-view); }
.icon-btn.ic-delete, .icon-btn.ic-purge, .icon-btn.ic-cancelSend, .icon-btn.is-danger { color: var(--danger); }
/* `download` prend le vert de `add`/`save` : c'est une action qui APPORTE quelque chose
   (le fichier arrive chez vous), à distinguer du bleu de `view` qui ne fait que montrer. */
.icon-btn.ic-add, .icon-btn.ic-save, .icon-btn.ic-restore, .icon-btn.ic-download { color: var(--c-add); }
.icon-btn.ic-favorite, .icon-btn.ic-react, .icon-btn.is-fav { color: var(--c-fav); }
.icon-btn.ic-flag { color: var(--c-flag); }
.icon-btn.ic-pin { color: var(--c-pin); }
.icon-btn.ic-reply, .icon-btn.ic-replyAll, .icon-btn.ic-forward { color: var(--c-reply); }
.icon-btn.ic-settings { color: var(--c-set); }
.icon-btn:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.icon-btn:active { transform: scale(.9); }
.icon-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }
.icon-btn[disabled] { opacity: .4; cursor: default; }
/* État actif (épinglé/favori/suivi) : fond teinté persistant, couleur de l'icône conservée. */
.icon-btn.is-on { opacity: 1; background: color-mix(in srgb, currentColor 15%, transparent); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

/* Sélecteur « Afficher N par page ». */
.pagesize-pick { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; white-space: nowrap; }
.pagesize-pick select { width: auto; padding-top: .4rem; padding-bottom: .4rem; }

/* --- Repli du menu : laisse une icône pour le rouvrir --- */
.page-with-aside.is-collapsed { grid-template-columns: minmax(0, 1fr) auto; }
.page-with-aside.is-collapsed .side-menu { display: none; }
.menu-reopen { display: none; }
.page-with-aside.is-collapsed .menu-reopen {
    display: inline-flex; align-items: center; justify-content: center;
    position: sticky; top: 0;
    width: 46px; height: 46px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--card); cursor: pointer;
    font-size: 1.25rem; color: var(--primary);
    box-shadow: 0 6px 18px rgba(31, 36, 64, .06);
    transition: background .15s ease;
}
.page-with-aside.is-collapsed .menu-reopen:hover { background: var(--primary-soft); }

/* Position du menu de module = réglage GLOBAL super-admin (<html data-menu-position>).
   Par défaut à droite ; « left » le passe à gauche (desktop uniquement — sous 900px le
   menu reste empilé en haut). Couvre toutes les pages avec module_layout d'un seul coup. */
@media (min-width: 901px) {
    [data-menu-position="left"] .page-with-aside { grid-template-columns: 300px minmax(0, 1fr); }
    [data-menu-position="left"] .page-with-aside > .page-main { order: 2; }
    [data-menu-position="left"] .page-with-aside > .side-menu { order: 1; }
    [data-menu-position="left"] .page-with-aside.is-collapsed { grid-template-columns: auto minmax(0, 1fr); }
    [data-menu-position="left"] .page-with-aside.is-collapsed > .menu-reopen { order: 1; }
}

.menu-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(31, 36, 64, .06);
}

/* Mini-barre : juste le bouton « replier » aligné à droite (pas d'en-tête inutile). */
.menu-toolbar { display: flex; justify-content: flex-end; padding: .3rem .5rem 0; }
.menu-collapse {
    border: none; background: transparent; cursor: pointer;
    width: 30px; height: 30px; border-radius: 9px; color: var(--muted); font-size: 1.1rem;
    transition: background .12s ease, color .12s ease;
}
.menu-collapse:hover { background: var(--bg); color: var(--ink); }

.menu-list { display: flex; flex-direction: column; gap: .2rem; padding: .15rem .5rem .5rem; }

.menu-item {
    display: flex; align-items: center; gap: .7rem;
    width: 100%; padding: .48rem .6rem;
    border: none; background: transparent;
    border-radius: 14px;
    font-family: inherit; font-size: .95rem; font-weight: 600; text-align: left;
    color: var(--ink); text-decoration: none; cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.menu-item:hover { background: var(--primary-soft); transform: translateX(3px); }
.menu-item .mi-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 12px; background: var(--primary-soft); color: var(--primary);
    font-size: 1.1rem; transition: background .15s ease, color .15s ease;
}
.menu-item:hover .mi-ico { background: #fff; }
.menu-item .mi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-item .mi-label { line-height: 1.15; }
.menu-item .mi-hint { font-size: .76rem; font-weight: 500; color: var(--muted); }

/* Item de SOUS-NIVEAU (retour vers l'accueil du module, sous « Tableau de bord »)
   : en retrait + connecteur ↳ + pastille plus petite → hiérarchie visible. */
.menu-item.is-sub { margin-left: 1.4rem; position: relative; }
.menu-item.is-sub::before {
    content: "↳"; position: absolute; left: -1rem; top: 50%; transform: translateY(-58%);
    color: var(--muted); font-size: 1rem; line-height: 1;
}
.menu-item.is-sub .mi-ico { width: 30px; height: 30px; font-size: .95rem; }
.menu-item.is-sub .mi-label { font-size: .9rem; }
.menu-item .mi-chevron { color: var(--muted); font-size: 1.05rem; opacity: 0; transition: opacity .15s ease; }
.menu-item:hover .mi-chevron { opacity: 1; }

/* Item « principal » (Nouveau) : pastille couleur du thème (violet ou bleu). */
.menu-item.is-primary .mi-ico { background: var(--primary); color: #fff; }
.menu-item.is-primary:hover .mi-ico { background: var(--primary-dark); color: #fff; }

/* Item « à venir » : désactivé visuellement + badge Bientôt. */
.menu-item.is-soon { cursor: default; opacity: .65; }
.menu-item.is-soon:hover { background: transparent; transform: none; }
.menu-item.is-soon:hover .mi-ico { background: var(--primary-soft); }
.menu-item.is-soon .mi-ico { background: #f1f2f7; color: var(--muted); }
.mi-soon-tag {
    align-self: center; font-size: .64rem; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted);
    background: #f1f2f7; border-radius: 999px; padding: .15rem .5rem;
}

.menu-sep { height: 1px; background: var(--line); margin: .35rem .65rem; }

/* Entrée de navigation ACTIVE (menus de module refondus 2026-07). */
.menu-item.is-current {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
    font-weight: 700;
    color: var(--primary-dark);
}
.menu-item.is-current .mi-ico { background: #fff; }

/* En-tête de section repliable du menu (type 'titre') — bien visible (retour Philippe). */
.menu-title {
    display: flex; align-items: center; gap: .4rem;
    width: 100%; border: none; cursor: pointer;
    margin-top: .5rem; padding: .5rem .6rem;
    background: var(--primary-soft); border-radius: 9px;
    color: var(--primary-dark);
    font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.menu-title:hover { filter: brightness(.97); }
/* Variante FIXE (`fixe: true`) : un intitulé, pas un bouton — rien à replier, donc ni
   curseur main ni survol. */
.menu-title.is-fixe { cursor: default; }
.menu-title.is-fixe:hover { filter: none; }
.menu-title .mt-chevron { margin-left: auto; transition: transform .15s ease; font-size: .7rem; }
.menu-title.is-closed .mt-chevron { transform: rotate(-90deg); }
.menu-sect-hidden { display: none; }

/* Sous-groupe repliable sous un item-parent (lien `collapsible: true`) : chevron ▾
   TOUJOURS visible (indique le repli), rotatif quand fermé. Cf. module_layout.html.twig. */
.menu-item .mi-subchevron {
    color: var(--muted); font-size: .8rem; cursor: pointer;
    padding: .1rem .3rem; border-radius: 6px; line-height: 1;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
.menu-item .mi-subchevron:hover { background: var(--primary-soft); color: var(--primary-dark); }
.menu-item.is-parent.is-closed .mi-subchevron { transform: rotate(-90deg); }
.submenu-hidden { display: none; }

/* ── Grids Présences (look UNIFIÉ : justificatifs à valider / à fournir / liste des
   absences). Classes jadis dupliquées en <style> inline, centralisées ici. ── */
.jv-grid td { vertical-align: middle; }
.jv-name { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; white-space: nowrap; }
.jv-num { font-weight: 700; white-space: nowrap; color: var(--ink); }
.jv-per { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.jv-day { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.jv-picto { font-size: .95rem; }
.jv-arrow { color: var(--muted); }
.jv-verif { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 10px;
    background: linear-gradient(135deg, #16a34a, #0ea5a4); color: #fff; font-weight: 700; font-size: .85rem;
    text-decoration: none; border: 0; box-shadow: 0 2px 6px rgba(16, 163, 74, .28); transition: transform .12s, box-shadow .12s; }
.jv-verif:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(16, 163, 74, .38); color: #fff; }
.jv-verif svg { width: 1.05em; height: 1.05em; }
/* Variante « info complémentaire » : même bouton, dégradé BLEU (iT.SCHOOL) + icône info. */
.jv-verif.is-info { background: linear-gradient(135deg, #0189d9, #22c1d6); box-shadow: 0 2px 6px rgba(1, 137, 217, .28); }
.jv-verif.is-info:hover { box-shadow: 0 5px 14px rgba(1, 137, 217, .38); }
/* Variante COMPACTE (Vue d'ensemble, colonne étroite) : picto SEUL, même couleur sémantique. */
.jv-verif.is-icon { padding: .42rem; gap: 0; }
.jv-verif.is-icon svg { width: 1.2em; height: 1.2em; }

/* ── Modale « Encoder une absence » — contrôles façon app mobile (chips + cartes) ───────── */
.me-modale { width: min(680px, 95vw); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
/* Le form remplit la modale en colonne : en-tête + pied figés, corps défilant entre les deux. */
.me-modale > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.me-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); flex: none; }
.me-head-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex: none; }
.me-x { border: 0; background: transparent; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer;
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; transition: background .12s, color .12s; }
.me-x:hover { background: var(--line); color: var(--ink); }
.me-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
    font-weight: 800; color: #fff; font-size: .92rem; background: linear-gradient(135deg, var(--brand), #22c1d6); }
.me-who { min-width: 0; }
.me-who .me-nm { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.15; }
.me-who .me-sb { font-size: .82rem; color: var(--muted); }
.me-body { display: flex; flex-direction: column; gap: .8rem; padding: 1rem 1.2rem 1.2rem; flex: 1 1 auto; overflow-y: auto; }
.me-lbl { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .45rem; }
/* Période sur UNE ligne (4 colonnes) pour limiter la hauteur → pas de scroll. */
.me-period { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr; gap: .55rem; }
.me-period .field-lbl { font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: .2rem; display: block; }
.me-input { width: 100%; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg, #fff); color: var(--ink); font: inherit; font-size: .92rem; }
.me-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Motif = chips (au lieu d'un menu déroulant). */
.me-chipgroup + .me-chipgroup { margin-top: .6rem; }
.me-chipgroup-lbl { font-size: .68rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
.me-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.me-chip { font: inherit; font-weight: 700; font-size: .85rem; border: 1.5px solid var(--line); background: var(--bg, #fff);
    color: var(--ink); padding: .44rem .75rem; border-radius: 999px; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.me-chip:hover { border-color: var(--primary); color: var(--primary); }
.me-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Gros bouton photo/fichier (le vrai <input file> est masqué, ce label le déclenche). */
.me-photo { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .75rem;
    border-radius: var(--radius-sm); border: 1.7px dashed var(--brand); background: var(--brand-soft); color: var(--brand);
    font: inherit; font-weight: 800; cursor: pointer; }
.me-photo:hover { background: var(--brand); color: #fff; }
/* Verrouillée tant qu'aucun motif justifié n'est choisi. */
.me-photo.is-disabled { border-color: var(--line); background: var(--bg, #fff); color: var(--muted); cursor: not-allowed; opacity: .6; }
.me-photo.is-disabled:hover { background: var(--bg, #fff); color: var(--muted); }
.me-photo-msg { font-size: .82rem; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: .4rem .6rem; margin-top: .4rem; }
.me-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.me-filename { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.me-filename:empty { display: none; }
.me-hint { font-size: .78rem; color: var(--muted); margin: .35rem 0 0; line-height: 1.4; }
.me-foot { display: flex; gap: .6rem; justify-content: center; padding: 1rem 1.3rem 1.3rem;
    border-top: 1px solid var(--line); flex: none; }
@media (max-width: 560px) {
    .me-period { grid-template-columns: 1fr 1fr; }
}
.jv-more { color: var(--primary); font-weight: 600; font-size: .88rem; text-decoration: none; }
.jv-more:hover { text-decoration: underline; }
.ve-gauge { display: inline-flex; align-items: center; gap: .5rem; }
.ve-gauge svg { width: 38px; height: 38px; flex: none; }
.ve-gauge-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.ve-gauge-sub.is-late { color: #b91c1c; font-weight: 600; }

/* Interrupteur de vue (toggle-view : à plat / par jour) — centralisé (jadis inline). */
.tv-switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; user-select: none; }
.tv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tv-track { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; flex: none; }
.tv-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.tv-switch input:checked + .tv-track { background: var(--primary, #6d5efc); }
.tv-switch input:checked + .tv-track .tv-thumb { transform: translateX(18px); }
.tv-switch input:focus-visible + .tv-track { box-shadow: 0 0 0 3px var(--primary-soft, #e0e7ff); }
/* Barre d'affichage (toggle au-dessus du grid) + en-tête de jour (« Vue par jour »). */
.jf-toolbar { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
/* Ligne-séparateur de jour (« Vue par jour » : une seule table → colonnes alignées). */
.jf-jour td { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; padding: .45rem .75rem; font-size: .9rem; }
.jf-jour-n { font-weight: 400; color: var(--muted); font-size: .85rem; }
/* Pastille de compteur à côté d'un titre de cadre (Vue d'ensemble, grids « à … »). */
.ve-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .45rem; border-radius: 999px; background: var(--primary-soft, #eef2ff); color: var(--primary-dark, #4338ca); font-weight: 800; font-size: .82rem; margin-left: .5rem; vertical-align: middle; }
.ve-badge.is-alert { background: #fee2e2; color: #991b1b; }

/* Bouton relance grisé au niveau « Dernier ». (La jauge de niveau réutilise .ve-gauge.) */
.rl-btn[disabled] { opacity: .45; cursor: default; }
/* Contrôle segmenté (bascule à N vues : Liste / Par jour / Par épisode). */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; }
.seg-btn { border: 0; background: transparent; padding: .3rem .75rem; border-radius: 8px; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Actions de page dans le page-head (droite du titre). */
.page-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Barre d'enregistrement en bas de page (flux normal, centrée) : le bouton
   « Enregistrer » d'une page d'édition vit EN BAS AU MILIEU (choix Philippe,
   facilite l'usage), plus dans le page-head. À placer à la fin du contenu. */
.page-save-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.page-save-bar .btn, .page-save-bar .btn-ghost { padding-inline: 2.2rem; }

/* Zone « danger » (retrait d'un membre) : bordure rouge discrète. */
.danger-box { border-color: #f3c9c9; }
.danger-box[open] { box-shadow: 0 0 0 3px #fdecec; }

/* ---------- Tableau triable (clic sur l'en-tête) ---------- */
table.sortable th { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s; }
table.sortable th:hover { color: var(--primary); }
table.sortable th .th-label { display: inline-flex; align-items: center; gap: .4rem; }
table.sortable th .th-caret { font-size: .72rem; opacity: .3; transition: opacity .12s; }
table.sortable th:hover .th-caret { opacity: .65; }
table.sortable th[aria-sort="ascending"],
table.sortable th[aria-sort="descending"] { color: var(--primary); }
table.sortable th[aria-sort="ascending"] .th-caret,
table.sortable th[aria-sort="descending"] .th-caret { opacity: 1; }
.no-result td { text-align: center; color: var(--muted); padding: 1.6rem; }
/* Décalage Nom ↔ autres colonnes : .cell-name est en display:flex, ce qui
   sort la cellule du modèle de tableau et la désaligne des td voisins (baseline
   décalée par les badges plus hauts). Ici la cellule Nom n'a pas d'avatar → on
   la remet en cellule de tableau normale + tout aligné au milieu. */
table.sortable td { vertical-align: middle; }
table.sortable td.cell-name { display: table-cell; }

/* ===========================================================================
   Assistant d'import du personnel (multi-step).
   =========================================================================== */
.section-sub { font-family: "Baloo 2", sans-serif; font-size: 1.15rem; margin: 1.6rem 0 .8rem; }

/* Indicateur d'étapes */
.stepper { display: flex; gap: .5rem; list-style: none; padding: 0; margin: .4rem 0 1.4rem; flex-wrap: wrap; }
.stepper .step { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.stepper .step-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: .8rem; font-weight: 800; }
.stepper .step.is-current { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.stepper .step.is-current .step-num { background: var(--primary); color: #fff; }
.stepper .step.is-done { color: var(--ink); }
.stepper .step.is-done .step-num { background: var(--primary); color: #fff; }

/* Cartes de type de source (radio) */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.src-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: 1.3rem 1rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .08s; }
.src-card:hover { border-color: var(--primary-soft); transform: translateY(-2px); }
.src-card input { position: absolute; opacity: 0; pointer-events: none; }
.src-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.src-emoji { font-size: 2rem; }
.src-name { font-weight: 800; font-family: "Baloo 2", sans-serif; }
.src-hint { font-size: .8rem; color: var(--muted); }

/* Mappage colonnes */
.map-grid { display: flex; flex-direction: column; gap: .6rem; }
.map-row { display: grid; grid-template-columns: 140px 24px 1fr; align-items: center; gap: .6rem; }
.map-target { font-weight: 600; }
.map-target .req { color: #c0392b; }
.map-arrow { text-align: center; color: var(--muted); }
@media (max-width: 560px) { .map-row { grid-template-columns: 1fr; } .map-arrow { display: none; } }

/* Options */
.opt-list { display: flex; flex-direction: column; gap: .8rem; }
.opt { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; line-height: 1.35; }
.opt input { margin-top: .25rem; }
.opt.is-disabled { opacity: .6; cursor: default; }

/* Rapport */
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-top: .4rem; }
.rstat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; }
.rstat-num { display: block; font-size: 1.9rem; font-weight: 800; font-family: "Baloo 2", sans-serif; line-height: 1; }
.rstat-lbl { display: block; margin-top: .35rem; font-size: .82rem; color: var(--muted); }
.rstat.ok .rstat-num { color: #1d9a6c; }
.rstat.warn .rstat-num { color: #b8860b; }
.rstat.err { border-color: #f3c9c9; }
.rstat.err .rstat-num { color: #c0392b; }
.err-list { margin: .6rem 0 0; padding-left: 1.2rem; font-size: .88rem; color: var(--muted); display: flex; flex-direction: column; gap: .25rem; }
.job-state { font-size: 2rem; line-height: 1; }
.job-state.job-running { display: inline-block; animation: job-spin 1.6s linear infinite; }
@keyframes job-spin { to { transform: rotate(360deg); } }

/* Badges de statut de job (et import, alias historiques) */
.badge.import-pending, .badge.job-pending { background: #fff7ed; color: #9a3412; }
.badge.import-running, .badge.job-running { background: var(--primary-soft); color: var(--primary-dark); }
.badge.import-done, .badge.job-done { background: #e7f7ef; color: #1d9a6c; }
.badge.import-failed, .badge.job-failed { background: #fdecec; color: #c0392b; }
.badge.job-canceled { background: var(--bg); color: var(--muted); }

/* Console admin — supervision des tâches */
.worker-state { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.worker-state .worker-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.worker-state.is-on .worker-dot { background: #1d9a6c; box-shadow: 0 0 0 3px rgba(29, 154, 108, .2); }
.worker-state.is-off { color: #c0392b; }
.worker-state.is-off .worker-dot { background: #c0392b; }
.job-counters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .2rem; }
.job-counter { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .85rem; transition: border-color .12s, background .12s; }
.job-counter:hover { background: var(--primary-soft); }
.job-counter.is-active { border-color: var(--primary); background: var(--primary-soft); }
.job-counter strong { font-family: "Baloo 2", sans-serif; }

/* ----- Écran de correspondance (mapping) ----- */
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.6rem 0 .2rem; }
.map-loader { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.map-loader .input { width: auto; }

.map2-card { padding: 1.3rem 1.4rem; }
.map2-group-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: .98rem; color: var(--ink); margin-bottom: .6rem; }
.map2 { display: flex; flex-direction: column; gap: .45rem; }
.map2-row {
    display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(110px, 200px);
    align-items: center; gap: 1rem;
    padding: .5rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
    transition: border-color .12s, box-shadow .12s;
}
.map2-row:hover { border-color: var(--primary-soft); box-shadow: 0 2px 10px rgba(31, 36, 64, .05); }
.map2-row.is-required { background: var(--primary-soft); border-color: transparent; }
.map2-target { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.map2-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    background: #fff; border: 1px solid var(--line); font-size: 1.05rem;
}
.map2-label { font-weight: 600; line-height: 1.2; min-width: 0; }
.map2-label .req { color: #c0392b; }
.map2-keytag {
    display: inline-block; margin-left: .3rem; font-size: .6rem; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; color: var(--primary-dark);
    background: #fff; border: 1px solid var(--primary-soft); border-radius: 999px;
    padding: .05rem .42rem; vertical-align: middle;
}
.map2-anon { font-size: .76rem; color: var(--muted); }
.map2-row select { width: 100%; }
.map2-ex { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map2-ex b { color: var(--ink); font-weight: 700; }
@media (max-width: 720px) {
    .map2-row { grid-template-columns: 1fr; gap: .45rem; }
    .map2-ex { display: none; }
}

/* ---------- Fenêtre modale (native <dialog>) ---------- */
dialog.modal {
    border: none; padding: 0; border-radius: var(--radius);
    max-width: 560px; width: calc(100% - 2rem);
    box-shadow: 0 30px 80px rgba(31, 36, 64, .3);
    color: var(--ink); background: var(--card);
}
dialog.modal::backdrop { background: rgba(31, 36, 64, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.15rem; font-family: "Baloo 2", sans-serif; }
.modal-close { border: none; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); border-radius: 8px; width: 34px; height: 34px; flex-shrink: 0; }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 1.2rem 1.3rem 1.4rem; }

/* Page « Mes infos » — pages du module (menu latéral contextuel). */
/* Convention : la colonne de contenu (gauche) scrolle indépendamment ; le menu (droite) reste fixe.
   Même principe que la liste du personnel (.page-with-aside .table-wrap) : la zone interne est bornée
   au viewport avec son propre overflow ; le menu latéral reste sticky en haut (cf. .side-menu). */
[id^="aside-mes-infos"] .page-main { max-height: calc(100vh - 11rem); overflow-y: auto; padding-right: .7rem; }
@media (max-width: 900px) {
    [id^="aside-mes-infos"] .page-main { max-height: none; overflow: visible; padding-right: 0; }
}
.mi-banner { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.mi-banner-av { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; box-shadow: 0 4px 16px rgba(20,20,60,.12); background: #fff; flex: 0 0 auto; }
.mi-banner-av svg { display: block; width: 100%; height: 100%; }
.avatar.mi-ini { width: 72px; height: 72px; font-size: 1.6rem; border-radius: 50%; }
.mi-card-block { margin-bottom: 1.4rem; }
/* Grille d'informations lisible : libellé au-dessus, valeur pleine largeur (pas de troncature). */
.mi-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.6rem; }
.mi-field { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.mi-field-k { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mi-field-v { font-weight: 600; color: #2b2f44; word-break: break-word; }
.mi-attach { display: flex; flex-direction: column; gap: .6rem; }
.mi-attach-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.mi-attach-row:first-child { border-top: 0; padding-top: 0; }
.mi-attach-ecole { font-weight: 600; }
.mi-attach-roles { display: flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 640px) { .mi-info { grid-template-columns: 1fr; } }

/* Éditeur d'avatar (page « Mon avatar »). */
.av-editor { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: start; }
.av-preview { position: sticky; top: 1rem; }
.av-preview img { width: 180px; height: 180px; border-radius: 50%; box-shadow: 0 6px 20px rgba(26,26,64,.12); }
.av-group { margin-bottom: 1rem; }
.av-group h3 { font-size: .85rem; margin: 0 0 .4rem; }
.av-chips, .av-swatches, .av-emoji-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.av-chip { border: 1px solid #d9dde8; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; font-size: .85rem; }
.av-chip input, .av-swatch input, .av-emoji input { position: absolute; opacity: 0; pointer-events: none; }
.av-chip:has(input:checked) { border-color: var(--primary, #6d5efc); background: var(--primary, #6d5efc); color: #fff; }
.av-swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d9dde8; cursor: pointer; }
.av-swatch:has(input:checked) span { box-shadow: 0 0 0 2px var(--primary, #6d5efc); }
.av-emoji span { display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; font-size: 22px; border-radius: 8px; cursor: pointer; }
.av-emoji:has(input:checked) span { background: #eef1ff; outline: 2px solid var(--primary, #6d5efc); }
.av-check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
@media (max-width: 700px) { .av-editor { grid-template-columns: 1fr; } .av-preview { position: static; text-align: center; } }

/* --- Badge messagerie global (topbar) --- */
.msg-pill, .mail-pill { position: relative; }
.msg-badge, .mail-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 17px; height: 17px; padding: 0 3px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: .65rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--card, #fff);
    pointer-events: none;
}
.msg-badge[hidden], .mail-badge[hidden] { display: none !important; }

/* ============================================================================
   Messagerie — refonte « chat » (bulles + menu droit navigateur)
   ========================================================================== */

/* --- Menu droit : badges non-lus + canal actif --- */
.menu-item .mi-badge {
    margin-left: .35rem;
    min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dc2626; color: #fff;
    font-size: .72rem; font-weight: 800; line-height: 1;
    border-radius: 999px;
}
.menu-item.is-current {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}
.menu-item.is-current .mi-label { color: var(--primary-dark); font-weight: 700; }

/* --- Conteneur chat : header fixe / feed scrollable / composer fixe --- */
/* La messagerie remplit la hauteur dispo : le .content ne scrolle pas, c'est le
   FIL (.chat-feed) qui défile. La chaîne content → page-with-aside → page-main → chat
   propage la hauteur (cf. body.app-fit). */
.content:has(.chat) { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.content:has(.chat) > .crumbs { flex: none; }
.content:has(.chat) .page-with-aside { flex: 1; min-height: 0; align-items: stretch; }
.content:has(.chat) .page-main { min-height: 0; }
.content:has(.chat) .side-menu { position: static; align-self: start; max-height: 100%; }
.content:has(.chat) .menu-card { max-height: 100%; display: flex; flex-direction: column; }
.content:has(.chat) .menu-list { overflow-y: auto; }

.chat {
    display: flex; flex-direction: column;
    height: 100%; min-height: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
/* Module « Mes équipes » : cadre de conversation plus étroit et centré (façon Teams).
   Le hub Vie Scolaire (.vs-hub, dashboard) garde sa pleine largeur. */
.chat:not(.vs-hub) { width: 100%; max-width: 940px; margin-inline: auto; }

/* En-tête */
.chat-head {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fcfcff);
}
.chat-head-ico {
    width: 46px; height: 46px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 14px; font-size: 1.4rem;
    background: var(--primary-soft);
}
.chat-head-ico.is-general { background: linear-gradient(135deg, #fde68a, #fca5a5); }
.chat-head-ico.is-team    { background: linear-gradient(135deg, var(--primary-soft), #dcd7ff); }
.chat-head-ico.is-dm      { background: linear-gradient(135deg, var(--brand-soft), #cfe9fb); }
.chat-head-info { min-width: 0; }
.chat-head-info h2 { margin: 0; font-size: 1.12rem; line-height: 1.2; }
.chat-head-info p { margin: .1rem 0 0; font-size: .85rem; }
.chat-head-leave { margin-left: auto; }
.chat-head-btn {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    padding: .4rem .8rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .82rem;
}
.chat-head-btn:hover { color: #dc2626; border-color: #f3c7c7; background: #fff5f5; }
.chat-head-btn.is-danger { color: #dc2626; border-color: #f3c7c7; }

/* Épinglés */
.chat-pinned { border-bottom: 1px solid var(--line); background: #fffdf5; }
.chat-pinned > summary { cursor: pointer; padding: .55rem 1.1rem; font-weight: 600; font-size: .85rem; color: #b45309; }
.chat-pin-item { display: block; padding: .35rem 1.1rem .35rem 2rem; font-size: .85rem; color: var(--ink); text-decoration: none; border-top: 1px dashed #f1e4c4; }
.chat-pin-item:hover { background: #fff8e8; }

/* Fil de discussion */
.chat-feed {
    flex: 1 1 auto; overflow-y: auto;
    padding: 1.1rem 1.1rem 1.4rem;
    display: flex; flex-direction: column; gap: .35rem;
    background:
        radial-gradient(1200px 400px at 100% -5%, rgba(109,94,252,.05), transparent 60%),
        var(--bg);
    scroll-behavior: smooth;
}
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty-emoji { font-size: 2.6rem; }

/* Écran d'accueil du module (aucun canal sélectionné) */
.chat--empty-module { align-items: center; justify-content: center; }
.chat-welcome { text-align: center; max-width: 420px; padding: 2rem; }
.chat-welcome h2 { margin: .4rem 0 .3rem; }
.chat-welcome-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }

/* Séparateur de jour (façon Teams) : pastille centrée. */
.chat-day { align-self: center; margin: .7rem 0 .25rem; }
.chat-day span {
    display: inline-block; padding: .15rem .75rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .01em;
    background: var(--primary-soft); color: var(--primary-dark);
}

/* Un message — TOUT aligné à gauche (style canal) : pastille + en-tête (nom + heure)
   AU-DESSUS de la bulle, pour soi comme pour les autres. */
.chat-msg { display: flex; align-items: flex-start; gap: .55rem; max-width: 100%; margin-top: .35rem; }
/* Pastille toujours alignée sur la ligne du nom (en haut du message). */
.chat-msg-av { flex: 0 0 auto; align-self: flex-start; margin-top: .1rem; }
.chat-msg-main { min-width: 0; max-width: 80%; display: flex; flex-direction: column; }

/* En-tête au-dessus du cadre */
.chat-msg-head { display: flex; align-items: center; gap: .45rem; margin: 0 .4rem .15rem; min-height: 1.45rem; align-self: flex-start; }
.chat-msg-author { font-size: .82rem; font-weight: 800; color: var(--primary-dark); }
.chat-msg-time { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* Barre d'actions : on RÉUTILISE la barre de Vie Scolaire (.vs-msg-tools / .vs-tool-btn /
   .vs-pop + éditeur Tiptap _cps). Sur la PAGE « Mes équipes » : révélée au survol ; les
   panneaux s'ouvrent vers la DROITE (tout aligné à gauche). */
.chat-msg .vs-msg-tools { margin-left: .25rem; }
.chat-msg:hover .vs-msg-tools,
.chat-msg-main:focus-within > .chat-msg-head > .vs-msg-tools,
.chat-msg .vs-msg-tools:has(.vs-pop[open]) { opacity: 1; transform: none; pointer-events: auto; }
/* Sur le DASHBOARD (chat embarqué « vie scolaire ») : barre TOUJOURS visible, quel que
   soit le type de message (.vs-msg vie scolaire OU .chat-msg équipe/conversation). */
.dash-msg .vs-msg-tools { opacity: 1; transform: none; pointer-events: auto; }
.chat-msg .vs-msg-tools .vs-pop[open] > .vs-react-picker,
.chat-msg .vs-msg-tools .vs-pop[open] > .vs-reply-form,
.chat-msg .vs-msg-tools .vs-pop[open] > .vs-edit-form { left: 0; right: auto; }

.chat-bubble {
    position: relative;
    padding: .5rem .75rem;
    border-radius: 12px;
    background: var(--card); border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(31,36,64,.05);
    display: flex; flex-direction: column; gap: .15rem;
}
/* Mes messages : même teinte légère que mes réponses (pas de violet plein). */
.chat-msg.is-mine .chat-bubble {
    background: var(--primary-soft); border-color: #ded8fc;
}
.chat-msg-subject { font-size: .82rem; font-weight: 700; color: var(--ink); opacity: .85; }
.chat-msg-text { word-break: break-word; line-height: 1.4; }
/* Sortie Tiptap = des <p> : on neutralise marges + paragraphes vides qui
   rendaient les bulles trop hautes pour un message court. */
.chat-msg-text p { margin: 0 0 .3rem; }
.chat-msg-text p:last-child { margin-bottom: 0; }
.chat-msg-text p:empty { display: none; }

/* Pièces jointes */
.chat-files { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.chat-file {
    display: inline-flex; align-items: center; gap: .3rem;
    background: rgba(0,0,0,.04); border: 1px solid var(--line);
    padding: .25rem .55rem; border-radius: 10px; font-size: .8rem;
    color: var(--ink); text-decoration: none;
}
.chat-file em { opacity: .65; font-style: normal; font-size: .75rem; }

/* Réactions posées sous la bulle (barre visible si réactions ; picker = outil 🙂). */
.vs-reactions-bar { display: flex; flex-wrap: wrap; gap: .25rem; margin: .25rem .15rem 0; }
.vs-reactions-bar:empty { display: none; }
.vs-reaction {
    display: inline-flex; align-items: center; gap: .2rem;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: .1rem .45rem; font-size: .78rem; line-height: 1.4; box-shadow: 0 1px 2px rgba(31,36,64,.05);
}
.vs-reaction.is-mine { background: var(--primary-soft); border-color: #d6cffc; color: var(--primary-dark); font-weight: 700; }
.vs-react-btn { border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; padding: .15rem .3rem; border-radius: 10px; transition: transform .1s ease; }
.vs-react-btn:hover { background: var(--primary-soft); transform: scale(1.25); }

/* Réponses en fil */
.chat-replies {
    margin: .35rem 0 .2rem; padding-left: .9rem;
    border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: .35rem;
}
.chat-msg.is-mine .chat-replies { align-self: stretch; }
.chat-reply { display: flex; align-items: flex-start; gap: .4rem; }
.chat-reply-av { flex: 0 0 auto; align-self: flex-start; margin-top: .1rem; }
.chat-reply-main { min-width: 0; display: flex; flex-direction: column; max-width: 80%; }
.chat-reply-head { display: flex; align-items: center; gap: .4rem; margin: 0 .3rem .08rem; }
.chat-reply-author { font-size: .74rem; font-weight: 800; color: var(--primary-dark); }
.chat-reply-time { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.chat-reply-bubble {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: .35rem .6rem; font-size: .9rem;
    display: flex; flex-direction: column; gap: .1rem;
}
.chat-reply.is-mine .chat-reply-bubble { background: var(--primary-soft); border-color: #ded8fc; }
.chat-reply-text { white-space: pre-wrap; word-break: break-word; }
/* Neutraliser les marges des <p> Tiptap (sinon la bulle de réponse est trop haute). */
.chat-reply-text p { margin: 0 0 .3rem; }
.chat-reply-text p:last-child { margin-bottom: 0; }
.chat-reply-text p:empty { display: none; }

/* Composer */
/* Composer façon Teams : une seule barre arrondie, icônes inline à droite */
.chat-composer { border-top: 1px solid var(--line); padding: .7rem .9rem .8rem; background: #fff; }
/* Bannière « réponse » : message cité au-dessus du composer (façon Teams). */
.cps-reply {
    display: flex; align-items: flex-start; gap: .5rem;
    margin-bottom: .5rem; padding: .4rem .55rem;
    background: var(--primary-soft); border-left: 3px solid var(--primary);
    border-radius: 8px;
}
.cps-reply[hidden] { display: none; } /* sinon display:flex masque l'attribut hidden */
.cps-reply-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.cps-reply-head { font-size: .78rem; font-weight: 700; color: var(--primary-dark); }
.cps-reply-extract { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cps-reply-cancel {
    flex: none; border: 0; background: transparent; cursor: pointer; color: var(--muted);
    font-size: .85rem; line-height: 1; padding: .15rem .35rem; border-radius: 6px;
}
.cps-reply-cancel:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.cps {
    display: flex; align-items: flex-end; gap: .4rem;
    border: 1.5px solid var(--line); border-radius: 14px;
    padding: .25rem .35rem .25rem .9rem; background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.cps:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* Zone d'édition Tiptap : .cps-editor = conteneur (flex), .cps-input = .ProseMirror. */
.cps-editor { flex: 1 1 auto; min-width: 0; }
.cps-input {
    min-height: 22px; max-height: 180px; overflow-y: auto;
    outline: none; font: inherit; line-height: 1.5; padding: .5rem 0; color: var(--ink);
    overflow-wrap: anywhere;
}
.cps-input p { margin: 0; }
.cps-input p + p { margin-top: .15rem; }
/* Placeholder Tiptap (extension Placeholder). */
.cps-input p.is-editor-empty:first-child::before {
    content: attr(data-placeholder); color: var(--muted); float: left; height: 0; pointer-events: none;
}
/* Mode rédaction (barre de mise en forme ouverte) : éditeur plus spacieux, comme Teams. */
.chat-composer.is-rich .cps-input { min-height: 90px; }
.chat-composer.is-rich .cps { align-items: stretch; }
.chat-composer.is-rich .cps-tools { align-items: flex-end; }
/* Composer Vie Scolaire : sujet optionnel (style annonce de Pauline). */
.vs-composer { display: flex; flex-direction: column; gap: .5rem; }
/* Rangée du haut du composer : « Ajoutez un sujet » à gauche, ⚙️ modifier à droite. */
.vs-composer-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.vs-subject-toggle {
    align-self: flex-start; background: none; border: none; cursor: pointer;
    padding: .1rem 0; color: var(--primary); font-weight: 600; font-size: .85rem;
}
.vs-subject-input { font-weight: 700; }
.vs-send { width: auto; margin-left: auto; }

/* Dashboard Vie Scolaire (façon Pauline) : pas de panneau autour. Chaque bloc
   (composer, recherche, message) est sa propre carte, dans une colonne. */
.dash-msg-chat .chat.vs-hub {
    /* display/align forcés : la classe vs-hub porte aussi une règle legacy
       (grid + align-items:start) qui empêchait le composer de s'étirer en largeur. */
    display: flex; flex-direction: column; align-items: stretch;
    background: transparent; border: none; box-shadow: none; border-radius: 0;
    padding: 0; gap: .8rem;
}
/* Zone de saisie : éditeur Tiptap qui remplit la carte composer. */
.vs-composer .cps-editor.vs-input {
    width: 100%; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    padding: .55rem .8rem; cursor: text;
}
.vs-composer .cps-editor.vs-input .cps-input { padding: 0; min-height: 4.5rem; max-height: 240px; }
.vs-composer:focus-within .cps-editor.vs-input { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.vs-composer-bar { align-items: center; }
/* Bouton « Publier » : texte blanc (.cps-send du module le peignait en violet). */
.vs-send.cps-send { color: #fff; }
.vs-send.cps-send:hover { color: #fff; }

/* Corps de message en HTML (Tiptap) dans le cadre .vs-msg. */
.vs-msg-body--html { white-space: normal; }
.vs-msg-body--html p { margin: 0; }
.vs-msg-body--html p + p { margin-top: .25rem; }
.vs-msg-body--html ul, .vs-msg-body--html ol { margin: .2rem 0; padding-left: 1.25rem; }
.vs-msg-body--html mark { background: #fff3a3; padding: 0 .15rem; border-radius: 3px; }
.vs-msg-body--html a { color: var(--brand); text-decoration: underline; }

/* Actions d'un message (réagir / répondre / modifier) via <details>. */
.vs-pop { position: relative; }
.vs-pop > summary { list-style: none; }
.vs-pop > summary::-webkit-details-marker { display: none; }
.vs-pop[open] > summary.vs-act-btn { background: var(--primary-soft); color: var(--primary); }
/* Réagir / Répondre / Modifier s'ouvrent DANS la carte du message (en flux, pleine
   largeur sous la barre d'actions) — plus de boîte flottante. */
.vs-msg-actions .vs-pop[open] { flex: 1 0 100%; }
.vs-pop--pick > .vs-react-picker {
    margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .15rem;
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 999px;
    padding: .25rem .35rem; width: max-content; max-width: 100%;
}
.vs-pop > .vs-reply-form, .vs-pop > .vs-edit-form {
    width: 100%; margin-top: .5rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .8rem;
}
.vs-pop > .vs-reply-form .vs-input, .vs-pop > .vs-edit-form .vs-input { width: 100%; }

/* ── Barre d'actions d'un message Vie Scolaire : pilule d'icônes, révélée au survol ──
   Placée sur la ligne nom + heure (margin-left:auto). Les popovers (réagir / répondre /
   modifier) s'ouvrent en panneaux flottants : le fil du dashboard scrolle avec la PAGE
   (pas de cadre interne) et ni .card ni .vs-msg n'ont d'overflow → aucun rognage. */
.vs-msg-tools {
    position: relative; margin-left: auto; flex: none;
    display: inline-flex; align-items: center; gap: .1rem;
    padding: .14rem; border-radius: 11px;
    background: var(--card, #fff); border: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(20, 20, 50, .10);
    opacity: 0; transform: translateY(-3px); pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
}
.vs-msg:hover > .vs-msg-main > .vs-msg-head > .vs-msg-tools,
.vs-reply:hover .vs-msg-tools,
.vs-msg-main:focus-within > .vs-msg-head > .vs-msg-tools,
.vs-msg-tools:has(.vs-pop[open]) {
    opacity: 1; transform: none; pointer-events: auto;
}
/* Boutons d'action Messagerie/VS migrés en .icon-btn : masquer le marqueur du
   <summary> (popover réagir/modifier) + reproduire l'état actif du popover ouvert. */
.vs-msg-tools summary.icon-btn { list-style: none; }
.vs-msg-tools summary.icon-btn::-webkit-details-marker { display: none; }
.vs-pop[open] > summary.icon-btn { opacity: 1; background: color-mix(in srgb, currentColor 15%, transparent); }

/* Popovers ouverts DEPUIS la barre = panneaux flottants ancrés sous la pilule. */
.vs-msg-tools .vs-pop { position: static; }
.vs-msg-tools .vs-pop[open] > .vs-react-picker {
    position: absolute; top: calc(100% + .4rem); right: 0; z-index: 40; margin: 0;
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 8px 24px rgba(20, 20, 50, .14); padding: .28rem .4rem; width: max-content; max-width: 80vw;
}
.vs-msg-tools .vs-pop[open] > .vs-reply-form,
.vs-msg-tools .vs-pop[open] > .vs-edit-form {
    position: absolute; top: calc(100% + .4rem); right: 0; z-index: 40; margin: 0;
    width: min(440px, 82vw); text-align: left;
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(20, 20, 50, .16); padding: .8rem;
}
.cps-input code { background: rgba(0,0,0,.06); padding: .05rem .3rem; border-radius: 5px; font-size: .9em; }
.cps-input a { color: var(--brand); text-decoration: underline; }
.cps-input ul, .cps-input ol { margin: .25rem 0; padding-left: 1.3rem; }
.cps-input blockquote { margin: .3rem 0; padding: .1rem .7rem; border-left: 3px solid var(--primary); }
.cps-input mark { background: #fff3a3; padding: 0 .15rem; border-radius: 3px; }
.cps-tools { flex: 0 0 auto; display: flex; align-items: center; gap: .1rem; padding-bottom: .15rem; }
.cps-wrap { position: relative; display: inline-flex; }
.cps-btn {
    border: 0; background: transparent; cursor: pointer; color: var(--muted);
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.cps-btn svg { width: 20px; height: 20px; }
.cps-aa { font-weight: 700; font-size: .92rem; letter-spacing: -.02em; }
.cps-btn:hover, .cps-btn.is-on { background: var(--primary-soft); color: var(--primary); }
.cps-send { color: var(--primary); }
.cps-send:hover { background: var(--primary); color: #fff; }
.cps-sep { width: 1px; align-self: stretch; margin: .35rem .2rem; background: var(--line); }
.cps-files { display: block; font-size: .76rem; color: var(--muted); margin: .4rem 0 0 .3rem; }

/* Popovers du composer (format / émoji) */
.cps-pop {
    position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 40;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
    padding: .35rem;
}
/* L'attribut hidden doit l'emporter sur les display:flex/grid ci-dessous. */
.cps-pop[hidden] { display: none; }
.cps-format { display: flex; align-items: center; gap: .1rem; }
.cps-fmt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 .2rem; }
.cps-format mark { background: #fff3a3; padding: 0 .15rem; border-radius: 3px; }
.cps-format button {
    border: 0; background: transparent; cursor: pointer; min-width: 30px; height: 30px;
    border-radius: 8px; font-size: .9rem; color: var(--ink);
}
.cps-format button:hover { background: var(--primary-soft); color: var(--primary); }
.cps-format button.is-on { background: var(--primary); color: #fff; }
.cps-emoji { display: grid; grid-template-columns: repeat(5, 1fr); gap: .1rem; width: max-content; }
.cps-emoji button { border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; padding: .15rem .3rem; border-radius: 8px; }
.cps-emoji button:hover { background: var(--primary-soft); transform: scale(1.15); }

/* Mentions : puce dans l'éditeur + menu d'autocomplétion */
.cps-mention {
    background: var(--primary-soft); color: var(--primary-dark); font-weight: 600;
    padding: 0 .3rem; border-radius: 6px; white-space: nowrap;
}
.chat-composer { position: relative; }
.cps-mention-menu {
    position: absolute; z-index: 50; min-width: 200px; max-width: 280px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
    padding: .25rem; display: flex; flex-direction: column; gap: 1px;
}
.cps-mention-item {
    text-align: left; border: 0; background: transparent; cursor: pointer;
    padding: .4rem .55rem; border-radius: 8px; font-size: .88rem; color: var(--ink);
}
.cps-mention-item:hover, .cps-mention-item.is-active { background: var(--primary-soft); color: var(--primary-dark); }

/* Mise en forme rendue dans les messages (et dans l'éditeur WYSIWYG) */
.chat-msg-text code, .chat-reply-text code, .cps-input code { background: rgba(0,0,0,.06); padding: .05rem .3rem; border-radius: 5px; font-size: .9em; }
.chat-msg.is-mine .chat-msg-text code { background: rgba(255,255,255,.2); }
.chat-msg-text a, .chat-reply-text a { color: var(--brand); text-decoration: underline; }
.chat-msg.is-mine .chat-msg-text a { color: #fff; }
.chat-msg-text mark, .cps-input mark { background: #fff3a3; padding: 0 .15rem; border-radius: 3px; }
.chat-msg.is-mine .chat-msg-text mark { color: var(--ink); }
.chat-msg-text ul, .chat-msg-text ol, .cps-input ul, .cps-input ol { margin: .25rem 0; padding-left: 1.3rem; }
.chat-msg-text li, .cps-input li { margin: .1rem 0; }
.chat-msg-text blockquote, .cps-input blockquote {
    margin: .3rem 0; padding: .15rem .7rem; border-left: 3px solid var(--primary); color: inherit; opacity: .9;
}
.chat-msg.is-mine .chat-msg-text blockquote { border-left-color: rgba(255,255,255,.6); }

/* Modales création */
.msg-dialog {
    border: 0; border-radius: var(--radius); padding: 1.4rem; width: min(460px, 92vw);
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow); color: var(--ink);
}
.msg-dialog::backdrop { background: rgba(31,36,64,.45); backdrop-filter: blur(2px); }
.msg-dialog h3 { margin: 0 0 .2rem; }
.msg-dialog .input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .55rem .75rem; margin-top: .6rem; }
/* Outils de sélection de membres : recherche + « Tout sélectionner », au-dessus de la liste. */
.msg-roster-tools { display: flex; align-items: center; gap: .6rem; margin: .8rem 0 .35rem; }
.msg-roster-tools .input { margin-top: 0; }
.msg-roster-search { flex: 1 1 auto; }
.msg-roster-all { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .85rem; color: var(--muted); cursor: pointer; }
.msg-roster-all input { width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }
.msg-roster-tools + .msg-roster { margin-top: 0; }
.msg-roster { border: 1px solid var(--line); border-radius: 12px; margin: .8rem 0 0; padding: .5rem; max-height: 190px; overflow-y: auto; }
.msg-roster legend { font-size: .8rem; color: var(--muted); padding: 0 .3rem; }
.msg-roster-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .4rem .55rem; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent;
}
.msg-roster-item:hover { background: var(--primary-soft); }
.msg-roster-item input { position: absolute; opacity: 0; pointer-events: none; }
.msg-roster-name { flex: 1 1 auto; }
.msg-roster-check {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 999px;
    display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800;
    background: var(--line); transition: background .12s ease;
}
.msg-roster-item:has(input:checked) { background: var(--primary-soft); border-color: #d6cffc; }
.msg-roster-item:has(input:checked) .msg-roster-check { background: var(--primary); }
.msg-roster-item:not(:has(input:checked)) .msg-roster-check { color: transparent; }
.msg-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin: 1rem 0 0; padding: 0; }
/* Zone sensible du dialogue de paramétrage VS : suppression du groupe, séparée des actions. */
.vs-danger-zone { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.vs-danger-hint { font-size: .8rem; }
/* (Ancienne définition de .btn-danger retirée : elle était écrasée par celle du
   bloc « boutons d'action », même spécificité mais déclarée plus bas — elle
   n'avait donc jamais d'effet. La variante rouge vit désormais avec les autres.) */

@media (max-width: 900px) {
    /* app-fit relâché sur mobile → on borne le chat au viewport explicitement. */
    .content:has(.chat) { display: block; overflow: visible; }
    .chat { height: calc(100dvh - 7rem); min-height: 420px; }
    .chat-msg-main { max-width: 86%; }
}

/* Menu droit « Mes équipes » — allégé, sections à scroll vertical indépendant */
.msg-nav { display: flex; flex-direction: column; gap: .7rem; margin-top: .5rem; }
.msg-nav-section { display: flex; flex-direction: column; min-height: 0; }
.msg-nav-head { display: flex; align-items: center; justify-content: space-between; padding: .15rem .45rem; }
.msg-nav-head > span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.msg-nav-add {
    width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: var(--primary); cursor: pointer;
    font-size: 1.05rem; font-weight: 700; line-height: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.msg-nav-add:hover { background: var(--primary-soft); border-color: #d6cffc; }
.msg-nav-search {
    width: 100%; border: 1px solid var(--line); border-radius: 8px;
    padding: .35rem .55rem; font: inherit; font-size: .82rem; margin: .15rem 0 .4rem;
}
.msg-nav-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.msg-nav-list { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.msg-nav-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem .5rem; border-radius: 8px; text-decoration: none; color: var(--ink);
    font-size: .88rem;
}
.msg-nav-item:hover { background: var(--primary-soft); }
.msg-nav-item.is-current { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.msg-nav-item.is-current .msg-nav-name { color: var(--primary-dark); font-weight: 600; }
.msg-nav-ico { flex: 0 0 auto; font-size: .9rem; opacity: .75; }
.msg-nav-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.msg-nav-badge {
    flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center;
}
.msg-nav-empty { font-size: .8rem; color: var(--muted); padding: .3rem .5rem; margin: 0; }

/* Messages flash (feedback global, ex. erreurs/confirmations) */
.flash {
    position: fixed; top: 4.2rem; left: 50%; transform: translateX(-50%);
    z-index: 200; max-width: min(560px, 92vw);
    padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow);
    font-weight: 600; font-size: .9rem; color: #fff;
    animation: flash-in .2s ease, flash-out .4s ease 4.6s forwards;
}
.flash + .flash { top: 7.3rem; }
.flash-success { background: var(--ok); }
.flash-error { background: #dc2626; }
.flash-info, .flash-notice { background: var(--primary); }
@keyframes flash-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes flash-out { to { opacity: 0; transform: translate(-50%, -8px); visibility: hidden; } }

/* === Boîte mail (module Messagerie ✉️) — disposition façon Outlook === */
/* Coquille maître-détail plein écran : la page ne scrolle pas, chaque volet a son overflow. */
/* .mailx-page = classe explicite (en plus de :has(.mailx)) pour garantir le scroll
   par volet même sur navigateurs sans :has(). */
.content:has(.mailx), .content.mailx-page { display:flex; flex-direction:column; overflow:hidden; min-height:0; max-width:none; }
.content:has(.mailx) > .crumbs, .content:has(.mailx) > .flash,
.content.mailx-page > .crumbs, .content.mailx-page > .flash { flex:none; }
.mailx {
    display:flex; flex:1; min-height:0;
    border:1px solid var(--border, #eee); border-radius:12px; overflow:hidden; background:#fff;
}
/* (a) Colonne dossiers — cachée en 2 volets (défaut), visible en 3 volets. */
.mailx-folders { display:none; }
.mailx.is-3pane .mailx-folders {
    display:flex; flex-direction:column; gap:.15rem; width:230px; flex:none;
    padding:.7rem; border-right:1px solid var(--border, #eee); overflow-y:auto;
}
.mailx-folder {
    display:flex; align-items:center; gap:.55rem; padding:.5rem .6rem; border-radius:8px;
    text-decoration:none; color:inherit; font-weight:600;
}
.mailx-folder:hover { background:var(--primary-soft, #f3f1ff); }
.mailx-folder.is-active { background:var(--primary-soft, #f3f1ff); color:var(--primary, #6d5efc); }
.mailx-folder.is-new { background:var(--primary, #6d5efc); color:#fff; justify-content:center; margin-bottom:.4rem; }
.mailx-folder.is-new:hover { filter:brightness(1.05); }
.mailx-folder-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mailx-folder-badge { background:var(--primary, #6d5efc); color:#fff; border-radius:10px; padding:0 .4rem; font-size:.72rem; font-weight:700; }
.mailx-folder.is-new .mailx-folder-badge,
.mailx-folder.is-active .mailx-folder-badge { background:#fff; color:var(--primary, #6d5efc); }

/* (b) Volet liste */
.mailx-list { width:360px; flex:none; display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--border, #eee); }
.mailx-list-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.6rem .7rem; border-bottom:1px solid var(--border, #eee); flex:none; }
.mailx-folder-menu { position:relative; }
.mailx-folder-menu > summary { list-style:none; cursor:pointer; font-weight:800; font-size:1.05rem; display:inline-flex; align-items:center; gap:.3rem; }
.mailx-folder-menu > summary::-webkit-details-marker { display:none; }
.mailx-caret { font-size:.7rem; color:var(--muted, #888); }
.mailx-folder-dd { position:absolute; z-index:40; top:100%; left:0; margin-top:.3rem; min-width:220px; background:#fff; border:1px solid var(--border, #ddd); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:.3rem; display:flex; flex-direction:column; }
.mailx-folder-dd a { padding:.45rem .6rem; border-radius:7px; text-decoration:none; color:inherit; }
.mailx-folder-dd a:hover { background:var(--primary-soft, #f3f1ff); }
.mailx-folder-dd a.is-active { color:var(--primary, #6d5efc); font-weight:700; }
.mailx-list-tools { display:flex; align-items:center; gap:.15rem; }
.mailx-tool-form { display:contents; }
.mailx-tool { display:inline-flex; align-items:center; gap:.25rem; background:none; border:1px solid transparent; border-radius:7px; cursor:pointer; color:var(--muted, #666); font-size:.8rem; padding:.25rem .45rem; text-decoration:none; }
.mailx-tool:hover { background:var(--primary-soft, #f3f1ff); }
.mailx-tool.is-on { color:var(--primary, #6d5efc); border-color:var(--primary, #6d5efc); font-weight:600; }
/* Menu filtre/tri/affichage façon Outlook : 1 icône → 1 menu qui regroupe tout. */
.mailx-filter-menu { position:relative; flex:none; }
.mailx-filter-btn { list-style:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; color:var(--muted, #666); border:1px solid transparent; }
.mailx-filter-btn::-webkit-details-marker { display:none; }
.mailx-filter-btn:hover, .mailx-filter-menu[open] > .mailx-filter-btn { background:var(--primary-soft, #f3f1ff); color:var(--primary, #6d5efc); }
.mailx-filter-dd { position:absolute; z-index:40; top:100%; right:0; margin-top:.3rem; min-width:262px; background:#fff; border:1px solid var(--border, #ddd); border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.14); padding:.4rem; display:flex; flex-direction:column; }
.mailx-filter-dd form { display:block; }
.mailx-filter-head { font-weight:800; font-size:.95rem; padding:.4rem .6rem .3rem; }
.mailx-filter-group { font-size:.72rem; text-transform:uppercase; letter-spacing:.03em; color:var(--muted, #999); padding:.5rem .6rem .15rem; }
.mailx-filter-opt { display:flex; align-items:center; gap:.25rem; width:100%; text-align:left; background:none; border:none; cursor:pointer; padding:.45rem .6rem; border-radius:8px; font-size:.9rem; font-family:inherit; color:inherit; text-decoration:none; }
.mailx-filter-opt:hover { background:var(--primary-soft, #f3f1ff); }
.mailx-filter-opt.is-on { color:var(--primary, #6d5efc); font-weight:600; }
.mailx-filter-check { width:1.1rem; flex:none; text-align:center; color:var(--primary, #6d5efc); font-weight:700; }
.mailx-filter-sep { height:1px; background:var(--border, #eee); margin:.3rem .35rem; }

.mail-list { display:flex; flex-direction:column; flex:1; min-height:0; overflow-y:auto; }
.mail-day { position:sticky; top:0; z-index:1; background:#fff; padding:.4rem .7rem .2rem; font-size:.76rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--muted, #999); }
.mail-row { display:flex; align-items:center; gap:.3rem; border-bottom:1px solid var(--border, #f0f0f0); position:relative; }
.mail-row-link { display:flex; align-items:flex-start; gap:.6rem; padding:.55rem .6rem; flex:1; min-width:0; text-decoration:none; color:inherit; }
.mail-row:hover { background:var(--primary-soft, #f3f1ff); }
.mail-row.is-selected { background:var(--primary-soft, #ece9ff); box-shadow:inset 3px 0 0 var(--primary, #6d5efc); }
/* Gras UNIQUEMENT si non lu : expéditeur en gras noir, titre en gras bleu. */
.mail-row.is-unread .mail-from { font-weight:800; color:#171717; }
.mail-row.is-unread .mail-subject { font-weight:800; color:var(--brand, #0189d9); }
.mail-row.is-unread::before { content:''; position:absolute; left:.18rem; top:50%; transform:translateY(-50%); width:7px; height:7px; border-radius:50%; background:var(--primary, #6d5efc); }
.mail-row-main { min-width:0; flex:1; display:flex; flex-direction:column; gap:.05rem; }
.mail-row-top { display:flex; justify-content:space-between; gap:.5rem; }
.mail-from { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:400; }
.mail-when { color:var(--muted, #888); font-size:.78rem; flex:none; margin-top:1.25rem; }
.mail-subject { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-preview { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted, #888); font-size:.82rem; }
.mail-count { background:var(--primary, #6d5efc); color:#fff; border-radius:10px; padding:0 .4rem; font-size:.72rem; }
.mail-clip { flex:none; align-self:center; font-size:.85rem; }
/* Indicateur de suivi (drapeau) persistant sur la ligne quand le mail est marqué. */
.mail-flag { flex:none; align-self:center; font-size:.85rem; }
.mail-star-form { flex:none; padding-right:.35rem; }
.mail-star { background:none; border:none; cursor:pointer; font-size:1.05rem; padding:.2rem; color:var(--muted, #bbb); line-height:1; }
.mail-star:hover { color:#f2b705; }
.mail-star.is-on { color:#f2b705; }
/* Colonne de droite façon Outlook : barre d'outils TRANSPARENTE en ligne 1 (révélée au
   survol ; une bascule activée — drapeau/favori/épingle — reste affichée), date en LIGNE 2. */
.mail-row-aside { position:relative; flex:none; align-self:flex-start; display:flex; flex-direction:column; align-items:flex-end; padding:.55rem .55rem .35rem 0; min-width:46px; }
.mail-row-actions { position:absolute; top:.4rem; right:.5rem; display:flex; align-items:center; gap:.05rem; background:transparent; }
/* Actions de ligne mail : icône seule révélée au survol de la ligne */
.mail-row-actions .icon-btn { display: none; }
.mail-row:hover .mail-row-actions .icon-btn,
.mail-row-actions:has(details[open]) .icon-btn,
.mail-row-actions .icon-btn.is-on { display: inline-flex; }
.mail-row.is-pinned { background:color-mix(in srgb, var(--brand, #0189d9) 6%, transparent); }

/* (c) Volet détail */
.mailx-detail { flex:1; min-width:0; display:flex; flex-direction:column; min-height:0; overflow-y:auto; }
/* Mode rédaction (nouveau message / répondre / transférer) : écran dédié — on masque
   la liste pour ne pas donner l'impression de « répondre dans la boîte ». Composer centré. */
.mailx.is-composing .mail-compose { max-width:820px; margin-inline:auto; width:100%; }
.mail-compose-title { font-size:1.05rem; font-weight:700; margin:.7rem .9rem .2rem; }
.mailx-detail-bar { display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; padding:.7rem .9rem; border-bottom:1px solid var(--border, #eee); position:sticky; top:0; background:#fff; z-index:2; }
.mailx-detail-bar form { display:inline; }
.mailx-bar-spacer { flex:1; }
.mailx-empty { margin:auto; text-align:center; color:var(--muted, #888); padding:2rem; }
.mailx-empty .big { font-size:3rem; }
.mailx-empty h3 { margin:.4rem 0 .2rem; }
.mailx-empty .btn { margin-top:.8rem; }
.mail-thread { padding:0 0 1.4rem; }
/* Sujet (petit) seul en haut — peu d'espace avant l'expéditeur, pas de séparateur ici. */
.mail-thread-head { display:flex; align-items:flex-start; gap:.6rem; padding:.8rem 1.1rem .2rem; position:sticky; top:0; background:#fff; z-index:2; }
.mail-thread-head + .mail-msg { padding-top:.3rem; }
.mail-thread-subject { margin:0; font-size:1.15rem; font-weight:700; line-height:1.3; min-width:0; overflow-wrap:anywhere; }
.mail-thread-tools { display:flex; align-items:center; gap:.15rem; flex:none; }
/* Message : plus de carte bordée — zone de lecture aérée, pleine largeur. */
.mail-msg { padding:.95rem 1.1rem; }
.mail-msg + .mail-msg { border-top:1px solid var(--border, #f0f0f0); }
/* Séparateur APRÈS l'en-tête (nom + « à … » + icônes), avant le corps. */
.mail-msg-head { display:flex; align-items:center; gap:.6rem; padding-bottom:.7rem; margin-bottom:.85rem; border-bottom:1px solid var(--border, #eee); }
.mail-msg-who { display:flex; flex-direction:column; min-width:0; flex:1; gap:.05rem; }
.mail-msg-name { color:#171717; font-weight:700; font-size:.98rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-msg-meta { color:var(--muted, #888); font-size:.82rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Actions du message : uniquement des icônes, toutes sur une seule ligne. */
.mail-msg-actions { display:flex; align-items:center; gap:.15rem; flex:none; }
.mail-msg-body { line-height:1.6; }
.mail-pj { display:inline-block; margin-top:.5rem; margin-right:.5rem; font-size:.9rem; }
.mail-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.8rem; }
/* ---- Composer (rédaction) façon Outlook/Gmail ---- */
.mail-compose { display:flex; flex-direction:column; flex:1; min-height:0; }

/* Boutons du module mail : compacts, largeur auto (annule le .btn width:100%) */
.mail-compose-bar .btn,
.mailx-detail-bar .btn,
.mail-schedule-menu .btn,
.mail-schedule-submit { width: auto; }

/* Barre d'action : 1 bouton primaire compact + actions icônes discrètes */
.mail-compose-bar { display:flex; align-items:center; gap:.35rem; padding:.55rem .9rem; border-bottom:1px solid var(--border, #eee); background:#fafafe; }
.mail-send-btn {
    width: auto;
    padding: .3rem .72rem;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 7px 0 0 7px;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
/* Lorsqu'il n'y a pas de caret accolé (ex : lien Répondre), arrondi plein */
a.mail-send-btn, a.btn.mail-send-btn { border-radius: 7px; }
.mail-send-caret {
    width: auto;
    padding: .3rem .5rem;
    border-radius: 0 7px 7px 0;
    border-left: 1px solid rgba(255,255,255,.3);
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
}
/* Menu split-button envoi différé */
[data-controller~="mail-schedule"] { position: relative; display: inline-flex; align-items: center; }
.mail-schedule-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--border, #e6e6ef);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: .3rem;
    min-width: 230px;
}
.mail-schedule-menu[hidden] { display: none; }
.mail-schedule-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: .45rem .7rem;
    border: none;
    background: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text, #1a1a2e);
}
.mail-schedule-item:hover { background: var(--primary-soft, #f3f1ff); }
.mail-schedule-sep { border: none; border-top: 1px solid var(--border, #e6e6ef); margin: .2rem 0; }
.mail-schedule-custom { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; padding: .3rem .5rem .4rem; }
.mail-schedule-dt { flex: 1; border: 1px solid var(--border, #e6e6ef); border-radius: 7px; padding: .25rem .5rem; font-size: .88rem; }
.mail-schedule-submit { padding: .25rem .6rem; font-size: .82rem; font-weight: 600; border-radius: 7px; }
/* Bandeau mail programmé (vue lecture) */
.mail-prog-banner {
    background: var(--primary-soft, #f3f1ff);
    color: var(--primary, #6d5efc);
    padding: .5rem .8rem;
    border-radius: 8px;
    font-weight: 600;
    margin: .6rem .9rem;
}
/* Badge « Programmé » dans la liste */
.mail-badge-prog {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    background: var(--primary-soft, #f3f1ff);
    color: var(--primary, #6d5efc);
    border-radius: 6px;
    padding: .05rem .35rem;
    margin-left: .3rem;
    vertical-align: middle;
    white-space: nowrap;
}
.mail-when-prog { font-size: .78rem; color: var(--muted, #888); }
.tile-ico.mail-at { font-weight: 800; }
.mail-pill { font-weight: 800; }
.mail-bar-sep { width:1px; align-self:stretch; background:var(--border,#e6e6ef); margin:.1rem .5rem; }

/* ── Dossiers personnalisés ─────────────────────────────────────── */
.mailx-folders-group { padding:.6rem .7rem .2rem; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted,#999); }
.mailx-folder-perso { font-size:.9rem; }
/* Zone de drop : contour pointillé + fond doux */
.mailx-folder.is-drop { outline:2px dashed var(--primary,#6d5efc); background:var(--primary-soft,#f3f1ff); }
/* Glisser-déposer par événements pointer (cf. mail_classer_controller) */
.mailx[data-dragging] { user-select:none; cursor:grabbing; }
.mailx[data-dragging] .mail-row-link { pointer-events:none; } /* le clic n'ouvre pas pendant le glisser */
.mail-classer-ghost { position:fixed; z-index:1000; pointer-events:none; background:var(--primary,#6d5efc); color:#fff; padding:.25rem .6rem; border-radius:8px; font-size:.82rem; font-weight:600; box-shadow:0 8px 24px rgba(0,0,0,.28); white-space:nowrap; max-width:280px; overflow:hidden; text-overflow:ellipsis; }
/* Nouveau dossier */
.mailx-folder-new-wrap { padding:.5rem .5rem .4rem; }
.mailx-folder-new-btn { width:100%; background:none; border:1px dashed var(--border,#ddd); border-radius:8px; cursor:pointer; color:var(--muted,#888); font-size:.82rem; padding:.3rem .5rem; text-align:left; }
.mailx-folder-new-btn:hover { border-color:var(--primary,#6d5efc); color:var(--primary,#6d5efc); }
.mailx-folder-new-form { display:flex; gap:.3rem; align-items:center; }
.mailx-folder-new-input { flex:1; min-width:0; border:1px solid var(--border,#ddd); border-radius:7px; padding:.25rem .45rem; font-size:.85rem; font-family:inherit; outline:none; }
.mailx-folder-new-input:focus { border-color:var(--primary,#6d5efc); }
.mailx-folder-new-ok { flex:none; background:var(--primary,#6d5efc); color:#fff; border:none; border-radius:7px; padding:.25rem .5rem; cursor:pointer; font-size:.9rem; }
/* En-tête du dossier perso courant */
.mailx-dossier-perso-head { display:flex; align-items:center; gap:.4rem; padding:.5rem .7rem; border-bottom:1px solid var(--border,#eee); background:#fafafe; flex:none; }
.mailx-dossier-perso-titre { font-weight:700; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mailx-dossier-rename-form { display:flex; align-items:center; gap:.2rem; }
.mailx-dossier-rename-input { border:1px solid var(--border,#ddd); border-radius:6px; padding:.18rem .35rem; font-size:.82rem; font-family:inherit; outline:none; max-width:110px; }
.mailx-dossier-rename-input:focus { border-color:var(--primary,#6d5efc); }
/* Séparateur dans le dropdown du header */
.mailx-folder-dd-sep { height:1px; background:var(--border,#eee); margin:.2rem 0; }
/* Menu « Classer » par ligne */
.mail-row-classer { position:relative; flex:none; }
.mail-row-classer > summary { list-style:none; cursor:pointer; }
.mail-row-classer > summary::-webkit-details-marker { display:none; }
.mail-row-classer[open] > summary { background:var(--primary-soft,#f3f1ff); border-radius:8px; }
.mail-row-classer-dd { position:absolute; z-index:50; right:0; top:100%; min-width:180px; background:#fff; border:1px solid var(--border,#ddd); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:.3rem; display:flex; flex-direction:column; }
.mail-row-classer-dd form { display:block; }
.mail-row-classer-opt { width:100%; text-align:left; background:none; border:none; cursor:pointer; padding:.4rem .6rem; border-radius:7px; font-size:.88rem; font-family:inherit; color:inherit; }
.mail-row-classer-opt:hover { background:var(--primary-soft,#f3f1ff); }
.mail-row-classer-opt.is-active { color:var(--primary,#6d5efc); font-weight:700; }

/* En-têtes serrés : libellé gris à gauche, champ pleine largeur, fin séparateur */
.mail-heads { display:flex; flex-direction:column; flex:none; }
.mail-head { display:flex; align-items:center; gap:.5rem; padding:.3rem .9rem; border-bottom:1px solid var(--border,#eee); font-weight:400; }
.mail-head-label { flex:none; width:42px; color:var(--muted,#888); font-size:.85rem; font-weight:600; }
.mail-head-field { position:relative; flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; }
.mail-head-field .mail-suggest-list { top:calc(100% + 2px); left:0; }
.mail-head-input { flex:1; min-width:120px; border:none; outline:none; background:none; padding:.2rem 0; font-size:.95rem; font-family:inherit; }
.mail-subject { font-weight:400; }
.mail-cc-toggle { flex:none; border:none; background:none; color:var(--brand,#0189d9); cursor:pointer; font-size:.82rem; font-weight:600; padding:.1rem .3rem; border-radius:6px; }
.mail-cc-toggle:hover { background:var(--primary-soft,#f3f1ff); }

/* Zone d'écriture : prend tout l'espace restant, scroll interne propre */
.mail-pieces-info { flex:none; padding:.4rem .9rem; color:var(--muted,#777); font-size:.85rem; border-top:1px solid var(--border,#eee); }

/* Responsive : sous 900px, on empile (liste au-dessus, détail dessous). */
@media (max-width: 900px) {
    .content:has(.mailx), .content.mailx-page { display:block; overflow:visible; }
    .mailx { flex-direction:column; border-radius:0; }
    .mailx.is-3pane .mailx-folders { width:auto; flex-direction:row; flex-wrap:wrap; border-right:none; border-bottom:1px solid var(--border, #eee); }
    .mailx-list { width:auto; border-right:none; border-bottom:1px solid var(--border, #eee); max-height:45vh; }
    .mailx-detail { min-height:50vh; }
}
.mail-recipients { display:flex; flex-wrap:wrap; gap:.3rem; }
.mail-chip { display:inline-flex; align-items:center; gap:.35rem; background:var(--primary-soft,#f3f1ff); border-radius:14px; padding:.1rem .2rem .1rem .2rem; font-weight:500; font-size:.85rem; }
.mail-chip button { background:none; border:none; cursor:pointer; color:var(--muted,#888); line-height:1; padding:0 .2rem; }
.mail-chip button:hover { color:#c92a2a; }

/* Zone d'écriture : prend l'espace restant ; la barre de format colle en haut */
.mail-editor { flex:1; min-height:0; overflow-y:auto; margin:.7rem .9rem 0; padding:0; border:1px solid var(--border,#e3e3ee); border-radius:12px; background:#fff; display:flex; flex-direction:column; }
.mail-editor:focus-within { border-color:var(--primary,#6d5efc); box-shadow:0 0 0 3px var(--primary-soft,#f3f1ff); }

/* Barre de formatage collante en haut de la zone */
.mail-format-bar { position:sticky; top:0; z-index:2; display:flex; align-items:center; gap:.15rem; flex-wrap:wrap; padding:.4rem .55rem; background:#fafafe; border-bottom:1px solid var(--border,#eee); border-radius:12px 12px 0 0; }
.mail-fb-btn { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 .35rem; background:none; border:1px solid transparent; border-radius:7px; cursor:pointer; font-size:.95rem; font-weight:600; line-height:1; color:#333; }
.mail-fb-btn:hover { background:var(--primary-soft,#f3f1ff); }
.mail-fb-btn.is-active { background:var(--primary-soft,#ece9ff); border-color:var(--primary,#6d5efc); color:var(--primary,#6d5efc); }
.mail-fb-btn b, .mail-fb-btn i, .mail-fb-btn u, .mail-fb-btn s { font-style:inherit; }
.mail-fb-select { height:30px; border:1px solid var(--border,#ddd); border-radius:7px; background:#fff; cursor:pointer; font-size:.85rem; padding:0 .3rem; font-family:inherit; }
.mail-fb-sep { width:1px; height:20px; background:var(--border,#e6e6ef); margin:0 .2rem; }
.mail-fb-color { position:relative; display:inline-flex; }
.mail-fb-color-menu { position:absolute; top:calc(100% + 4px); left:0; z-index:10; display:flex; flex-wrap:wrap; gap:.3rem; width:128px; padding:.5rem; background:#fff; border:1px solid var(--border,#ddd); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.14); }
.mail-fb-color-menu[hidden] { display:none; }
.mail-fb-swatch { width:22px; height:22px; border:1px solid rgba(0,0,0,.12); border-radius:50%; cursor:pointer; padding:0; }
.mail-fb-swatch:hover { transform:scale(1.12); }
.mail-fb-swatch-clear { width:22px; height:22px; border:1px solid var(--border,#ddd); border-radius:50%; background:#fff; cursor:pointer; color:var(--muted,#888); font-size:.7rem; line-height:1; padding:0; }

/* Contenu éditable : rendu propre, AUCUN cadre par phrase/paragraphe (fix focus) */
.mail-editor .ProseMirror { flex:1; min-height:180px; outline:none; padding:.8rem 1rem; line-height:1.55; font-size:.97rem; }
.mail-editor .ProseMirror:focus, .mail-editor .ProseMirror:focus-visible { outline:none; box-shadow:none; border:none; }
.mail-editor .ProseMirror p { margin:.2em 0; }
.mail-editor .ProseMirror h2 { font-size:1.3rem; margin:.5em 0 .25em; }
.mail-editor .ProseMirror h3 { font-size:1.1rem; margin:.5em 0 .2em; }
.mail-editor .ProseMirror ul, .mail-editor .ProseMirror ol { padding-left:1.3em; margin:.3em 0; }
.mail-editor .ProseMirror blockquote { border-left:3px solid var(--primary,#6d5efc); margin:.4em 0; padding:.1em 0 .1em .8em; color:#555; }
.mail-editor .ProseMirror code { background:#f1f0fb; border-radius:4px; padding:.05em .35em; font-size:.9em; }
.mail-editor .ProseMirror hr { border:none; border-top:1px solid var(--border,#ddd); margin:.8em 0; }
.mail-editor .ProseMirror a { color:var(--brand,#0189d9); }
.mail-editor .ProseMirror:focus-visible, .mail-editor .ProseMirror *:focus, .mail-editor .ProseMirror-selectednode { outline:none; }
.mail-editor .ProseMirror p.is-editor-empty:first-child::before { content:attr(data-placeholder); color:var(--muted,#aaa); float:left; height:0; pointer-events:none; }
.mail-suggest { position:relative; }
.mail-suggest-list { position:absolute; z-index:30; background:#fff; border:1px solid var(--border,#ddd); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); max-height:240px; overflow:auto; min-width:260px; }
.mail-suggest-item { display:flex; align-items:center; gap:.5rem; padding:.4rem .6rem; cursor:pointer; }

/* Éditeur réutilisable de modèles d'e-mail (App\Controller\Email\AbstractModeleEmailController). */
.me-edit { display:flex; flex-direction:column; gap:1rem; }
.me-vars { display:flex; flex-wrap:wrap; gap:.4rem; margin:.3rem 0; }
.me-var { cursor:pointer; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.8rem; }

/* ---------- Constructeur d'e-mail v2 — deux volets (templates/email/modele/builder.html.twig,
   assets/controllers/email_builder_controller.js, assets/editor/email-builder.js). Rendu
   INCRÉMENTAL : un bloc = un nœud DOM créé une seule fois par `reconcilier()`, déplacé par
   `insertBefore`, jamais recréé par `innerHTML` (cf. spec 2026-07-26, garantie caret/undo). ---------- */
.ebx-tabs { display: none; }

.ebx-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1.2rem; align-items: start; }

/* Volet de composition = carte blanche (même esprit que l'aperçu à droite, .ebx-frame-wrap).
   En-tête STICKY (actions : Ajouter un bloc / Insérer un champ / Réinitialiser — ne bougent pas au
   scroll) + corps défilant. « Enregistrer » vit dans le page-head (haut-droite). */
.ebx-editor {
    display: flex; flex-direction: column; min-width: 0;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(31,27,46,.04);
}
.ebx-editor-head {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    padding: .55rem .7rem; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 16; background: var(--card);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ebx-head-reset { margin-left: auto; }
/* Outils de mise en forme du texte, dans le popover de réglages d'un bloc Titre/Texte (à côté de
   l'alignement) : rangée d'icônes ; état actif .is-on = marque/liste appliquée à la sélection. */
.ebx-format { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.ebx-format .icon-btn.is-on { background: var(--primary-soft); color: var(--primary-dark); }
.ebx-editor-body { display: flex; flex-direction: column; gap: .9rem; padding: .85rem .8rem; min-width: 0; }
/* Boutons du builder (en-tête composition + actions de page) : icône + libellé alignés, largeur auto. */
.eb .page-actions .btn, .eb .ebx-editor-head .btn { display: inline-flex; align-items: center; gap: .4rem; }
.eb .page-actions .btn svg, .eb .ebx-editor-head .btn svg { width: 1.05em; height: 1.05em; }
/* Ancre du menu « Insérer un champ » : wrapper étroit position:relative → le menu (.eb-champ-menu,
   inséré en SIBLING du bouton par _ouvrirMenuChamps) se positionne SOUS le bouton, et non contre la
   barre sticky (qui serait sinon le bloc conteneur). Utilisé par le bouton de la barre ET du sujet. */
.eb-champ-anchor { position: relative; display: inline-flex; }
/* Sélecteur composé `.eb-inserter.ebx-toolbar-inserter` (spécificité 0,2,0) — le générique
   `.eb-inserter` (0,1,0) est déclaré PLUS LOIN dans la feuille (inserteurs « + » entre blocs) ;
   sans ce renfort de spécificité, l'ordre source le ferait gagner et écraserait ce override. */
.eb-inserter.ebx-toolbar-inserter { display: inline-flex; height: auto; }

.ebx-subject-wrap { display: flex; align-items: flex-end; gap: .5rem; }
.ebx-subject { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 0; }
/* Sujet = éditeur Tiptap mono-ligne à pastilles (hôte .ebx-subject-host, aspect input). */
.ebx-subject-host { min-height: 2.5rem; display: flex; align-items: center; cursor: text; overflow-x: auto; white-space: nowrap; }
.ebx-subject-host .ProseMirror { flex: 1; min-width: 0; outline: none; white-space: nowrap; }
.ebx-subject-host .ProseMirror p { margin: 0; }
.ebx-subject-host .tpl-var { vertical-align: baseline; }

.ebx-canvas { display: flex; flex-direction: column; gap: .8rem; min-height: 60px; }
.ebx-empty {
    padding: 1.4rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm);
    display: flex; flex-direction: column; gap: .8rem; align-items: center;
}

.ebx-block {
    display: flex; gap: .4rem; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: .6rem .9rem .8rem .35rem;
}
.ebx-block.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ebx-block.dragging { opacity: .4; }

/* Rail latéral (spec affordances 2026-07-26) : poignée + « + » d'ajout. */
.ebx-rail { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding-top: .1rem; }
.ebx-block-body { flex: 1 1 auto; min-width: 0; }

.ebx-block-tools { display: flex; align-items: center; gap: .15rem; margin-bottom: .4rem; }
/* Barre d'actions révélée au survol/focus/sélection (le libellé du bloc reste toujours visible). */
.ebx-block-tools .icon-btn { opacity: 0; transition: opacity .12s ease; }
.ebx-block:hover .ebx-block-tools .icon-btn,
.ebx-block:focus-within .ebx-block-tools .icon-btn,
.ebx-block.is-selected .ebx-block-tools .icon-btn { opacity: 1; }

/* Poignée : TOUJOURS visible (discrète au repos → pleine au survol) = signal « bloc déplaçable ». */
.ebx-handle { cursor: grab; opacity: .5; transition: opacity .12s ease; }
.ebx-handle:active { cursor: grabbing; }
.ebx-block:hover .ebx-rail .ebx-handle,
.ebx-block:focus-within .ebx-rail .ebx-handle,
.ebx-block.is-selected .ebx-rail .ebx-handle { opacity: 1; }

/* « + » d'ajout du rail : révélé au survol du bloc (insère avant ce bloc). */
.ebx-rail .eb-inserter { height: auto; }
.ebx-rail .eb-inserter-btn { opacity: 0; }
.ebx-block:hover .ebx-rail .eb-inserter-btn,
.ebx-block:focus-within .ebx-rail .eb-inserter-btn,
.ebx-rail .eb-inserter.is-open .eb-inserter-btn { opacity: 1; transform: scale(1); }
/* Menu de palette ouvert depuis le rail étroit : aligné au rail (pas centré). */
.ebx-rail .eb-inserter-menu { left: 0; transform: none; }

.ebx-block-label { font-size: .78rem; font-weight: 700; color: var(--muted); flex: 1; }
.ebx-spacer-flex { flex: 1; }

.ebx-block-content { min-width: 0; cursor: text; }

/* Popover de réglages UNIQUE, réutilisé : déplacé (appendChild) dans la carte sélectionnée —
   rendu comme un panneau inline sous le contenu, pas de positionnement absolu (fondation ;
   l'ancrage flottant précis est un raffinement ultérieur). */
.ebx-popover {
    margin-top: .7rem; padding: .8rem .9rem; border: 1px dashed var(--line); border-radius: 8px;
    background: var(--bg); display: flex; flex-direction: column; gap: .7rem;
}
.ebx-popover[hidden] { display: none; }
.ebx-insp-row { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; }
.ebx-insp-row label { display: flex; flex-direction: column; gap: .3rem; }
.ebx-insp-row select, .ebx-insp-row input[type="text"] {
    font-family: inherit; font-size: .9rem; padding: .4rem .55rem; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; color: var(--ink);
}
.ebx-insp-label { font-weight: 600; color: var(--muted); }
.ebx-insp-note { margin: 0; font-size: .85rem; }

.eb-align { display: flex; gap: .2rem; }
.eb-align .icon-btn.is-on { background: var(--primary-soft); color: var(--primary); opacity: 1; }
.eb-align .btn.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

.eb-swatches { display: flex; gap: .4rem; }
.eb-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.eb-swatch.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* Hôte d'édition riche (Titre/Texte, monté par email-builder.js) : aperçu statique stylé
   jusqu'au montage de l'éditeur, puis ProseMirror vivant — même nœud DOM dans les deux cas. */
.ebx-richhost .eb-text { border: 1px solid transparent; border-radius: 8px; padding: .3rem .4rem; min-height: 40px; }
.ebx-richhost .eb-text:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.ebx-texte-titre { font-family: Arial, Helvetica, sans-serif; font-weight: 700; color: #1f2937; font-size: 1.25rem; }
.ebx-texte-titre[data-niveau="h3"] { font-size: 1.05rem; }
.ebx-texte-texte { font-family: Arial, Helvetica, sans-serif; color: #1f2937; line-height: 1.5; }

.ebx-btn-wrap { padding: .3rem 0; }
.ebx-btn-fake {
    display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 700;
    font-family: Arial, Helvetica, sans-serif; cursor: default; user-select: none;
}
.ebx-hr { border: none; border-top: 1px solid #e5e7eb; margin: 8px 0; }
.ebx-spacer {
    border-radius: 6px;
    background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 6px, var(--line) 6px, var(--line) 7px);
}
.ebx-legacy-preview {
    margin: .4rem 0 0; padding: .6rem .7rem; background: var(--bg); border-radius: 8px; font-size: .78rem;
    max-height: 140px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* Menu palette d'ajout de bloc (template `data-eb-palette`) — cloné dans DEUX contextes :
   l'état canevas vide (`.ebx-empty`) et le menu d'ajout (barre sticky du haut + inserteurs
   « + » entre blocs, `.eb-inserter-menu`). TOUJOURS une LISTE VERTICALE (icône + libellé par
   ligne, jamais une rangée/grille de boutons — cf. Task #2). Plus de palette en fin de
   canevas (`.ebx-end-palette`, retirée — Task #1). */
.eb-palette-menu { display: flex; flex-direction: column; gap: .1rem; min-width: 200px; }
.eb-palette-item {
    display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
    padding: .5rem .7rem; border: 0; border-radius: 8px; background: none; cursor: pointer;
    font: inherit; font-size: .88rem; color: var(--ink); white-space: nowrap;
}
.eb-palette-item:hover, .eb-palette-item:focus-visible { background: var(--primary-soft); color: var(--primary-dark); outline: none; }

/* Sélecteur d'élève pour « Envoyer un test » (Task #4, `.page-actions`) — recherche débouncée,
   résultats en liste déroulante ; sélection = pastille retirable (chip) ; sans sélection =
   indice « données d'exemple ». Purement visuel, la logique vit dans
   email_builder_controller.js (eleveSaisir/eleveClear/_eleveChoisir…). */
.ebx-eleve-picker { display: flex; align-items: center; gap: .5rem; }
.ebx-eleve-search-box { position: relative; }
.ebx-eleve-input {
    width: 210px; font-family: inherit; font-size: .85rem; padding: .45rem .7rem;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fcfcff; color: var(--ink);
}
.ebx-eleve-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ebx-eleve-results {
    position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: .3rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 260px; overflow-y: auto;
}
.ebx-eleve-item {
    display: block; width: 100%; text-align: left; padding: .45rem .7rem; border: 0;
    border-top: 1px solid var(--line); background: none; cursor: pointer;
    font: inherit; font-size: .85rem; color: var(--ink);
}
.ebx-eleve-item:first-child { border-top: 0; }
.ebx-eleve-item:hover, .ebx-eleve-item:focus-visible { background: var(--primary-soft); color: var(--primary-dark); outline: none; }
.ebx-eleve-empty { margin: .5rem .7rem; font-size: .82rem; }
.ebx-eleve-chip {
    display: flex; align-items: center; gap: .3rem; padding: .3rem .3rem .3rem .75rem;
    background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px;
    font-size: .85rem; font-weight: 600;
}
.ebx-eleve-hint { font-size: .8rem; }

.ebx-preview { position: sticky; top: 0; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.ebx-preview-bar { display: flex; align-items: center; gap: .8rem; }
.ebx-device-toggle { display: flex; gap: .2rem; }
.ebx-device-toggle .icon-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); opacity: 1; }
.ebx-status { font-size: .8rem; color: var(--muted); margin-left: auto; }
.ebx-frame-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f3f4f6; padding: .8rem; overflow: auto; }
.ebx-frame { width: 100%; height: 560px; border: 0; background: #fff; border-radius: 8px; display: block; margin-inline: auto; transition: width .15s ease; }
.ebx-preview[data-device="mobile"] .ebx-frame { width: 375px; }

@media (max-width: 900px) {
    .ebx-tabs { display: flex; gap: .4rem; margin-bottom: .8rem; }
    .ebx-tab { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .85rem; cursor: pointer; }
    .ebx-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .ebx-split { grid-template-columns: 1fr; }
    .ebx-split .ebx-editor, .ebx-split .ebx-preview { display: none; }
    .ebx-split[data-tab="editor"] .ebx-editor { display: flex; }
    .ebx-split[data-tab="preview"] .ebx-preview { display: flex; }
    .ebx-preview { position: static; }
}

/* ---------- Inserteur « + » (bouton rond, ouvre la palette d'ajout) — classes RÉUTILISÉES par le
   « + » du rail de chaque bloc (insère avant ce bloc) ET la barre d'ajout sticky du haut (ajoute en
   fin). Plus d'inserteurs flottants ENTRE les blocs (retirés avec _regenererInserters, spec
   affordances 2026-07-26). Aucun éditeur à l'intérieur. */
.eb-inserter { display: flex; align-items: center; justify-content: center; height: 18px; position: relative; }
.eb-inserter-btn {
    width: 24px; height: 24px; border-radius: 50%; padding: 0;
    border: 1px solid var(--line); background: var(--card); color: var(--muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; transform: scale(.8);
    transition: opacity .12s ease, transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.eb-inserter-btn svg { width: 14px; height: 14px; display: block; }
.eb-inserter:hover .eb-inserter-btn,
.eb-inserter:focus-within .eb-inserter-btn,
.eb-inserter.is-open .eb-inserter-btn { opacity: 1; transform: scale(1); }
.eb-inserter-btn:hover, .eb-inserter-btn:focus-visible { background: var(--primary); border-color: var(--primary); color: #fff; }
.eb-inserter-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .3rem; z-index: 20;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: .6rem; width: max-content; max-width: min(360px, 85vw);
}

/* Menus « Insérer un champ » (toolbar bloc Titre/Texte + sujet) — même déclencheur
   `.ebx-champ-btn` dans les deux contextes (cf. _ouvrirMenuChamps). */
.ebx-champ-btn { position: relative; }
.eb-champ-menu {
    position: absolute; top: 100%; right: 0; margin-top: .3rem; z-index: 20;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    padding: .3rem; min-width: 190px; max-width: min(280px, 85vw); max-height: 260px; overflow-y: auto;
    display: flex; flex-direction: column;
}
.eb-champ-item {
    display: block; width: 100%; text-align: left; padding: .4rem .6rem; border-radius: 6px;
    border: none; background: transparent; cursor: pointer; font-size: .85rem; color: var(--ink);
}
.eb-champ-item:hover, .eb-champ-item:focus-visible { background: var(--primary-soft); color: var(--primary-dark); }
.eb-champ-empty { margin: .2rem .4rem; font-size: .82rem; }

/* Région d'annonces a11y (aria-live) — texte visuellement masqué. Jamais posé sur `.ebx-canvas`
   lui-même (cf. gabarit) : ce conteneur mute à chaque frappe Tiptap, ce qui spammerait le
   lecteur d'écran à chaque caractère saisi. */
.ebx-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Zone d'édition riche d'un bloc Titre/Texte (mont Tiptap par email-builder.js) — classes
   RÉUTILISÉES telles quelles par le builder v2 (host .eb-text à l'intérieur de .ebx-richhost). */
.eb-text { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; background: #fff; min-height: 70px; }
.eb-text:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.eb-text .ProseMirror { outline: none; line-height: 1.5; }
.eb-text .ProseMirror p { margin: .2em 0; }

/* Pastille de variable (Tiptap Mention détournée) : jamais le jeton `{{ … }}` brut à l'écran. */
.tpl-var {
    display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
    border-radius: 999px; padding: .05rem .5rem; font-size: .85em; font-weight: 600;
    white-space: nowrap; user-select: none; cursor: pointer;
}
/* Pastille SÉLECTIONNÉE (clic → NodeSelection) : anneau net → l'utilisateur voit le champ ciblé
   par la mise en forme (classe posée par ProseMirror sur le node view node-sélectionné). */
.tpl-var.ProseMirror-selectednode { outline: 2px solid var(--primary); outline-offset: 1px; background: var(--primary); color: #fff; }

/* Module Dossiers élèves — liste des élèves dans une fiche de classe. */
.eleve-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.eleve-list-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.eleve-list-row:last-child { border-bottom: 0; }

/* ============================================================
   Fiche élève — CSS porté 1:1 du legacy gestion-ecole
   ============================================================ */

/* Conteneur principal de la fiche (onglets + panneaux) */
.dossier { display: flex; flex-direction: column; }

/* .tabs, .tab.active et l'alias .tab.is-active sont définis plus haut, en un seul
   endroit : rien à redéfinir ici (une surcharge locale ferait diverger les deux). */

/* ── Onglet Identité : disposition grille 2 colonnes, cards égales (legacy inline #tab-infos) ─ */
.dossier .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.dossier .detail-grid > .card { height: 100%; }
/* .parents est déjà défini (grid gap:1rem) ; on force auto-fill ici pour compatibilité */
.dossier .parents { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 760px) { .dossier .detail-grid { grid-template-columns: 1fr; } }

/* ── Onglet Santé : cases à cocher imagées (legacy app.css, identiques) ─────────────────── */
/* .sante-pics, .sante-pic, .sante-card, .sante-plus déjà définis plus haut ; on ne redéfinit pas */

/* Soutiens cochables (case + coordonnées dépliables) — porté du legacy inline #tab-infos */
.sante-soutien-list { display: flex; flex-direction: column; gap: .5rem; }
/* Une ligne par soutien, REPLIÉE par défaut : on ne voit que la case, le libellé et
   un aperçu de ce qu'elle contient. Le chevron n'apparaît que si la case est cochée. */
.soutien-item { border: 1px solid var(--border, #e5e7eb); border-radius: .45rem; padding: .45rem .6rem; }
.soutien-item.is-on { border-color: var(--primary); background: var(--primary-soft); }
.soutien-head { display: flex; align-items: center; gap: .6rem; }
.soutien-head > .field-edit.check { flex: none; }
/* Coordonnées de la ligne repliée, en pastilles typées (nom, téléphone, e-mail).
   Téléphone et e-mail sont des liens tel:/mailto: — joindre l'intervenant sans
   déplier. Masquées si la ligne n'est pas active : leur contenu vient du serveur
   et n'aurait plus de sens sur une case qu'on vient de décocher. */
.soutien-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.soutien-item:not(.is-on) .soutien-chips { display: none; }
.soutien-chip { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
    padding: .14rem .5rem; border-radius: 999px; background: var(--card);
    border: 1px solid var(--line); font-size: .78rem; color: var(--muted);
    text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soutien-chip b { color: var(--ink); font-weight: 650; }
.soutien-chip.is-lien:hover { border-color: var(--primary); color: var(--primary-dark); }
.soutien-chip.is-lien:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.soutien-vide { color: var(--muted); font-size: .8rem; font-style: italic; }

/* Champ de coordonnée : libellé au-dessus, comme les autres formulaires de l'app. */
.coord-f { display: flex; flex-direction: column; gap: .22rem; min-width: 0; }
.coord-f > span { font-size: .72rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em; }
.coord-f .input { padding: .38rem .55rem; font-size: .9rem; }
.coord-f-full { margin-bottom: .55rem; }
.soutien-chevron { margin-left: auto; flex: none; display: inline-grid; place-items: center;
    width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent;
    color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1;
    transition: transform .15s, background .12s, color .12s; }
.soutien-chevron[hidden] { display: none; }
.soutien-chevron:hover { background: var(--card); color: var(--primary-dark); }
.soutien-chevron:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.soutien-item.is-open .soutien-chevron { transform: rotate(180deg); }
.soutien-coord { margin-top: .5rem; }
.soutien-coord[hidden] { display: none; }
.coord-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
@media (max-width: 520px) { .coord-grid { grid-template-columns: 1fr; } }

/* ── Onglet Autorisations : lignes de personnes — porté du legacy inline #tab-autorisations ─ */
.personnes { display: flex; flex-direction: column; gap: .4rem; margin: .3rem 0 .5rem; }
.personne-row { display: grid; grid-template-columns: 1fr 1fr .9fr 1fr auto; gap: .4rem; align-items: center; }
.personne-row .link-danger { font-size: 1rem; }
@media (max-width: 900px) { .personne-row { grid-template-columns: 1fr 1fr; } }
/* ⚠️ `.field-edit` est un flex COLONNE : son `align-items: stretch` par défaut étire tout
   enfant direct sur la largeur de la carte — un `.btn` s'y retrouve pleine largeur alors
   que `.btn` est en `width:auto`. D'où le `align-self` explicite. Piège à connaître pour
   tout bouton posé directement dans un `.field-edit`. */
.personnes-add { align-self: flex-start; margin-top: .4rem; }
/* « Tous les jours » pilote les cinq cases : on la sépare visuellement du groupe. */
.jours-tous { margin-right: .5rem; padding-right: .8rem; border-right: 1px solid var(--line); }
@media (max-width: 600px) { .jours-tous { margin-right: 0; padding-right: 0; border-right: 0; } }

/* Zone dangereuse (retrait élève) */
details.danger-zone { margin-top: 1.2rem; border: 1px solid #fca5a5; border-radius: var(--radius); background: #fff5f5; }
details.danger-zone > summary { cursor: pointer; padding: .6rem .9rem; font-weight: 600; color: #c0392b; list-style: none; }
details.danger-zone > summary::-webkit-details-marker { display: none; }
details.danger-zone > p { margin: 0 .9rem .5rem; font-size: .88rem; }
details.danger-zone > form { padding: .5rem .9rem .9rem; display: flex; flex-direction: column; gap: .6rem; }
/* Variante destructrice — déclarée ici pour rester avec la zone dangereuse, mais
   elle suit la même formule que les autres (dégradé + ombre teintée). */
.btn-danger { --btn-a: #c0392b; --btn-b: #e5484d; --btn-sh: rgba(192, 57, 43, .30); }

/* Carte parent / responsable : avatar + corps (porté 1:1 du legacy) */
/* .parent, .parent-body, .parent-head, .parent-meta déjà définis plus haut ; identiques */

/* Section « Ajouter un responsable » : bouton simple + panneau révélé au clic
   (plus de <details> — un champ dans <details> est soumis vide sur Safari). */
.resp-add { margin-top: 1rem; }
.resp-add > form { margin-top: .7rem; padding: .6rem .8rem .8rem; display: flex; flex-direction: column;
    gap: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.resp-add > form[hidden] { display: none; }   /* sinon display:flex l'emporterait */

/* Suggestions de responsables existants */
.resp-results { display: flex; flex-direction: column; gap: .3rem; margin: .3rem 0; }
.resp-hit { display: block; width: 100%; text-align: left; padding: .4rem .6rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
    cursor: pointer; font-size: .9rem; transition: background .12s, border-color .12s; }
.resp-hit:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.mail-suggest-item.is-active, .mail-suggest-item:hover { background:var(--primary-soft,#f3f1ff); }

/* Variantes mineures du wizard d'import (relevées en revue finale menus). */
.flash.flash-warn { background: #fff4e5; color: #8a5300; border-color: #ffd9a8; }
.map-groupe > summary { cursor: pointer; padding: .5rem .2rem; }

/* ── Grille des années scolaires (Établissement) — lignes dépliables (fermetures) ── */
.asg-grid th.num, .asg-grid td.num { text-align: right; white-space: nowrap; }
.asg-grid .asg-row td { transition: background .12s; }
.asg-grid .asg-row:hover td { background: var(--primary-soft, #f3f1ff); }
.asg-grid .asg-row.is-open td { background: var(--primary-soft, #f3f1ff); }
.asg-lib { cursor: pointer; }
.asg-caret { cursor: pointer; }
.asg-caret svg { transform: rotate(-90deg); transition: transform .15s; }
.asg-row.is-open .asg-caret svg { transform: rotate(0); }
.asg-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; white-space: nowrap; }
.asg-actions form { display: inline-flex; margin: 0; }
/* « Définir courante » aligné : le bloc d'icônes (✏️/🗑️) a une largeur constante, quel que soit
   le nombre d'icônes présentes → le bouton courante démarre toujours au même endroit. */
.asg-act-courante { display: inline-flex; justify-content: flex-end; }
.asg-act-icons { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.asg-act-placeholder { display: inline-block; width: 28px; height: 28px; }
.asg-detail > td { padding: 0; background: color-mix(in srgb, var(--primary-soft, #f3f1ff) 55%, #fff); }
.asg-panel { padding: 1rem 1.2rem 1.3rem; border-left: 3px solid var(--primary); }
.asg-dates { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border, #e6e3f0); }
.asg-dates .field-edit { gap: .3rem; }
.asg-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.asg-panel-head h3 { margin: 0; font-size: .98rem; }
.asg-add > summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: .35rem 0; list-style: none; }
.asg-add > summary::-webkit-details-marker { display: none; }
.asg-add-form { margin-top: .7rem; max-width: 680px; }
.ferm-portee { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ferm-scope { margin-top: .4rem; }
.dp-label { margin: 1rem 0 .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.dp-check[hidden] { display: none; }

/* Sélecteur d'implantation en pastilles cliquables (radios). */
.ferm-impl { display: flex; flex-wrap: wrap; gap: .5rem; }
.ferm-impl-opt { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .6rem .28rem .35rem; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; transition: border-color .12s, background .12s; }
.ferm-impl-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.ferm-impl-opt:hover { border-color: var(--primary); }
.ferm-impl-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
/* Niveaux / classes en 3 colonnes (niveaux : M1-M3 · P1-P3 · P4-P6). */
.ferm-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem 1rem; max-width: 560px; margin: .3rem 0 .4rem; }
.ferm-cols-col { display: flex; flex-direction: column; gap: .15rem; }
.ferm-cols-classes { max-width: 640px; }

/* Chip multi-implantations (dégradé + acronymes en tirets), comme le nom des groupes virtuels. */
.pastille-acr { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .02em; }

dialog.modal.modal-lg { max-width: 720px; }
.asg-add-form fieldset { border: 1px solid var(--border, #e6e3f0); border-radius: 10px; padding: .6rem .9rem; }
.asg-add-form legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 .4rem; }

/* ── Statut de justification d'absence — vocabulaire UNIQUE ──────────────────
   Cf. App\Presence\Enum\EtatMetier. Classe .etat-{value} ; le libellé vient du PHP.
   Rendu partout où un statut d'absence est affiché (grids, tuiles, fiche élève). */
.etat-justif { display: inline-flex; align-items: center; gap: .28rem; border-radius: 8px; padding: .1rem .5rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.etat-justif .etat-ic { width: .95em; height: .95em; flex: none; opacity: .85; }
/* Palette « une couleur par statut » (proposition B validée) : plus aucun doublon rouge. */
.etat-non_fourni          { background: #fef3c7; color: #92400e; } /* ambre     — pièce attendue, délai ouvert */
.etat-a_valider           { background: #eae7ff; color: #5b3fd6; } /* violet    — attend la validation direction */
.etat-valide              { background: #dcfce7; color: #166534; } /* vert      — validé */
.etat-non_justifie        { background: #fee2e2; color: #b91c1c; } /* rouge     — injustifiée (délai dépassé / actée) */
.etat-refuse              { background: #fce7f3; color: #9d174d; } /* framboise — refusé par la direction */
.etat-info_complementaire { background: #e0f2fe; color: #0369a1; } /* bleu ciel — infos complémentaires attendues */
.etat-annule              { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; } /* gris barré — annulé */
.etat-non_requis          { background: #eef1f5; color: #64748b; } /* gris neutre — non requis (M1/M2 dispensés) */

/* ── Présence FWB (axe ② de la refonte 2 axes) — écusson 🛡️ affiché DÈS que l'issue est résolue.
   Binaire : justifiée (vert) ⟺ justificatif validé ; injustifiée (rouge) sinon. Cf. Absence::presenceFwb(). */
.pfwb { display: inline-flex; align-items: center; gap: .28rem; border-radius: 8px; padding: .1rem .5rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pfwb .pfwb-ic { width: .95em; height: .95em; flex: none; }
.pfwb-justifiee   { background: #dcfce7; color: #166534; } /* vert  — présence justifiée (pièce validée) */
.pfwb-injustifiee { background: #fee2e2; color: #b91c1c; } /* rouge — présence injustifiée (défaut FWB) */

/* ── Statut d'e-mail sortant — supervision (Lot 2) ───────────────────────────
   Cf. App\Email\Enum\StatutEmail::couleur(). Classe .email-statut-{token} ; libellé via ::label(). */
.email-statut { display: inline-block; border-radius: 8px; padding: .1rem .5rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.email-statut-gris   { background: #f1f5f9; color: #64748b; }
.email-statut-bleu   { background: #dbeafe; color: #1e40af; }
.email-statut-vert   { background: #dcfce7; color: #166534; }
.email-statut-orange { background: #fef3c7; color: #92400e; }
.email-statut-rouge  { background: #fee2e2; color: #991b1b; }

/* Bandeau de compteurs du journal e-mails */
.email-kpis { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .2rem 0; }
.email-kpi { display: inline-block; border-radius: 8px; padding: .25rem .6rem; font-size: .85rem; background: #f1f5f9; color: #475569; }

/* ── Fiche élève — édition en place (cadres Identité / Scolarité) ───────────
   Le cadre est un <form> ; le crayon (data-eleve-edit-target="crayon") bascule .is-editing
   qui échange .ee-read (lecture) contre .ee-edit (champ) — cf. contrôleur Stimulus eleve-edit. */
.eleve-edit .ee-edit { display: none; }
.eleve-edit.is-editing .ee-edit { display: block; width: 100%; }
.eleve-edit.is-editing .ee-read { display: none; }
/* En édition, la valeur (dd) prend la place restante — sans quoi l'input resterait
   à sa largeur intrinsèque (dd shrink-to-fit) avec le texte hérité aligné à droite. */
.eleve-edit.is-editing .fields dd { flex: 1; text-align: left; margin-left: 1rem; }
/* Champ vide : la LIGNE ENTIÈRE disparaît en lecture (pas de « — » décoratif) et
   revient en édition pour rester complétable. La classe est posée au rendu Twig puis
   entretenue par le contrôleur eleve-edit (_miroir) quand on vide/remplit un champ.
   L'input reste dans le DOM (juste masqué) : le form continue de tout soumettre. */
.eleve-edit .fields > div.is-vide { display: none; }
.eleve-edit.is-editing .fields > div.is-vide { display: flex; }
.eleve-edit .card-title { display: flex; align-items: center; gap: .5rem; }
.eleve-edit .card-title .icon-btn { margin-left: auto; }
/* Pied d'onglet du dossier élève : « dernière mise à jour … par … », SOUS le bouton
   d'enregistrement et centré comme lui. Discret — c'est de la traçabilité, pas du
   contenu. Rendu UNE SEULE FOIS par onglet (eleve/_derniere_maj.html.twig) : la
   carte Santé avait sa propre ligne, d'où un doublon désormais supprimé. */
.maj-pied { margin: .6rem 0 0; font-size: .82rem; color: var(--muted); text-align: center; }

.ee-statut { font-size: .8rem; font-weight: 600; color: #16a34a; }
.ee-statut.is-err { color: var(--danger, #dc2626); }

/* Fiche élève — frise du parcours scolaire */
.sco-tl-titre { margin: .9rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.sco-tl { list-style: none; margin: .2rem 0 0 .5rem; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.sco-tl-item { position: relative; padding: .35rem 0 .55rem; }
.sco-tl-item::before {
    content: ''; position: absolute; left: calc(-1.1rem - 7px); top: .72rem;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--line); border: 2px solid var(--card, #fff);
}
.sco-tl-item.is-cur::before { background: var(--primary); }
.sco-tl-main { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sco-tl-tit { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; }
.sco-tl-meta { font-size: .8rem; margin-top: .15rem; }
.email-kpi strong { font-weight: 700; }

/* ===================== Modules du dossier élève — système commun (Discipline + Pédagogie) ===================== */
/* Les classes `disc-*` ci-dessous sont le système COMMUN aux modules du dossier élève qui
   partagent le même habillage (Discipline ⚖️, Pédagogie 📚 à venir) : cartes à ombre douce,
   tuiles KPI à icône teintée, badges fins, zones de texte sur fond doux. PAS de renommage —
   « disc- » reste le préfixe historique/commun, les modules le RÉUTILISENT. Les classes propres
   à la Pédagogie (accordéon d'aménagements, grille de zones, pastille compteur, carte d'année
   passée…) sont préfixées `pedago-*` et vivent en fin de bloc. Valeurs portées TELLES QUELLES de
   la maquette validée (`docs/superpowers/specs/assets/2026-08-08-onglet-pedagogie-maquette.html`,
   § Engagement de fidélité visuelle) en harmonisant avec les tokens du projet (--line, --muted,
   --primary, --radius-sm) quand ils rendent la même chose à l'œil — jamais au prix du rendu. */

/* Carte de module : rayon 14px + ombre douce mauve (ni --radius 18px ni --radius-sm 12px ne
   correspond → valeur maquette figée en dur), titre en violet foncé dédié (#40378f, sans token
   existant assez proche). Titre en flex pour pousser le bouton d'action à droite (margin-left:auto
   ne résout pas hors flex — cf. revue Task 6). */
.disc-card { border-radius: 14px; border-color: var(--line); box-shadow: 0 1px 3px rgba(80, 70, 150, .07); }
/* Espacement des cadres d'un onglet du dossier (Pédagogie, Discipline). `.card` n'a AUCUNE
   marge : les cartes se touchaient. On ne peut pas se contenter de `+` (sélecteur de
   frère adjacent) — un <script> sépare Entretiens de Documents et casserait l'adjacence.
   La marge du haut se recouvre avec le `margin-bottom` des KPIs (fusion des marges), donc
   pas de double espace sous eux. Portée aux enfants DIRECTS de l'onglet : les cartes
   posées dans une grille (fiche incident) gardent le `gap` de leur grille. */
.tab-panel > .disc-card { margin-top: 1.1rem; }
.disc-card .card-title { display: flex; align-items: center; gap: .5rem; color: #40378f; font-size: .95rem; letter-spacing: .01em; }
.disc-head-btn { margin-left: auto; }

/* Tuiles KPI : icône dans un carré teinté (défaut violet = var(--primary-soft), variantes
   .is-bad rouge / .is-warn orange selon la gravité du signal — 3ᵉ variante « violet » = défaut,
   pas de classe à poser). */
.disc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.disc-kpi { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm, 12px); padding: 10px 14px; background: var(--card); box-shadow: 0 1px 2px rgba(80, 70, 150, .06); }
.disc-kpi-ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px; font-size: 16px; background: var(--primary-soft); }
.disc-kpi-ico.is-bad { background: #ffe9e9; }
.disc-kpi-ico.is-warn { background: #fff2e3; }
.disc-kpi-n { font-size: 19px; font-weight: 800; line-height: 1.1; font-family: "Baloo 2", sans-serif; }
.disc-kpi-l { color: var(--muted); font-size: 10.5px; letter-spacing: .02em; text-transform: uppercase; }

/* Badge fin (catégorie / gravité / lieu d'un incident, dispositif pédagogique…) : rayon 7px,
   10.5px/700 — remplace l'ancienne pill toute ronde (999px), fidèle à la maquette. */
.disc-b { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; background: var(--bg); color: var(--muted); }
.disc-b.disc-g1 { background: #fff6d6; color: #93780a; }
.disc-b.disc-g2 { background: #ffedd8; color: #c1560a; }
.disc-b.disc-g3 { background: #ffe3e3; color: #c92a2a; }
/* Badge de dispositif (Pédagogie) : ✓ actif (vert) / inactif barré-atténué (gris). */
.disc-b.is-on { background: #e7f5ec; color: #1f7a3d; }
.disc-b.is-off { background: #f4f2fa; color: #9b97b3; text-decoration: line-through; opacity: .7; }
/* Ambre : mise en avant douce — « année en cours », « Maintien P2 » (maquette .b.warn). */
.disc-b.is-warn { background: #fff3bf; color: #997404; }

/* Zone de texte (difficultés, points forts, objectifs, remarques…) : fond doux + libellé
   uppercase gris — classe commune, consommée par la grille .pedago-zones de la Pédagogie. */
.disc-zone { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fbfaff; white-space: pre-line; }
.disc-zone > b { display: block; margin-bottom: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: normal; }

/* Pastille « statut » d'un incident (point coloré + libellé). */
.disc-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; }
.disc-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.disc-dot.disc-st-ouvert { color: #f08c00; }
.disc-dot.disc-st-suivi { color: #1971c2; }
.disc-dot.disc-st-clos { color: #2f9e44; }

/* Menu DU DOSSIER : le nom de l'élève coiffe la table des matières, pour savoir de qui
   est le dossier même après avoir défilé (proposition 2 : le nom seul, sans carte). */
.dossier-menu-nom { padding: .1rem .2rem .55rem; font-family: 'Baloo 2', sans-serif;
    font-weight: 800; font-size: 1rem; line-height: 1.15; color: var(--ink); }
/* Cibles des entrées « Identité / Scolarité / … » : elles vivent sur la même page, on y va
   par ancre. Ancres DÉDIÉES et non `id` posé sur les cartes : les formulaires portent déjà
   `identite-form`/`scolarite-form`, référencés par les tests — on ne les renomme pas.
   ⚠️ L'ancre est PREMIER ENFANT DE LA CARTE, jamais posée avant elle : `.detail-grid` est
   une grille, et un élément placé entre deux cartes y occuperait une CELLULE — ce qui
   cassait la mise côte à côte d'Identité et Scolarité.
   `scroll-margin-top` évite que la topbar collante recouvre le titre visé. */
.sec-ancre { display: block; height: 0; scroll-margin-top: 1rem; }

/* Cadres « 🛡️ Absences » et « ⏰ Retards » (lecture seule, données de Présences).
   La ligne de chiffres sert de résumé au-dessus de la liste ; les deux cartes sont
   posées côte à côte par `.disc-detail-grid`, réutilisé de la fiche incident. */
.disc-pres-chiffres { margin: -.2rem 0 .6rem; font-size: .88rem; color: var(--muted); }
.disc-pres-chiffres strong { color: var(--ink); }
/* Barre ‹ › + œil dans le TITRE de la carte (motif des cartes de la Vue d'ensemble).
   `.pg-nav` est déclarée plus bas avec `margin-top:.7rem` et `justify-content:flex-end`,
   pensés pour un pied de grid : on les annule ici, la barre est en ligne dans l'en-tête. */
.disc-card-nav { display: inline-flex; align-items: center; gap: .5rem; }
.disc-card-nav .pg-nav { margin: 0; }

/* Grids Incidents / Devoirs — single-line, largeurs fixes. */
.disc-table { table-layout: fixed; }
.disc-table td, .disc-table th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc-num { font-size: .76rem; color: var(--muted); font-weight: 600; }

/* Barre de pagination des grids (vues école Incidents/Devoirs, 50 lignes/page) — mêmes
   classes que le bloc <style> local de presence/vue_ensemble.html.twig, mutualisées ici
   pour ne pas dupliquer un <style> par template. */
.pg-nav { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .7rem; }
/* ⚠️ `display:flex` l'emporte sur l'attribut `hidden` : sans cette règle, le contrôleur
   `paginate` a beau poser `navTarget.hidden = true` quand il n'y a qu'une page, la barre
   reste affichée — un « 1 / 1 » avec deux flèches grisées. Vaut pour TOUTES les cartes
   paginées (Vue d'ensemble Présences comprise). Même piège que `.cps-reply[hidden]` : sur
   ce projet, un élément masqué par `hidden` ET stylé en `display:flex`/`grid` exige sa
   règle explicite. */
.pg-nav[hidden] { display: none; }
.pg-nav .pg-info { color: var(--muted); font-size: .85rem; min-width: 3.2rem; text-align: center; }
.pg-btn { border: 1px solid var(--line, #e2e8f0); background: #fff; border-radius: 8px; padding: .28rem .6rem; cursor: pointer; font-size: .9rem; line-height: 1; }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-btn:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
.pg-hide { display: none !important; }

/* Drawer latéral « Nouvel incident » (Task 7) : overlay + panneau glissant depuis la droite. */
.disc-drawer-overlay { position: fixed; inset: 0; background: rgba(31, 36, 64, .45); opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 60; }
.disc-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.disc-drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 92vw); background: var(--card); box-shadow: -8px 0 24px rgba(0, 0, 0, .12); transform: translateX(100%); transition: transform .2s ease; z-index: 61; display: flex; flex-direction: column; }
.disc-drawer-panel.is-open { transform: translateX(0); }
.disc-drawer-panel form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.disc-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); flex: none; }
.disc-drawer-head h2 { margin: 0; font-size: 1.15rem; font-family: "Baloo 2", sans-serif; }
.disc-drawer-body { padding: 1.2rem 1.3rem; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .9rem; }
.disc-drawer-foot { padding: 1rem 1.3rem; border-top: 1px solid var(--line); flex: none; }

/* Gravité en 3 segments cliquables (radios masqués, sélection via :has). */
.disc-grav { display: flex; gap: .5rem; }
.disc-grav-opt { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm, 10px); cursor: pointer; font-weight: 700; font-size: .88rem; text-align: center; }
.disc-grav-opt input { position: absolute; opacity: 0; pointer-events: none; }
.disc-grav-mineur:has(input:checked) { border-color: #93780a; background: #fff6d6; color: #93780a; }
.disc-grav-majeur:has(input:checked) { border-color: #c1560a; background: #ffedd8; color: #c1560a; }
.disc-grav-grave:has(input:checked) { border-color: #c92a2a; background: #ffe3e3; color: #c92a2a; }

/* Recherche d'élèves (drawer) : suggestions cliquables + pastilles retirables. */
.disc-eleve-results { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.disc-eleve-hit { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: .4rem .6rem; font: inherit; cursor: pointer; }
.disc-eleve-hit:hover { border-color: var(--primary); color: var(--primary); }
.disc-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.disc-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: .3rem .5rem .3rem .8rem; font-weight: 700; font-size: .85rem; }
.disc-chip button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }

/* Fiche incident (Task 8) : en-tête badges, corps 2 colonnes, chronologie des suites, barre de statut. */
.disc-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.disc-detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
/* ⚠️ `white-space: normal` et PAS `pre-line` : depuis le passage à l'éditeur riche, ces
   blocs contiennent du HTML (les sauts de ligne y sont des balises). En `pre-line`, ce
   sont les retours d'INDENTATION DU TEMPLATE qui deviendraient visibles — un grand vide
   sous le titre. Même piège que `.disc-zone` en pédagogie. */
.disc-detail-desc { white-space: normal; }
.disc-eleves-impliques { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.disc-eleves-impliques li { display: flex; align-items: center; gap: .5rem; }

.disc-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.disc-timeline-item { position: relative; padding: 0 0 1rem 1.1rem; }
.disc-timeline-item::before { content: ''; position: absolute; left: -6px; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.disc-timeline-date { font-size: .78rem; font-weight: 700; color: var(--muted); }
.disc-timeline-body p { margin: .3rem 0; }
.disc-timeline-auteur { font-size: .8rem; }

.disc-statusbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.disc-statusbar-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Pédagogie (`pedago-*`) : classes propres au module, posées sur le système commun
   ci-dessus (.disc-card/.disc-kpi/.disc-b/.disc-zone/.disc-timeline). ---------- */

/* Grille des 4 zones de texte de la fiche annuelle : 2 colonnes, 1 seule sous 900px. */
.pedago-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Accordéon « Aménagements raisonnables » : fond doux, résumé en gras violet foncé (même teinte
   que .disc-card .card-title), catégories en ligne avec leur pastille compteur .pedago-n. */
.pedago-amg { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 10px 0; background: #fbfaff; }
.pedago-amg summary { cursor: pointer; font-weight: 700; font-size: .8rem; color: #40378f; }
.pedago-cat { display: inline-flex; align-items: center; gap: 4px; margin: 4px 8px 0 0; font-size: .72rem; color: var(--muted); }

/* Pastille compteur ronde (nombre d'items cochés dans une catégorie d'aménagements). */
.pedago-n { display: inline-block; background: var(--primary); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 700; line-height: 1.5; }

/* Panneau d'une ANNÉE scolaire : l'en-tête se lit sans ouvrir (année, état, dispositifs,
   titulaire). L'année courante est ouverte ; les révolues sont repliées et en lecture
   seule — cf. FichePedagogique::estModifiable(). */
.pedago-annee > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap;
    align-items: center; gap: .45rem; padding: .1rem 0; }
.pedago-annee > summary::-webkit-details-marker { display: none; }
.pedago-annee > summary::before { content: '▸'; color: var(--muted); font-size: .8rem;
    transition: transform .15s; flex: none; }
.pedago-annee[open] > summary::before { transform: rotate(90deg); }
.pedago-annee-lib { font-weight: 800; letter-spacing: -.01em; }
.pedago-annee-etat { font-size: .66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; padding: .05rem .45rem; border-radius: 999px; white-space: nowrap; }
.pedago-annee-etat.is-cur { background: linear-gradient(135deg, var(--primary), var(--primary-lift)); color: #fff; }
.pedago-annee-etat.is-lock { background: #64748b; color: #fff; }
.pedago-annee-etat.is-futur { background: #94a3b8; color: #fff; }
.pedago-annee-etat.is-open { background: #b45309; color: #fff; }
.pedago-annee-tit { margin-left: auto; font-size: .8rem; color: var(--muted); }
/* Une année clôturée s'affiche en retrait : c'est une archive, pas la fiche vivante. */
.pedago-annee.is-cloturee { background: #fbfbfd; }
.pedago-verrou { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    margin: .6rem 0 .2rem; padding: .5rem .7rem; border-radius: 9px;
    background: var(--bg); border: 1px dashed var(--line); color: #475569; font-size: .82rem; }
.pedago-verrou.is-open { background: #fffbeb; border-color: #fde68a; color: #78350f; }

/* ── Onglet Pédagogie : respiration entre les cadres ──────────────────────────
   `.card` n'a AUCUNE marge par défaut : sans ces règles, les panneaux d'année,
   la carte Entretiens et la carte Documents se touchent. */
.pedago-annee { margin-bottom: 1rem; }
.pedago-barre + .pedago-annee { margin-top: .2rem; }
.pedago-annee + .card,
.pedago-annee ~ .card + .card { margin-top: 1.6rem; }

/* ── Disposition des données de suivi, reprise de l'app de Pauline ───────────
   Ligne 1 = les dispositifs ; ligne 2 = maintien et avancement, chacun dans son
   bloc bordé. Même structure en lecture et dans le drawer d'édition. */
.pedago-l1 { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.maintien-avancement { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .9rem; }
.disp-bloc { flex: 1 1 260px; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
    padding: .6rem .8rem; }
.disp-bloc.is-on { border-color: var(--primary); background: var(--primary-soft); }
.disp-bloc-lib { font-weight: 700; font-size: .88rem; }
.disp-bloc-detail { display: block; margin-top: .15rem; font-size: .8rem; color: var(--muted); }
.disp-menus { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: .5rem; }
.disp-menus[hidden] { display: none; }
.disp-menus .field-edit { flex: 1 1 130px; min-width: 0; }

/* Aménagements : une catégorie repliable, compteur en pastille à droite (motif PL). */
.amenagements { display: flex; flex-direction: column; gap: .35rem; }
.amen-cat { border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; }
.amen-cat > summary { cursor: pointer; padding: .4rem .6rem; font-weight: 600; font-size: .85rem;
    list-style: none; display: flex; align-items: center; gap: .45rem; }
.amen-cat > summary::-webkit-details-marker { display: none; }
.amen-cat > summary::before { content: '▸'; font-size: .75rem; color: var(--muted); transition: transform .15s; }
.amen-cat[open] > summary::before { transform: rotate(90deg); }
.amen-cat[open] > summary { background: var(--primary-soft); }
.amen-cat .pill { margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--primary);
    color: #fff; border-radius: 1rem; padding: .05rem .45rem; }
.amen-items { display: flex; flex-direction: column; gap: .3rem; padding: .4rem .7rem .6rem 1.5rem; }
.amen-check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .85rem;
    line-height: 1.25; cursor: pointer; }
.amen-check input { margin: .15rem 0 0; flex: none; }
.amen-lu { font-size: .84rem; color: var(--ink); }
.amen-block[hidden] { display: none; }
.pedago-amg-lecture { margin-bottom: .9rem; }

/* Zones de texte du suivi : WYSIWYG dans le drawer, HTML rendu en lecture.
   Plus HAUTES que les anciens textarea (rows=3) — on y écrit de vrais paragraphes. */
.pedago-zone-edit { margin-bottom: .2rem; }
/* Barre d'outils FLOTTANTE : elle suit le défilement du panneau au lieu de filer
   vers le haut. `.mail-format-bar` est déjà en `position:sticky`, mais dans le
   composer mail elle se cale sur `.mail-editor`, qui est lui-même la zone de
   défilement. Ici c'est le DRAWER qui défile : on retire donc le défilement de
   l'éditeur pour que le sticky se résolve contre `.disc-drawer-body`. */
.pedago-editeur { margin: .25rem 0 0; overflow: visible; }
.pedago-editeur .mail-format-bar { z-index: 5; box-shadow: 0 2px 6px rgba(20, 26, 46, .07); }
/* Outils REPLIABLES : la barre est masquée, une petite pastille « Aa » la déplie.
   Sur une page qui empile 4 zones, une barre permanente au-dessus de chacune
   saturait l'écran. Le composer mail n'est pas concerné (opt-in par data-outils). */
.mail-fb-toggle { position: absolute; top: .3rem; right: .4rem; z-index: 6;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 24px; padding: 0 .4rem;
    border: 1px solid var(--line); border-radius: 7px; background: var(--card);
    color: var(--muted); font: 700 .78rem/1 var(--sans, inherit); cursor: pointer;
    opacity: .55; transition: opacity .12s, color .12s, border-color .12s; }
.pedago-zone-edit { position: relative; }
.pedago-zone-edit:hover .mail-fb-toggle, .mail-fb-toggle:focus-visible { opacity: 1; }
.mail-fb-toggle:hover { color: var(--primary-dark); border-color: var(--primary); opacity: 1; }
.mail-fb-toggle.is-on { opacity: 1; color: #fff; background: var(--primary); border-color: var(--primary); }
.mail-format-bar[hidden] { display: none; }
.pedago-editeur .ProseMirror { min-height: 150px; font-size: .92rem; }
/* Compte-rendu d'entretien : un vrai texte, pas une note — zone nettement plus haute. */
.pedago-zone-haute .pedago-editeur .ProseMirror { min-height: 320px; }
/* ⚠️ `.disc-zone` est en `white-space: pre-line`, hérité du temps où ces champs
   étaient du texte brut. Le contenu étant devenu du HTML, les retours à la ligne
   d'INDENTATION du gabarit se voyaient — d'où le grand blanc entre le titre et le
   texte. On repasse en `normal` : les sauts viennent désormais du balisage. */
.pedago-zone { white-space: normal; padding: 10px 12px; }
/* Titre mis en évidence, même traitement que « Aménagements raisonnables »
   (.pedago-cat-titre) : violet foncé et lisible, au lieu du gris minuscule en
   capitales. Le picto est DÉCORATIF — aria-hidden côté gabarit.
   ⚠️ Sélecteur porté à `.disc-zone > b…` : `.disc-zone > b` (0,1,1) l'emportait sur
   la simple classe (0,1,0) et le titre restait gris. */
.disc-zone > b.pedago-zone-titre { display: flex; align-items: center; gap: .35rem;
    margin: 0 0 .55rem; font-size: .84rem; font-weight: 700; letter-spacing: 0;
    text-transform: none; color: #40378f; }
.disc-zone > b.pedago-zone-titre span { font-size: .95em; opacity: .9; }
.pedago-zone-lu { font-size: .88rem; line-height: 1.5; }
/* Les marges du premier/dernier bloc doubleraient l'espace du cadre. */
.pedago-zone-lu > :first-child { margin-top: 0; }
.pedago-zone-lu > :last-child { margin-bottom: 0; }
.pedago-zone-lu p { margin: .2em 0; }
.pedago-zone-lu ul, .pedago-zone-lu ol { margin: .2em 0; padding-left: 1.2rem; }
.pedago-zone-lu blockquote { margin: .3em 0; padding-left: .6rem; border-left: 3px solid var(--line); color: var(--muted); }

/* Convention des formulaires du dossier élève : UN SEUL bouton d'enregistrement,
   vert, aligné à GAUCHE. Pas d'« Annuler » — la croix, l'Échap et le clic hors du
   panneau ferment déjà, et un second bouton concurrence l'action réelle.
   (.disc-drawer-foot aligne déjà à gauche : rien à y ajouter.) */
.pedago-form-actions { display: flex; justify-content: flex-start; margin-top: 1rem; }

/* Phrase d'orientation de la carte Documents (formats acceptés, taille max). */
.pedago-doc-aide { margin: -.4rem 0 .7rem; font-size: .82rem; color: var(--muted); }

/* ── Entretiens : une LIGNE par entretien, le fil conducteur conservé ────────
   Date · objet · auteur · actions. Le compte-rendu ne s'étale plus dans la liste :
   il s'ouvre dans le panneau latéral, en lecture. */
/* GRILLE INVISIBLE : colonnes de largeur fixe, alignées d'une ligne à l'autre, et
   `justify-content: start` — l'espace restant va TOUT À DROITE au lieu d'écarter la
   date de l'œil aux deux bouts de la carte. */
/* ⚠️ `padding` REDÉCLARÉ en entier : la valeur héritée de `.disc-timeline-item`
   (`0 0 1rem 1.1rem`) porte le retrait qui écarte la ligne du trait vertical —
   l'écraser par un `padding: .4rem 0` collait le texte sur le fil. */
.pedago-ent-item { display: grid; justify-content: start; align-items: center;
    grid-template-columns: 6.5rem minmax(0, 26rem) minmax(0, 13rem) auto;
    gap: .25rem 1.1rem; padding: .35rem 0 .35rem 1.1rem; }
/* La pastille du fil était calée sur `top: .3rem`, pensé pour l'ancien bloc
   multi-lignes dont la date était la 1re ligne. La ligne étant désormais une grille
   centrée, on centre la pastille : elle s'aligne alors sur la date. */
.pedago-ent-item::before { top: 50%; transform: translateY(-50%); }
.pedago-ent-date { font-size: .82rem; font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums; }
.pedago-ent-objet { min-width: 0; font-weight: 650; font-size: .9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedago-ent-auteur { display: inline-flex; align-items: center; gap: .35rem; min-width: 0;
    font-size: .82rem; color: var(--muted); }
.pedago-ent-auteur > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedago-ent-actions { display: inline-flex; align-items: center; gap: .2rem; }
/* Écran étroit : la grille se resserre, l'objet garde la priorité. */
@media (max-width: 760px) {
    .pedago-ent-item { grid-template-columns: 5.6rem minmax(0, 1fr) auto; }
    .pedago-ent-auteur { display: none; }
}

/* Détail d'un entretien : VERROUILLÉ à l'ouverture, l'édition est un geste
   explicite. La bascule est visuelle ; la garde réelle est côté serveur. */
.pedago-ent-detail .ent-ed { display: none; }
.pedago-ent-detail.is-edit .ent-ed { display: revert; }
.pedago-ent-detail.is-edit .ent-ro { display: none; }
.pedago-ent-verrou { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    margin: 0 0 .9rem; padding: .5rem .7rem; border-radius: 9px; background: var(--bg);
    border: 1px dashed var(--line); color: #475569; font-size: .82rem; }
.ent-meta { display: grid; gap: .5rem 1.2rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 0 0 .9rem; }
.ent-meta dt { font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); }
.ent-meta dd { margin: .1rem 0 0; font-weight: 600; font-size: .88rem;
    display: flex; align-items: center; gap: .35rem; }

/* Documents (bilans, rapports…) : GRID INVISIBLE calqué sur la liste des entretiens —
   colonnes alignées, aucune bordure. La régularité suffit à faire lire la liste ; les
   filets de l'ancienne version hachaient la carte sans rien ajouter. */
.pedago-doc-liste { list-style: none; margin: .2rem 0 0; padding: 0; }
.pedago-doc-item { display: grid; justify-content: start; align-items: center;
    grid-template-columns: 6.5rem minmax(0, 26rem) minmax(0, 13rem) auto;
    gap: .25rem 1.1rem; padding: .35rem 0; }
.pedago-doc-item + .pedago-doc-item { border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.pedago-doc-date { font-size: .82rem; font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums; }
.pedago-doc-nom { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; font-size: .9rem; }
.pedago-doc-ico { flex: none; line-height: 1; }
/* Seul le LIBELLÉ se tronque : la catégorie et la taille sont courtes et doivent rester
   entières (une taille coupée ne veut plus rien dire). */
.pedago-doc-lib { min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedago-doc-taille { flex: none; font-size: .78rem; font-variant-numeric: tabular-nums; }
.pedago-doc-auteur { display: inline-flex; align-items: center; gap: .35rem; min-width: 0;
    font-size: .82rem; color: var(--muted); }
.pedago-doc-auteur > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedago-doc-actions { display: inline-flex; align-items: center; gap: .2rem; }
@media (max-width: 760px) {
    .pedago-doc-item { grid-template-columns: 5.6rem minmax(0, 1fr) auto; }
    .pedago-doc-auteur, .pedago-doc-taille { display: none; }
}

/* ---------- Édition en place (crayon) : réutilise TEL QUEL le système générique
   .eleve-edit/.ee-read/.ee-edit/.ee-statut du bloc « Fiche élève — édition en place »
   ci-dessus (aucune classe inventée pour le read/edit toggle lui-même) — uniquement la
   mise en page propre aux champs de la fiche pédagogique. ---------- */

/* Cases dispositifs + sous-blocs maintien/avancement : ligne flex qui wrap. Spécificité
   à 3 classes, IDENTIQUE à `.eleve-edit.is-editing .ee-edit` (display:block générique) —
   gagne par ordre de cascade (cette règle est plus bas dans le fichier). */
.eleve-edit.is-editing .pedago-disp-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; margin: 10px 0; }
.pedago-sub-select { flex-basis: 100%; display: flex; gap: .5rem; margin: -.3rem 0 .4rem 1.7rem; }
.pedago-sub-select select { max-width: 220px; }
.pedago-sub-select[hidden] { display: none; } /* sinon display:flex masque l'attribut hidden (motif .cps-reply) */

/* Bloc « Aménagements raisonnables » en édition (.pedago-amg.ee-edit) : même piège que
   .cps-reply/.pedago-sub-select ci-dessus — la règle auteur `.eleve-edit.is-editing .ee-edit
   { display: block }` (générique, ci-dessus) bat la règle user-agent [hidden]{display:none}
   à spécificité égale/inférieure quel que soit l'attribut `hidden` posé par le template
   quand `fiche.ar` est faux. Sans ce correctif, le catalogue des 28 aménagements s'affiche
   dès qu'on entre en édition même sur une fiche sans AR (et les cases cochées y sont
   silencieusement jetées par PedagogieService::majFiche, qui vide amenagements si ar=false). */
.eleve-edit.is-editing .ee-edit[hidden] { display: none; }

/* Catalogue d'aménagements en édition : accordéon de cases par catégorie (le violet/gras
   du résumé vient de la règle héritée `.pedago-amg summary` ci-dessus). */
.pedago-cat-titre { margin: 0 0 6px; font-weight: 700; font-size: .8rem; color: #40378f; }
.pedago-cat-group { margin: 2px 0; }
.pedago-amg-item { padding: 2px 0 2px 14px; font-size: .78rem; }

@media (max-width: 900px) {
    .disc-detail-grid { grid-template-columns: 1fr; }
    .pedago-zones { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Aide des modules (App\Aide) — documents empilés et centrés, puis la FAQ.
   Les classes vivent ICI et jamais dans un <style> de gabarit : la page peut
   être rendue pour plusieurs modules, le style serait dupliqué.
   --------------------------------------------------------------------------- */
.aide-doc, .aide-faq { max-width: 900px; margin-inline: auto; }

/* `.card` n'a AUCUNE marge dans ce projet : sans ça les cartes se touchent. */
.aide-doc { margin-bottom: 1.1rem; }

/* Même en-tête de carte que la Discipline : titre à gauche, actions repoussées
   à droite. On ne réutilise pas les classes `disc-*`, réservées au dossier élève. */
.aide-doc .card-title,
.aide-faq .card-title { display: flex; align-items: center; gap: .5rem; color: #40378f; font-size: .95rem; }
.aide-doc-actions { margin-left: auto; display: flex; gap: .4rem; }

/* CONSULTATION SEULE : les pages du PDF sont dessinées par PDF.js et empilées. Aucune
   hauteur imposée — on déroule les pages, c'est `.content` qui défile (body.app-fit).
   Pas de cadre sombre, pas de barre d'outils : il n'y a plus de visualiseur natif. */
.aide-doc-pages { display: flex; flex-direction: column; gap: .8rem; }

.aide-doc-page {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 36, 64, .06);
}

.aide-doc-pages.is-chargement { min-height: 120px; }
.aide-doc-pages.is-chargement::after {
    content: "Chargement du document…";
    color: var(--muted);
    font-size: .9rem;
}
.aide-doc-pages.is-erreur { color: var(--muted); font-size: .9rem; }

/* Document déposé en IMAGE (capture d'écran PNG…) : même présentation qu'une page de PDF,
   pleine largeur de la carte. `height:auto` préserve les proportions sur mobile. */
.aide-doc-image {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 36, 64, .06);
}

.aide-faq-item { border-top: 1px solid var(--line); padding: .55rem 0; }
.aide-faq-item:first-of-type { border-top: 0; }
.aide-faq-item > summary { cursor: pointer; font-weight: 600; }
.aide-faq-reponse { padding: .45rem 0 .2rem; }
.aide-faq-reponse p:last-child { margin-bottom: 0; }

/* Titre de la section FAQ, HORS de la carte : les utilisateurs doivent voir d'un coup
   d'œil que ce qui suit les documents est une foire aux questions. */
.aide-faq-titre {
    max-width: 900px;
    margin: 1.6rem auto .6rem;
    font-size: 1.25rem;
}

/* Rien à masquer sur téléphone : les pages sont des images, elles s'y affichent
   exactement comme sur grand écran (c'était tout l'intérêt d'abandonner l'<iframe>). */

/* Import d'une FAQ par collage : la zone reçoit un document entier, pas une réponse —
   elle a donc besoin de bien plus de hauteur qu'un champ ordinaire. */
.aide-import-zone { min-height: 220px; }
.aide-import-liste { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.aide-import-liste li { margin-bottom: .3rem; }

/* Intertitre de la FAQ : sépare les sections d'un document d'aide (« Faire l'appel »,
   « Absences »…). Sans lui, soixante questions s'empilent sans repère. */
.aide-faq-section {
    margin: 1.1rem 0 .3rem;
    font-family: "Baloo 2", sans-serif;
    font-size: 1rem;
    color: #40378f;
}
.aide-faq-section:first-of-type { margin-top: .2rem; }

/* ═══ Export APP100 — écran de pilotage « À traiter / Le registre » (préfixe a1-) ════════════
   Refonte 2026-08-14 : l'écran s'était empilé par itérations (5 KPIs, file par élève de ~2 000
   lignes, section hors-fenêtre, liste des lots) et deux tableaux jumeaux décrivaient le même
   jour avec deux vocabulaires. Il porte désormais DEUX temps : « À traiter » = un mur de CAS
   (une carte = un geste, écrite en français) ; « Le registre » = la consultation exhaustive.
   Template + CSS seulement : assembleurs, jetons, routes et endpoint live sont inchangés. */

/* Palette : sous cette racine, les badges du module parlent la langue de Présences (.etat-*)
   au lieu de celle des jobs d'import. On cible `data-etat` (posé par le gabarit) et NON les
   classes rendues par PHP — le repeint live efface l'attribut, la classe du serveur reprend
   alors la main : jamais un badge « Transmis » peint aux couleurs de « À envoyer ». */
.a1-app100 .badge[data-etat="appels_non_valides"] { background: #eef1f5; color: #64748b; }
.a1-app100 .badge[data-etat="a_envoyer"],
.a1-app100 .badge[data-etat="susp_a_transmettre"] { background: #fef3c7; color: #92400e; }
.a1-app100 .badge[data-etat="en_cours"]           { background: #eae7ff; color: #5b3fd6; }
.a1-app100 .badge[data-etat="transmis"],
.a1-app100 .badge[data-etat="susp_transmise"],
.a1-app100 .badge[data-etat="suppr_transmise"]    { background: #dcfce7; color: #166534; }
.a1-app100 .badge[data-etat="correction"]         { background: #e0f2fe; color: #0369a1; }
.a1-app100 .badge[data-etat="echec"]              { background: #fee2e2; color: #b91c1c; }
.a1-app100 .badge[data-etat="bloquee"]            { background: #fce7f3; color: #9d174d; }

/* Les deux temps de l'écran. Ce sont des LIENS (?vue=) : l'onglet survit au rechargement
   qui suit chaque envoi, et le registre reste partageable par son URL. */
   Le contrôle est le SEGMENTÉ de l'app (`.seg` / `.seg-btn`) : l'ancien jeu `.a1-tab` en était
   un double, d'où sa dérive de couleurs. Il ne reste ici que la marge du bloc, le fait que les
   segments sont des liens (donc sans soulignement) et la pastille de comptage. */
.a1-segment { margin: 0 0 1.1rem; }
.a1-segment .seg-btn { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.a1-tab-n {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem;
    border-radius: 999px; background: var(--primary); color: #fff; font-size: .78rem;
}
.seg-btn:not(.is-active) .a1-tab-n { background: var(--muted); }

/* Rien à faire : l'écran doit le DIRE, sinon il a l'air aussi chargé qu'un jour de panne. */
.a1-ok {
    display: flex; align-items: center; gap: 1rem;
    background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--ok);
    border-radius: var(--radius); padding: 1.1rem 1.3rem;
}
.a1-ok-ic { font-size: 2rem; line-height: 1; }

/* Filtres du mur de cartes : radios masquées + règles ~ . Aucun JS, aucun aller-retour, et
   l'état se voit dans la tuile allumée. Une tuile à zéro n'est pas un label (rien à filtrer). */
.a1-f { position: absolute; opacity: 0; pointer-events: none; }
.a1-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.a1-kpi {
    display: block; border: 1px solid var(--line); border-radius: 14px; padding: .75rem .9rem;
    background: var(--card); cursor: pointer; transition: border-color .14s, box-shadow .14s;
}
.a1-kpi.is-vide { cursor: default; opacity: .6; }
.a1-kpi:not(.is-vide):hover { border-color: var(--primary); }
.a1-n { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.7rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.a1-l { display: block; color: var(--muted); font-size: .82rem; }
.a1-kpi.is-echec .a1-n { color: #b91c1c; }
.a1-kpi.is-bloque .a1-n { color: #9d174d; }
/* La tuile n'est qu'un label : c'est la case radio, invisible, qui reçoit le focus clavier —
   on reporte donc l'anneau sur SA tuile (une règle par filtre, comme pour :checked). */
#a1f-tout:focus-visible   ~ .a1-kpis [for="a1f-tout"],
#a1f-envoi:focus-visible  ~ .a1-kpis [for="a1f-envoi"],
#a1f-renvoi:focus-visible ~ .a1-kpis [for="a1f-renvoi"],
#a1f-echec:focus-visible  ~ .a1-kpis [for="a1f-echec"],
#a1f-bloque:focus-visible ~ .a1-kpis [for="a1f-bloque"] { outline: 2px solid var(--primary); outline-offset: 2px; }
#a1f-tout:checked   ~ .a1-kpis [for="a1f-tout"],
#a1f-envoi:checked  ~ .a1-kpis [for="a1f-envoi"],
#a1f-renvoi:checked ~ .a1-kpis [for="a1f-renvoi"],
#a1f-echec:checked  ~ .a1-kpis [for="a1f-echec"],
#a1f-bloque:checked ~ .a1-kpis [for="a1f-bloque"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#a1f-envoi:checked  ~ .a1-cards .a1-cas:not([data-cat="envoi"]),
#a1f-renvoi:checked ~ .a1-cards .a1-cas:not([data-cat="renvoi"]),
#a1f-echec:checked  ~ .a1-cards .a1-cas:not([data-cat="echec"]),
#a1f-bloque:checked ~ .a1-cards .a1-cas:not([data-cat="bloque"]) { display: none; }

/* Le mur de cas. Une carte = un problème + sa phrase + son bouton ; la couleur du liseré
   redit la famille déjà donnée par le picto du titre (jamais la couleur seule). */
.a1-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: .9rem; align-items: start; }
.a1-cas {
    display: flex; flex-direction: column; gap: .5rem;
    background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--muted);
    border-radius: var(--radius-sm); padding: .95rem 1.05rem;
}
.a1-cas.is-echec  { border-left-color: #b91c1c; }
.a1-cas.is-bloque { border-left-color: #9d174d; }
.a1-cas.is-renvoi { border-left-color: #0369a1; }
.a1-cas.is-envoi  { border-left-color: #f59e0b; }
.a1-cas-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.a1-cas-head h3 { margin: 0; font-size: .98rem; font-weight: 800; line-height: 1.3; text-wrap: balance; }
.a1-badge-lien { text-decoration: none; }
.a1-cas-ou { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.a1-delai { font-weight: 600; }
.a1-cas-dit { font-size: .88rem; }
.a1-cas-dit p { margin: 0 0 .4rem; }
.a1-cas-dit p:last-child { margin-bottom: 0; }
.a1-warn { color: #92400e; }
.a1-eleves { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .86rem; }
.a1-eleves li { margin-bottom: .2rem; }
.a1-cas-act { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: auto; padding-top: .2rem; }
.a1-cas-oeil { margin-left: auto; }
.a1-hint { font-size: .78rem; }
/* Aboutissement en direct : la carte ne disparaît pas toute seule (on ne retire jamais un
   nœud sous la souris) — elle se grise et invite à actualiser. */
.a1-cas.is-fini { opacity: .6; }
.a1-fini { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.a1-fini[hidden] { display: none; }

/* Pied : ce qui vit sans nous (appels pas encore validés, envois en vol). */
.a1-pied { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); font-size: .85rem; }

/* Hors fenêtre : c'est du droit FWB, pas du pilotage — replié par défaut. */
.a1-hf { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem 1rem; }
.a1-hf summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
.a1-hf p { font-size: .85rem; }
.a1-hf-jour { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 .2rem; }

/* Le registre. `a1-raison` sert AUSSI aux pages de communication (suspensions, justificatifs) :
   sa place est ici, pas dans un <style> de gabarit. */
.a1-reg-note { font-size: .85rem; margin: 0 0 .7rem; }
.a1-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.a1-raison { display: block; color: var(--muted); font-size: .82rem; }
/* Registre : signal d'anomalie réduit à un pictogramme, pour que la ligne tienne sur UNE
   hauteur. Ce qu'il annonce se lit derrière l'œil (et en infobulle au survol). */
.a1-flag { margin-left: .3rem; cursor: help; }
/* Colonnes d'ACTION du registre : une par picto (œil, puis rejouer/envoyer). Deux colonnes et
   non une seule — c'est ce qui aligne les œils d'une ligne à l'autre, même quand il n'y a rien
   à rejouer. `table-layout:fixed` (disc-table) fige la largeur, le centrage fait le reste. */
.a1-col-ic { text-align: center; white-space: nowrap; overflow: visible; }
.a1-col-ic form { display: inline; margin: 0; }
/* Grille des tentatives (page de détail) : la ligne dont on lit le contenu plus bas. Le
   liseré porte l'information — une simple teinte se confondrait avec le survol. */
.a1-tent-grid tr.is-vue > td { background: var(--primary-soft); }
.a1-tent-grid tr.is-vue > td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
/* Unité APP100 au fil du texte, à côté de la pastille d'implantation : ce n'est PAS un badge
   (elle ne porte aucun état), juste la précision « unité 1 (primaire) » sur la même ligne.
   Le conteneur est `.cell-name` (flex) — cf. gabarit. */
.a1-unite { color: var(--muted); font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ── Détail d'une transmission : méta à gauche, élèves à droite (même partition que la fiche
   justificatif). Les blocs « Communication » avaient leurs styles en `style=` inline dans le
   gabarit : ramenés ici. ── */
.a1-detail { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .a1-detail { grid-template-columns: 1fr; } }
.a1-req { font-size: .82rem; font-weight: 500; color: var(--muted); word-break: break-all; }
.a1-rapport { margin-top: .8rem; }
.a1-rapport summary { cursor: pointer; }
.a1-tent { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .6rem; }
.a1-tent-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.a1-tent-err { margin-top: .4rem; }
.a1-tent-err summary { cursor: pointer; }
.a1-tent-json { max-height: 320px; overflow: auto; font-size: .78rem; }

/* Liste clé/valeur d'une page de détail. Née dans la fiche justificatif (où elle vivait en
   <style> local), PARTAGÉE depuis avec le détail d'une transmission APP100 → promue ici pour
   qu'il n'y ait qu'une définition. Les surcharges d'ÉDITION EN PLACE restent locales à la
   fiche justificatif (son <style> est rendu après cette feuille, il gagne). */
.pj-dl { display: flex; flex-direction: column; gap: 0; }
.pj-dl > div { display: flex; gap: .8rem; padding: .55rem 0; border-top: 1px solid #eef2f7; }
.pj-dl > div:first-child { border-top: 0; }
.pj-dl dt { flex: 0 0 42%; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.pj-dl dd { flex: 1; margin: 0; font-weight: 600; }
