/* Gatekeeper — règles propres à l'application, par-dessus gatekeeper.css (tokens et composants de la maquette).
   Aucune couleur, taille ou rayon hors des variables de la maquette. */

/* Navigation latérale : des liens, pas des boutons */
.nav a { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--r); color: var(--t2); font-size: 13.5px; }
.nav a:hover { background: var(--s2); color: var(--t1); }
.nav a.on { background: var(--s3); color: var(--t1); font-weight: 500; }
.nav a .n { background: var(--s3); color: var(--t2); border-radius: 10px; padding: 0 7px; font-size: 11.5px; line-height: 18px; }
.nav a.on .n { background: var(--s1); }
.side .entity { text-decoration: none; }
.side .entity:hover { background: var(--s3); }
.side .foot { line-height: 1.6; }

/* Barre haute : recherche, avatar, thème */
.top-droite { display: flex; align-items: center; gap: 14px; }
.recherche { position: relative; width: 280px; }
.recherche-champ { width: 100%; box-sizing: border-box; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--s2); color: var(--t1); font: inherit; font-size: 13px; }
.recherche-champ:focus { outline: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); border-color: var(--acc); }
.recherche-resultats { position: absolute; top: 36px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); z-index: 30; }
.recherche-item { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--t1); }
.recherche-item .m { color: var(--t3); font-size: 12px; }
.recherche-item .pill { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.recherche-item:hover, .recherche-item.on { background: var(--s3); }
.recherche-vide { padding: 8px 10px; color: var(--t3); font-size: 13px; }
.avatar { position: relative; }
.avatar summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--t2); }
.avatar summary::-webkit-details-marker { display: none; }
.avatar-menu { position: absolute; right: 0; top: 36px; min-width: 240px; z-index: 30; }
.avatar-menu .bd { display: grid; gap: 10px; }

/* Page : toutes les sections visibles (la maquette n'en montrait qu'une à la fois) */
.page { display: flex; }
.sec { display: flex; }
.page-fixe .head.fixe { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 10px 0; margin: -10px 0 0; }
.fixe-haut { position: sticky; top: 74px; z-index: 5; background: var(--bg); }
.head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.actions form { display: inline; }
a.btn { text-decoration: none; display: inline-block; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.a-venir { display: inline-flex; align-items: center; gap: 8px; }
.a-venir .note { border: 0; padding: 0; margin: 0; white-space: nowrap; }
.pied-section { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.card .bd .pied-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.vide { color: var(--t3); }
.list .vide-ligne { padding: 12px 16px; color: var(--t3); font-size: 13px; }
.card .bd p { margin: 0 0 10px; line-height: 1.5; }
.card .bd p:last-child { margin-bottom: 0; }
.card h3 { margin: 16px 0 6px; font-size: 13px; font-weight: 500; color: var(--t2); }
.card h3:first-child { margin-top: 0; }
.grid2, .grid3 { align-items: start; }
table a { color: inherit; text-decoration: none; }
tbody tr.cliquable { cursor: pointer; }
td.droite, th.droite { text-align: right; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a.chip { text-decoration: none; }

/* Dossier : rail en liens, sections repliées, panneau latéral */
.dossier { grid-template-columns: 200px 1fr 300px; }
.rail a { all: unset; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 7px 8px; border-radius: var(--r); width: 100%; color: var(--t2); font-size: 13px; box-sizing: border-box; }
.rail a:hover { background: var(--s2); }
.rail a.on { background: var(--s3); color: var(--t1); }
.rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 130px; }
.side-panel { position: sticky; top: 130px; }
.repli > summary { list-style: none; cursor: pointer; }
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary .hd { align-items: center; }
.repli-ligne { color: var(--t2); font-size: 13px; margin-left: auto; margin-right: 12px; }
.repli:not([open]) > summary .hd { border-bottom: 0; }
.card .hd .droite { display: flex; gap: 10px; align-items: center; }
.completude { display: flex; gap: 24px; align-items: center; }
.completude .bar { flex: 1; }
.completude .texte { font-size: 13px; color: var(--t2); white-space: nowrap; }
.completude .texte b { color: var(--t1); }
@media (max-width: 1100px) { .dossier { grid-template-columns: 1fr; } .rail, .side-panel { position: static; } .rail { flex-direction: row; flex-wrap: wrap; } }

/* Pièces */
.vault { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 1100px) { .vault { grid-template-columns: 1fr; } }

/* La porte */
.porte { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.porte-carte { width: 100%; max-width: 420px; }
.porte-carte .bd { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 28px; }
.porte-bouton { width: 100%; box-sizing: border-box; text-align: center; }
.porte-motif { margin: 0; color: var(--bad); font-weight: 500; }
.porte-texte { margin: 0; color: var(--t2); font-size: 13.5px; }
.ligne-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.identifier > summary { list-style: none; cursor: pointer; }
.identifier > summary::-webkit-details-marker { display: none; }
.identifier-form input[type=text], .identifier-form input[type=date], .identifier-form select { height: 28px; }
.fields input[type=radio], .fields input[type=checkbox] { margin: 0 6px 0 0; }
label.chk { cursor: pointer; }

/* Le parcours : mode « Compléter », plein écran sur le contenu, une question à la fois */
.parcours { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.parcours-bar { width: 100%; height: 4px; border-radius: 0; }
.parcours-haut { width: 100%; max-width: 760px; display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px 0; font-size: 13px; color: var(--t2); }
.parcours-haut .m { color: var(--t3); font-size: 12px; }
.parcours-corps { width: 100%; max-width: 760px; padding: 48px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.parcours-question { font: 500 22px/1.35 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: 0; color: var(--t1); }
.parcours-aide { margin: 0; color: var(--t2); font-size: 14px; }
.parcours-source { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.parcours-citation { color: var(--t3); font-size: 12.5px; }
.parcours-champ { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--s2); color: var(--t1); font: inherit; font-size: 15px; }
.parcours-champ:focus { outline: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); border-color: var(--acc); }
textarea.parcours-champ { resize: vertical; min-height: 96px; line-height: 1.5; }
.parcours-choix { display: flex; flex-direction: column; gap: 2px; }
.parcours-choix .chk { padding: 8px 10px; border-radius: var(--r); font-size: 14px; }
.parcours-choix .chk:hover { background: var(--s2); }
.parcours-choix input { margin: 3px 0 0; }
.parcours-personnes { display: grid; grid-template-columns: 1.4fr 1.2fr 80px 1fr; gap: 6px 8px; align-items: center; }
.parcours-personnes .m { color: var(--t3); font-size: 12px; }
.parcours-personnes input { box-sizing: border-box; height: 32px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--s2); color: var(--t1); font: inherit; font-size: 13.5px; }
.parcours-attestation.fields { grid-template-columns: 140px 1fr; }
.parcours-attestation .parcours-champ { font-size: 14px; padding: 7px 10px; }
.parcours-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.parcours-actions .note { margin-left: auto; }

/* L'import box : propositions comprises, manques, incohérences */
.compris .row { grid-template-columns: 1fr auto; }
.compris .valeur { font-size: 14px; }
.compris .citation { color: var(--t3); font-size: 12px; }
.compris .actions-ligne { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.compris .actions-ligne form { display: inline; }
.compris .corriger > summary { list-style: none; cursor: pointer; }
.compris .corriger > summary::-webkit-details-marker { display: none; }
.compris .corriger[open] { grid-column: 1 / -1; }
.compris .corriger form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.compris .corriger input { height: 28px; }
.manques .row { grid-template-columns: 1fr auto; }

/* Section D : détenteurs de parts (ce que les pièces disent) */
table.detenteurs { width: 100%; }
table.detenteurs tr.total td { border-top: 1px solid var(--line); color: var(--t2); font-size: 13px; }

/* Import box : zone de dépôt pleine largeur, progression par fichier */
.zone-depot { border: 2px dashed var(--line); border-radius: var(--r); padding: 26px 20px; text-align: center; background: var(--s2); cursor: pointer; outline: none; }
.zone-depot.on, .zone-depot:focus { border-color: var(--acc); background: var(--s3); }
.zone-depot .zone-titre { font-size: 15px; font-weight: 500; color: var(--t1); }
.zone-depot .zone-sous { font-size: 13px; color: var(--t2); margin-top: 4px; }
.zone-lien { color: var(--acc); text-decoration: underline; cursor: pointer; }
.zone-natif { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.zone-fichiers-liste { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.depot-fichier { display: grid; grid-template-columns: 1fr 160px 200px; gap: 12px; align-items: center; font-size: 13px; }
.depot-fichier .bar { width: 160px; }
.depot-fichier.ok .bar i { background: var(--ok); }
.depot-fichier.bad .bar i { background: var(--bad); }
.depot-fichier.bad .etat { color: var(--bad); }
.zone-aide { margin-top: 10px; }
.zone-aide > summary { cursor: pointer; list-style: none; color: var(--t3); font-size: 12.5px; }
.zone-aide > summary::-webkit-details-marker { display: none; }

/* Section G : la chronologie (preuve de diligence) — une ligne par fait, du plus récent au plus ancien à l'écran */
table.chronologie { width: 100%; }
table.chronologie td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
table.chronologie td.ts { white-space: nowrap; color: var(--t2); font-variant-numeric: tabular-nums; width: 84px; }
table.chronologie .cat { display: inline-block; font-size: 11px; color: var(--t2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
table.chronologie .cat.screening, table.chronologie .cat.controle { color: var(--acc); border-color: var(--acc); }
table.chronologie .cat.visa, table.chronologie .cat.classification { color: var(--ok); border-color: var(--ok); }
