/* GestionFi : charte du site autonomieetsolidarite.fr (couleurs, polices Albert Sans et Merriweather, boutons en
   pilule). Les polices sont servies par l'application : aucune page n'appelle un service externe. */

@font-face {
  font-family: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(polices/albert-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(polices/albert-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Merriweather"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(polices/merriweather-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Merriweather"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(polices/merriweather-latin-ext-400-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Couleurs du site */
  --sarcelle: #008a8f; --sarcelle-clair: #9cd4d8; --bleu: #2d307a; --bleu-clair: #6bb2e3;
  --brun: #ca8965; --brun-pale: #fde6da; --noir: #000a0a; --gris-fonce: #656565; --gris-clair: #d9d9d9;
  /* Nuances pour la lisibilite (contraste AA) : fond des boutons, liens et petits textes, survol */
  --sarcelle-action: #007f84; --sarcelle-texte: #007377; --sarcelle-fonce: #005f63;
  --sarcelle-pale: #e3f2f3; --sarcelle-voile: #f1f8f8; --bleu-pale: #edf7ff; --brun-texte: #8f4f2c;
  --texte: #1d2a2b; --discret: var(--gris-fonce); --bord: #dbe4e4; --bord-fort: #c3d0d0; --ligne: #e9efef;
  --fond: #f4f8f8; --carte: #fff;
  --ok: #1b7a45; --ok-pale: #e6f4ec; --danger: #b42318; --danger-fonce: #8f1c13; --danger-pale: #fdecea;
  --info: #24497a;
  --rayon: 12px; --rayon-petit: 8px;
  --ombre: 0 1px 2px rgb(0 10 10 / .05), 0 2px 8px rgb(0 10 10 / .04);
  --ombre-forte: 0 10px 30px rgb(0 10 10 / .14), 0 2px 6px rgb(0 10 10 / .06);
  --police: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-titre: "Merriweather", Georgia, "Times New Roman", serif;
  --hauteur-bandeau: 67px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hauteur-bandeau) + 1rem); }
body { margin: 0; min-height: 100vh; font: 15px/1.5 var(--police); color: var(--texte); background: var(--fond);
  -webkit-font-smoothing: antialiased; }
a { color: var(--sarcelle-texte); text-decoration: none; text-underline-offset: 2px; }
a:hover { color: var(--sarcelle-fonce); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--sarcelle-clair); outline-offset: 2px; }
::selection { background: var(--sarcelle-pale); color: var(--noir); }
img { max-width: 100%; }
p { margin: 0 0 .75rem; }
code { font: .85em/1.4 ui-monospace, Consolas, monospace; background: var(--sarcelle-voile); padding: .1em .35em;
  border-radius: 4px; color: var(--bleu); }
strong { font-weight: 650; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 1rem; top: -100px; z-index: 100; padding: .5rem 1rem; border-radius: 999px;
  background: var(--bleu); color: #fff; }
.evitement:focus { top: .75rem; color: #fff; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- Titres ---------- */
h1, h2, h3 { color: var(--bleu); }
h1 { font: italic 400 1.8rem/1.3 var(--police-titre); margin: 0 0 .3rem; }
h2 { font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin: 1.75rem 0 .8rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.25rem 0 .5rem; }
.sous-titre { color: var(--discret); margin: 0 0 1.25rem; max-width: 80ch; }
.vide { color: var(--discret); font-style: italic; }
p.vide { display: flex; align-items: center; gap: .55rem; padding: .8rem 1rem; border: 1px dashed var(--bord-fort);
  border-radius: var(--rayon-petit); background: var(--sarcelle-voile); }
p.vide::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--sarcelle); opacity: .7;
  -webkit-mask: var(--icone-info) center / contain no-repeat; mask: var(--icone-info) center / contain no-repeat; }
.compte { color: var(--discret); font-size: .875rem; margin: .5rem 0; }
.note { color: var(--discret); font-size: .875rem; margin: .75rem 0 0; }
.aide { display: block; margin-top: .3rem; font-size: .8rem; font-weight: 400; color: var(--discret); }
.requis { color: var(--brun-texte); font-weight: 700; margin-left: .15rem; }
.marque-fiche { color: var(--brun-texte); font-size: .85em; font-weight: 600; }
.montant-etat { font-weight: 650; margin: .5rem 0; }

/* ---------- Bandeau ---------- */
.bandeau { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--bord);
  box-shadow: 0 2px 12px rgb(0 10 10 / .05); }
.bandeau::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--sarcelle), var(--bleu)); }
.bandeau-interieur { display: flex; align-items: center; gap: 1rem; height: 64px; padding: 0 1.5rem; max-width: 1920px; margin: 0 auto; }
.marque { display: flex; align-items: center; gap: .8rem; flex: none; color: var(--bleu); }
.marque:hover { text-decoration: none; color: var(--bleu); }
.marque img { display: block; width: auto; height: 40px; }
.marque-appli { padding-left: .8rem; border-left: 1px solid var(--bord); font-weight: 750; font-size: 1.05rem; letter-spacing: .01em; }
.navigation { display: flex; align-items: center; gap: .15rem; margin-left: .5rem; }
.navigation a { display: flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border-radius: 999px; color: var(--bleu);
  font-weight: 550; white-space: nowrap; transition: background-color .15s, color .15s; }
.navigation a:hover { background: var(--sarcelle-voile); color: var(--sarcelle-fonce); text-decoration: none; }
.navigation a[aria-current] { background: var(--sarcelle-pale); color: var(--sarcelle-fonce); font-weight: 700; }
.navigation .ico { color: var(--sarcelle); }
.bouton-menu { display: none; align-items: center; gap: .4rem; padding: .45rem .9rem; border: 1px solid var(--bord-fort);
  border-radius: 999px; background: #fff; color: var(--bleu); font: inherit; font-weight: 600; cursor: pointer; }
.bouton-menu:hover, .bouton-menu[aria-expanded=true] { background: var(--sarcelle-pale); border-color: var(--sarcelle); }

.recherche-rapide { position: relative; flex: 0 1 270px; min-width: 150px; margin: 0 0 0 auto; }
.recherche-rapide > .ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--discret); pointer-events: none; }
.recherche-rapide input { min-height: 40px; margin: 0; padding: 0 2.4rem 0 2.5rem; border-radius: 999px; background: var(--fond); }
.recherche-rapide input:focus { background: #fff; }
.recherche-rapide .raccourci { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.recherche-rapide input:focus ~ .raccourci, .recherche-rapide input:not(:placeholder-shown) ~ .raccourci { display: none; }
kbd { display: inline-grid; place-items: center; min-width: 1.55em; padding: 0 .35rem; border: 1px solid var(--bord-fort);
  border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--discret); font: 650 .75rem/1.45 var(--police); }
.suggestions mark { background: var(--brun-pale); color: inherit; border-radius: 3px; padding: 0 .05em; }
.suggestions { position: absolute; right: 0; top: calc(100% + .45rem); width: max(100%, 340px); max-width: calc(100vw - 1.5rem);
  margin: 0; padding: .35rem; list-style: none; background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); z-index: 60; }
.suggestions a { display: flex; flex-direction: column; padding: .5rem .75rem; border-radius: var(--rayon-petit); color: var(--texte); }
.suggestions a strong { color: var(--bleu); font-weight: 650; }
.suggestions a small { color: var(--discret); }
.suggestions a:hover, .suggestions [aria-selected=true] a { background: var(--sarcelle-pale); text-decoration: none; }
.suggestions .aucune { padding: .55rem .75rem; color: var(--discret); }

.menu-utilisateur { position: relative; flex: none; }
.avatar-bouton { display: flex; align-items: center; gap: .55rem; padding: .25rem .65rem .25rem .25rem; border: 1px solid transparent;
  border-radius: 999px; background: none; color: var(--texte); font: inherit; cursor: pointer; }
.avatar-bouton:hover, .avatar-bouton[aria-expanded=true] { background: var(--sarcelle-voile); border-color: var(--bord); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bleu); color: #fff;
  font-weight: 700; font-size: .82rem; letter-spacing: .03em; }
.nom-utilisateur { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.avatar-bouton .ico { color: var(--discret); }
.menu-deroulant { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 270px; padding: .4rem; background: #fff;
  border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-forte); z-index: 60; }
.menu-deroulant[hidden] { display: none; }
.menu-entete { margin: 0 0 .35rem; padding: .5rem .75rem .65rem; border-bottom: 1px solid var(--bord); font-weight: 650; color: var(--bleu); }
.menu-entete small { display: block; font-weight: 400; color: var(--discret); }
.menu-deroulant a, .lien-menu { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .75rem; border: 0;
  border-radius: var(--rayon-petit); background: none; color: var(--texte); font: inherit; text-align: left; cursor: pointer; }
.menu-deroulant a:hover, .lien-menu:hover { background: var(--sarcelle-voile); color: var(--sarcelle-fonce); text-decoration: none; }
.menu-deroulant .ico { color: var(--sarcelle); }
.menu-deroulant form { margin: .35rem 0 0; padding-top: .35rem; border-top: 1px solid var(--bord); }

/* ---------- Page ---------- */
main { max-width: 1920px; margin: 0 auto; padding: 1.25rem 1.5rem 2.5rem; }
.ariane ol { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; margin: 0 0 .9rem; padding: 0; list-style: none;
  font-size: .85rem; color: var(--discret); }
.ariane li { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.ariane li + li::before { content: "›"; margin: 0 .3rem; color: var(--bord-fort); font-size: 1.15em; line-height: 1; }
.ariane a { color: var(--discret); }
.ariane a:hover { color: var(--sarcelle-texte); }
.ariane [aria-current] { max-width: 45ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte); font-weight: 550; }
.entete-page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.entete-page > div:first-child { min-width: 0; flex: 1 1 420px; }
.entete-page .sous-titre { margin-bottom: 0; }
.entete-page .pastilles { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.actions, .actions-page, .actions-fiche { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.actions-fiche { margin: 0 0 1rem; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--ombre); }
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.carte-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-bottom: .9rem; }
.carte-entete h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.carte-entete h2 .ico { color: var(--sarcelle); }
.etroite { max-width: 460px; margin: 3rem auto; }
/* Accueil : les cartes s'empilent sur deux colonnes, sans les vides d'une grille a lignes communes */
.mosaique { columns: 2 460px; column-gap: 1.25rem; }
.mosaique > * { break-inside: avoid; }
/* Fiche : les onglets et le bouton de l'onglet ouvert sur une meme ligne */
.barre-onglets { display: flex; align-items: flex-end; gap: .5rem 1.5rem; margin: 0 0 1.25rem; box-shadow: inset 0 -1px 0 var(--bord); }
.barre-onglets .onglets { flex: 1 1 auto; min-width: 0; margin: 0; border-bottom: 0; }
.barre-onglets .onglets a { margin-bottom: 0; }
.barre-onglets > .actions { flex: none; align-self: center; padding: .35rem 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 1.25rem; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 0 1.25rem; align-items: start; }
dl.champs { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: .55rem 1.25rem; margin: 0 0 .75rem; }
dl.champs dt { color: var(--discret); font-size: .875rem; padding-top: .05rem; }
dl.champs dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
dl.champs + dl.champs { padding-top: .75rem; border-top: 1px dashed var(--bord); }
hr { border: 0; border-top: 1px solid var(--bord); margin: 1.25rem 0; }

/* ---------- Formulaires ---------- */
form { margin: 0; }
label { display: block; margin: 0 0 .95rem; color: var(--texte); font-size: .875rem; font-weight: 600; }
input, select, textarea { display: block; width: 100%; min-height: 42px; margin-top: .35rem; padding: .5rem .8rem;
  font: inherit; font-size: .95rem; font-weight: 400; color: var(--texte); background: #fff;
  border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #9fb4b4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sarcelle); box-shadow: 0 0 0 3px rgb(0 138 143 / .2); }
select { appearance: none; padding-right: 2.4rem; cursor: pointer; background: #fff no-repeat right .75rem center / 16px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007377' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
select[multiple] { min-height: 130px; padding-right: .8rem; background-image: none; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0;
  padding: 0; vertical-align: middle; accent-color: var(--sarcelle-action); cursor: pointer; flex: none; }
input[type=file] { padding: .4rem; background: var(--sarcelle-voile); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { margin-right: .8rem; padding: .4rem 1rem; border: 0; border-radius: 999px;
  background: var(--sarcelle-action); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { background: var(--fond); color: var(--discret); cursor: not-allowed; }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--danger); }
input:user-invalid:focus, select:user-invalid:focus, textarea:user-invalid:focus { box-shadow: 0 0 0 3px rgb(180 35 24 / .15); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
label.case { display: flex; align-items: center; gap: .6rem; font-weight: 550; }
label[hidden] { display: none; }
.erreur { display: block; margin-top: .3rem; color: var(--danger); font-size: .85rem; font-weight: 600; }
label:has(> .erreur) :is(input, select, textarea) { border-color: var(--danger); }
.formulaire-pied { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .5rem; padding-top: 1rem;
  border-top: 1px solid var(--ligne); }
/* Formulaire long : la barre des boutons reste en bas de l'ecran tant que le formulaire est affiche ;
   classe « flottant » posee par app.js quand elle est detachee de sa place */
form.carte > .formulaire-pied:last-child { position: sticky; bottom: -1px; z-index: 5; margin: .5rem -1.5rem -1.25rem;
  padding: .9rem 1.5rem 1.25rem; background: #fff; border-radius: 0 0 var(--rayon) var(--rayon); transition: box-shadow .15s; }
form.carte > .formulaire-pied.flottant { border-radius: 0; border-top-color: var(--bord); box-shadow: 0 -10px 22px -14px rgb(0 10 10 / .35); }
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; padding: 1rem 1.25rem; }
.filtres label { flex: 1 1 170px; min-width: 0; margin: 0; }
.filtres label:has(> input[type=search]) { flex: 2 1 240px; }
.filtres .actions { flex: 0 0 auto; flex-wrap: nowrap; }
.cases > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .2rem 1rem; }
.cases label { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; font-weight: 500; }
.cases input { margin: 0; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Boutons ---------- */
.bouton, main button[type=submit]:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 42px; padding: .55rem 1.3rem;
  border: 1.5px solid var(--sarcelle-action); border-radius: 999px; background: var(--sarcelle-action); color: #fff;
  font: inherit; font-size: .95rem; font-weight: 650; line-height: 1.2; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; box-shadow: 0 1px 2px rgb(0 10 10 / .08), 0 3px 8px rgb(0 127 132 / .2);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.bouton:hover, main button[type=submit]:not([class]):hover { background: var(--sarcelle-fonce); border-color: var(--sarcelle-fonce);
  color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 14px rgb(0 95 99 / .28); }
.bouton:active { transform: none; box-shadow: none; }
.bouton:focus-visible { outline: 3px solid var(--sarcelle-clair); outline-offset: 2px; }
.bouton .ico { width: 18px; height: 18px; }
.bouton.secondaire { background: #fff; color: var(--sarcelle-texte); box-shadow: none; }
.bouton.secondaire:hover { background: var(--sarcelle-pale); border-color: var(--sarcelle-fonce); color: var(--sarcelle-fonce); }
.bouton.discret { background: transparent; border-color: transparent; color: var(--sarcelle-texte); box-shadow: none; padding-inline: .9rem; }
.bouton.discret:hover { background: var(--sarcelle-voile); color: var(--sarcelle-fonce); transform: none; box-shadow: none; }
.bouton.danger { background: var(--danger); border-color: var(--danger); box-shadow: 0 3px 8px rgb(180 35 24 / .2); }
.bouton.danger:hover { background: var(--danger-fonce); border-color: var(--danger-fonce); box-shadow: 0 6px 14px rgb(143 28 19 / .28); }
.bouton.danger.secondaire { background: #fff; color: var(--danger); box-shadow: none; }
.bouton.danger.secondaire:hover { background: var(--danger-pale); color: var(--danger-fonce); }
.bouton.petit { min-height: 34px; padding: .3rem .9rem; font-size: .85rem; gap: .35rem; }
.bouton.petit .ico { width: 16px; height: 16px; }
.bouton.icone { width: 34px; min-height: 34px; padding: 0; }
.bouton.large { width: 100%; }
.bouton[disabled], .bouton[aria-disabled=true] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.bouton.en-cours { pointer-events: none; opacity: .85; }
.bouton.en-cours::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.actions-ligne { display: inline-flex; gap: .35rem; white-space: nowrap; }

/* ---------- Listes et tableaux ---------- */
.defile { position: relative; max-height: min(70vh, 760px); overflow: auto; overscroll-behavior: contain; background: #fff;
  border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  scrollbar-width: thin; scrollbar-color: var(--sarcelle-clair) transparent; }
.defile::-webkit-scrollbar { width: 11px; height: 11px; }
.defile::-webkit-scrollbar-thumb { background: var(--sarcelle-clair); border: 3px solid #fff; border-radius: 10px; }
.defile::-webkit-scrollbar-thumb:hover { background: var(--sarcelle); }
.carte .defile { box-shadow: none; border-color: var(--ligne); }
.carte .defile + * { margin-top: .75rem; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; background: #fff; }
.tableau th, .tableau td { padding: .6rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ligne); }
.tableau thead th { position: sticky; top: 0; z-index: 2; background: var(--sarcelle-voile); color: var(--bleu); font-size: .74rem;
  font-weight: 750; letter-spacing: .05em; text-transform: uppercase; vertical-align: bottom; border-bottom: 2px solid var(--sarcelle-clair); }
.tableau tbody tr:nth-child(even) td { background: #fbfdfd; }
.tableau tbody tr:hover td { background: var(--sarcelle-voile); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau td.n, .tableau th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau td a { font-weight: 600; }
.tableau.etendu { width: max-content; min-width: 100%; }
.tableau.etendu td { white-space: nowrap; }
.tableau.etendu td.long { width: 22rem; min-width: 14rem; white-space: normal; }
.tableau tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--sarcelle-pale); color: var(--bleu); font-weight: 750;
  border-top: 2px solid var(--sarcelle-clair); border-bottom: 0; }
.tableau tbody tr.retard td, .tableau tbody tr.modifiee td { background: var(--brun-pale); }
.tableau tbody tr.nouvelle td { background: var(--ok-pale); }
.tableau td .pastille { line-height: 1.35; vertical-align: 1px; }
/* Lignes cliquables (table.cliquable) : un clic hors des liens et boutons ouvre le premier lien de la ligne */
.tableau tbody tr.lien-ligne { cursor: pointer; }
.tableau tbody tr.lien-ligne:hover td { background: var(--sarcelle-pale); }
/* Echeancier : prochaine echeance (data-repere-jour), signalee par app.js */
.tableau tbody tr.prochaine td { background: var(--bleu-pale); font-weight: 600; }
.tableau tbody tr.prochaine td:first-child { box-shadow: inset 4px 0 0 var(--bleu-clair); }
.tableau td.vide[colspan] { padding: 1.5rem; text-align: center; }
.tableau th .tri { all: unset; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; border-radius: 3px; }
.tableau th.n .tri { flex-direction: row-reverse; }
.tableau th .tri::after { content: ""; flex: none; width: .9em; height: .9em; opacity: .35; background: currentColor;
  -webkit-mask: var(--fleches) center / contain no-repeat; mask: var(--fleches) center / contain no-repeat; }
.tableau th .tri:hover::after { opacity: .8; }
.tableau th .tri:focus-visible { outline: 2px solid var(--sarcelle); outline-offset: 2px; }
.tableau th[aria-sort] .tri::after { opacity: 1; }
.tableau th[aria-sort=ascending] { --fleches: var(--fleche-haut); }
.tableau th[aria-sort=descending] { --fleches: var(--fleche-bas); }
:root {
  --fleches: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E");
  --fleche-haut: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E");
  --fleche-bas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Pastilles ---------- */
.pastille { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .7rem; border: 1px solid transparent;
  border-radius: 999px; background: #eef2f2; color: var(--discret); font-size: .78rem; font-weight: 650; line-height: 1.55; white-space: nowrap; }
.pastille.etape { background: #fff; border-color: var(--bord-fort); color: var(--bleu); }
.pastille.etude { background: var(--bleu-pale); color: var(--bleu); }
.pastille.finance, .pastille.P { background: var(--ok-pale); color: var(--ok); }
.pastille.sortie, .pastille.S, .pastille.A { background: var(--brun-pale); color: var(--brun-texte); }
.pastille.archive { background: #eef0f0; color: var(--discret); }
.pastille.I, .pastille.L { background: var(--danger-pale); color: var(--danger); }
.pastille.info { background: var(--sarcelle-pale); color: var(--sarcelle-fonce); }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: .2rem; margin: 0 0 1.25rem; overflow-x: auto; border-bottom: 1px solid var(--bord); scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a { flex: none; margin-bottom: -1px; padding: .75rem 1rem; border-bottom: 3px solid transparent; color: var(--discret);
  font-weight: 600; white-space: nowrap; transition: color .15s, border-color .15s; }
.onglets a:hover { color: var(--bleu); border-bottom-color: var(--sarcelle-clair); text-decoration: none; }
.onglets a[aria-current] { color: var(--bleu); border-bottom-color: var(--sarcelle); font-weight: 750; }

/* ---------- Messages ---------- */
.message { position: relative; margin: 0 0 1rem; padding: .8rem 2.9rem .8rem 2.85rem; border: 1px solid #cfe1f5;
  border-left: 4px solid var(--bleu-clair); border-radius: var(--rayon-petit); background: var(--bleu-pale); color: var(--info); font-weight: 550; }
p.message, div.message:not(:has(.fermer-message)) { padding-right: 1rem; }
.message::before { content: ""; position: absolute; left: .9rem; top: .85rem; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: var(--icone-message) center / contain no-repeat; mask: var(--icone-message) center / contain no-repeat; }
.message a { color: inherit; text-decoration: underline; }
.message.success { border-color: #c4e6d2; border-left-color: var(--ok); background: var(--ok-pale); color: var(--ok);
  --icone-message: var(--icone-succes); }
.message.error { border-color: #f6cbc6; border-left-color: var(--danger); background: var(--danger-pale); color: var(--danger);
  --icone-message: var(--icone-alerte); }
.message.warning { border-color: #f5cfb9; border-left-color: var(--brun); background: var(--brun-pale); color: var(--brun-texte);
  --icone-message: var(--icone-alerte); }
.fermer-message { position: absolute; right: .45rem; top: .45rem; display: grid; place-items: center; width: 30px; height: 30px;
  padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; opacity: .7; }
.fermer-message:hover { opacity: 1; background: rgb(0 10 10 / .06); }
:root {
  --icone-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  --icone-succes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
  --icone-alerte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
  --icone-message: var(--icone-info);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
}

/* ---------- Sections repliables ---------- */
details { margin: 1rem 0; }
details > summary { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem 0; margin-bottom: .5rem; color: var(--sarcelle-texte);
  font-weight: 650; cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 1em; height: 1em; background: currentColor; transition: transform .15s;
  -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--sarcelle-fonce); }

/* ---------- Infobulles ---------- */
.infobulle { position: fixed; left: 0; top: 0; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: .45rem .7rem;
  border-radius: 8px; background: var(--bleu); color: #fff; font-size: .8rem; font-weight: 550; line-height: 1.35; text-align: center;
  box-shadow: 0 8px 20px rgb(0 10 10 / .22); pointer-events: none; visibility: hidden; opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s, visibility .12s; }
.infobulle.visible { visibility: visible; opacity: 1; transform: none; }
.infobulle::after { content: ""; position: absolute; left: var(--fleche, 50%); bottom: -5px; width: 10px; height: 10px;
  background: inherit; transform: translateX(-50%) rotate(45deg); }
.infobulle.dessous::after { top: -5px; bottom: auto; }

/* ---------- Etats ---------- */
.grille-etats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.carte.etat { display: flex; flex-direction: column; gap: .4rem; margin: 0; color: var(--texte);
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.carte.etat:hover { border-color: var(--sarcelle); transform: translateY(-2px); box-shadow: var(--ombre-forte); text-decoration: none; }
.carte.etat strong { display: flex; align-items: center; gap: .55rem; color: var(--bleu); font-size: 1.02rem; }
.carte.etat strong .ico { color: var(--sarcelle); }
.carte.etat span { color: var(--discret); font-size: .9rem; }
.carte.etat small { margin-top: auto; padding-top: .5rem; color: var(--discret); font-size: .78rem; }

/* ---------- Accueil ---------- */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.indicateur { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--bord);
  border-top: 4px solid var(--sarcelle); border-radius: var(--rayon); box-shadow: var(--ombre); color: var(--texte);
  transition: border-color .15s, transform .15s, box-shadow .15s; }
a.indicateur:hover { transform: translateY(-2px); box-shadow: var(--ombre-forte); text-decoration: none; color: var(--texte); }
a.indicateur { position: relative; }
a.indicateur::after { content: ""; position: absolute; right: 1rem; top: 1.05rem; width: 16px; height: 16px; background: var(--sarcelle);
  opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s;
  -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; }
a.indicateur:hover::after, a.indicateur:focus-visible::after { opacity: 1; transform: none; }
.indicateur .libelle { display: flex; align-items: center; gap: .45rem; font-weight: 650; color: var(--discret); font-size: .85rem; }
.indicateur .libelle .ico { color: var(--sarcelle); }
.indicateur .valeur { color: var(--bleu); font-size: 2rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.indicateur small { color: var(--discret); font-size: .82rem; }
.indicateur.bleu { border-top-color: var(--bleu-clair); }
.indicateur.bleu .libelle .ico { color: var(--bleu-clair); }
.indicateur.brun { border-top-color: var(--brun); }
.indicateur.brun .libelle .ico { color: var(--brun); }
.indicateur.alerte { border-top-color: var(--danger); }
.indicateur.alerte .valeur, .indicateur.alerte .libelle .ico { color: var(--danger); }
.barres { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.barres li { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .9rem; }
.barres .piste { height: 10px; overflow: hidden; border-radius: 999px; background: var(--sarcelle-voile); }
.barres .remplissage { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sarcelle), var(--sarcelle-clair)); }
.barres .n { text-align: right; font-weight: 700; color: var(--bleu); font-variant-numeric: tabular-nums; }
.liste-simple { margin: 0; padding: 0; list-style: none; }
.liste-simple li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--ligne); }
.liste-simple li:last-child { border-bottom: 0; }
.liste-simple small { color: var(--discret); white-space: nowrap; }
.raccourcis { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Connexion ---------- */
.page-connexion { background: var(--fond); }
.connexion { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.connexion-visuel { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 3rem clamp(1.5rem, 5vw, 4.5rem); overflow: hidden; background: var(--bleu); color: #fff; }
.connexion-visuel::before, .connexion-visuel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.connexion-visuel::before { width: 560px; height: 560px; right: -190px; bottom: -220px; background: var(--sarcelle); opacity: .55; }
.connexion-visuel::after { width: 260px; height: 260px; right: -60px; top: -120px; border: 36px solid var(--bleu-clair); opacity: .25; }
.connexion-visuel > * { position: relative; z-index: 1; }
.connexion-visuel img { align-self: flex-start; width: auto; height: 60px; }
.connexion-visuel .surtitre { margin: 0 0 .5rem; color: var(--sarcelle-clair); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.connexion-visuel .slogan { max-width: 30rem; margin: 0; font: italic 400 clamp(1.5rem, 2.6vw, 2.25rem)/1.35 var(--police-titre); }
.connexion-visuel .mention { margin: 0; color: rgb(255 255 255 / .75); font-size: .875rem; }
.connexion-formulaire { display: grid; place-items: center; max-width: none; margin: 0; padding: 2rem 1.25rem; }
.connexion-formulaire .carte { width: min(100%, 440px); margin: 0; padding: 2.25rem 2rem; box-shadow: var(--ombre-forte); }
.connexion-formulaire h1 { font-size: 1.7rem; }
.lien-bas { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--ligne); text-align: center; font-size: .9rem; }

/* ---------- Ecrans moyens et petits ---------- */
@media (max-width: 1599px) {
  .navigation .ico { display: none; }
  .navigation a { padding: .5rem .7rem; }
  .recherche-rapide { flex-basis: 260px; }
}
@media (max-width: 1439px) {
  .marque-appli, .nom-utilisateur, .avatar-bouton > .ico { display: none; }
  .avatar-bouton { padding: .2rem; }
}
@media (max-width: 1279px) {
  .marque-appli { display: block; }
  .bouton-menu { display: inline-flex; }
  .navigation { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    gap: .15rem; margin: 0; padding: .6rem 1rem 1rem; max-height: calc(100vh - var(--hauteur-bandeau)); overflow-y: auto;
    background: #fff; border-bottom: 1px solid var(--bord); box-shadow: var(--ombre-forte); }
  .navigation.ouverte { display: flex; }
  .navigation a { padding: .75rem 1rem; border-radius: var(--rayon-petit); }
  .navigation .ico { display: block; }
}
@media (max-width: 900px) {
  .connexion { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .connexion-visuel { justify-content: flex-start; gap: .75rem; padding: 1.5rem; }
  .connexion-visuel::before { width: 240px; height: 240px; right: -80px; bottom: -150px; }
  .connexion-visuel::after { width: 130px; height: 130px; right: -30px; top: -70px; border-width: 20px; }
  .connexion-visuel .slogan, .connexion-visuel .mention { display: none; }
  .connexion-visuel .surtitre { margin: 0; }
  .connexion-visuel img { height: 46px; }
  .connexion-formulaire { place-items: start center; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .bandeau-interieur { gap: .5rem; padding: 0 .75rem; }
  .marque-appli, .bouton-menu span, .avatar-bouton > .ico, .recherche-rapide .raccourci { display: none; }
  .marque img { height: 34px; }
  .bouton-menu { padding: .5rem; }
  .recherche-rapide { flex: 1 1 auto; min-width: 0; }
  .recherche-rapide input { padding-right: 1rem; }
  form.carte > .formulaire-pied:last-child { margin: .5rem -1rem -1rem; padding: .8rem 1rem 1rem; }
  .barre-onglets { flex-wrap: wrap; box-shadow: none; }
  .barre-onglets .onglets { flex-basis: 100%; border-bottom: 1px solid var(--bord); }
  .barre-onglets .onglets a { margin-bottom: -1px; }
  .avatar-bouton { padding: .2rem; }
  main { padding: 1rem .75rem 2rem; }
  h1 { font-size: 1.45rem; }
  .carte { padding: 1rem; }
  .filtres { padding: 1rem; }
  .filtres label { flex-basis: 135px; }
  .filtres .actions { flex: 1 1 100%; flex-wrap: wrap; }
  .indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .indicateur { padding: .8rem .9rem; }
  .indicateur .valeur { font-size: 1.6rem; }
  dl.champs { grid-template-columns: 1fr; gap: .1rem; }
  dl.champs dd { margin-bottom: .5rem; }
  .defile, .defile.plein { max-height: 75vh; }
  .entete-page .actions-page { width: 100%; }
  .bouton { min-height: 44px; }
  .bouton.petit { min-height: 36px; }
  .barres li { grid-template-columns: 7rem 1fr 2rem; }
  .connexion-formulaire .carte { padding: 1.5rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .bouton:hover, a.indicateur:hover, .carte.etat:hover { transform: none; }
}

/* ---------- Impression ---------- */
@media print {
  .bandeau, .ariane, .non-imprime, .fermer-message, .infobulle, .suggestions, .evitement,
  .barre-onglets > .actions, .formulaire-pied { display: none !important; }
  .mosaique { columns: auto; }
  body { background: #fff; font-size: 8.5pt; }
  h1 { font-size: 15pt; }
  h2 { font-size: 11pt; margin: .6rem 0 .4rem; }
  h3 { font-size: 10pt; }
  main { max-width: none; padding: 0; }
  .defile, .defile.plein { max-height: none !important; overflow: visible; border: 0; box-shadow: none; }
  .tableau thead th, .tableau tfoot td { position: static; }
  /* tableaux compacts sur la largeur de la page, comme avant la charte : textes replies, en-tetes en casse normale */
  .tableau { font-size: 1em; }
  .tableau th, .tableau td { padding: .2rem .35rem; }
  .tableau thead th { font-size: .95em; letter-spacing: 0; text-transform: none; }
  .tableau.etendu { width: 100%; }
  .tableau.etendu td, .tableau.etendu td.long { width: auto; min-width: 0; white-space: normal; }
  .tableau.tres-large { font-size: 7pt; }
  .tableau.tres-large th, .tableau.tres-large td { padding: .12rem .22rem; }
  .tableau tbody tr:nth-child(even):not(.retard):not(.modifiee):not(.nouvelle) td { background: none; }
  /* section repliee d'un etat : imprimee seulement si elle a ete ouverte a l'ecran */
  details.replie:not([open]) { display: none; }
  details.replie > summary { display: block; color: var(--bleu); font-weight: 650; }
  details.replie > summary::before { display: none; }
  .tableau th .tri::after { display: none; }
  .carte { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: inherit; }
  .titre-etat { margin-top: 0; }
}
