/*
 * L'habillage de l'administration du socle : barre latérale sombre, contenu clair,
 * mesures (tailles, rayons, gris, ombres) communes à tous les écrans.
 *
 * LES COULEURS SONT DES JETONS, jamais écrites en dur : `--accent`, `--sidebar-bg`… ont
 * ici leur valeur de charte, et l'instance les surcharge par la balise que pose
 * `theme_css()` APRÈS cette feuille (atelier d'apparence). Une teinte dérivée de
 * l'accent s'écrit `rgba(var(--accent-rgb), .08)` : elle suit le jeton quand il change,
 * là où une teinte écrite en dur resterait l'ancienne couleur sur tous les survols dès
 * que l'instance change d'accent. PAS `color-mix()` : la capture d'écran des
 * retours (html2canvas) ne la lit pas, et échouait sur toutes les pages.
 */
:root {
    /* Jetons de la charte (surchargés par l'instance, voir App\Apparence\Theme). */
    --accent: #f16314;
    /* L'accent en composantes, pour ses teintes transparentes (voir plus haut). */
    --accent-rgb: 241, 99, 20;
    --accent-strong: #c9540f;
    --accent-contrast: #0b0b0d;
    --sidebar-bg: #0b0b0d;
    --sidebar-fg: #d7d3ca;
    --text: #0b0b0d;
    --panel-bg: #f0eee9;

    /* Ce qui ne se règle pas : les gris de structure et les états. */
    --surface: #ffffff;
    --bord: #eeeeee;
    --bord-champ: #e0e0e0;
    --texte-doux: #888888;
    --texte-moyen: #555555;
    --succes: #16a34a;
    --succes-fond: #f0fdf4;
    --erreur: #dc2626;
    --erreur-fond: #fef2f2;
    --erreur-bord: #fecaca;
    /* Les deux autres états d'un message (toasts) : un avertissement, et une information
       en cours — un envoi, par exemple —, volontairement plus sobre que les trois
       états qui annoncent un résultat. */
    --avertissement: #f59e0b;
    --info: #334155;
    /* Ceux du vocabulaire des écrans (voir « Vocabulaire des écrans », plus bas) : le
       bleu des titres de bloc, et l'encadré d'information (« un lien sera envoyé… »). */
    --titre-bloc: #1183d7;
    --note-fond: #f0f9ff;
    --note-bord: #bae6fd;
    --note-texte: #075985;
    --rayon: 8px;
    --largeur-barre: 230px;

    /* Les noms d'avant, gardés pour ce qui s'en sert encore (extensions). */
    --texte: var(--text);
    --fond: var(--surface);
    --accent-texte: var(--accent-contrast);
    --barre: var(--sidebar-bg);
    --barre-texte: var(--sidebar-fg);
    color-scheme: light;

    /* LA FORME DES CONTRÔLES (boutons, champs) : des jetons aussi. Le socle établit la
       base ; une extension la surcharge dans sa feuille d'habillage (« habillage » de son
       manifeste) — Peas'Up y fixe des boutons en pilule (docs/apparence.md). */
    --btn-hauteur: 36px;
    --btn-hauteur-petit: 30px;
    --btn-rayon: 8px;
    --btn-espace: 1.1rem;
    --btn-espace-petit: .6rem;
    --btn-graisse: 500;
    --btn-graisse-principal: 600;
    --btn-taille: .85rem;
    --btn-police: inherit;
    --champ-rayon: 8px;
}

/* `hidden` masque, partout : toute règle qui pose un `display` l'emporterait sinon sur
   l'attribut, et un élément que le code masque resterait affiché (sur des boutons et
   des pastilles, typiquement). */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
}

a { color: var(--accent-strong); }
a:hover { color: var(--accent); }

/* ── Barre latérale ────────────────────────────────────────────────────────── */

.barre {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--largeur-barre);
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
}
.barre .marque { display: block; padding: 1.25rem 1rem .75rem; flex-shrink: 0; }
.barre .marque img { display: block; max-width: 140px; max-height: 48px; height: auto; }

.barre nav {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.barre nav a,
.barre .compte .notifications {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    margin: 1px .5rem;
    border-radius: 8px;
    color: var(--sidebar-fg);
    font-size: .88rem;
    text-decoration: none;
    transition: all .15s;
}
.barre nav a i,
.barre .compte .notifications i { width: 20px; text-align: center; font-size: .9rem; flex-shrink: 0; }
/* POURQUOI LE TEXTE NE PREND PLUS L'ACCENT ICI. Ces états s'écrivaient en
   `--accent` sur `--sidebar-bg` : lisible tant que l'accent est vif (l'orange
   d'origine donnait 6,1:1 sur la barre noire), illisible dès qu'une instance
   choisit un accent sombre — le rouge de LMIF y tombait à 2,5:1, et sur une barre
   bordeaux il devient du rouge sur du rouge. Le texte garde donc l'encre de la
   barre, qui se lit sur n'importe quel fond ; l'état se marque par le fond teinté
   et, pour l'entrée active, par la graisse. Le fond actif est monté à 22 % : à
   12 %, il ne pesait que 0,6 point de luminance sur du bordeaux, on ne le voyait
   pas. */
.barre nav a:hover,
.barre .compte .notifications:hover { background: rgba(var(--accent-rgb), 0.10); }
.barre nav a.actif,
.barre .compte .notifications.actif { background: rgba(var(--accent-rgb), 0.22); font-weight: 600; }
.barre nav .groupe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1.25rem .35rem;
    background: none;
    border: 0;
    font: inherit;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    /* L'encre de la barre plutôt que l'accent, pour la même raison ; l'opacité la
       garde discrète sans la rendre illisible (6,5:1 sur le bordeaux). */
    color: var(--sidebar-fg);
    opacity: .7;
    cursor: pointer;
    text-align: left;
}
.barre nav .groupe i { font-size: .6rem; opacity: .65; transition: transform .15s; }
.barre nav .rubrique.repliee .groupe i { transform: rotate(-90deg); }
.barre nav .rubrique.repliee .rubrique-entrees { display: none; }
.barre nav a .externe { margin-left: auto; width: auto; font-size: .65rem; opacity: .5; }

/* Un sous-menu : une entrée qui ouvre un panneau à côté de la barre (barre.js). */
.barre .sousmenu-ouvrir {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: calc(100% - 1rem);
    margin: 1px .5rem;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-fg);
    font: inherit;
    font-size: .88rem;
    text-align: left;
    cursor: pointer;
    transition: all .15s;
}
.barre .sousmenu-ouvrir > i:first-child { width: 20px; text-align: center; font-size: .9rem; flex-shrink: 0; }
.barre .sousmenu-ouvrir .caret { margin-left: auto; font-size: .62rem; opacity: .6; }
.barre .sousmenu-ouvrir:hover, .barre .sousmenu-ouvrir[aria-expanded="true"] { background: rgba(var(--accent-rgb), .10); }
.barre .sousmenu.actif > .sousmenu-ouvrir { background: rgba(var(--accent-rgb), .22); font-weight: 600; }
.sousmenu-panneau-flottant {
    position: fixed;
    z-index: 1200;
    min-width: 210px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: .4rem;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.sousmenu-titre { font-size: .68rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); padding: .35rem .65rem .45rem; }
.sousmenu-panneau-flottant a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    margin: 1px 0;
    border-radius: 7px;
    color: var(--sidebar-fg);
    font-size: .86rem;
    text-decoration: none;
}
.sousmenu-panneau-flottant a i { width: 18px; text-align: center; font-size: .85rem; flex-shrink: 0; }
.sousmenu-panneau-flottant a:hover, .sousmenu-panneau-flottant a:focus-visible { color: var(--accent); background: rgba(var(--accent-rgb), .1); outline: none; }
.sousmenu-panneau-flottant a.actif { color: var(--accent); background: rgba(var(--accent-rgb), .14); }
.sousmenu-panneau-flottant a .externe { margin-left: auto; width: auto; font-size: .65rem; opacity: .5; }

/* Le compte, en bas de la barre. */
/* Les espaces des extensions : on y passe depuis le bas de la barre. */
.barre .compte .espaces { display: flex; flex-direction: column; padding: 0 .5rem .35rem; }
.barre .compte .espaces a { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-radius: 8px; color: var(--sidebar-fg); text-decoration: none; font-size: .85rem; }
.barre .compte .espaces a:hover { background: rgba(var(--accent-rgb), 0.10); }
.barre .compte .espaces i { width: 20px; text-align: center; font-size: .9rem; }
.barre .compte .espaces .sortant { width: auto; margin-left: auto; font-size: .65rem; opacity: .6; }
.barre .compte { flex-shrink: 0; border-top: 1px solid rgba(255, 255, 255, .08); padding: .5rem 0 .75rem; }
.barre .compte .notifications .pastille { margin: 0 0 0 auto; background: var(--accent); color: var(--accent-contrast); }
.barre .moi { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem 0 1rem; }
.barre .avatar-lien { flex-shrink: 0; display: block; text-decoration: none; line-height: 0; }

/* La pastille d'un compte (twig `avatar()`) : sa photo, sinon ses initiales. */
.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.barre .qui { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--sidebar-fg); text-decoration: none; line-height: 1.25; }
.barre .qui strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre .qui small { font-size: .65rem; letter-spacing: .5px; text-transform: uppercase; opacity: .6; }
/* Même raison que plus haut : l'accent d'une instance peut être sombre, et il
   disparaîtrait sur la barre. Le survol se marque par le soulignement. */
.barre .qui:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.barre .moi form { margin: 0; }
.barre .sortie { background: none; border: 0; padding: .35rem; color: var(--sidebar-fg); opacity: .7; cursor: pointer; font-size: .9rem; }
.barre .sortie:hover { opacity: 1; }

/* ── Zone principale ───────────────────────────────────────────────────────── */

.principal {
    margin-left: var(--largeur-barre);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.contenu { flex: 1 0 auto; width: 100%; max-width: 1400px; padding: 2rem; }

.bandeau-emprunt {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 2rem;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: .88rem;
    font-weight: 600;
}
.bandeau-emprunt a { color: inherit; }
/* L'environnement (« Recette »), hors production : en tête de chaque écran. Couleur de
   l'avertissement, distincte de l'accent : il ne doit se confondre avec rien. */
.bandeau-environnement {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem 2rem;
    background: var(--avertissement);
    color: var(--text);
    font-size: .8rem;
    letter-spacing: .02em;
}
.bandeau-environnement strong { text-transform: uppercase; }
.bandeau-environnement span { opacity: .75; }
.page-seule .bandeau-environnement { position: fixed; inset: 0 0 auto 0; z-index: 50; justify-content: center; }

.pied {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 2rem;
    border-top: 1px solid var(--bord);
    font-size: .72rem;
    color: #aaa;
}
.pied img { height: 16px; width: auto; }
/* Les liens posés par les extensions (point `admin.pied_liens`). */
.pied .pied-sep { color: #ccc; }
.pied .pied-lien { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; padding: 0; font: inherit; font-size: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.pied .pied-lien:hover { color: var(--accent-strong); }

@media (max-width: 760px) {
    .barre { position: static; width: auto; }
    .barre nav { display: flex; flex-wrap: wrap; }
    .barre nav .groupe { display: none; }
    .principal { margin-left: 0; }
    .contenu { padding: 1rem; }
}

/* ── Titres ────────────────────────────────────────────────────────────────── */

h1 { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 0 0 1.5rem; display: flex; align-items: center; gap: .5rem; }
h1 > i { color: var(--accent); }
h2 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 1.75rem 0 .75rem; }
.carte > h2:first-child { margin-top: 0; }

.titre-page { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.titre-page h1 { margin: 0; }

/* ── Cartes, fiches, messages ──────────────────────────────────────────────── */

.carte {
    background: var(--surface);
    border: 1px solid var(--bord);
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.doux { color: var(--texte-doux); }

.flash {
    padding: .75rem 1rem;
    border-radius: var(--rayon);
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
}
.flash-success { background: var(--succes-fond); color: var(--succes); border-color: #bbf7d0; }
.flash-error { background: var(--erreur-fond); color: var(--erreur); border-color: var(--erreur-bord); }
.flash-warning, .flash-info { background: rgba(var(--accent-rgb), 0.08); color: var(--accent-strong); border-color: rgba(var(--accent-rgb), 0.25); }

dl.fiche { display: grid; grid-template-columns: 180px 1fr; gap: .6rem 1rem; margin: 0; font-size: .9rem; }
dl.fiche dt { font-size: .78rem; font-weight: 600; color: var(--texte-moyen); text-transform: uppercase; letter-spacing: .4px; padding-top: .1rem; }
dl.fiche dd { margin: 0; }

.pastille {
    display: inline-block;
    padding: .3rem .7rem;
    border-radius: 20px;
    background: #f3f3f3;
    color: #666;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 .25rem .25rem 0;
}

/* ── Tableaux ──────────────────────────────────────────────────────────────── */

table.liste {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--bord);
    border-radius: 12px;
    overflow: hidden;
}
table.liste th {
    padding: .85rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--texte-doux);
    background: var(--panel-bg);
    border-bottom: 2px solid var(--bord);
}
table.liste td {
    padding: .85rem 1rem;
    font-size: .88rem;
    color: #333;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}
table.liste tr:last-child td { border-bottom: 0; }
table.liste tbody tr { transition: background .15s; }
table.liste tbody tr:hover { background: rgba(var(--accent-rgb), 0.04); }
table.liste td a { color: var(--accent-strong); }

a.tri { color: inherit; text-decoration: none; }
a.tri.actif, a.tri:hover { color: var(--accent); }

/* ── Formulaires ───────────────────────────────────────────────────────────── */

.champ { margin-bottom: 1.15rem; }
.champ > label, .champ > legend {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--texte-moyen);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .35rem;
}
.champ .aide, .aide { font-size: .78rem; color: #aaa; margin-top: .3rem; }
.aide.erreur { color: var(--erreur); }

/* Le mode d'envoi des courriels (Réglages) : quatre cartes à cocher, puis le panneau
   des réglages du mode choisi. Le bouton radio est masqué mais reste le vrai champ :
   clavier, lecteur d'écran et envoi du formulaire passent par lui. */
.modes-envoi { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.modes-envoi legend { font-size: .78rem; font-weight: 600; color: var(--texte-moyen); text-transform: uppercase; letter-spacing: .4px; margin-bottom: .6rem; padding: 0; }
.modes-envoi-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; max-width: 760px; }
@media (max-width: 720px) { .modes-envoi-grille { grid-template-columns: 1fr; } }
.mode-envoi { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; background: var(--surface); border: 1.5px solid var(--bord-champ); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mode-envoi:hover { border-color: rgba(var(--accent-rgb), .55); box-shadow: 0 4px 14px rgba(0, 0, 0, .06); transform: translateY(-1px); }
.mode-envoi input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mode-envoi:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-envoi:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .05); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.mode-envoi-icone { flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--panel-bg); color: var(--texte-moyen); transition: background .15s, color .15s; }
.mode-envoi:has(input:checked) .mode-envoi-icone { background: var(--accent); color: var(--accent-contrast); }
.mode-envoi-texte { display: flex; flex-direction: column; gap: .25rem; min-width: 0; padding-right: 1.4rem; }
.mode-envoi-titre { font-weight: 600; font-size: .92rem; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.mode-envoi-desc { font-size: .8rem; line-height: 1.4; color: var(--texte-doux); }
.mode-envoi-badge { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: .12rem .45rem; border-radius: 999px; background: rgba(var(--accent-rgb), .12); color: var(--accent-strong); }
.mode-envoi-coche { position: absolute; top: .75rem; right: .8rem; color: var(--accent); font-size: 1.05rem; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.mode-envoi:has(input:checked) .mode-envoi-coche { opacity: 1; transform: none; }
.mode-envoi-aucun:has(input:checked) { border-color: var(--erreur); background: var(--erreur-fond); box-shadow: 0 0 0 3px var(--erreur-fond); }
.mode-envoi-aucun:has(input:checked) .mode-envoi-icone { background: var(--erreur); color: #fff; }
.mode-envoi-aucun:has(input:checked) .mode-envoi-coche { color: var(--erreur); }

.mode-panneau { max-width: 760px; margin: 0 0 1rem; padding: 1.1rem 1.25rem .35rem; background: var(--panel-bg); border-radius: 12px; }
.mode-panneau[hidden] { display: none; }
.mode-panneau-tete { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; color: var(--text); margin-bottom: .9rem; }
.mode-panneau-tete i { color: var(--accent); }
.mode-panneau-ligne { margin: 0 0 .85rem; font-size: .88rem; color: var(--texte-moyen); }
/* Plus précis que la règle générale des champs (420 px) : dans le panneau, un champ
   occupe sa colonne. */
.mode-panneau .champ input:not([type=checkbox]), .mode-panneau .champ select { max-width: none; background: var(--surface); }
.mode-panneau-alerte { background: var(--erreur-fond); border: 1px solid var(--erreur-bord); }
.mode-panneau-alerte .mode-panneau-tete i { color: var(--erreur); }
.mode-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1rem; }
.mode-grille .champ { min-width: 0; grid-column: span 2; }
.mode-grille .mode-large { grid-column: span 3; }
.mode-grille .mode-court { grid-column: span 1; }
.mode-grille .mode-plein { grid-column: 1 / -1; }
@media (max-width: 720px) { .mode-grille .champ, .mode-grille .mode-large, .mode-grille .mode-court { grid-column: 1 / -1; } }
.mode-puce { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; padding: .15rem .5rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--bord-champ); color: var(--text); }
.mode-etapes { margin: 0 0 .9rem; padding-left: 1.2rem; font-size: .82rem; color: var(--texte-moyen); line-height: 1.6; }
.secret-etat { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; font-size: .66rem; font-weight: 700; letter-spacing: .3px; background: var(--succes-fond); color: var(--succes); vertical-align: middle; }
.secret-etat.illisible { background: var(--erreur-fond); color: var(--erreur); }
.secret-effacer { margin-top: .45rem; font-size: .8rem; }
.secret-note { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--texte-doux); margin: 0 0 1.4rem; }
.secret-note i { color: var(--succes); }

/* L'œil d'un champ de mot de passe (réglage d'instance, public/js/oeil-mot-de-passe.js).
   L'enveloppe prend la largeur que le champ aurait eue — 420px, 320px dans les réglages,
   toute la largeur sur la connexion — et le champ la remplit : l'œil reste ainsi collé à
   son bord droit, quelle que soit la page. */
.champ-oeil { position: relative; display: block; width: 100%; max-width: 420px; }
.settings-section .champ-oeil { max-width: 320px; }
.panneau-connexion .champ-oeil { max-width: none; }
.champ-oeil > input { max-width: none !important; padding-right: 2.75rem !important; }
.champ-oeil .oeil {
    position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
    display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
    border: 0; border-radius: 6px; background: none; color: var(--texte-doux); cursor: pointer;
}
.champ-oeil .oeil:hover, .champ-oeil .oeil[aria-pressed="true"] { color: var(--accent-strong); }
.champ-oeil .oeil:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=url], input[type=tel], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%;
    max-width: 420px;
    padding: .6rem .85rem;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--bord-champ);
    border-radius: var(--champ-rayon);
    transition: border-color .2s, box-shadow .2s;
}
textarea { max-width: 640px; min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
input[readonly] { background: #f9f9f9; color: var(--texte-doux); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.case { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .4rem; font-size: .9rem; font-weight: normal; text-transform: none; letter-spacing: 0; color: var(--text); }
.champ > label.case { font-size: .9rem; font-weight: normal; text-transform: none; letter-spacing: 0; color: var(--text); }
/* LA BASCULE : un réglage oui/non (`<label class="case bascule">`, ou la classe sur la case
   seule, dans un tableau). Une case À COCHER reste pour choisir PLUSIEURS éléments d'une
   liste (rôles, droits, colonnes) et pour l'option d'un geste ponctuel (« effacer le mot de
   passe enregistré ») : elle ne dit pas un état, elle modifie ce que fait le bouton. Une vraie
   case sous le dessin — clavier, formulaire et `role="switch"` restent ceux du navigateur. */
.case.bascule { align-items: center; }
.bascule input[type="checkbox"], input[type="checkbox"].bascule {
    appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0;
    width: 2.25rem; height: 1.25rem; border-radius: 999px; background: var(--bord-champ);
    cursor: pointer; transition: background .15s; vertical-align: middle;
}
.bascule input[type="checkbox"]::before, input[type="checkbox"].bascule::before {
    content: ''; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 4px); height: calc(1.25rem - 4px);
    border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.bascule input[type="checkbox"]:checked, input[type="checkbox"].bascule:checked { background: var(--accent); }
.bascule input[type="checkbox"]:checked::before, input[type="checkbox"].bascule:checked::before { transform: translateX(1rem); }
.bascule input[type="checkbox"]:focus-visible, input[type="checkbox"].bascule:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bascule input[type="checkbox"]:disabled, input[type="checkbox"].bascule:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .bascule input[type="checkbox"], .bascule input[type="checkbox"]::before, input[type="checkbox"].bascule, input[type="checkbox"].bascule::before { transition: none; } }

/* ── Boutons ───────────────────────────────────────────────────────────────── */

.boutons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* LES BOUTONS : UNE SEULE DÉFINITION pour les deux familles du socle — `.btn` (le
   vocabulaire des écrans) et `.bouton` (la plus ancienne, gardée telle quelle dans les
   gabarits). Même forme, réglée par les jetons --btn-* :
     .btn            le bouton ordinaire (blanc, bordé)  = .bouton.second
     .btn-primary    l'action principale (l'accent)      = .bouton
     .btn-danger     le rouge pâle                        = .bouton.danger
     .btn-fantome    sans fond ni bord, pour les gestes discrets
     .btn-lien       un lien qui agit                     = .bouton.lien
     .btn-sm, .btn-icon : la petite taille.
   Une extension n'écrit pas son propre bouton : elle emploie ces classes, et en change
   l'aspect, si elle le veut, par sa feuille d'habillage. */
.btn, .bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    box-sizing: border-box; height: var(--btn-hauteur); padding: 0 var(--btn-espace);
    font-family: var(--btn-police); font-size: var(--btn-taille); font-weight: var(--btn-graisse); line-height: 1;
    white-space: nowrap; text-decoration: none; cursor: pointer;
    border-radius: var(--btn-rayon); border: 1px solid var(--bord-champ);
    background: var(--surface); color: var(--texte-moyen); transition: all .15s;
}
.btn:hover, .bouton.second:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-primary, .bouton:not(.second):not(.danger):not(.lien) { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: var(--btn-graisse-principal); }
.btn-primary:hover, .bouton:not(.second):not(.danger):not(.lien):hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.btn-danger, .bouton.danger { border-color: var(--erreur-bord); color: var(--erreur); background: var(--erreur-fond); }
.btn-danger:hover, .bouton.danger:hover { border-color: var(--erreur); color: var(--erreur); }
.btn-fantome { background: transparent; border-color: transparent; }
.btn-fantome:hover { background: rgba(var(--accent-rgb), .08); border-color: transparent; }
.btn-lien, .bouton.lien { height: auto; padding: 0; background: none; border: 0; color: var(--accent-strong); font-weight: normal; }
.btn-lien:hover, .bouton.lien:hover { color: var(--accent); background: none; }
.btn-lien:disabled, .bouton.lien:disabled { color: var(--texte-doux); cursor: default; opacity: .6; }
.btn-icon, .btn-sm { padding: 0 var(--btn-espace-petit); height: var(--btn-hauteur-petit); font-size: .78rem; gap: .35rem; }
.btn[disabled], .bouton[disabled] { opacity: .55; cursor: default; }

/* UN CHAMP DANS UNE RANGÉE D'ACTIONS (une liste à côté d'un bouton) prend la hauteur des
   boutons et sa largeur naturelle : le style général des champs les étire (width: 100%)
   et les fait un peu plus hauts — à côté d'un bouton, ils sortaient de la ligne. */
:is(.boutons, .page-actions, .form-actions, .tdb-filtres, .tdb-role) :is(select, input:not([type=checkbox]):not([type=radio]):not([type=file])) {
    width: auto; height: var(--btn-hauteur); padding-block: 0; box-sizing: border-box;
}

/* ── Mot de passe : critères ───────────────────────────────────────────────── */

.critere-ok { color: var(--succes); }
.critere-ko { color: var(--erreur); }
ul.criteres { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .85rem; line-height: 1.7; color: var(--texte-doux); }
ul.criteres [data-marque] { display: inline-block; width: 1.1em; font-weight: 700; }

.lien-a-copier { font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; background: var(--panel-bg); padding: .75rem; border-radius: 8px; }

/* ── Pages hors coquille : la connexion ───────────────────────────────────── */

body.page-seule {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow-x: hidden;
}
/* Le dégradé de repli, quand aucune image de connexion n'est posée : il suit
   l'accent de l'instance plutôt qu'un noir écrit en dur. */
.fond-connexion { position: fixed; inset: 0; z-index: 0; background: linear-gradient(135deg, var(--accent-strong), var(--sidebar-bg)); }
.fond-connexion img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fond-connexion .voile {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, .5) 40%, rgba(0, 0, 0, .7) 100%);
}
/* Les autres voiles (réglés dans l'atelier) : un dessin sur fond blanc se lit sous un
   voile clair, que le sombre rendrait gris sale. */
.voile-clair .fond-connexion { background: linear-gradient(135deg, #ffffff, #f0f0f1); }
.voile-clair .fond-connexion .voile { background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .55) 100%); }
.voile-aucun .fond-connexion .voile { display: none; }
.voile-clair .panneau-connexion { box-shadow: 0 25px 60px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .05); }
.panneau-connexion {
    position: relative;
    z-index: 1;
    width: 460px;
    max-width: calc(100% - 2rem);
    margin: 2rem 8% 2rem 1rem;
    padding: 3rem 2.5rem;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .1);
    animation: panneau-entre .7s cubic-bezier(.16, 1, .3, 1);
}
@keyframes panneau-entre {
    from { opacity: 0; transform: translateX(80px) scale(.95); filter: blur(8px); }
    to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) { .panneau-connexion { animation: none; } }
.marque-connexion { text-align: center; margin-bottom: 2rem; }
.marque-connexion img { max-width: 220px; max-height: 90px; height: auto; }
.marque-connexion p { margin: .25rem 0 0; color: var(--texte-doux); font-size: .9rem; }
.panneau-connexion h1 { font-size: 1.15rem; justify-content: center; margin-bottom: 1.5rem; }
.panneau-connexion .champ { margin-bottom: 1.25rem; }
.panneau-connexion .champ > label { font-size: .8rem; letter-spacing: .5px; }
.panneau-connexion input[type=text], .panneau-connexion input[type=email],
.panneau-connexion input[type=password], .panneau-connexion input[type=number] {
    max-width: none;
    padding: .85rem 1rem;
    font-size: .95rem;
    background: #fafafa;
    border: 2px solid #e5e7eb;
    /* Jamais moins arrondi que la page le veut, et la forme des champs de l'habillage au-delà. */
    border-radius: max(12px, var(--champ-rayon));
}
.panneau-connexion input:focus { border-color: var(--accent-strong); background: var(--surface); box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.panneau-connexion .bouton {
    width: 100%;
    height: auto;
    padding: 1rem;
    margin-top: .5rem;
    font-size: 1rem;
    font-weight: 700;
    border: 0;
    border-radius: max(12px, var(--btn-rayon));
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
    transition: all .3s;
}
.panneau-connexion .bouton:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.4); }
.panneau-connexion .bouton.second { background: var(--surface); border: 1px solid #ddd; box-shadow: none; font-weight: 600; font-size: .9rem; padding: .8rem; }
.panneau-connexion .bouton.second:hover { transform: none; border-color: var(--accent); }
.panneau-connexion .editeur { text-align: center; margin: 2rem 0 0; }
.panneau-connexion .editeur img { height: 20px; width: auto; opacity: .75; }
@media (max-width: 768px) {
    body.page-seule { justify-content: center; }
    .panneau-connexion { margin: 1rem; padding: 2rem 1.5rem; }
}

/* ── La pile des travaux de fond (bas à droite) ────────────────────────────── */

/* Les toasts (public/js/toasts.js) : centrés en haut, fond plein, en pilule. Ils ne
   poussent pas le contenu, et passent au-dessus des tiroirs et des fenêtres d'extension
   — un message qu'on ne voit pas ne sert à rien. */
.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 5000;
    display: flex; flex-direction: column; align-items: center; gap: .6rem; max-width: 90vw; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .6rem; padding: .7rem 1.3rem;
    border-radius: 999px; font-size: .9rem; font-weight: 600; color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    animation: toast-entree .22s ease; }
.toast.toast-sortie { animation: toast-sortie .22s ease forwards; }
.toast i { font-size: 1rem; }
.toast-success { background: var(--succes); }
.toast-error { background: var(--erreur); }
.toast-warning { background: var(--avertissement); }
.toast-info { background: var(--info); }
.toast-fermer { background: none; border: 0; color: rgba(255, 255, 255, .85); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 .1rem; }
.toast-fermer:hover { color: #fff; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toast-sortie { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.toast-sortie { animation: none; } }

/* Une fiche de valeurs en deux colonnes (relecture d'un import). */
.definitions { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.definitions dt { font-weight: 600; color: var(--texte-moyen); }
.definitions dd { margin: 0; }

/* La commande à taper (écran Mise à jour d'une copie de développement) : copiable d'un
   bloc, sur le fond de la barre — un terminal, sans couleur écrite en dur. */
.commande-maj { background: var(--sidebar-bg); color: var(--sidebar-fg); border-radius: var(--rayon);
    padding: .75rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem;
    white-space: pre; overflow-x: auto; user-select: all; }

.pile-travaux { position: fixed; right: 1rem; bottom: 6rem; display: flex; flex-direction: column; gap: .5rem; z-index: 150; width: min(22rem, calc(100vw - 2rem)); }
.carte-travail { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: .75rem 1rem; box-shadow: 0 8px 28px rgba(0, 0, 0, .12); font-size: .88rem; display: flex; flex-direction: column; gap: .35rem; }
.carte-travail[data-statut="failed"] { border-color: var(--erreur); }
.carte-travail-tete { display: flex; justify-content: space-between; gap: .5rem; }
.carte-travail progress { width: 100%; accent-color: var(--accent); }

/* ── La grappe de bulles (bas à droite) ────────────────────────────────────── */

/* Des disques à l'accent, côte à côte. La pile des travaux de fond se tient
   au-dessus. La couleur vient du thème, comme le reste. */
.bulles { position: fixed; right: 22px; bottom: 22px; z-index: 140; display: flex; gap: 4px; align-items: center; }
.bulle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 0;
    display: grid;
    place-items: center;
    /* L'accent, pas un noir écrit en dur : la bulle suit le thème de l'instance
       comme le reste, et son icône garde un contraste franc (6,5:1). L'ancienne
       valeur `#1a1a1a` était le seul fond sombre que l'atelier d'apparence ne
       pouvait pas changer. */
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    transition: transform .15s, background .15s;
}
.bulle:hover, .bulle[aria-expanded="true"] { transform: translateY(-2px); background: var(--accent-strong); color: var(--accent-contrast); }
/* Le compteur mord sur le disque : il se lit d'un coup d'œil sans grossir la bulle. */
.bulle-pastille {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    /* L'anneau détoure le disque : il en reprend la couleur, sinon il le cerne. */
    box-shadow: 0 0 0 2px var(--accent);
}
/* Les raccourcis (point `admin.raccourcis`) : une bulle de la grappe, et son menu ancré
   au-dessus d'elle. Les entrées sont des boutons ou des liens d'extensions : le menu les
   habille, elles n'ont pas de style à déclarer. */
.raccourcis { position: relative; }
.raccourcis-menu {
    position: absolute;
    right: 0;
    bottom: 70px;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--bord);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.raccourcis-menu[hidden] { display: none; }
.raccourcis-menu > button, .raccourcis-menu > a {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .75rem .9rem;
    border: 0;
    border-bottom: 1px solid var(--bord);
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: .86rem;
    color: var(--texte);
    text-align: left;
    text-decoration: none;
}
.raccourcis-menu > :last-child { border-bottom: 0; }
.raccourcis-menu > button:hover, .raccourcis-menu > a:hover, .raccourcis-menu > :focus-visible { background: rgba(var(--accent-rgb), .12); }
.raccourcis-menu i { width: 18px; text-align: center; color: var(--texte-doux); }

/* Le contenu de la page ne doit pas finir sous la grappe. */
.contenu { padding-bottom: 6rem; }
body.atelier .contenu { padding-bottom: 1rem; }

/* Un tiroir, ouvert par une bulle (messagerie, retours) : il glisse depuis la droite. */
.tiroir-voile { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .32); opacity: 0; pointer-events: none; transition: opacity .2s; }
.tiroir-voile.ouvert { opacity: 1; pointer-events: auto; }
.tiroir {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 401;
    height: 100vh;
    width: 420px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    box-shadow: -8px 0 28px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .25s ease;
}
.tiroir.ouvert { transform: none; }
.tiroir-tete { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--bord); }
.tiroir-tete h2 { margin: 0; font-size: 1rem; flex: 1; display: flex; align-items: center; gap: .5rem; }
.tiroir-tete h2 i { color: var(--accent); }
.tiroir-tete button { background: #f3f4f6; border: 0; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: #666; }
.tiroir-tete button:hover { background: #e5e7eb; color: #111; }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; }
.tiroir-pied { padding: .9rem 1.1rem; border-top: 1px solid var(--bord); }
@media (prefers-reduced-motion: reduce) { .tiroir, .tiroir-voile { transition: none; } }

/* ── Profil ────────────────────────────────────────────────────────────────── */

.photo-profil { display: flex; gap: 1.25rem; align-items: flex-start; }
.photo-profil .boutons { margin-bottom: .4rem; }

/* ── Boîte de réception ────────────────────────────────────────────────────── */

.boite-filtres { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.boite-filtres .bouton { height: 32px; font-size: .82rem; }
.boite-filtres .a-droite { margin-left: auto; }
.boite { display: flex; flex-direction: column; gap: .5rem; }
.notification { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid #ececec; border-radius: 12px; }
/* Le liseré : bleu, parce que l'accent sert déjà aux gestes. */
.notification.non-lue { border-color: rgba(20, 110, 220, .3); box-shadow: inset 4px 0 0 #1565c0; }
.notification-icone { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; background: #f3f3f3; color: #999; }
.notification.niveau-warning .notification-icone { background: rgba(240, 170, 20, .14); color: #b47d10; }
.notification.niveau-critical .notification-icone { background: rgba(200, 60, 60, .12); color: #b23c3c; }
.notification-corps { flex: 1; min-width: 0; }
.notification-titre { font-weight: 600; font-size: .93rem; color: var(--text); }
.notification-titre a { color: inherit; }
.notification.non-lue .notification-titre { font-weight: 700; }
.notification-texte { color: #777; font-size: .86rem; line-height: 1.5; margin-top: .3rem; white-space: pre-wrap; }
.notification-meta { color: #aaa; font-size: .78rem; margin-top: .4rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.notification-gestes { display: flex; gap: .35rem; flex-shrink: 0; }
.notification-gestes form { margin: 0; }
.notification-gestes button { width: 30px; height: 30px; background: none; border: 1px solid #ececec; border-radius: 8px; color: #999; cursor: pointer; }
.notification-gestes button:hover { color: var(--text); border-color: #d5d5d5; }
.boite-vide { padding: 2.5rem 1rem; text-align: center; color: #aaa; font-size: .9rem; }
.boite-vide i { display: block; font-size: 1.6rem; margin-bottom: .6rem; color: #d5d5d5; }
.boite-pages { justify-content: center; margin-top: 1.2rem; }

/* ── Listes : panneau de recherche, barre, pagination (lot 5) ─────────────── */

.liste-avec-panneau { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .liste-avec-panneau { grid-template-columns: 1fr; } }

.panneau-liste { background: var(--panel-bg); border: 1px solid var(--bord); border-radius: 12px; padding: 1rem; position: sticky; top: 1rem; }
.panneau-liste .champ { margin-bottom: .75rem; }
.panneau-liste input, .panneau-liste select { max-width: none; width: 100%; }
.panneau-liste .champ.recherche { position: relative; }
.recherches-recentes { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--surface); border: 1px solid var(--bord-champ); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.recherches-recentes button { display: block; width: 100%; text-align: left; padding: .4rem .7rem; border: 0; background: none; font: inherit; cursor: pointer; }
.recherches-recentes button:hover { background: rgba(var(--accent-rgb), 0.08); }
.filtres-sauvegardes { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bord); display: flex; flex-direction: column; gap: .5rem; }
.filtres-sauvegardes label { font-weight: 600; }
.filtres-sauvegardes .boutons input { flex: 1 1 100%; min-width: 0; }
.filtres-sauvegardes .aide { margin: 0; }

.barre-liste { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.pagination { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; font-size: .85rem; margin: .5rem 0; color: var(--texte-doux); }
.pagination .tailles a, .pagination .tailles strong { margin-right: .2rem; }
.pagination strong { color: var(--accent); }

.menu-liste { position: relative; }
.menu-liste > summary { list-style: none; }
.menu-liste > summary::-webkit-details-marker { display: none; }
.menu-liste-contenu { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; min-width: 16rem; background: var(--surface); border: 1px solid var(--bord-champ); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: .9rem 1rem; }
.menu-export .menu-liste-contenu { min-width: 20rem; }
.menu-liste fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.menu-liste legend { font-weight: 600; margin-bottom: .35rem; }
.colonnes-export { list-style: none; margin: 0 0 .5rem; padding: 0; max-height: 18rem; overflow-y: auto; }
.colonnes-export li { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.colonnes-export .deplacer .bouton { padding: 0 .25rem; }

/* ── Écran des tests (lot 8) ───────────────────────────────────────────────── */

.echec-test { border-top: 1px solid var(--bord); padding: .5rem 0; }
.echec-test summary { cursor: pointer; }
.echec-test pre { white-space: pre-wrap; font-size: .8rem; background: var(--panel-bg); padding: .6rem .8rem; border-radius: 8px; overflow-x: auto; }
.tests-rouges { color: var(--erreur); font-size: .9rem; }

/* ── Atelier d'apparence ───────────────────────────────────────────────────── */

/* L'atelier prend l'écran entier : l'aperçu est une copie de l'application, et la barre
   de la page hôte s'ajouterait à la sienne — deux barres côte à côte, on ne sait plus
   ce qu'on regarde. */
body.atelier { --largeur-barre: 0px; }
body.atelier .principal { margin-left: 0; }
body.atelier .contenu { max-width: none; padding: 1rem 1.25rem; }
body.atelier .pied { display: none; }

.atelier-grille { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .atelier-grille { grid-template-columns: minmax(0, 1fr); } }

.atelier-reglages { background: var(--surface); border: 1px solid #ececec; border-radius: 12px; padding: 1rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.atelier-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #999; margin: 1.25rem 0 .5rem; padding-top: .9rem; border-top: 1px solid #f0f0f0; }
.atelier-titre:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.jeton { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid #f4f4f4; }
.jeton:last-of-type { border-bottom: 0; }
.jeton label { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; color: #444; }
.jeton label code { display: block; color: #aaa; font-weight: 400; font-size: .72rem; }
.jeton .saisie { display: flex; align-items: center; gap: .35rem; flex: none; }
.jeton input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; background: var(--surface); }
.jeton input[type=text] { width: 88px; padding: .3rem .4rem; font-family: ui-monospace, monospace; font-size: .78rem; border-radius: 6px; }
.jeton.modifie label { color: var(--accent-strong); }
/* Le voile : un choix, pas une couleur — le menu déroulant prend toute la largeur (il
   écrasait le libellé en une colonne d’un mot par ligne), donc il passe sous le libellé. */
.jeton.voile { flex-wrap: wrap; }
.jeton.voile label { flex-basis: 100%; }

.piece { display: flex; flex-direction: column; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid #f4f4f4; }
.piece:last-child { border-bottom: 0; }
.piece-tete { display: flex; align-items: center; gap: .6rem; }
.piece-apercu { width: 96px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid #eee; border-radius: 8px; overflow: hidden; background: var(--surface); }
.piece-apercu.sombre { background: var(--sidebar-bg); border-color: var(--sidebar-bg); }
.piece-apercu.photo { background: linear-gradient(135deg, #1a1a1a, #30302e); }
.piece-apercu img { max-width: 88px; max-height: 32px; }
.piece-apercu.icone img { width: 32px; height: 32px; object-fit: contain; }
.piece-apercu.photo img { max-width: none; max-height: none; width: 100%; height: 100%; object-fit: cover; }
.piece-nom { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; color: #444; line-height: 1.3; }
.piece-nom small { display: block; font-weight: 400; color: #aaa; font-size: .72rem; }
.piece input[type=file] { font-size: .78rem; max-width: 100%; }
.piece .boutons .bouton { height: 30px; padding: 0 .75rem; font-size: .78rem; }

.atelier-ecrans { display: flex; gap: .25rem; margin-bottom: .75rem; flex-wrap: wrap; }
.atelier-ecrans a { padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; color: #666; text-decoration: none; border: 1px solid transparent; }
.atelier-ecrans a:hover { background: #f4f4f4; color: var(--text); }
.atelier-ecrans a.actif { border-color: #e2e2e2; color: var(--text); font-weight: 600; }
.atelier-fenetre { border: 1px solid #e2e2e2; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 6px 24px rgba(0, 0, 0, .06); }
.atelier-fenetre-barre { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: #fafafa; border-bottom: 1px solid #ececec; font-size: .78rem; color: var(--texte-doux); }
.atelier-fenetre-barre .point { width: 9px; height: 9px; border-radius: 50%; background: #e0e0e0; }
.atelier-fenetre-barre .adresse { flex: 1; min-width: 0; font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atelier-fenetre-barre .etat { color: var(--accent-strong); font-weight: 600; }
.atelier-cadre { display: block; width: 100%; height: calc(100vh - 9rem); min-height: 460px; border: 0; background: var(--surface); }

/* ---------- Le sélecteur cherchable (public/js/selecteur-cherchable.js) ----------
   Les teintes passent par les jetons du thème. Le <select> habillé
   est masqué d'emblée (sinon il clignote en liste native au chargement). */
select[data-searchable-picker] { display: none; }
.sp-trigger { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; border: 1px solid #e0e0e0; border-radius: 8px;
    background: var(--surface); cursor: pointer; font-size: .9rem; transition: border-color .15s; width: 100%; }
.sp-trigger:hover { border-color: var(--accent); }
.sp-trigger-compact { width: auto; height: 36px; padding: 0 .7rem; gap: .3rem; }
.sp-trigger-compact .sp-value, .sp-trigger-compact .sp-placeholder, .sp-trigger-compact .sp-clear { display: none; }
.sp-trigger .sp-value { flex: 1; color: var(--text); }
.sp-trigger .sp-placeholder { color: #aaa; flex: 1; }
.sp-trigger .sp-clear { color: #999; background: none; border: none; padding: 0 .3rem; cursor: pointer; border-radius: 4px; }
.sp-trigger .sp-clear:hover { color: #dc2626; background: rgba(239, 68, 68, .08); }
.sp-trigger-multi { padding: .45rem .6rem; min-height: 42px; flex-wrap: wrap; }
.sp-trigger-multi .sp-chips { flex: 1; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-width: 0; }
.sp-trigger-multi .sp-chip { display: inline-flex; align-items: center; gap: .35rem; background: rgba(var(--accent-rgb), .12); color: var(--accent-strong);
    border-radius: 6px; padding: .15rem .45rem; font-size: .82rem; max-width: 220px; }
.sp-trigger-multi .sp-chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-trigger-multi .sp-chip-remove { background: none; border: none; padding: 0 .2rem; cursor: pointer; color: var(--accent-strong); font-size: .75rem; line-height: 1; }
.sp-trigger-multi .sp-chip-remove:hover { color: #dc2626; }
.sp-trigger-multi .sp-chip .sp-opt-img, .sp-trigger-multi .sp-chip .sp-opt-fallback { width: 18px; height: 18px; }
.sp-option-multi .sp-opt-check { width: 18px; height: 18px; border: 1.5px solid #ccc; border-radius: 4px; display: inline-flex; align-items: center;
    justify-content: center; color: transparent; font-size: .65rem; flex-shrink: 0; transition: all .1s; }
.sp-option-multi.selected .sp-opt-check { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.sp-option-multi.selected { background: transparent; font-weight: inherit; color: inherit; }
.sp-option-multi.selected .sp-opt-label { color: var(--accent-strong); font-weight: 600; }
.sp-popover { display: none; position: fixed; z-index: 99999; background: var(--surface); border: 1px solid #e0e0e0; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .15); max-height: 360px; flex-direction: column; overflow: hidden; }
.sp-popover.open { display: flex; }
.sp-popover .sp-search { padding: .6rem; border-bottom: 1px solid #f0f0f0; }
.sp-popover .sp-search input { width: 100%; max-width: none; padding: .5rem .75rem; border: 1px solid #e0e0e0; border-radius: 8px; font-size: .88rem; }
.sp-popover .sp-search input:focus { outline: none; border-color: var(--accent); }
.sp-popover .sp-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .15) transparent; }
.sp-option { padding: .5rem .85rem; cursor: pointer; font-size: .88rem; color: var(--text); border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; gap: .6rem; }
.sp-option:last-child { border-bottom: none; }
.sp-option:hover { background: rgba(var(--accent-rgb), .06); }
.sp-option.selected { background: rgba(var(--accent-rgb), .12); color: var(--accent-strong); font-weight: 600; }
.sp-option.hidden { display: none; }
.sp-option .sp-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sp-opt-img { width: 32px; height: 32px; object-fit: contain; background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 2px; flex-shrink: 0; }
.sp-opt-fallback { width: 32px; height: 32px; border-radius: 6px; background: #f5f5f5; color: #ccc; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-opt-flag { width: 26px; height: 20px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.sp-opt-tag { margin-left: auto; flex-shrink: 0; font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 10px; background: #f5f5f5; color: #888; text-transform: uppercase; letter-spacing: .3px; }
.sp-trigger .sp-opt-img, .sp-trigger .sp-opt-fallback { width: 26px; height: 26px; }
.sp-trigger .sp-opt-flag { width: 22px; height: 16px; }
.sp-option mark { background: transparent; color: var(--accent-strong); padding: 0; margin: 0; font: inherit; line-height: inherit; box-shadow: inset 0 -2px 0 rgba(var(--accent-rgb), .55); }
.sp-empty { text-align: center; padding: 1.5rem; color: #aaa; font-size: .85rem; }

/* ── Branches (écran Releases) ─────────────────────────────────────────────── */

.pastille-info { background: rgba(var(--accent-rgb), 0.1); color: var(--accent-strong); }
.pastille-avertissement { background: transparent; color: var(--texte-moyen); box-shadow: inset 0 0 0 1px var(--avertissement); }
.branches { border-top: 1px solid rgba(var(--accent-rgb), 0.15); margin-top: .9rem; padding-top: .7rem; }
.gestes-branches { display: flex; flex-direction: column; gap: .45rem; }
.gestes-branches select, .gestes-branches input[type="text"] { width: auto; max-width: 14rem; }

/* ── Vocabulaire des écrans ─────────────────────────────────────────────────────
   Les classes des écrans d'administration (`page-header`, `btn`, `data-table`,
   `badge`, `info-block`…), communes à tous ceux qui les emploient : un écran nouveau
   les reprend plutôt que de s'écrire les siennes. Les classes plus anciennes
   (`titre-page`, `bouton`, `liste`, `carte`) restent pour les écrans qui ne sont pas
   encore passés à ce vocabulaire. Les couleurs, en jetons.
   ─────────────────────────────────────────────────────────────────────────────── */

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; font-size: 1.6rem; color: var(--texte); display: flex; align-items: center; gap: .5rem; }
.page-header h1 > i { color: var(--accent); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

/* Les boutons (.btn et ses variantes) : voir « LES BOUTONS », plus haut. */

.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.toolbar form { display: flex; gap: .75rem; align-items: center; flex: 1; }
.toolbar-search { position: relative; flex: 1; max-width: 400px; }
.toolbar-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texte-doux); font-size: .85rem; pointer-events: none; }
.toolbar-search-input {
    width: 100%; box-sizing: border-box; padding: .65rem 1rem .65rem 2.5rem;
    border: 1px solid var(--bord-champ); border-radius: 10px;
    font-size: .9rem; background: var(--surface); color: var(--texte); transition: all .2s ease;
}
.toolbar-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .1); }
.toolbar-count { font-size: .85rem; color: var(--texte-doux); white-space: nowrap; }

.table-wrapper { border: 1px solid var(--bord); border-radius: 12px; max-width: 100%; overflow-x: auto; background: var(--surface); }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table thead th {
    padding: .85rem 1rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--texte-doux); background: var(--panel-bg); border-bottom: 2px solid var(--bord); text-align: left; white-space: nowrap;
}
th .sort-link { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; cursor: pointer; }
th .sort-link:hover { color: var(--texte); }
th .sort-link .sort-caret { font-size: .7rem; opacity: 0; transition: opacity .12s; }
th .sort-link:hover .sort-caret, th .sort-link:focus-visible .sort-caret { opacity: .45; }
th .sort-link.is-sorted, th .sort-link.is-sorted .sort-caret { color: var(--accent); opacity: 1; }
table.data-table tbody tr { border-bottom: 1px solid var(--bord); transition: background .15s; }
table.data-table tbody tr[data-href] { cursor: pointer; }
table.data-table tbody tr:last-child { border-bottom: none; }
table.data-table tbody tr:hover { background: rgba(var(--accent-rgb), .04); }
table.data-table tbody td { padding: .85rem 1rem; font-size: .88rem; color: var(--texte); vertical-align: middle; }
table.data-table tr.domain-group-row td { background: var(--panel-bg); padding: .5rem .85rem; border-top: 2px solid var(--bord); font-weight: 700; font-size: .82rem; color: var(--texte-moyen); }
table.data-table tr.domain-group-row:hover { background: none; }
table.data-table tr.domain-group-row i { color: var(--accent); }
table.data-table .compte-groupe { color: var(--texte-doux); font-weight: normal; margin-left: .4rem; }
table.data-table .vide { text-align: center; color: var(--texte-doux); padding: 2rem; }
.actions-ligne { display: flex; gap: 4px; }
.actions-ligne form { display: inline; margin: 0; }

.badge { display: inline-block; padding: .3rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 600; margin: 0 .2rem .2rem 0; }
.badge-warning { background: rgba(var(--accent-rgb), .12); color: var(--accent-strong); }
.badge-secondary { background: var(--panel-bg); color: var(--texte-moyen); }
.badge-success { background: var(--succes-fond); color: var(--succes); }
.badge-danger { background: var(--erreur-fond); color: var(--erreur); }

.info-block { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.25rem; max-width: 900px; }
.info-block h3 { font-size: .95rem; color: var(--titre-bloc); margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--bord); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.field-label { display: block; font-size: .72rem; text-transform: uppercase; color: var(--texte-doux); font-weight: 600; letter-spacing: .4px; margin-bottom: .3rem; }
.field input[type="text"], .field input[type="email"] {
    width: 100%; box-sizing: border-box; padding: .55rem .75rem; border: 1px solid var(--bord-champ); border-radius: 8px; font-size: .9rem; background: var(--surface);
}
.field input:focus { outline: none; border-color: var(--accent); }
.field input:disabled { color: var(--texte); background: var(--surface); }
.note-info { background: var(--note-fond); border: 1px solid var(--note-bord); border-radius: 8px; padding: .6rem .8rem; font-size: .85rem; color: var(--note-texte); line-height: 1.5; }
.readonly-banner { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: rgba(var(--accent-rgb), .08); border: 1px solid var(--accent); border-radius: 10px; color: var(--accent-strong); font-size: .88rem; margin-bottom: 1rem; }
fieldset.readonly-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.role-list { display: flex; gap: 1rem; flex-wrap: wrap; }
.role-list label { display: flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border: 1px solid var(--bord-champ); border-radius: 8px; cursor: pointer; }
.role-list label:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.role-list .role-verrou { color: var(--accent); font-size: .7rem; margin-left: .2rem; }
.role-list .role-portee { font-size: .7rem; color: var(--texte-doux); margin-left: .3rem; }
.role-list .role-portee.tout { color: var(--accent-strong); }
.info-block .indication { font-size: .78rem; color: var(--texte-doux); margin: .75rem 0 0; }
.identity-row { display: flex; align-items: flex-start; gap: 1.5rem; }
.identity-row .field-row { flex: 1; min-width: 0; }
.identity-photo { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 150px; flex: none; }
.identity-photo .hint { color: var(--texte-doux); font-size: .74rem; line-height: 1.4; text-align: center; }
@media (max-width: 700px) {
    .identity-row { flex-direction: column; }
    .identity-photo { width: auto; }
    .field-row { grid-template-columns: 1fr; }
}
.ip { font-family: monospace; font-size: .82rem; color: var(--texte-moyen); }
.ua-cell { max-width: 480px; font-size: .78rem; color: var(--texte-doux); word-break: break-word; }
.page-empty { text-align: center; padding: 3rem; color: var(--texte-doux); }
.page-empty > i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .4; }

/* Rôles & permissions */
.info-block.large { max-width: 1000px; }
.info-block h3 { display: flex; align-items: center; gap: .5rem; }
.field.plein { grid-column: 1 / -1; }
.field textarea { width: 100%; box-sizing: border-box; min-height: 70px; resize: vertical; padding: .55rem .75rem; border: 1px solid var(--bord-champ); border-radius: 8px; font: inherit; font-size: .9rem; background: var(--surface); }
.field textarea:focus { outline: none; border-color: var(--accent); }
.field input.code { font-family: monospace; text-transform: uppercase; }
.field input[readonly] { background: var(--panel-bg); color: var(--texte-doux); }
.system-badge { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; background: rgba(var(--accent-rgb), .12); color: var(--accent-strong); font-weight: 700; font-size: .78rem; padding: .3rem .7rem; border-radius: 16px; }
.niveaux-auth { display: grid; gap: .5rem; }
.niveau-auth { display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; cursor: pointer; border: 1px solid var(--bord-champ); background: var(--surface); border-radius: 10px; padding: .7rem .85rem; }
.niveau-auth:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.niveau-auth input { width: auto; margin: .2rem 0 0; accent-color: var(--accent); }
.niveau-auth .niveau-aide { display: block; font-size: .78rem; color: var(--texte-doux); margin-top: .15rem; }
.niveau-none i { color: var(--texte-doux); }
.niveau-second i { color: var(--accent); }
.niveau-strong i { color: var(--succes); }
.note-avertissement { font-size: .75rem; color: var(--texte); background: var(--surface); border: 1px solid var(--avertissement); border-radius: 8px; padding: .55rem .75rem; margin-top: .6rem; }
.note-avertissement i { color: var(--avertissement); }
.note-accent { background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .3); color: var(--texte); padding: 1rem 1.25rem; border-radius: 10px; font-size: .88rem; margin-bottom: 1rem; }
.note-accent i { color: var(--accent-strong); }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.perm-group { background: var(--panel-bg); border: 1px solid var(--bord); border-radius: 10px; padding: 1rem; }
.perm-group h4 { font-size: .78rem; color: var(--titre-bloc); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 .6rem; display: flex; align-items: center; justify-content: space-between; }
.perm-group h4 button { font-size: .7rem; padding: .15rem .45rem; border-radius: 6px; border: 1px solid var(--bord-champ); background: var(--surface); cursor: pointer; color: var(--texte-doux); }
.perm-group h4 button:hover { color: var(--accent-strong); border-color: var(--accent); }
.perm-check { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .86rem; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--bord); position: relative; }
.perm-check:last-child { border-bottom: none; }
.perm-check .perm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.perm-key { font-family: monospace; font-size: .7rem; color: var(--texte-doux); flex-shrink: 0; }
.perm-check input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.perm-check .perm-toggle { position: relative; flex-shrink: 0; width: 36px; height: 18px; background: var(--bord-champ); border-radius: 9px; transition: background .15s; }
.perm-check .perm-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.perm-check input:checked ~ .perm-toggle { background: var(--accent); }
.perm-check input:checked ~ .perm-toggle::after { left: 20px; }
.perm-check input:disabled ~ .perm-toggle { cursor: not-allowed; opacity: .65; }
.perm-check input:focus-visible ~ .perm-toggle { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
.r-grip { width: 30px; text-align: center; color: var(--bord-champ); cursor: grab; }
.r-grip:not([data-grip]) { cursor: default; }
.r-grip:hover { color: var(--texte-doux); }
body.r-dragging, body.r-dragging * { cursor: grabbing !important; user-select: none; }
tr.r-dragging { opacity: .55; background: rgba(var(--accent-rgb), .08); }
.r-order-back { font-size: .82rem; color: var(--texte-doux); }
.r-order-back i { color: var(--accent); }
/* Dans le vocabulaire des écrans, un champ remplit sa colonne : la largeur maximale des
   champs plus anciens (420 px, 640 px pour un texte) n'y vaut pas. */
.field input, .field textarea, .field select, .toolbar-search-input { max-width: none; }

/* Profil : ses « sections » et ses lignes de formulaire, réutilisables par tout écran
   qui les emploie. */
.section { border: 1px solid var(--bord); border-radius: 14px; padding: 1.75rem; margin-bottom: 1.5rem; background: var(--surface); }
.section-header { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; padding-bottom: .85rem; border-bottom: 1px solid var(--bord); }
.section-header > i { color: var(--accent); font-size: 1rem; }
.section-header h2 { font-size: 1.05rem; color: var(--texte); font-weight: 600; margin: 0; }
.form-row { margin-bottom: 1.15rem; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: .78rem; font-weight: 600; color: var(--texte-moyen); text-transform: uppercase; letter-spacing: .4px; margin-bottom: .35rem; }
.form-row input, .form-row select, .form-row textarea { width: 100%; max-width: none; box-sizing: border-box; padding: .6rem .85rem; border: 1px solid var(--bord-champ); border-radius: 8px; font-size: .9rem; color: var(--texte); background: var(--surface); font-family: inherit; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-row input[readonly] { background: var(--panel-bg); color: var(--texte-moyen); }
.form-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--texte-doux); margin-top: .5rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.avatar-area { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--bord); }
.avatar-info { flex: 1; }
.avatar-info h3 { font-size: 1.15rem; color: var(--texte); margin: 0 0 .15rem; }
.avatar-info p { color: var(--texte-doux); font-size: .85rem; margin: 0 0 .5rem; }
.avatar-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.avatar-actions form { margin: 0; }
.avatar-actions label.btn { cursor: pointer; }
.avatar-actions .hint { color: var(--texte-doux); font-size: .78rem; }
.sub-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); margin: 1.4rem 0 .7rem; padding-top: 1rem; border-top: 1px solid var(--bord); font-weight: 600; }
.section-header + .sub-title { margin-top: .2rem; padding-top: 0; border-top: 0; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.profile-grid > .section { margin-bottom: 0; }
@media (max-width: 1000px) { .profile-grid { grid-template-columns: 1fr; } }
.etat-acces { padding: .75rem 0; }
.etat-acces > .btn { margin-top: .9rem; }
.etat-ligne { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.etat-pastille { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; padding: .4rem .8rem; border-radius: 20px; }
.etat-pastille.oui { background: var(--succes-fond); color: var(--succes); }
.etat-pastille.non { background: var(--erreur-fond); color: var(--erreur); }
.etat-aide { color: var(--texte-moyen); font-size: .88rem; }
.note-astuce { background: var(--surface); border: 1px solid var(--avertissement); border-radius: 10px; padding: .6rem .85rem; font-size: .85rem; color: var(--texte-moyen); margin-top: .7rem; max-width: 640px; }
.note-astuce i { color: var(--avertissement); }
.langue-fuseau { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; padding: .5rem 0; }
.langue-fuseau .form-row { margin-bottom: 0; flex: 1; min-width: 250px; max-width: 380px; }

/* Mentions légales (page publique, dans le panneau des pages sans session) */
.mentions-legales h1 { font-size: 1.3rem; margin: 0 0 1rem; display: block; }
.mentions-legales h2, .mentions-legales h3, .mentions-legales h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-strong); margin: 1.4rem 0 .5rem; }
.mentions-legales p, .mentions-legales li { font-size: .9rem; line-height: 1.6; }
.mentions-legales a { color: var(--accent-strong); }
.mentions-legales .retour-connexion { font-weight: 600; text-decoration: none; }
.panneau-connexion .lien-mentions { text-align: center; margin: .5rem 0 0; font-size: .78rem; }
.panneau-connexion .lien-mentions a { color: var(--texte-doux); text-decoration: none; }
.panneau-connexion .lien-mentions a:hover { color: var(--accent-strong); }

/* Réglages */
.settings-section { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; max-width: 800px; }
.settings-section h2 { font-size: 1rem; color: var(--titre-bloc); margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; }
.settings-section .section-desc { color: var(--texte-doux); font-size: .85rem; margin: 0 0 1.25rem; }
.settings-section .field-row { display: grid; grid-template-columns: 200px 1fr; gap: .75rem 1.5rem; align-items: start; }
.settings-section .field-row + .field-row { margin-top: .5rem; }
.settings-section .field-row > label, .settings-section .field-row-label { font-size: .82rem; font-weight: 600; color: var(--texte-moyen); padding-top: .55rem; text-transform: none; letter-spacing: 0; margin: 0; }
.settings-section .field-control { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.settings-section .field-control input[type="text"], .settings-section .field-control input[type="email"], .settings-section .field-control input[type="number"], .settings-section .field-control input[type="password"] { width: 100%; max-width: 320px; box-sizing: border-box; padding: .55rem .85rem; border: 1px solid var(--bord-champ); border-radius: 8px; font-size: .9rem; }
.settings-section .field-control input.format-date { font-family: monospace; }
.settings-section .field-control textarea { width: 100%; max-width: none; box-sizing: border-box; padding: .55rem .85rem; border: 1px solid var(--bord-champ); border-radius: 8px; font-size: .85rem; font-family: inherit; line-height: 1.5; resize: vertical; min-height: 0; }
.settings-section .field-control input:focus, .settings-section .field-control textarea:focus { outline: none; border-color: var(--accent); }
.settings-section .field-control .case { margin: 0; }
.preview-line { font-size: .82rem; color: var(--accent-strong); font-weight: 600; background: rgba(var(--accent-rgb), .08); padding: .3rem .6rem; border-radius: 6px; display: inline-block; align-self: flex-start; }
.preview-line i { margin-right: .3rem; }
.preset-buttons { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.preset-btn { padding: .4rem .75rem; border: 1px solid var(--bord-champ); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: .78rem; font-family: inherit; transition: all .15s; }
.preset-btn:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .05); }
.preset-btn.active { border-color: var(--accent); background: rgba(var(--accent-rgb), .15); color: var(--accent-strong); font-weight: 600; }
.preset-btn code { font-family: monospace; color: var(--texte-doux); }
.preset-btn.active code { color: var(--accent-strong); }
.help-text { font-size: .78rem; color: var(--texte-doux); }
.help-text a { color: var(--accent-strong); }
.mail-redirect-on { margin: .4rem 0 0; padding: .4rem .6rem; border-radius: 6px; background: var(--erreur-fond); border: 1px solid var(--erreur-bord); color: var(--erreur); font-size: .8rem; }
.mail-redirect-on i { margin-right: .3rem; }
.settings-actions { display: flex; gap: .75rem; justify-content: flex-end; max-width: 800px; }
@media (max-width: 700px) { .settings-section .field-row { grid-template-columns: 1fr; } .settings-section .field-row > label, .settings-section .field-row-label { padding-top: 0; } }

/* Journal d'audit */
.audit-retention { color: var(--texte-doux); font-size: .82rem; margin: -.75rem 0 .9rem; }
.filters { display: flex; gap: .75rem; align-items: end; margin-bottom: 1rem; flex-wrap: wrap; }
.filters .f { display: flex; flex-direction: column; gap: .25rem; }
.filters label { font-size: .7rem; text-transform: uppercase; color: var(--texte-doux); font-weight: 600; letter-spacing: .4px; }
.filters input, .filters select { padding: .45rem .7rem; border: 1px solid var(--bord-champ); border-radius: 8px; font-size: .85rem; min-width: 200px; max-width: none; }
table.data-table.audit tbody td { padding: .55rem .85rem; font-size: .85rem; vertical-align: top; }
.action-pill { display: inline-block; padding: .15rem .55rem; border-radius: 12px; font-family: monospace; font-size: .75rem; background: rgba(17, 131, 215, .08); color: var(--titre-bloc); }
.action-pill.danger { background: var(--erreur-fond); color: var(--erreur); }
.action-pill.warn { background: rgba(var(--accent-rgb), .12); color: var(--accent-strong); }
pre.payload { margin: 0; font-size: .72rem; white-space: pre-wrap; word-break: break-word; max-width: 520px; color: var(--texte-moyen); }

/* Ménage de var/ (écran Maintenance) */
.mnt-disk { border: 1px solid var(--bord); border-radius: 12px; padding: 1.1rem 1.3rem; background: var(--surface); margin-bottom: 1.2rem; max-width: 940px; }
.mnt-disk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.mnt-disk-total { font-size: 1.25rem; font-weight: 600; }
.mnt-disk-free { color: var(--texte-doux); font-size: .84rem; }
.mnt-bar { height: 8px; border-radius: 999px; background: var(--panel-bg); overflow: hidden; display: flex; }
.mnt-bar-used { background: var(--accent); }
.mnt-bar-free { background: var(--succes); opacity: .55; }
.mnt-legend { display: flex; gap: 1.2rem; margin-top: .55rem; font-size: .78rem; color: var(--texte-doux); }
.mnt-legend i, .mnt-parts i { font-size: .55rem; vertical-align: middle; margin-right: .3rem; }
.mnt-puce-occupe { color: var(--accent); }
.mnt-puce-libre { color: var(--succes); opacity: .55; }
.mnt-puce-base { color: var(--titre-bloc); }
.mnt-parts { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--bord); font-size: .82rem; color: var(--texte-moyen); }
.mnt-parts b { color: var(--texte); font-weight: 600; margin-left: .2rem; }
.mnt-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
.mnt-table th { padding: .85rem .9rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--texte-doux); background: var(--panel-bg); border-bottom: 2px solid var(--bord); text-align: left; }
.mnt-table td { padding: .85rem .9rem; border-bottom: 1px solid var(--bord); vertical-align: top; font-size: .88rem; }
.mnt-table tr:last-child td { border-bottom: 0; }
.mnt-name { font-weight: 600; color: var(--texte); }
.mnt-path { font-family: monospace; font-size: .74rem; color: var(--texte-doux); margin-top: .15rem; }
.mnt-hint { color: var(--texte-doux); font-size: .8rem; margin-top: .35rem; line-height: 1.5; max-width: 46ch; }
.mnt-files-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); margin-top: .6rem; }
.mnt-files { list-style: none; margin: .25rem 0 0; padding: 0; max-width: 52ch; }
.mnt-files li { display: flex; justify-content: space-between; gap: 1rem; font-family: monospace; font-size: .74rem; color: var(--texte-moyen); padding: .1rem 0; }
.mnt-size, .mnt-gain { text-align: right; white-space: nowrap; width: 9rem; }
.mnt-gain { color: var(--succes); font-weight: 600; }
.mnt-gain.none { color: var(--texte-doux); font-weight: normal; }
.mnt-act { width: 9rem; text-align: right; }
.mnt-meter { height: 4px; border-radius: 999px; background: var(--panel-bg); margin-top: .3rem; overflow: hidden; }
.mnt-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* Mise à jour : l'état, les nouveautés repliables, l'historique */
.upd-card { border: 1px solid var(--bord); border-radius: 12px; padding: 1.2rem 1.3rem; margin-bottom: 1rem; background: var(--surface); max-width: 720px; }
.upd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.upd-versions { font-size: .95rem; }
.upd-versions b { font-size: 1.05rem; }
.upd-label { color: var(--texte-doux); font-size: .8rem; }
.upd-sep { color: var(--texte-doux); margin: 0 .5rem; }
.upd-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.upd-actions form { margin: 0; }
.upd-badge { font-size: .7rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-bg); color: var(--texte-moyen); }
.upd-badge.ok { background: var(--succes-fond); color: var(--succes); }
.upd-badge.new { background: rgba(var(--accent-rgb), .18); color: var(--accent-strong); }
.upd-badge.ko { background: var(--erreur-fond); color: var(--erreur); }
.upd-changelog { margin-top: 1rem; padding: 1rem 1.2rem; background: var(--panel-bg); border-radius: 10px; font-size: .88rem; line-height: 1.6; color: var(--texte); }
.upd-changelog p { margin: .35rem 0; }
.upd-changelog em { color: var(--texte-doux); font-style: normal; font-size: .82rem; }
.upd-changelog ul, .upd-changelog ol { margin: .4rem 0 .8rem 1.3rem; }
.upd-changelog code { background: var(--surface); padding: .05rem .3rem; border-radius: 4px; font-size: .88em; }
.upd-changes-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); margin-bottom: .5rem; }
.upd-change { border-top: 1px solid var(--bord); }
.upd-change:first-of-type { border-top: 0; }
.upd-change > summary { display: flex; align-items: baseline; gap: .6rem; padding: .55rem .2rem; cursor: pointer; list-style: none; }
.upd-change > summary::-webkit-details-marker { display: none; }
.upd-change > summary:hover { background: rgba(0, 0, 0, .02); }
.upd-change-caret { color: var(--texte-doux); font-size: .7rem; transition: transform .15s; flex: none; }
.upd-change[open] > summary .upd-change-caret { transform: rotate(90deg); }
.upd-change-title { font-weight: 600; color: var(--texte); }
.upd-change-meta { color: var(--texte-doux); font-size: .78rem; margin-left: auto; flex: none; }
.upd-change-body { padding: 0 .2rem .8rem 1.4rem; }
.upd-change-body > *:first-child { margin-top: 0; }
.upd-change-outro { color: var(--texte-doux); font-size: .82rem; margin-top: .7rem; }
.upd-version { border-top: 1px solid var(--bord); padding: .6rem 0; }
.upd-version > summary { cursor: pointer; font-weight: 600; }
.upd-version ul { margin: .7rem 0 .3rem; padding-left: 1.1rem; color: var(--texte-moyen); font-size: .88rem; }
.upd-version li { margin: .35rem 0; }

/* Fiche d'une extension */
.ext-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.75rem 0 1rem; }
.ext-prose { font-size: .9rem; line-height: 1.6; color: var(--texte); max-width: 760px; }
.ext-section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); font-weight: 600; margin: 1.6rem 0 .6rem; }
.ext-version { border: 1px solid var(--bord); border-radius: 10px; padding: .8rem 1rem; margin-bottom: .7rem; background: var(--surface); max-width: 760px; }
.ext-version.a-installer { border-color: var(--accent); }
.ext-version h4 { margin: 0 0 .4rem; font-size: .95rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ext-version .ext-prose h4, .ext-version .ext-prose h5 { font-size: .9rem; margin: .8rem 0 .2rem; }
.ext-version .ext-prose em { color: var(--texte-doux); font-style: normal; font-size: .82rem; }
.ext-when { margin-left: auto; color: var(--texte-doux); font-size: .78rem; font-weight: 400; }
/* La prochaine version, dans l'écran Releases : la même liste repliable que les notes. */
.upd-changelog.prochaine { margin: .3rem 0 .8rem; max-width: 760px; }

/* L'écran Santé : le détail replié d'une erreur. */
.erreur-detail { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: .6rem 0; font-size: .82rem; }
.erreur-detail dt { color: var(--texte-doux); }
.erreur-detail dd { margin: 0; word-break: break-all; }
.erreur-trace { max-height: 18rem; overflow: auto; font-size: .75rem; background: var(--panel-bg); border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; white-space: pre-wrap; word-break: break-all; }

/* Comptes des portails : le formulaire d'invitation sur une ligne, qui passe à la ligne sur un écran étroit. */
.portail-inviter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.portail-inviter input, .portail-inviter select { flex: 1 1 10rem; min-width: 0; }
.portail-filtres select { max-width: 14rem; }

/* ── Le tableau de bord (widgets) ──────────────────────────────────────────── */

/* Quatre colonnes : un petit widget en prend une, un moyen deux, un large toutes. */
/* Dense : un petit widget vient combler le trou qu'un moyen a laissé en bout de rangée. */
.tdb-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 1rem; align-items: start; }
.tdb-widget { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 1rem 1.1rem; min-height: 7rem; }
.tdb-petit { grid-column: span 1; }
.tdb-moyen { grid-column: span 2; }
.tdb-large { grid-column: 1 / -1; }
@media (max-width: 1100px) { .tdb-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tdb-moyen { grid-column: 1 / -1; } }
@media (max-width: 640px) { .tdb-grille { grid-template-columns: minmax(0, 1fr); } .tdb-petit, .tdb-moyen { grid-column: 1 / -1; } }
.tdb-titre { display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem; font-size: .8rem; letter-spacing: .4px; text-transform: uppercase; color: var(--texte-doux); }
.tdb-titre i { color: var(--accent-strong); }
.tdb-contenu p { margin: .25rem 0; }
.tdb-grand { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.tdb-alerte { color: var(--erreur); }
.tdb-chiffres { display: flex; gap: 1.5rem; margin-bottom: .5rem; }
.tdb-chiffres div { display: flex; flex-direction: column; }
.tdb-chiffres strong { font-size: 1.5rem; }
.tdb-chiffres span { font-size: .8rem; color: var(--texte-doux); }
.tdb-liste { list-style: none; margin: 0; padding: 0; }
.tdb-liste li { padding: .35rem 0; border-top: 1px solid var(--bord); font-size: .88rem; }
.tdb-liste li:first-child { border-top: 0; }
.tdb-filtres { display: flex; gap: .75rem; align-items: center; }
.tdb-filtres label { display: flex; gap: .4rem; align-items: center; font-size: .85rem; }
.tdb-composition { list-style: none; margin: 0; padding: 0; }
.tdb-composition li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--bord); }
.tdb-composition li:first-child { border-top: 0; }
.tdb-composition .case { flex: 1; }
.tdb-composition .doux { font-size: .78rem; }
.tdb-fleches { display: flex; gap: .25rem; }
.tdb-role { display: flex; gap: .75rem; align-items: center; }

