/*
 * L'habillage de l'administration : celui du PIM (Entropim), à l'identique.
 *
 * Repris à la VUE et non recopié : le PIM surcharge EasyAdmin en profondeur, et ses
 * feuilles importeraient cette dépendance avec elles. Les valeurs (tailles, rayons,
 * gris, ombres) sont les siennes ; les classes sont celles des écrans d'ici.
 *
 * 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ù le PIM écrivait `rgba(251, 186, 0, .08)` — le jaune d'origine, resté sur tous les
 * survols quand l'accent est passé à l'orange. 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;
    --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;
}

/* `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é (payé deux fois au
   PIM, sur des boutons et des pastilles). */
[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; }
.barre nav a:hover,
.barre .compte .notifications:hover { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.barre nav a.actif,
.barre .compte .notifications.actif { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.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;
    color: var(--accent);
    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"] { color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.barre .sousmenu.actif > .sousmenu-ouvrir { color: var(--accent); background: rgba(var(--accent-rgb), .12); }
.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. */
.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; }
.barre .qui:hover strong { color: var(--accent); }
.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 { color: var(--accent); 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; }

.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; }

@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; }

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: 8px;
    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); }

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

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

/* `.bouton` est le bouton principal (l'accent) ; `.second`, le bouton ordinaire du PIM
   (blanc, bord gris, l'accent au survol) ; `.danger`, le rouge pâle. */
.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    height: 36px;
    padding: 0 1.1rem;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
    transition: all .15s;
}
.bouton:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.bouton.second { background: var(--surface); border-color: #ddd; color: var(--texte-moyen); font-weight: 500; }
.bouton.second:hover { background: var(--surface); border-color: var(--accent); color: var(--accent-strong); }
.bouton.danger { background: var(--erreur-fond); border-color: var(--erreur-bord); color: var(--erreur); font-weight: 500; }
.bouton.danger:hover { background: #fee2e2; }
.bouton.lien { height: auto; padding: 0; background: none; border: 0; color: var(--accent-strong); font-weight: normal; }
.bouton.lien:hover { color: var(--accent); background: none; }
.bouton.lien:disabled { color: var(--texte-doux); cursor: default; opacity: .6; }
.bouton[disabled] { opacity: .55; cursor: default; }

/* ── 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 du PIM ─────────────────────────────── */

body.page-seule {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow-x: hidden;
}
.fond-connexion { position: fixed; inset: 0; z-index: 0; background: linear-gradient(135deg, #1a1a1a, #30302e); }
.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;
    border-radius: 12px;
}
.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: 12px;
    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: 44px; width: auto; opacity: .9; }
@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) ────────────────────────────── */

.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) ────────────────────────────────────── */

/* Le PIM, à l'identique : des disques sombres à l'accent, côte à côte. La pile des
   travaux de fond se tient au-dessus. */
.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;
    background: #1a1a1a;
    color: var(--accent);
    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: #000; color: var(--accent); }
/* 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;
    box-shadow: 0 0 0 2px #1a1a1a;
}
/* 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é du PIM : 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); }

.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.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); }
