/* ==========================================================================
   Bernard - feuille de style
   Palette : encre (bleu nuit) + vert, dans l'esprit des sites d'agences.
   Typographie : Marianne, comme holystyl-django.
   ========================================================================== */

/* Marianne — police du Système de Design de l'État, servie par le CDN du DSFR.
   Hors ligne, la pile système prend le relais sans casser la mise en page.
   La famille s'arrête à la graisse 700 : aucun titre ne doit demander plus,
   sinon le navigateur fabrique un faux gras. */
@font-face {
  font-family: 'Marianne';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.13.0/dist/fonts/Marianne-Light.woff2) format('woff2');
}

@font-face {
  font-family: 'Marianne';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.13.0/dist/fonts/Marianne-Regular.woff2) format('woff2');
}

@font-face {
  font-family: 'Marianne';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.13.0/dist/fonts/Marianne-Regular_Italic.woff2) format('woff2');
}

@font-face {
  font-family: 'Marianne';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.13.0/dist/fonts/Marianne-Medium.woff2) format('woff2');
}

@font-face {
  font-family: 'Marianne';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.13.0/dist/fonts/Marianne-Bold.woff2) format('woff2');
}

:root {
  --encre: #101f2b;
  --encre-clair: #1b3242;
  --vert: #86bc42;
  --vert-sombre: #6ca231;
  --blanc: #ffffff;
  --fond: #ffffff;
  --fond-doux: #f4f7f1;
  --texte: #1f2a33;
  --texte-doux: #5d6b76;
  --bordure: #e3e8e2;
  --erreur: #b3261e;
  --ombre: 0 18px 40px rgba(16, 31, 43, .10);
  --rayon: 14px;
}

* { box-sizing: border-box; }

/* holystyl fixe la base à 15px : tout le reste est exprimé en rem et suit. */
html {
  font-size: 15px;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Marianne', system-ui, ui-sans-serif, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6rem; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--vert-sombre); }

.limite { width: min(1160px, 100% - 3rem); margin-inline: auto; }

/* --- Barre utilitaire ---------------------------------------------------- */

.barre-utile {
  background: var(--fond-doux);
  border-bottom: 1px solid var(--bordure);
  font-size: .82rem;
  color: var(--texte-doux);
}

.barre-utile .limite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
}

.barre-utile a { color: var(--texte-doux); text-decoration: none; }
.barre-utile a:hover { color: var(--vert-sombre); }
.barre-utile .groupe { display: flex; align-items: center; gap: 1.25rem; }

/* --- En-tete ------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
}

.entete .limite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--encre);
  text-decoration: none;
}

.marque .sigle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--vert);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}

.entete nav { display: flex; align-items: center; gap: 1.6rem; }
.entete nav a { color: var(--encre); text-decoration: none; font-size: .93rem; font-weight: 600; }
.entete nav a:hover { color: var(--vert-sombre); }
.entete nav a.bouton { color: #fff; }

.liens-site { display: flex; align-items: center; gap: 1.6rem; }
.form-inline { display: inline; margin: 0; }

/* --- Boutons ------------------------------------------------------------- */

.bouton, .bouton-clair {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.35rem;
  border: 0;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.bouton { background: var(--vert); color: #fff; }
.bouton:hover { background: var(--vert-sombre); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(108, 162, 49, .3); }

.bouton-clair { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); }
.bouton-clair:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

.lien-bouton {
  border: 0; background: none; padding: 0;
  color: inherit; font: inherit; font-weight: 600;
  cursor: pointer;
}
.lien-bouton:hover { color: var(--vert-sombre); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, var(--encre) 0%, var(--encre-clair) 58%, #23485c 100%);
  color: #fff;
  padding: clamp(4rem, 11vw, 7.5rem) 0 clamp(6rem, 12vw, 9rem);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 85% at 88% 8%, rgba(134, 188, 66, .22), transparent 58%);
}

/* Chevrons verts : signature graphique, cantonnee a droite pour laisser
   respirer le texte a gauche. */
.hero-forme {
  position: absolute;
  top: -12%;
  height: 124%;
  pointer-events: none;
  clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
}

.hero-forme.forme-1 {
  right: -4%;
  width: 34%;
  background: linear-gradient(165deg, rgba(134, 188, 66, .38), rgba(134, 188, 66, .06));
}

.hero-forme.forme-2 {
  right: 16%;
  width: 22%;
  background: linear-gradient(165deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01));
}

.hero .limite { position: relative; z-index: 1; }

.surtitre {
  display: inline-block;
  padding: .35rem .9rem;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(134, 188, 66, .55);
  border-radius: 999px;
  background: rgba(134, 188, 66, .14);
  color: #cfe6a6;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 { max-width: 15ch; }
.hero .accroche { max-width: 46ch; font-size: 1.12rem; color: rgba(255, 255, 255, .82); }

.hero-services {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0 2.4rem;
  font-weight: 700;
  font-size: 1.02rem;
}

.hero-services li { display: flex; align-items: center; gap: .65rem; padding: .2rem 0; }
.hero-services svg { flex: none; color: var(--vert); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }

/* --- Piliers (cartes en chevauchement sous le hero) ---------------------- */

.piliers {
  position: relative;
  z-index: 2;
  margin-top: clamp(-5rem, -7vw, -3.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.pilier {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.6rem 1.5rem;
}

.pilier .puce {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--fond-doux);
  color: var(--vert-sombre);
}

.pilier p { color: var(--texte-doux); font-size: .93rem; margin: 0; }

/* --- Sections ------------------------------------------------------------ */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-douce { background: var(--fond-doux); }

.etiquette {
  display: block;
  margin-bottom: .6rem;
  color: var(--vert-sombre);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.duo p { color: var(--texte-doux); }
.duo-inverse .duo-visuel { order: -1; }

.points { list-style: none; padding: 0; margin: 1.5rem 0; }
.points li { display: flex; gap: .7rem; padding: .35rem 0; font-weight: 600; }
.points svg { flex: none; color: var(--vert); margin-top: .35rem; }

.duo-visuel {
  min-height: 260px;
  border-radius: var(--rayon);
  background: linear-gradient(140deg, var(--encre) 0%, var(--encre-clair) 100%);
  box-shadow: var(--ombre);
  padding: 1.75rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .9rem;
}

.ligne-visuel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: .9rem;
}

.ligne-visuel .valeur { font-weight: 700; }
.jeton { padding: .15rem .6rem; border-radius: 999px; background: rgba(134, 188, 66, .22); color: #cfe6a6; font-size: .78rem; font-weight: 700; }

/* --- Bande de chiffres --------------------------------------------------- */

.bande {
  background: var(--encre);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.bande h2 { margin-bottom: 2rem; }
.bande .grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem 2rem;
}

.bande .item strong { display: block; font-size: 1.15rem; }
.bande .item span { color: rgba(255, 255, 255, .7); font-size: .92rem; }
.bande .item { border-top: 3px solid var(--vert); padding-top: .9rem; }

/* --- Appel final --------------------------------------------------------- */

.appel {
  text-align: center;
  background: var(--fond-doux);
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.appel p { max-width: 52ch; margin-inline: auto; color: var(--texte-doux); }

/* --- Pages interieures --------------------------------------------------- */

.contenu { width: min(760px, 100% - 3rem); margin: 0 auto; padding: 3rem 0 4rem; }
.contenu h1 { font-size: clamp(1.55rem, 3vw, 2.05rem); }
.contenu h2 { font-size: 1.15rem; }
.contenu-large { width: min(1160px, 100% - 3rem); }

.sous-titre { color: var(--texte-doux); margin-top: 0; }
.secondaire { color: var(--texte-doux); font-size: .9rem; }
.aide { display: block; color: var(--texte-doux); font-size: .8rem; margin-top: .25rem; }

.carte {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.carte-etroite { max-width: 440px; margin-inline: auto; }

.champ { margin: 0 0 1.1rem; }
.champ label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .35rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: #fff;
  color: var(--texte);
  font-size: 1rem;
  font-family: inherit;
}

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

.fiche { display: grid; grid-template-columns: 12rem 1fr; gap: .5rem 1rem; margin: 0 0 1.25rem; }
.fiche dt { color: var(--texte-doux); font-size: .9rem; }
.fiche dd { margin: 0; font-weight: 600; }

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.message {
  padding: .8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--bordure);
  border-left: 4px solid var(--texte-doux);
  background: #fff;
  margin-bottom: .5rem;
}
.message.success { border-left-color: var(--vert); }
.message.error { border-left-color: var(--erreur); color: var(--erreur); }

ul.errorlist {
  list-style: none;
  padding: 0;
  margin: .35rem 0 0;
  color: var(--erreur);
  font-size: .85rem;
  font-weight: 600;
}

/* --- Pied de page -------------------------------------------------------- */

.pied {
  background: var(--encre);
  color: rgba(255, 255, 255, .72);
  padding: 3.5rem 0 2rem;
  font-size: .92rem;
}

.pied .colonnes {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 2.5rem 2rem;
}

.pied h3 { color: #fff; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .9rem; }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: .5rem; }
.pied a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.pied a:hover { color: var(--vert); }
.pied .marque { color: #fff; margin-bottom: .8rem; }

.pied-bas {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .85rem;
  color: rgba(255, 255, 255, .55);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 860px) {
  .liens-site { display: none; }
  .pied .colonnes { grid-template-columns: 1fr 1fr; }
  .hero-forme.forme-2 { display: none; }
  .hero-forme.forme-1 { right: -18%; width: 55%; opacity: .7; }
  .entete .limite { min-height: 64px; }
  .duo-inverse .duo-visuel { order: 0; }
}

@media (max-width: 560px) {
  .limite, .contenu, .contenu-large { width: calc(100% - 2rem); }
  .pied .colonnes { grid-template-columns: 1fr; gap: 1.75rem; }
  .barre-utile .groupe.optionnel { display: none; }
  .fiche { grid-template-columns: 1fr; }
  .fiche dd { margin-bottom: .6rem; }
  .piliers { margin-top: -3rem; }
}

/* ==========================================================================
   Shell d'application : barre laterale + barre haute
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--fond-doux);
}

/* --- Barre laterale ------------------------------------------------------ */

.barre-laterale {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: var(--encre);
  color: rgba(255, 255, 255, .7);
  overflow-y: auto;
}

.barre-laterale .marque { color: #fff; padding: 0 .5rem; }

.barre-laterale nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }

.nav-groupe {
  margin: 1.2rem 0 .4rem;
  padding: 0 .75rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
}

.nav-groupe:first-child { margin-top: 0; }

/* --- Groupes dépliants --------------------------------------------------- */

.groupe-nav > summary.nav-groupe {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .75rem;
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color .15s ease, background .15s ease;
}

.groupe-nav > summary::-webkit-details-marker { display: none; }
.groupe-nav > summary:hover { background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .7); }
.groupe-nav > summary:focus-visible { outline: 2px solid var(--vert); outline-offset: 1px; }

.groupe-nav .chevron {
  flex: none;
  opacity: .7;
  transition: transform .18s ease;
}

.groupe-nav[open] > summary .chevron { transform: rotate(180deg); }

.nav-liens { display: flex; flex-direction: column; gap: .2rem; }

/* Un groupe replié qui contient la page courante garde un repère visible */
.groupe-nav:not([open]) > summary:has(~ .nav-liens .nav-item.actif) {
  color: var(--vert);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .75rem;
  border-radius: 9px;
  color: rgba(255, 255, 255, .75);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.nav-item svg { flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav-item.actif {
  background: rgba(134, 188, 66, .16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--vert);
}

.nav-item.actif svg { color: var(--vert); opacity: 1; }

.nav-item.desactive { color: rgba(255, 255, 255, .34); cursor: default; }
.nav-item.desactive:hover { background: none; color: rgba(255, 255, 255, .34); }

.badge-bientot {
  margin-left: auto;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-style: normal;
}

/* --- Zone principale ----------------------------------------------------- */

.zone { display: flex; flex-direction: column; min-width: 0; }

.barre-haute {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 2rem;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
}

.barre-haute h1 { font-size: 1.35rem; margin: 0; }
.barre-haute .fil { margin: 0; font-size: .85rem; color: var(--texte-doux); }

.zone-contenu { padding: 2rem; flex: 1; }
.zone-contenu h2 { font-size: 1.1rem; }
.zone-contenu > :first-child { margin-top: 0; }

/* --- Avatar et son menu -------------------------------------------------- */

.avatar-menu { position: relative; }

.avatar-menu summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .3rem .3rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  transition: background .15s ease;
}

.avatar-menu summary::-webkit-details-marker { display: none; }
.avatar-menu summary:hover { background: var(--fond-doux); }
.avatar-menu[open] summary { background: var(--fond-doux); }

.avatar-menu .identite { text-align: right; line-height: 1.25; }
.avatar-menu .identite strong { display: block; font-size: .88rem; }
.avatar-menu .identite span { font-size: .76rem; color: var(--texte-doux); }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--encre);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
}

.avatar-menu.est-admin .avatar { background: var(--vert); }

.avatar-panneau {
  position: absolute;
  top: calc(100% + .6rem);
  right: 0;
  width: 270px;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  box-shadow: var(--ombre);
  z-index: 30;
}

.avatar-panneau .entete-panneau {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .85rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--bordure);
}

.avatar-panneau .entete-panneau strong { display: block; font-size: .92rem; }
.avatar-panneau .entete-panneau span { font-size: .78rem; color: var(--texte-doux); word-break: break-all; }

.avatar-panneau .role {
  display: inline-block;
  margin-top: .3rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--fond-doux);
  color: var(--vert-sombre);
  font-size: .7rem;
  font-weight: 700;
}

.menu-lien {
  display: block;
  width: 100%;
  padding: .5rem .6rem;
  border: 0;                 /* le bouton de deconnexion en est un */
  background: none;
  border-radius: 8px;
  color: var(--texte);
  font-family: inherit;
  font-size: .9rem;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.menu-lien:hover { background: var(--fond-doux); }
.menu-lien.danger { color: var(--erreur); }

.menu-separateur { height: 1px; background: var(--bordure); margin: .5rem 0; }

/* --- Tuiles de synthese -------------------------------------------------- */

.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tuile {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1.25rem;
}

.tuile .intitule {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--texte-doux);
  font-size: .82rem;
  font-weight: 600;
}

.tuile .intitule svg { color: var(--vert-sombre); }
.tuile .chiffre { margin-top: .6rem; font-size: 2rem; font-weight: 700; letter-spacing: -.03em; }
.tuile .detail { font-size: .8rem; color: var(--texte-doux); }
.tuile.a-venir .chiffre { color: var(--texte-doux); opacity: .35; }

/* --- Tableau simple ------------------------------------------------------ */

.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { padding: .7rem .6rem; text-align: left; border-bottom: 1px solid var(--bordure); }
.tableau th { color: var(--texte-doux); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.tableau tr:last-child td { border-bottom: 0; }

.grille-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; align-items: start; }
.grille-cartes .carte { margin-top: 0; }

.vide { color: var(--texte-doux); font-size: .9rem; }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }

  .barre-laterale {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    padding: .85rem 1rem;
  }

  .barre-laterale nav { flex-direction: row; flex-wrap: nowrap; gap: .3rem; }
  .barre-laterale .nav-groupe { display: none; }
  /* le repli n'a pas de sens sur une barre horizontale : tout reste visible */
  .groupe-nav { display: contents; }
  .groupe-nav:not([open]) > .nav-liens { display: flex; }
  .nav-liens { flex-direction: row; }
  .nav-item { white-space: nowrap; }
  .badge-bientot { display: none; }

  .barre-haute { padding: 1rem; }
  .zone-contenu { padding: 1.25rem 1rem; }
  .avatar-menu .identite { display: none; }
}

/* ==========================================================================
   Ecrans metier : pastilles de statut, filtres, listes
   ========================================================================== */

.etat {
  display: inline-block;
  padding: .18rem .65rem;
  border-radius: 999px;
  background: var(--fond-doux);
  color: var(--texte-doux);
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}

.etat-vert   { background: rgba(134, 188, 66, .18); color: #4d7d20; }
.etat-bleu   { background: rgba(27, 50, 66, .10);   color: #1b3242; }
.etat-orange { background: rgba(196, 120, 18, .15); color: #96570a; }
.etat-rouge  { background: rgba(179, 38, 30, .10);  color: var(--erreur); }
.etat-gris   { background: var(--fond-doux);        color: var(--texte-doux); }

.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.filtre {
  padding: .35rem .85rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: #fff;
  color: var(--texte-doux);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}

.filtre:hover { border-color: var(--vert); color: var(--vert-sombre); }
.filtre.actif { background: var(--encre); border-color: var(--encre); color: #fff; }

.panneau {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
}

.panneau .tableau { margin: 0; }
.panneau .tableau th, .panneau .tableau td { padding: .85rem 1.25rem; }
.panneau .tableau tbody tr:hover { background: var(--fond-doux); }
.panneau .tableau a { font-weight: 600; text-decoration: none; }
.panneau .tableau a:hover { text-decoration: underline; }

/* `.tableau td` pose text-align:left et l'emporte en specificite :
   on cible donc les cellules dans le tableau, pas la classe seule. */
.tableau th.nombre, .tableau td.nombre, .nombre {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.etat-vide {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--texte-doux);
}

.etat-vide strong { display: block; color: var(--texte); margin-bottom: .35rem; }

.entete-fiche {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.entete-fiche .reference { color: var(--texte-doux); font-size: .85rem; font-weight: 700; letter-spacing: .05em; }
.entete-fiche h2 { margin: .2rem 0 .3rem; font-size: 1.4rem; }
.entete-fiche .adresse { color: var(--texte-doux); margin: 0; }

.chiffre-cle { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.chiffre-cle small { display: block; font-size: .78rem; font-weight: 600; color: var(--texte-doux); letter-spacing: 0; }

.retour { display: inline-block; margin-bottom: 1rem; font-size: .88rem; text-decoration: none; }

@media (max-width: 700px) {
  .panneau { overflow-x: auto; }
  .panneau .tableau { min-width: 560px; }
}

/* Tuiles cliquables du tableau de bord */
a.tuile { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.tuile:hover { border-color: var(--vert); transform: translateY(-2px); }
a.tuile:hover .detail { color: var(--vert-sombre); }
.tuile-alerte .chiffre { color: var(--erreur); }

/* --- Formulaires de saisie ----------------------------------------------- */

.formulaire-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 1.5rem;
}

.formulaire-grille .pleine-largeur { grid-column: 1 / -1; }

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

textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--texte);
  resize: vertical;
}

textarea:focus { outline: 2px solid var(--vert); outline-offset: 1px; border-color: var(--vert); }

.actions-formulaire {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bordure);
}

.bouton-danger { background: var(--erreur); }
.bouton-danger:hover { background: #8f1e17; box-shadow: 0 8px 18px rgba(179, 38, 30, .28); }

.barre-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.actions-ligne { white-space: nowrap; }
.actions-ligne a { font-size: .85rem; margin-left: .85rem; }
.actions-ligne a:first-child { margin-left: 0; }
.lien-danger { color: var(--erreur); }

/* --- Carnet de contacts -------------------------------------------------- */

.recherche { display: flex; align-items: center; gap: .5rem; margin: 0; }

.recherche input[type="search"] {
  width: min(280px, 60vw);
  padding: .45rem .85rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: .9rem;
}

.recherche input[type="search"]:focus { outline: 2px solid var(--vert); outline-offset: 1px; border-color: var(--vert); }
.recherche button.filtre { cursor: pointer; font-family: inherit; }

.nom-contact { display: block; font-weight: 700; text-decoration: none; }
.nom-contact:hover { text-decoration: underline; }
.tableau td .secondaire { font-size: .82rem; }
.tableau td .etat + .etat { margin-left: .3rem; }

/* --- Formulaire en sections ---------------------------------------------- */

.form-sections {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 0 1.75rem;
}

.section-form {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--bordure);
}

.section-form:first-of-type { border-top: 0; }

.section-entete h3 { margin: 0 0 .25rem; font-size: 1rem; }
.section-entete .intro { margin: 0; color: var(--texte-doux); font-size: .86rem; line-height: 1.5; }

.section-champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 1.25rem;
  align-content: start;
}

.section-champs .pleine-largeur { grid-column: 1 / -1; }
.section-champs .champ.court input { max-width: 8rem; }

/* Sélecteur segmenté (civilité) */
.segmente {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: #fff;
}

.segmente input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.segmente label {
  display: block;
  margin: 0;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  color: var(--texte-doux);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.segmente label:hover { background: var(--fond-doux); }
.segmente input:checked + label { background: var(--encre); color: #fff; }
.segmente input:focus-visible + label { outline: 2px solid var(--vert); outline-offset: 2px; }

/* Barre d'actions qui reste visible pendant la saisie */
.actions-collantes {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 -1.75rem;
  padding: 1.1rem 1.75rem;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--bordure);
  border-radius: 0 0 var(--rayon) var(--rayon);
}

@media (max-width: 780px) {
  .section-form { grid-template-columns: 1fr; gap: 1rem; }
  .form-sections { padding: 0 1.1rem; }
  .actions-collantes { margin: 0 -1.1rem; padding: 1rem 1.1rem; }
}

/* --- Formulaire d'un bien ------------------------------------------------ */

/* Le bloc de prix suit l'activité choisie, sans JavaScript : `:has()` observe
   le bouton radio coché. Si le navigateur ne le gère pas, les deux blocs
   restent visibles — la validation serveur reste seule juge. */
.form-sections:has(input[name="activite"][value="vente"]:checked) .champs-location { display: none; }
.form-sections:has(input[name="activite"][value="location"]:checked) .champs-vente { display: none; }

/* Étiquette énergie : la couleur porte l'information, la lettre la confirme */
.segmente-dpe { flex-wrap: wrap; }
.segmente-dpe label { padding: .45rem .85rem; min-width: 2.6rem; text-align: center; }
.segmente-dpe input:checked + label[data-dpe="A"] { background: #319b42; }
.segmente-dpe input:checked + label[data-dpe="B"] { background: #4fae4f; }
.segmente-dpe input:checked + label[data-dpe="C"] { background: #8fc03f; }
.segmente-dpe input:checked + label[data-dpe="D"] { background: #f0d02e; color: #33290a; }
.segmente-dpe input:checked + label[data-dpe="E"] { background: #efa13a; color: #33290a; }
.segmente-dpe input:checked + label[data-dpe="F"] { background: #e2703a; }
.segmente-dpe input:checked + label[data-dpe="G"] { background: #d0342c; }

/* --- Contact : particulier ou entreprise --------------------------------- */

/* Les champs propres à chaque type s'affichent selon le bouton radio coché.
   Sans support de `:has()`, tout reste visible et le serveur tranche. */
.form-sections:has(input[name="type_personne"][value="particulier"]:checked) .bloc-entreprise { display: none; }
.form-sections:has(input[name="type_personne"][value="entreprise"]:checked) .bloc-particulier { display: none; }

/* Dans une étiquette, les variantes de libellé restent en ligne */
label > .bloc-particulier, label > .bloc-entreprise,
.intro > .bloc-particulier, .intro > .bloc-entreprise { display: inline; }

.form-sections:has(input[name="type_personne"][value="particulier"]:checked) label > .bloc-entreprise,
.form-sections:has(input[name="type_personne"][value="particulier"]:checked) .intro > .bloc-entreprise { display: none; }
.form-sections:has(input[name="type_personne"][value="entreprise"]:checked) label > .bloc-particulier,
.form-sections:has(input[name="type_personne"][value="entreprise"]:checked) .intro > .bloc-particulier { display: none; }

.separateur-filtres {
  width: 1px;
  align-self: stretch;
  margin: .2rem .35rem;
  background: var(--bordure);
}

/* --- Actions en icônes dans les listes ----------------------------------- */

.actions-ligne { display: flex; gap: .25rem; justify-content: flex-end; }

.bouton-icone {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--texte-doux);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.bouton-icone:hover { background: var(--fond-doux); color: var(--encre); }
.bouton-icone:focus-visible { outline: 2px solid var(--vert); outline-offset: 1px; }
.bouton-icone.danger:hover { background: rgba(179, 38, 30, .10); color: var(--erreur); }

/* Recherche instantanée : léger retrait pendant l'aller-retour serveur */
.recherche-en-cours input[type="search"] { opacity: .65; }
#resultats-contacts { transition: opacity .12s ease; }

/* --- Galerie de photos --------------------------------------------------- */

.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.vignette {
  position: relative;
  margin: 0;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  overflow: hidden;
  background: var(--fond-doux);
}

.vignette img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--fond-doux);
}

.vignette figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .6rem;
  padding: .6rem .7rem;
  background: #fff;
  font-size: .82rem;
}

.vignette figcaption > span:first-child {
  flex: 1 1 100%;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.badge-vignette { position: absolute; top: .5rem; left: .5rem; }

input[type="file"] {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px dashed var(--bordure);
  border-radius: 10px;
  background: var(--fond-doux);
  font-family: inherit;
  font-size: .92rem;
  cursor: pointer;
}

input[type="file"]:focus { outline: 2px solid var(--vert); outline-offset: 1px; }

/* --- Messagerie ---------------------------------------------------------- */

.pastille {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  margin-left: auto;
  border-radius: 999px;
  background: var(--vert);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}

.pastille[hidden] { display: none; }

.fils { list-style: none; margin: 0; padding: 0; }

.fil {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bordure);
}

.fil:last-child { border-bottom: 0; }
.fil:hover { background: var(--fond-doux); }
.fil > a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }

.fil-entete { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fil-entete .pastille { margin-left: 0; }
.fil-meta { display: block; margin-top: .15rem; color: var(--texte-doux); font-size: .84rem; }
.fil-extrait {
  display: block;
  margin-top: .35rem;
  color: var(--texte-doux);
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.fil-extrait em { font-style: normal; font-weight: 600; color: var(--texte); }
.fil-date { flex: none; color: var(--texte-doux); font-size: .8rem; white-space: nowrap; }
.fil-non-lu { background: rgba(134, 188, 66, .06); }
.fil-non-lu strong { color: var(--encre); }

.conversation { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.25rem; }

.message-fil { display: flex; gap: .85rem; align-items: flex-start; }
.message-fil.message-moi { flex-direction: row-reverse; }

.avatar-fil { width: 34px; height: 34px; font-size: .78rem; }

.bulle {
  max-width: min(640px, 78%);
  padding: .85rem 1rem;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  background: #fff;
}

.message-moi .bulle { background: rgba(134, 188, 66, .10); border-color: rgba(134, 188, 66, .35); }

.bulle-entete {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .35rem;
  font-size: .84rem;
}

.bulle-entete time { color: var(--texte-doux); font-size: .78rem; }
.bulle p { margin: 0; overflow-wrap: anywhere; }

.jointes { list-style: none; margin: .75rem 0 0; padding: .6rem 0 0; border-top: 1px solid var(--bordure); }
.jointes li { display: flex; align-items: center; gap: .5rem; font-size: .86rem; padding: .15rem 0; }
.jointes a { display: inline-flex; align-items: center; gap: .35rem; }

/* La pastille du groupe ne sert qu'une fois celui-ci replié : sinon elle
   ferait doublon avec celle de l'entrée « Messages ». */
.groupe-nav > summary .pastille-groupe { margin-left: 0; }
.groupe-nav[open] > summary .pastille-groupe { display: none; }

/* --- Chat en deux panneaux ----------------------------------------------- */

.chat {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1rem;
  height: calc(100vh - 74px - 4rem);
  min-height: 460px;
}

.chat-fils,
.chat-echange {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
}

.chat-fils-entete {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .6rem;
  padding: .75rem;
  border-bottom: 1px solid var(--bordure);
}

.chat-fils-entete .bouton { justify-content: center; }

.bouton-compact { padding: .4rem .8rem; font-size: .85rem; }

.chat-fils .fils { flex: 1; overflow-y: auto; }
.chat-fils .fil { padding: .75rem 1rem; }
.chat-fils .fil > a { display: block; }
.chat-fils .fil-date { display: block; margin-top: .3rem; font-size: .76rem; color: var(--texte-doux); }
.fil-actif { background: var(--fond-doux); box-shadow: inset 3px 0 0 var(--vert); }
.chat-vide, .chat-close { padding: 1.5rem; color: var(--texte-doux); text-align: center; }

.chat-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--bordure);
}

.chat-entete .secondaire { display: block; font-size: .82rem; }

.chat-echange .conversation {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  scroll-behavior: smooth;
}

.chat-accueil {
  flex: 1;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--texte-doux);
}

/* --- Composeur ----------------------------------------------------------- */

.composeur { border-top: 1px solid var(--bordure); padding: .85rem 1.25rem 1rem; }

.composeur textarea {
  min-height: 62px;
  resize: vertical;
  border-radius: 10px;
}

.composeur-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .6rem;
}

.composeur-actions .bouton { margin-left: auto; }
.composeur-aide { margin: .45rem 0 0; }

.composeur-erreur {
  margin-bottom: .6rem;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: rgba(179, 38, 30, .08);
  color: var(--erreur);
  font-size: .86rem;
  font-weight: 600;
}

.joindre {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  color: var(--texte-doux);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.joindre:hover { border-color: var(--vert); color: var(--vert-sombre); }
.joindre input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 900px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-fils .fils { max-height: 300px; }
  .chat-echange .conversation { max-height: 60vh; }
  .joindre-texte { display: none; }
}

/* --- Chat : liste avec avatars, choix des participants ------------------- */

.chat-fils .fil > a { display: flex; align-items: flex-start; gap: .7rem; }
.fil-corps { flex: 1; min-width: 0; }
.fil-corps .fil-entete { display: flex; align-items: center; gap: .5rem; }
.fil-corps strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar-groupe { background: var(--vert-sombre); letter-spacing: 0; }

/* Le bouton « Clore » a disparu : plus rien à repousser à droite. */
.chat-entete { align-items: center; justify-content: flex-start; gap: .75rem; }
.chat-entete .avatar-fil { flex: none; }

.choix-personnes {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--bordure);
  border-radius: 10px;
}

.choix-personnes li + li { border-top: 1px solid var(--bordure); }

.personne {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0;
  padding: .7rem .9rem;
  font-weight: 500;
  cursor: pointer;
}

.personne:hover { background: var(--fond-doux); }
.personne input { width: 18px; height: 18px; accent-color: var(--vert); }
.personne-nom { font-weight: 600; }

/* --- Reformulation par l'IA ---------------------------------------------- */

/* Le bouton vit dans le coin du champ, pas en dessous. Il est placé à
   gauche : la poignée de redimensionnement du textarea occupe le coin droit. */
.zone-avec-ia { position: relative; }
/* Icône seule : le champ n'a plus qu'à réserver la hauteur du bouton. */
.zone-avec-ia.avec-bouton textarea { padding-bottom: 2.4rem; }

.bouton-ia {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texte-doux);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.bouton-ia svg { width: 17px; height: 17px; }

.bouton-ia:hover:not(:disabled) {
  color: var(--vert-sombre);
  background: var(--fond-doux);
}

.bouton-ia:focus-visible { outline: 2px solid var(--vert); outline-offset: 1px; }
.bouton-ia:disabled { opacity: .55; cursor: progress; }

.barre-ia { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.barre-ia button { cursor: pointer; font-family: inherit; }
.barre-ia button:disabled { opacity: .55; cursor: progress; }


.ia-etat { font-size: .84rem; }
.ia-erreur { color: var(--erreur); font-weight: 600; }

/* --- Création de compte : rattachement réservé aux clients --------------- */

/* Cocher « Membre de l'équipe » masque le rattachement à un contact : un
   salarié n'est pas un client du portefeuille. Le formulaire l'ignore aussi
   côté serveur, l'affichage n'est qu'un confort. */
#form-compte:has(input[name="is_staff"]:checked) .bloc-client { display: none; }

/* Bouton secondaire sur fond clair (section d'appel de la page d'accueil) */
.bouton-sombre { border-color: var(--bordure); color: var(--texte); }
.bouton-sombre:hover { background: #fff; border-color: var(--encre); }

/* Renvoi vers l'autre porte, en bas des pages de connexion */
.porte-voisine {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bordure);
}

/* ============================================================
   DOSSIER CLIENT
   ============================================================ */

/* Jauge d'avancement du dossier */
.jauge {
  height: 8px;
  border-radius: 999px;
  background: var(--fond-doux);
  border: 1px solid var(--bordure);
  overflow: hidden;
  margin: .25rem 0 .4rem;
}
.jauge span {
  display: block;
  height: 100%;
  background: var(--vert);
  border-radius: 999px;
  transition: width .25s ease;
}
.jauge-legende { margin: 0 0 1.25rem; font-size: .82rem; color: var(--texte-doux); }

/* Sections de pièces : identité, domicile, revenus, garant… */
.section-pieces {
  padding: .9rem 0;
  border-bottom: 1px solid var(--bordure);
}
.section-pieces:last-of-type { border-bottom: 0; }

.titre-section {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  font-size: .95rem;
  color: var(--texte-doux);
}
.section-complete .titre-section { color: var(--texte); }

/* Liste des pièces attendues, sous le titre de sa section */
.checklist { list-style: none; margin: 0; padding: 0 0 0 1.85rem; }
.checklist > li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .4rem 0;
}
.checklist .check-corps { flex: 1; min-width: 0; }

.puce-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px dashed var(--bordure);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.section-complete .puce-check { border: 0; background: var(--vert); }
.puce-check svg { width: 13px; height: 13px; }

/* Une pièce encore attendue se signale dans une section incomplète. */
.checklist > li:not(.fournie) .check-corps > strong { color: var(--texte-doux); }
.checklist > li .check-corps > strong { display: block; font-size: .88rem; }

/* Une pièce déposée */
.pieces { list-style: none; margin: .35rem 0 0; padding: 0; }
.piece {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .3rem 0;
  font-size: .86rem;
}
.piece > a { display: inline-flex; align-items: center; gap: .35rem; overflow-wrap: anywhere; }
.piece .actions-ligne { margin-left: auto; }
.piece .motif {
  flex-basis: 100%;
  color: var(--erreur);
  font-size: .82rem;
}

.titre-secondaire {
  margin: 1.5rem 0 .25rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--texte-doux);
}

/* Bandeau d'information en tête du dossier */
.bandeau {
  margin: 0 0 1.5rem;
  padding: .85rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--bordure);
  border-left: 3px solid var(--encre);
  background: #fff;
  font-size: .9rem;
}
.bandeau-alerte { border-left-color: var(--erreur); }
.bandeau-ok { border-left-color: var(--vert); }

/* Case à cocher alignée avec son libellé */
.champ label.case {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  margin-bottom: 0;
}
.champ label.case input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--vert);
}

/* Le financement ne concerne qu'un achat, le garant qu'une location :
   chaque bloc ne s'affiche que pour le projet qui le justifie. */
.form-sections:has(input[name="projet"][value="location"]:checked) .bloc-achat { display: none; }
.form-sections:has(input[name="projet"][value="achat"]:checked) .bloc-location { display: none; }
