/* Espaces connectés (compte, admin) et pages de connexion. */

/* ---------------------------------------------------------------- corps de page */
.app-corps { max-width: 90rem; margin-inline: auto; padding: var(--e-5) var(--gouttiere) var(--e-8); display: flex; flex-direction: column; gap: var(--e-5); }
.app-corps--etroit { max-width: 52rem; }
.page-entete { --c-texte-doux: var(--c-sur-jaune); --etiquette-fond: var(--c-surface); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--e-4); padding: var(--e-5); border-radius: var(--r-lg); background: var(--c-jaune); color: var(--c-sur-jaune); }
.page-entete .fil-ariane { color: inherit; margin-bottom: var(--e-2); }
.page-entete h1 { font-size: var(--t-3xl); }
.page-entete p { color: var(--c-texte-doux); margin-top: var(--e-1); }
.section-titre { font-size: var(--t-xl); margin-bottom: var(--e-3); }

/* Actions réservées au propriétaire : masquage de confort, le serveur refuse de toute façon (403). */
html[data-role-admin="editeur"] .reserve-proprietaire { display: none !important; }

/* ---------------------------------------------------------------- pages de connexion */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-block: var(--e-5); max-width: 60rem; }
.auth-message { min-height: 15rem; }
.auth-message .titre-ecran { font-size: var(--t-2xl); }
.auth-formulaire { justify-content: center; gap: var(--e-4); }
@media (min-width: 48rem) and (max-width: 63.99rem) { .auth .mosaique > * { grid-column: span 12; } }
@media (min-width: 64rem) { .auth-message { min-height: 26rem; } }

/* ---------------------------------------------------------------- espace compte */
.app-corps--moyen { max-width: 68rem; }
.app-corps > section { display: flex; flex-direction: column; }
.page-entete-tuile { display: flex; flex-direction: column; gap: var(--e-2); }
.etapes-suivi { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: var(--e-2); font-size: var(--t-sm); }

/* ---------------------------------------------------------------- admin */
.kpis { display: grid; gap: var(--espace-tuiles); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin-bottom: var(--e-5); }
.kpis > * { display: flex; flex-direction: column; gap: var(--e-1); padding: var(--e-4) var(--e-5); }
.lignes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e-2); }
.lignes > li { --etiquette-fond: var(--c-surface-2); padding: var(--e-3) var(--e-4); border-radius: var(--r-bande); background: var(--c-surface); }
.journal > li { display: flex; gap: var(--e-4); align-items: baseline; font-size: var(--t-sm); padding-block: var(--e-2); }
.journal time { flex: 0 0 3rem; }
.texte-libre { white-space: pre-wrap; overflow-wrap: anywhere; }
.grappe--serree { gap: var(--e-1); }
.champ--recherche { max-width: 24rem; }
.tableau th[scope="row"] { white-space: normal; }
.tri { background: none; border: 0; min-height: 1.5rem; padding: .25rem 0; font: inherit; color: inherit; cursor: pointer; }
.tri:hover { color: var(--c-texte); }
th[aria-sort="ascending"] .tri::after { content: " ↑"; }
th[aria-sort="descending"] .tri::after { content: " ↓"; }
.panneau { padding-top: var(--e-4); }
.panneau:focus-visible { outline-offset: 4px; }
.journal .journal-date { flex-basis: 9rem; }
.journal.carte { padding: var(--e-4) var(--e-5); }
.filtres-liste { display: flex; flex-wrap: wrap; gap: var(--e-3); }
.filtres-liste .champ { flex: 1 1 14rem; max-width: 24rem; }
.grille-auto--large { --col-min: 24rem; }
.saisie--petite { width: auto; flex: 1 1 9rem; min-width: 0; min-height: var(--cible-petite); padding: .3rem .75rem; font-size: var(--t-sm); }
.liens-fichiers { gap: var(--e-1) var(--e-4); }
.cellule-email { font-weight: 400; overflow-wrap: anywhere; }
.liste-cases { max-height: 18rem; overflow-y: auto; }
.liste-fuites { margin: 0; padding-left: 1.2rem; }
label.btn { cursor: pointer; }
input.sr-only:focus-visible + .btn, label.btn:has(+ input:focus-visible) { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.saisie--fixe { flex: 0 0 auto; width: auto; }
.champ--court { max-width: 14rem; }
html:not([data-role-admin="editeur"]) .reserve-editeur { display: none !important; }
details > summary { cursor: pointer; font-weight: 600; }
details > summary.section-titre { margin: 0; }
.volet-contenu { margin-top: var(--e-4); }
.liste-simple { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: var(--e-2); }
.lignes.carte { padding: var(--e-4) var(--e-5); }

/* ---------------------------------------------------------------- générateur */
.modules { display: grid; gap: var(--e-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.module-groupe { padding: var(--e-4); display: flex; flex-direction: column; gap: var(--e-3); }
.module { display: flex; flex-direction: column; gap: var(--e-1); }
.module-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-2); min-height: 2.25rem; }
.module-tete .case label { font-weight: 600; }
.module > .champ-aide { padding-left: 2.25rem; }
.module-reglage[aria-expanded="true"] { background: var(--c-primaire); border-color: var(--c-primaire); color: var(--c-sur-primaire); }
.module-reglage { width: 2.25rem; }
.module-panneau { margin-top: var(--e-2); padding: var(--e-4); border-radius: var(--r-bande); background: var(--c-surface-2); }
.module-panneau[hidden] { display: none; }
.grappe--champ { flex-wrap: nowrap; }
.grappe--champ .saisie { flex: 1; min-width: 0; }
.saisie--fichier { width: auto; flex: 1 1 14rem; padding: .45rem; font-size: var(--t-sm); }
.logo-apercu { width: 3rem; height: 3rem; object-fit: contain; border-radius: var(--r-md); background: var(--c-surface); }
.app-corps > *, .panneau > * { min-width: 0; }

/* Colonnes secondaires des tableaux, masquées sur mobile */
@media (max-width: 47.99rem) { .tableau .col-sec { display: none; } }
