* { box-sizing: border-box; }

body { margin: 0; }

a { color: inherit; text-decoration: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.coquille { min-height: 100vh; display: flex; flex-direction: column; }

.barre {
    height: 60px;
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
}

.marque {
    width: 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-right: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--text-title);
}

.barre-outils {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
}

.recherche {
    position: relative;
    width: min(420px, 100%);
}

.recherche input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px 8px 36px;
    font: inherit;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
}

.recherche input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--text);
}

.corps { flex: 1; display: flex; min-height: 0; }

.menu {
    width: 240px;
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    background: var(--surface-soft);
}

.menu a, .menu span {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
}

.menu a:hover { background: var(--surface); }

.menu a[aria-current="page"] {
    background: var(--surface);
    font-weight: 600;
    color: var(--le-blue);
    box-shadow: inset 3px 0 0 var(--accent);
}

.menu .groupe {
    margin: 16px 12px 6px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.page { flex: 1; padding: 28px 32px 48px; background: var(--surface); }

.page h1 {
    font-family: var(--font-display);
    font-size: 28px;
    margin: 0 0 8px;
    color: var(--text-title);
}

.intro { color: var(--text-muted); margin: 0 0 24px; }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

.grille-apercu { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.carte, .table, .panneau {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.carte { padding: 16px; }

.carte strong {
    display: block;
    font-size: 28px;
    font-family: var(--font-display);
    color: var(--text-title);
}

.carte span { color: var(--text-muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th { color: var(--text-muted); font-weight: 500; font-size: 12px; }

tr:hover td { background: var(--surface-soft); }

table.table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table th,
.table td {
    vertical-align: middle;
}

.table th:last-child,
.table td:last-child {
    width: 10rem;
    text-align: right;
    white-space: nowrap;
}

.table td.col-email,
.table th.col-email {
    width: 22%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table .col-date {
    width: 7.5rem;
    white-space: nowrap;
}

.table .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.table form { margin: 0; }
.table input { width: auto; max-width: none; }

.table-contributeurs th:nth-child(1),
.table-contributeurs td:nth-child(1) { width: 18%; }
.table-contributeurs th:nth-child(2),
.table-contributeurs td:nth-child(2) { width: 24%; overflow-wrap: anywhere; word-break: break-word; }
.table-contributeurs th:nth-child(3),
.table-contributeurs td:nth-child(3) { width: auto; }
.table-contributeurs th:nth-child(4),
.table-contributeurs td:nth-child(4) { width: 7.5rem; white-space: nowrap; }
.table-contributeurs th:nth-child(5),
.table-contributeurs td:nth-child(5) { width: 11rem; }

.table th a,
.tri-liste a { color: inherit; text-decoration: none; }

.table th a:hover,
.tri-liste a:hover { text-decoration: underline; }

.table th[aria-sort] a,
.tri-liste a[aria-current="true"] { color: var(--text-title); font-weight: 600; }

.tri-fleche { margin-left: 4px; }

.tri-liste { display: flex; gap: 16px; margin: -8px 0 16px; font-size: 13px; color: var(--text-muted); }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    background: var(--surface-muted);
    color: var(--text);
}

.badge.publiee { background: var(--success-soft); color: var(--success); }
.badge.valider { background: var(--warning-soft); color: var(--warning); }
.badge.brouillon { background: var(--surface-muted); color: var(--text-muted); }
.badge.inactive { background: var(--surface-muted); color: var(--text-soft); }
.badge.refusee { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

.ligne-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }

button, .bouton {
    border: 1px solid var(--le-blue);
    background: var(--le-blue);
    color: var(--le-white);
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .bouton:hover {
    background: var(--le-navy);
    border-color: var(--le-navy);
}

button.secondaire, .bouton.secondaire {
    background: var(--surface);
    color: var(--le-blue);
    border-color: var(--border-strong);
}

button.secondaire:hover, .bouton.secondaire:hover {
    border-color: var(--accent);
    color: var(--le-navy);
}

label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; color: var(--text); }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

textarea { min-height: 90px; }

.formulaire { max-width: 720px; }

.choix { display: flex; gap: 16px; align-items: center; }

.choix label { margin: 0; }

.arborescence details { border-bottom: 1px solid var(--border); padding: 8px 0; }
.arborescence summary { cursor: pointer; font-weight: 600; color: var(--text-title); }
.arborescence ul { margin: 8px 0 8px 18px; color: var(--text); }

.connexion {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--gradient-secondary-1);
    padding: 24px 0;
}

.connexion form {
    width: min(420px, calc(100% - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.connexion h1,
.choix-acces h1 {
    font-family: var(--font-display);
    margin-top: 0;
    color: var(--text-title);
}

.connexion h1 a,
.choix-acces h1 a {
    color: var(--text-title);
}

.choix-acces {
    width: min(420px, calc(100% - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.familles-contributeur { border: 0; margin: 16px 0 0; padding: 0; }
.familles-contributeur legend { font-weight: 600; margin-bottom: 8px; color: var(--text-title); }
.choix-famille {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.choix-famille input { width: auto; }

.erreur { color: var(--danger); }

.entete-familles { justify-content: space-between; align-items: flex-start; }
.entete-familles h1 { margin-bottom: 0; }
.entete-familles .intro { margin-top: 4px; }
.entete-familles .bouton { background: var(--le-blue); border-color: var(--le-blue); }

.liste-familles { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }

.arbre-creation {
    gap: 0;
    position: relative;
}
.arbre-creation .arbre-noeud {
    --niveau: 0;
    position: relative;
    margin-left: calc(var(--niveau) * 36px);
    padding-bottom: 10px;
}
.arbre-creation .arbre-noeud[data-niveau]:not([data-niveau="0"])::before {
    content: "";
    position: absolute;
    left: -22px;
    top: -10px;
    bottom: 10px;
    width: 2px;
    background: color-mix(in srgb, var(--famille-encre) 50%, var(--border-strong));
}
.arbre-creation .arbre-noeud[data-niveau]:not([data-niveau="0"]):last-child::before {
    bottom: auto;
    height: 38px;
}
.arbre-creation .arbre-noeud[data-niveau]:not([data-niveau="0"])::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 36px;
    width: 20px;
    height: 2px;
    background: color-mix(in srgb, var(--famille-encre) 50%, var(--border-strong));
}
.arbre-creation .arbre-enfants {
    position: relative;
    margin-top: 0;
}
.arbre-creation .famille-choix {
    cursor: pointer;
    border: 2px solid color-mix(in srgb, var(--famille-encre) 28%, var(--border));
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    min-height: 72px;
    background: color-mix(in srgb, var(--famille-fond) 55%, var(--surface));
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.arbre-creation .famille-choix:hover {
    border-color: var(--famille-encre);
    background: var(--famille-fond);
}
.arbre-creation .famille-choix.retenue {
    border-color: var(--famille-encre);
    background: var(--famille-fond);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--famille-encre) 22%, transparent);
}
.arbre-creation .famille-choix .famille-texte {
    flex: none;
    width: 100%;
}
.arbre-creation .famille-choix .famille-texte strong {
    color: var(--famille-encre);
    font-size: 16px;
}
.arbre-creation .famille-choix .famille-texte span {
    color: color-mix(in srgb, var(--famille-encre) 70%, var(--text-muted));
}
.arbre-creation .famille-choix:focus-within {
    outline: 2px solid var(--famille-encre);
    outline-offset: 2px;
}
.bloc-detail { margin: 0 0 28px; max-width: 680px; }

.famille-carte {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dossier {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--le-blue);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.titre-famille { display: flex; align-items: center; gap: 10px; }

.famille-texte { flex: 1; min-width: 0; }
.famille-texte strong { display: block; font-size: 15px; color: var(--text-title); }
.famille-texte span { display: block; color: var(--text-muted); font-size: 12px; }

.bloc-sous-famille { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.modale button.secondaire { width: 100%; margin-top: 4px; color: var(--le-blue); border-color: var(--border-strong); }

button.icone {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modale {
    width: min(480px, calc(100% - 32px));
    border: none;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.modale::backdrop { background: rgba(0, 0, 100, 0.45); }

/* Confirmation commune (assets/backoffice/confirmation.js) : centrée, Annuler à gauche, l'action à droite. */
.modale.modale-confirmation { width: min(460px, calc(100% - 32px)); }
.modale-confirmation .modale-entete { align-items: flex-start; }
.modale-confirmation-etape { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--danger); }
.modale-confirmation-neutre .modale-confirmation-etape { color: var(--le-blue); }
.modale-confirmation-texte { margin: 4px 0 20px; font-size: 15px; line-height: 1.55; color: var(--text-title); }
.modale-confirmation-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modale.modale-confirmation .modale-confirmation-boutons button { width: 100%; margin: 0; padding: 11px; font-weight: 600; }
.modale-confirmation-boutons button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.modale-confirmation-boutons button.danger:hover { border-color: #991B1B; background: #991B1B; }
.modale-confirmation-boutons button.plein { border-color: var(--le-blue); background: var(--le-blue); color: #fff; }

.modale-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modale-entete h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0;
    color: var(--text-title);
}

button.fermer {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 22px;
    padding: 0;
    line-height: 1;
}

.etoile { color: var(--danger); }

.meta-famille { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 22px; }
.meta-libelle { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

.modale button.plein {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    background: var(--le-blue);
    border-color: var(--le-blue);
    font-weight: 600;
}

.choix-actif { display: flex; align-items: center; gap: 8px; }
.choix-actif input { width: auto; }
.choix-actif label { margin: 0; }
.aide-actif { color: var(--text-muted); font-size: 13px; margin-top: 0; }
.aide-sujet { font-weight: 400; color: var(--text-soft); }

.contenu-riche {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}
.contenu-riche > :first-child { margin-top: 0; }
.contenu-riche > :last-child { margin-bottom: 0; }
.contenu-riche h1,
.contenu-riche h2,
.contenu-riche h3 {
    font-family: var(--font-display);
    color: var(--text-title);
    margin: 1.1em 0 0.4em;
}
.contenu-riche p { margin: 0 0 0.75em; }
.contenu-riche ul,
.contenu-riche ol { margin: 0 0 0.85em; padding-left: 1.35em; }
.contenu-riche blockquote {
    margin: 0 0 0.85em;
    padding-left: 14px;
    border-left: 3px solid var(--le-cyan);
    color: var(--text-muted);
}
.contenu-riche code {
    font-size: 0.92em;
    background: var(--surface-soft);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.contenu-riche pre {
    background: var(--surface-soft);
    padding: 12px 14px;
    border-radius: var(--radius);
    overflow-x: auto;
}
.contenu-riche a { color: var(--le-blue); text-decoration: underline; }

.fiche-obligation { max-width: none; width: 100%; }
.regles { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.regles h2 { margin: 0 0 10px; font-size: 15px; color: var(--text-title); }
.regle-vide, .regle-apercu { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }
.regles h3 { margin: 16px 0 8px; font-size: 15px; color: var(--text-title); }
.regle-liste { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.regle-liste li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.regle-phrase { flex: 1; min-width: 180px; }
.regle-liste button.lien { margin-left: auto; }
.actions-critere { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.actions-critere form { margin: 0; display: flex; align-items: center; }
.actions-critere button,
.actions-critere button.plein.etroit,
.actions-critere button.danger.etroit {
    margin-top: 0;
    width: auto;
    padding: 8px 14px;
    line-height: 1.2;
    min-height: 36px;
}
.regles.vient-d-enregistrer .regle-liste li { background: var(--success-soft); border-color: #86efac; }
.regle-forme label { display: block; margin: 10px 0 4px; font-size: 13px; }
.regle-forme select, .regle-forme input, .regle-forme textarea { width: 100%; box-sizing: border-box; }
.regle-demander { display: flex !important; align-items: center; gap: 8px; font-size: 14px !important; }
.regle-demander input { width: auto; }
.retour { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.titre-obligation {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    padding: 4px 0 12px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-title);
}
.grille-obligation { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin: 18px 0 24px; }
.onglets { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.onglets button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    padding: 10px 4px;
    margin-right: 16px;
    font-weight: 500;
}
.onglets button[aria-selected="true"] {
    color: var(--le-blue);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.onglets.intercalaires {
    align-items: flex-end;
    gap: 6px;
    border-bottom: 3px solid var(--warning-mid);
    margin: 8px 0 28px;
    padding: 0;
}
.onglets.intercalaires button {
    background: var(--warning-soft);
    border: 1px solid #fdba74;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    color: var(--warning);
    font-weight: 600;
    margin: 0;
    padding: 12px 16px;
}
.onglets.intercalaires button[aria-selected="true"] {
    background: var(--warning-mid);
    border-color: var(--warning-mid);
    color: #fff;
    padding-bottom: 16px;
    position: relative;
    top: 3px;
}
.sous-familles label { display: block; margin: 14px 0 4px; }
.sous-familles select { width: 100%; }
.choix-ligne { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.choix-ligne input[type="text"] { flex: 1; }
.delai-champs { display: flex; gap: 12px; align-items: center; }
.delai-champs input { width: 120px; }
.delai-champs select { width: auto; flex: 1; }
.revoir section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin: 0 0 16px;
    box-shadow: var(--shadow);
}
.revoir h2 { margin: 0 0 16px; color: var(--text-title); font-family: var(--font-display); }
.revoir h3 { margin: 0 0 12px; color: var(--text-title); }
.revoir dl { margin: 0; }
.revoir dt { color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.revoir dd, .revoir p { margin: 2px 0 0; white-space: pre-wrap; }
.titre-statut h1 { flex: 1; font-size: 28px; margin: 0; }
.modale button.plein.etroit, button.plein.etroit {
    width: auto;
    margin-top: 28px;
    padding: 11px 28px;
    background: var(--le-blue);
    border-color: var(--le-blue);
    color: var(--le-white);
}
.fichier-actuel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.fichier-actuel button.lien { margin-left: auto; }
.depot .lien { color: var(--le-blue); text-decoration: underline; }

.depot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    background: var(--surface-soft);
}
label.depot input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
label.depot.survol { border-color: var(--le-blue); background: var(--surface-muted); }

.actions-cell {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}
.actions-cell form { margin: 0; display: inline-flex; align-items: center; }
button.lien {
    background: none;
    border: none;
    color: var(--le-blue);
    padding: 0;
    font-size: 13px;
    font-weight: 600;
}
button.lien.danger { color: var(--danger); }
button.danger {
    background: var(--surface);
    color: var(--danger);
    border-color: #fca5a5;
}
.modale button.danger {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    font-weight: 600;
}
.cases input, .choix input { width: auto; }
.cases > div > div, .choix > div { display: flex; align-items: center; gap: 8px; }
.cases label, .choix label { margin: 0; }
.connexion-figee { margin-top: 0; color: var(--text-title); }
.formulaire ul { list-style: none; margin: 0 0 8px; padding: 0; }
.formulaire li { color: var(--danger); font-size: 13px; }
.aide { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; }
.sous-onglet {
    margin: 16px 0 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
    color: var(--le-blue);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}
button.ajouter {
    background: var(--surface);
    color: var(--le-blue);
    border-color: var(--border-strong);
    margin: 4px 0 16px;
}

.arbre, .arbre ul { list-style: none; margin: 0; padding: 0; }
.arbre ul { padding-left: 28px; }
.arbre-ligne {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
}
.arbre-nom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.arbre-suite { display: flex; align-items: center; gap: 10px; }
.periode { color: var(--text-muted); font-size: 13px; min-width: 72px; text-align: right; }
.pastille {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.pastille-point { width: 10px; height: 10px; border-radius: 3px; }
.pastille.jaune { background: #fef3c7; border-radius: 50%; width: 22px; height: 22px; }
.pastille.jaune .pastille-point { background: #eab308; border-radius: 50%; }
a.icone {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button.icone.danger, a.icone.danger { color: var(--danger); border-color: #fecaca; }

.titre-statut { display: flex; align-items: center; gap: 12px; }
.titre-statut .titre-obligation { flex: 1; }
.actions-fiche { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.actions-fiche .aide-actif { flex-basis: 100%; margin: 0; }
.actions-fiche button.plein.etroit,
.actions-fiche button.secondaire.etroit { margin-top: 0; }
button.secondaire.etroit {
    width: auto;
    padding: 11px 28px;
    background: var(--surface);
    color: var(--le-blue);
    border-color: var(--border-strong);
}
.fil {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
}
.fil-sep { color: var(--text-soft); }
.pilule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    background: var(--surface);
}
.pilule::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #eab308;
}
.pilule.famille::before { background: var(--le-blue); }
.infos-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 32px;
}
.infos-grille p { margin: 6px 0 0; }

.confirmation {
    background: var(--success-soft);
    border: 1px solid #86efac;
    color: var(--success);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-weight: 600;
    margin: 0 0 16px;
}
.suite { margin-top: 8px; }
.suite a { text-decoration: underline; color: var(--le-blue); }
.choix-etablissement {
    width: min(420px, calc(100% - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 16px;
    box-shadow: var(--shadow-lg);
}
.choix-etablissement h2 { margin: 0 0 12px; font-size: 18px; font-family: var(--font-display); color: var(--text-title); }
.choix-etablissement fieldset { border: 0; margin: 16px 0 0; padding: 0; }
.choix-etablissement legend { font-weight: 600; margin-bottom: 8px; }
.choix-ligne { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.choix-ligne input { width: auto; margin-top: 4px; }
.choix-ligne small { display: block; color: var(--text-muted); }

/* ——— Espace PME ——— */
.espace {
    min-height: 100vh;
    background: var(--surface-soft);
    display: grid;
    /* Une colonne à la largeur de l'écran : une rangée qui défile ne l'élargit pas. */
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}
.espace-app {
    width: min(420px, 100%);
    min-height: 100vh;
    background: var(--surface);
    color: var(--text);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.espace-corps { flex: 1; padding: 12px 16px 168px; }
.espace-corps h1 {
    margin: 8px 0 4px;
    font-size: 28px;
    font-family: var(--font-display);
    color: var(--text-title);
}
.espace-corps h2 {
    margin: 28px 0 10px;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.espace-resume { margin: 0 0 16px; color: var(--text-muted); }
.tache-fiche { margin: 0 0 20px; }
.tache-fiche a { font-weight: 600; color: var(--le-blue); text-decoration: underline; text-underline-offset: 3px; }
.espace-vide { color: var(--text-muted); }
.espace-cartes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.espace-cartes li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}
.espace-obligation {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 14px;
    color: inherit;
    text-decoration: none;
}
.espace-cartes strong, .espace-cartes small { display: block; }
.espace-cartes strong { color: var(--text-title); }
.espace-cartes small { color: var(--text-muted); margin-top: 2px; }
.espace-point { width: 10px; height: 10px; border-radius: 50%; }
.espace-cartes em {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
}
.espace-cartes em.faire { color: var(--warning); background: var(--warning-soft); }
.espace-cartes em.retard { color: #fff; background: var(--danger); }
.espace-cartes em.planifiee { color: #fff; background: var(--le-blue); }
.espace-cartes em.traitee { color: #fff; background: var(--success); }
.espace-cartes-longues { padding-right: 4px; }
.espace-historique { list-style: none; margin: 0; padding: 0; }
.espace-historique a { color: inherit; text-decoration: none; }
.espace-historique span { color: var(--success); margin-right: 4px; }


/* Une réponse donnée avant une évolution du critère : elle s'applique toujours, l'établissement est invité à la revoir. */
.espace-a-revoir { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid #FED7AA; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning); font-size: 14px; }
.espace-a-revoir a { font-weight: 700; color: var(--warning); text-decoration: underline; text-underline-offset: 3px; }
.critere-a-revoir { margin: 16px 0 6px; padding: 10px 12px; border-left: 3px solid var(--warning-mid); border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 13.5px; }
.critere-a-revoir-formulaire { padding-left: 12px; border-left: 3px solid var(--warning-mid); }
/* Un choix : boutons radio ; plusieurs : cases à cocher. Une réponse par ligne. */
.choix.choix-liste { flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0 8px; }
.choix-liste label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.choix-liste input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--le-blue); }

/* ——— Session expirée pendant une saisie : bandeau en haut de l'écran, la page reste en place ——— */
.session-expiree {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 100;
    width: min(680px, calc(100% - 32px));
    padding: 14px 18px;
    border: 1px solid #FED7AA;
    border-left: 4px solid var(--warning);
    border-radius: 12px;
    background: var(--warning-soft);
    box-shadow: 0 12px 32px rgba(0, 0, 100, 0.18);
    color: var(--text-title);
    font-size: 14px;
    line-height: 1.5;
    transform: translateX(-50%);
}
.session-expiree p { margin: 0; }
.session-expiree a { font-weight: 700; color: var(--le-blue); text-decoration: underline; text-underline-offset: 3px; }

/* ——— Menu du compte : l'avatar en haut à droite ouvre « Mon compte » et « Se déconnecter » ——— */
.menu-compte { position: relative; }
.menu-compte > summary { list-style: none; cursor: pointer; }
.menu-compte > summary::-webkit-details-marker { display: none; }
.menu-compte-bouton { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.menu-compte-bouton:hover { border-color: var(--le-blue); }
.menu-compte-bouton:focus-visible { outline: 3px solid var(--le-cyan); outline-offset: 2px; }
.menu-compte[open] > .menu-compte-bouton { border-color: var(--le-blue); box-shadow: 0 0 0 3px rgba(0, 50, 185, 0.12); }
.menu-compte-initiales { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--le-blue); }
.menu-compte-panneau {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 290px;
    max-width: calc(100vw - 32px);
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(0, 0, 100, 0.16);
    animation: menu-compte-ouverture 0.14s ease-out;
}
@keyframes menu-compte-ouverture { from { opacity: 0; transform: translateY(-4px); } }
.menu-compte-identite { display: grid; gap: 1px; margin: 0 0 4px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); }
.menu-compte-identite strong { overflow: hidden; font-size: 14px; color: var(--text-title); text-overflow: ellipsis; white-space: nowrap; }
.menu-compte-identite small { overflow: hidden; font-size: 12.5px; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.menu-compte-espace { justify-self: start; margin-top: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-muted); font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.menu-compte-panneau ul { margin: 0; padding: 0; list-style: none; }
.menu-compte-rubrique { margin: 4px 0 2px; padding: 4px 12px 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-soft); }
.menu-compte-panneau ul.menu-compte-espaces { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-compte-panneau a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-title); text-decoration: none; }
.menu-compte-panneau a:hover, .menu-compte-panneau a:focus-visible { background: var(--surface-soft); color: var(--le-blue); outline: none; }
.menu-compte-panneau a:focus-visible { box-shadow: inset 0 0 0 2px var(--le-cyan); }
.menu-compte-panneau svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-compte-panneau a.menu-compte-deconnexion { color: var(--danger); }
.menu-compte-panneau a.menu-compte-deconnexion:hover, .menu-compte-panneau a.menu-compte-deconnexion:focus-visible { background: var(--danger-soft); color: var(--danger); }
/* Dans l'espace entreprise : l'établissement affiché, en évidence, ceux vers lesquels basculer, et l'ajout. */
.menu-compte-lieux { margin: 0 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-compte-panneau .menu-compte-lieu {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--text-title);
    font: inherit;
    text-align: left;
}
.menu-compte-panneau button.menu-compte-lieu { cursor: pointer; }
.menu-compte-panneau button.menu-compte-lieu:hover, .menu-compte-panneau button.menu-compte-lieu:focus-visible { border: 0; background: var(--surface-soft); color: var(--le-blue); outline: none; }
.menu-compte-panneau button.menu-compte-lieu:focus-visible { box-shadow: inset 0 0 0 2px var(--le-cyan); }
.menu-compte-panneau .menu-compte-actif { margin: 2px 0 6px; box-shadow: inset 0 0 0 1.5px var(--le-blue); background: #EEF3FD; }
.menu-compte-logo { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-muted); color: var(--le-blue); font-size: 14px; font-weight: 800; }
img.menu-compte-logo { border: 1px solid var(--border); background: #fff; object-fit: cover; }
.menu-compte-actif span.menu-compte-logo { background: var(--le-blue); color: #fff; }
.menu-compte-lieu-nom { display: grid; flex: 1; gap: 1px; min-width: 0; }
.menu-compte-lieu-nom strong { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.menu-compte-lieu-nom small { overflow: hidden; color: var(--text-soft); font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.menu-compte-lieu-nom small.menu-compte-a-completer { color: var(--warning); font-weight: 600; }
.menu-compte-actif .menu-compte-lieu-nom strong { color: var(--le-navy); font-weight: 700; }
.menu-compte-panneau .menu-compte-coche { width: 18px; height: 18px; stroke: var(--le-blue); stroke-width: 2.4; }
.menu-compte-prefere { color: #F59E0B; }
.menu-compte-panneau a.menu-compte-attente { color: var(--warning); font-weight: 600; }
.menu-compte-panneau ul.menu-compte-autres { max-height: min(240px, 40vh); overflow-y: auto; }
.menu-compte-autres form { margin: 0; }
.menu-compte-panneau a.menu-compte-ajout { margin-top: 2px; color: var(--le-blue); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .menu-compte-panneau { animation: none; } }

/* ——— Page « Mon compte » du back-office ——— */
.page:has(> .compte) { background: var(--surface-soft); }
.compte { display: grid; gap: 18px; max-width: 980px; }
.compte :where(h1, h2) { margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--text-title); }
.compte :where(p, dl, dd, ul) { margin: 0; }
.compte-entete { position: relative; display: flex; align-items: center; gap: 20px; overflow: hidden; padding: 24px 26px 24px 30px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.compte-entete::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--gradient-principal, var(--le-blue)); }
.compte-avatar { display: grid; flex: none; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--le-blue); color: var(--le-white); font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.compte-surtitre { margin-bottom: 2px !important; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-soft); }
.page .compte-entete h1 { margin: 0; font-size: 25px; }
.compte-email { margin-top: 2px !important; font-size: 14px; color: var(--text-muted); }
.compte-espaces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; }
.compte-espaces span { padding: 2px 10px; border-radius: 999px; background: #E6FAFE; color: var(--le-navy); font-size: 12px; font-weight: 600; }

.compte-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.compte-carte { display: grid; align-content: start; gap: 12px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.compte-carte h2 { font-size: 16px; }
.compte-large { grid-column: 1 / -1; }
.compte-aide { margin-top: -6px !important; font-size: 13px; color: var(--text-soft); }
.compte-carte dl { display: grid; gap: 10px; }
.compte-carte dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.compte-carte dt { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.compte-carte dd { overflow-wrap: anywhere; font-size: 14px; color: var(--text-title); }

.compte-familles { display: grid; gap: 8px; padding: 0; list-style: none; }
.compte-familles li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--encre); border-radius: 12px; }
.compte-famille-point { width: 10px; height: 10px; flex: none; border: 2px solid var(--encre); border-radius: 50%; background: var(--fond); }
.compte-famille-texte { display: grid; flex: 1; min-width: 0; }
.compte-famille-texte strong { font-size: 14px; color: var(--text-title); }
.compte-famille-texte strong small { font-weight: 500; color: var(--text-muted); }
.compte-famille-texte > small { font-size: 12px; color: var(--text-soft); }
.compte-droits { display: flex; flex-wrap: wrap; gap: 6px; }
.compte-droits span { padding: 1px 8px; border-radius: 999px; background: var(--fond); color: var(--encre); font-size: 12px; font-weight: 600; }

.compte-session { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; }
.compte-session p { margin-top: 4px !important; font-size: 14px; color: var(--text-muted); }
.compte-deconnexion { color: var(--danger) !important; border-color: #FECACA !important; }
.compte-deconnexion:hover { background: var(--danger-soft) !important; }

@media (max-width: 760px) {
    .compte-grille, .compte-session { grid-template-columns: minmax(0, 1fr); }
    .compte-carte dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .compte-entete { padding: 18px; }
}

/* ——— Badges de rôle (liste des utilisateurs) : un compte peut cumuler les trois espaces ——— */
.table .col-roles { width: 9.5rem; }
.badge.badge-role { font-weight: 600; white-space: nowrap; }
.badge.badge-admin { background: var(--le-navy); color: var(--le-white); }
.badge.badge-contributeur { background: #EFE6FB; color: #5B3A99; }
.badge.badge-utilisateur { background: #E6FAFE; color: var(--le-blue); }

/* Support : les signalements et les messages des personnes en attente d'un accès. */
.support-demande { display: grid; gap: 10px; margin: 0 0 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.support-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.support-tete small { flex-basis: 100%; color: var(--text-muted); }
.support-auteur, .support-message { margin: 0; }
.support-message { padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); white-space: pre-line; }
.support-formulaire { display: grid; gap: 10px; justify-items: start; }
.support-formulaire fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.support-formulaire legend { margin-bottom: 4px; font-weight: 600; }
.support-formulaire label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.support-formulaire input[type="checkbox"] { width: auto; margin: 0; }
