/* Suivi des travaux — Bagnes Immobilier
   Palette du site : anthracite #353535, blanc, gris #e2e2e2, crème #f6f6f1 */

@font-face {
  font-family: "Mona Sans";
  src: url("mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  /* Thème « Pétrole » : la couleur porte le haut de chaque écran ; le rouge reste réservé aux retards. */
  --petrole: oklch(0.34 0.062 228);
  --petrole-2: oklch(0.42 0.068 228);
  --petrole-3: oklch(0.52 0.07 228);
  --givre: oklch(0.93 0.025 228);
  --sur-petrole: oklch(0.97 0.012 228);
  --encre: oklch(0.23 0.025 228);
  --encre-2: oklch(0.49 0.022 228);
  --trait: oklch(0.90 0.01 228);
  --bord: oklch(0.82 0.015 228);
  --creme: oklch(0.975 0.006 228);
  --blanc: oklch(0.995 0.003 228);
  --alerte: oklch(0.52 0.17 28);
  --alerte-fond: oklch(0.95 0.03 28);
  --alerte-texte: oklch(0.40 0.14 28);
  --orange: oklch(0.72 0.15 40);
  --ok: oklch(0.45 0.09 160);
  --ok-fond: oklch(0.95 0.03 160);
  --rayon: 12px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font: 400 16px/1.5 var(--police);
}
body.sans-defilement { overflow: hidden; }
h1, h2 { font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; margin-bottom: .9rem; }
p { margin: 0 0 .8rem; }
a { color: inherit; text-underline-offset: 3px; }
strong { font-weight: 620; }
.discret { color: var(--encre-2); font-size: .875rem; font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--petrole); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.entete { background: var(--petrole); color: var(--blanc); position: sticky; top: 0; z-index: 30; }
.entete-int {
  max-width: 1180px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem; position: relative;
}
.marque { text-decoration: none; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; line-height: 1.15; }
.marque-logo { display: block; height: 35px; width: auto; }
.marque-nom { font-weight: 650; letter-spacing: .01em; }
.marque-app { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
.entete :focus-visible { outline-color: var(--blanc); }

/* ---------- Structure ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.titre-page {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem;
}
.sous-titre { margin: .4rem 0 0; color: var(--encre-2); }
.retour { margin-bottom: .8rem; font-size: .92rem; }
.carte {
  background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 1.25rem; margin-bottom: 1.1rem;
}
.carte-etroite { max-width: 440px; margin: 2.5rem auto; }
.carte-etroite h1 { margin-bottom: .8rem; }
.carte-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.carte-tete h2 { margin: 0; }
.vide { color: var(--encre-2); margin: 0 0 1rem; }
.vide-bloc { text-align: center; padding: 2.2rem 1.25rem; }
.surtitre { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--encre-2); margin-bottom: .4rem; }

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--petrole); color: var(--blanc); border: 1px solid var(--petrole);
  padding: .62rem 1.15rem; border-radius: 999px; font: 600 .95rem var(--police);
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--petrole-2); }
.btn-sec { background: var(--blanc); color: var(--encre); border-color: var(--bord); }
.btn-sec:hover { background: var(--creme); }
.btn-mini {
  background: var(--creme); border: 1px solid var(--trait); color: var(--encre); border-radius: 999px;
  padding: .3rem .7rem; font: 500 .82rem var(--police); cursor: pointer; min-height: 36px;
}
.btn-mini:hover { border-color: var(--petrole); }
a.btn-mini { display: inline-flex; align-items: center; text-decoration: none; }
.lien, .lien-danger {
  background: none; border: 0; padding: 0; font: inherit; font-size: .92rem; color: inherit;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.lien-danger { color: var(--alerte); }
.entete .lien { color: var(--blanc); }

/* ---------- Formulaires ---------- */
label, .champ { display: block; font-weight: 550; font-size: .92rem; }
label > input, label > select, label > textarea, .champ > select { display: block; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel],
input[type=date], select, textarea {
  width: 100%; font: 400 1rem var(--police); color: var(--encre);
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 8px;
  padding: .55rem .7rem; min-height: 44px;
}
textarea { resize: vertical; min-height: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--petrole); outline-offset: 1px; }
input[readonly] { background: var(--creme); }
.case { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.case input { width: 18px; height: 18px; margin: 0; accent-color: var(--encre); }
.case-sous { margin-top: .5rem; font-size: .9rem; }
.champ > input { display: block; margin-top: .3rem; }
.formulaire { display: flex; flex-direction: column; gap: 1rem; }
.formulaire .btn { align-self: flex-start; }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; align-items: start; }
.grille .large { grid-column: 1 / -1; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.grille-3 { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: .5rem; }
.montants { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.creation-rapide { font-weight: 400; margin-top: .2rem; }
.creation-rapide summary { cursor: pointer; font-size: .88rem; color: var(--encre-2); text-decoration: underline; text-underline-offset: 3px; }
.creation-rapide[open] summary { margin-bottom: .5rem; }
.barre-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.fiche > .barre-actions {
  position: sticky; bottom: 0; background: var(--creme); padding: .8rem 0; margin-bottom: 1.1rem;
  border-top: 1px solid var(--trait); z-index: 2;
}
.zone-danger { text-align: right; margin-top: 1.5rem; }

/* ---------- Messages ---------- */
.flash { border-radius: var(--rayon); padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.flash ul { margin: 0; padding-left: 1.1rem; }
.flash-ok { background: var(--ok-fond); border-color: oklch(0.86 0.05 160); color: oklch(0.34 0.08 160); }
.flash-erreur { background: var(--alerte-fond); border-color: oklch(0.86 0.06 28); color: var(--alerte-texte); }
.prochaine {
  background: var(--blanc); border: 1px solid var(--trait); border-left: 4px solid var(--petrole);
  border-radius: 6px; padding: .7rem 1rem; margin-bottom: 1.1rem;
}
.prochaine-alerte { border-left-color: var(--alerte); background: var(--alerte-fond); border-color: oklch(0.86 0.06 28); }

/* ---------- Étiquettes et statuts ---------- */
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--trait); background: var(--creme);
  white-space: nowrap; vertical-align: middle;
}
.tag-ppe { background: var(--petrole); color: var(--blanc); border-color: var(--petrole); }
.tag-loc { background: var(--blanc); border-color: var(--petrole); }
.tag-sem { background: #eef1f6; border-color: #8fa3c4; color: #2c3f5e; }
.tag-sai { background: #f3efe4; border-color: #b9a36b; color: #5a4a1c; }
.tag-urgent { background: var(--alerte); color: var(--blanc); border-color: var(--alerte); }
.tag-ent { background: #eef1f6; border-color: #cfd6e2; }
.statut {
  display: inline-block; font-size: .85rem; font-weight: 600; padding: .18rem .65rem; border-radius: 999px;
  background: var(--creme); border: 1px solid var(--trait); white-space: nowrap;
}
.statut-alerte { background: var(--alerte-fond); border-color: oklch(0.86 0.06 28); color: var(--alerte-texte); }
.statut-clos { background: var(--ok-fond); border-color: oklch(0.86 0.05 160); color: oklch(0.34 0.08 160); }
.etat-fiche { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }

/* Barre de progression à 9 segments */
.barre { display: inline-flex; gap: 3px; vertical-align: middle; }
.seg { width: 16px; height: 8px; border-radius: 2px; background: var(--trait); }
.seg.fait { background: var(--petrole); }
.seg.saute { background: repeating-linear-gradient(135deg, var(--trait) 0 3px, #f3f3f0 3px 6px); }
.seg.actuel { outline: 2px solid var(--petrole); outline-offset: 1px; }
.ligne-alerte .seg.actuel { background: var(--alerte); outline-color: var(--alerte); }

/* ---------- Tableau de bord ---------- */
.tuiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.tuile {
  background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: .8rem .9rem; text-decoration: none; display: flex; flex-direction: column; gap: .1rem;
}
.tuile:hover { border-color: var(--petrole); }
.tuile.active { background: var(--petrole); color: var(--blanc); border-color: var(--petrole); }
.tuile-nb { font-size: 1.7rem; font-weight: 650; line-height: 1.1; }
.tuile-lib { font-size: .82rem; color: var(--encre-2); }
.tuile.active .tuile-lib { color: rgba(255, 255, 255, .8); }
.tuile-alerte:not(.active) { border-color: oklch(0.86 0.06 28); background: var(--alerte-fond); }
.tuile-alerte:not(.active) .tuile-nb { color: var(--alerte); }

.filtres {
  display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: .8rem 1rem; align-items: end;
  background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 1rem 1.25rem; margin-bottom: 1.1rem;
}
.filtres .case { grid-column: 1 / 3; }
.filtres-actions { grid-column: 3 / -1; display: flex; gap: 1.2rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.compte-resultats { margin-bottom: .5rem; }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ligne { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); }
.ligne:hover { border-color: var(--petrole); }
.ligne-alerte { border-left: 4px solid var(--alerte); }
.ligne-close { opacity: .72; }
.ligne-lien {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.9fr); gap: .4rem 1.25rem;
  padding: .85rem 1.1rem; text-decoration: none; align-items: center;
}
.ligne-titre strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.ligne-objet { display: block; color: var(--encre-2); font-size: .9rem; margin-top: .15rem; overflow-wrap: anywhere; }
.ligne-ent { font-size: .94rem; overflow-wrap: anywhere; }
.nb-photos { display: block; }
.ligne-etat { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.ligne-statut { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ligne-action { font-size: .88rem; color: var(--alerte-texte); font-weight: 550; }

/* ---------- Étapes ---------- */
.etapes { list-style: none; margin: 0; padding: 0; }
.etape {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center;
  padding: .65rem 0; border-top: 1px solid var(--trait);
}
.etape:first-child { border-top: 0; }
.etape-num {
  width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid var(--bord); color: var(--encre-2);
  display: grid; place-items: center; font-weight: 600; font-size: .9rem;
}
.etape-faite .etape-num { background: var(--petrole); border-color: var(--petrole); color: var(--blanc); }
.etape-actuelle .etape-num { box-shadow: 0 0 0 3px var(--creme), 0 0 0 4.5px var(--petrole); }
.etape-lib { display: flex; flex-direction: column; font-weight: 400; }
.etape-saisie { display: flex; gap: .5rem; align-items: center; }
.etape-saisie input[type=date] { width: 11rem; }
.etapes-ent .etape { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Photos ---------- */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.photo { margin: 0; }
.photo a { display: block; border-radius: 8px; overflow: hidden; background: var(--creme); aspect-ratio: 4 / 3; border: 1px solid var(--trait); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { font-size: .8rem; margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.photo .suppr { margin-left: auto; }
.photo .lien-danger { font-size: .8rem; }
.envoi-ligne { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.champ-compact { width: 12rem; }
.fichier { position: relative; overflow: hidden; cursor: pointer; }
.fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; }
.fichier:focus-within { outline: 2px solid var(--petrole); outline-offset: 2px; }
.en-cours .fichier { opacity: .5; pointer-events: none; }
.etat-envoi { margin: .6rem 0 0; min-height: 1.2em; }
.etat-erreur { color: var(--alerte-texte); }

.visionneuse {
  position: fixed; inset: 0; background: rgba(20, 20, 20, .92); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem 1rem;
}
.visionneuse[hidden] { display: none; }
.visionneuse img { max-width: 100%; max-height: calc(100vh - 7rem); border-radius: 6px; cursor: zoom-out; }
.visionneuse-legende { color: var(--blanc); margin: .7rem 0 0; font-size: .9rem; text-align: center; }
.visionneuse-fermer {
  position: absolute; top: .6rem; right: .8rem; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: var(--blanc); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.visionneuse-fermer:focus-visible { outline-color: var(--blanc); }

/* ---------- Lien entreprise ---------- */
.lien-zone { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 1.25rem; align-items: start; margin-bottom: .9rem; }
.lien-champ { display: flex; flex-direction: column; gap: .7rem; }
.lien-boutons { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; }
.qr { width: 150px; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; background: var(--blanc); line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.ligne-form { margin: 0; }

/* ---------- Journal ---------- */
.note-form { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; margin-bottom: 1.1rem; }
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { padding: .6rem 0 .6rem .9rem; border-left: 2px solid var(--trait); margin-left: .2rem; display: flex; flex-direction: column; gap: .1rem; }
.journal-ent { border-left-color: #8fa3c4 !important; }
.journal-meta { font-size: .8rem; color: var(--encre-2); }
.journal-texte { overflow-wrap: anywhere; }

/* ---------- Tableaux (immeubles, entreprises, utilisateurs) ---------- */
.table-defilante { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-2); font-weight: 600; padding: .5rem .7rem; border-bottom: 1px solid var(--petrole); white-space: nowrap; }
.table td { padding: .7rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.table .num { text-align: right; }
.table .actions { text-align: right; line-height: 2.1; min-width: 15rem; }
.table .actions form { display: inline; }
.table .actions > *, .table .actions form > button { margin-left: .8rem; white-space: nowrap; }
.table tr.en-edition td { background: var(--creme); }
.carte-edition { border-color: var(--petrole); }
.table tr.archive td { opacity: .6; }

/* ---------- Page entreprise ---------- */
.public .entete-int { justify-content: center; }
.public .marque { align-items: center; }
.public .page { max-width: 720px; }
.public .carte-etroite { max-width: 440px; }
.resume { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.5rem; margin: 1rem 0; }
.resume dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-2); }
.resume dd { margin: .15rem 0 0; }
.description { white-space: normal; overflow-wrap: anywhere; }
.public h2 { margin-top: .4rem; }

/* ---------- Affiche QR ---------- */
.page-qr { background: var(--blanc); }
.affiche { max-width: 560px; margin: 0 auto; padding: 3rem 1.5rem; text-align: center; }
.affiche-agence { text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; margin-bottom: 1.5rem; }
.affiche h1 { font-size: 1.9rem; margin-bottom: .6rem; }
.affiche-lieu { color: var(--encre-2); font-size: 1.05rem; }
.qr-grand { width: 300px; max-width: 80%; margin: 2rem auto; border: 0; }
.affiche-consigne { font-size: 1.15rem; }
.affiche-contact { color: var(--encre-2); margin-bottom: 2rem; }

/* ---------- Écrans étroits ---------- */
@media (max-width: 900px) {
  .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filtres { grid-template-columns: 1fr 1fr; }
  .filtres .case, .filtres-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ligne-lien { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .page { padding: 1rem .8rem 3rem; }
  .carte { padding: 1rem; }
  .entete-int { gap: .6rem 1rem; padding: .6rem .8rem; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille, .montants, .grille-2, .grille-3, .resume { grid-template-columns: 1fr; }
  .filtres { grid-template-columns: 1fr; }
  .etape { grid-template-columns: 2rem minmax(0, 1fr); }
  .etape-saisie { grid-column: 2; }
  .etapes-ent .etape { grid-template-columns: 1fr; }
  .etapes-ent .etape-saisie { grid-column: 1; }
  .etape-saisie input[type=date] { flex: 1; width: auto; }
  .lien-zone { grid-template-columns: 1fr; }
  .titre-page .btn { width: 100%; }
  .etat-fiche { align-items: flex-start; }
  .galerie { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table .actions { white-space: normal; }
}

@media print {
  .sans-impression, .entete { display: none !important; }
  .affiche { padding-top: 1.5cm; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tuile, .ligne, .nav a { transition: background-color .12s, border-color .12s; }
}

/* ---------- Bilans annuels ---------- */
.discret-titre { color: var(--encre-2); font-weight: 400; }
.choix-annee label { flex-direction: row; display: flex; align-items: center; gap: .6rem; }
.choix-annee select { width: auto; margin-top: 0; min-width: 6.5rem; }
.tuiles-bilan { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tuiles-bilan .tuile-nb { font-size: 1.45rem; }
.table tfoot th { padding: .7rem; border-top: 1px solid var(--petrole); border-bottom: 0; text-align: left; font-size: .94rem; text-transform: none; letter-spacing: 0; color: var(--encre); }
.table tfoot th.num { text-align: right; }
@media (max-width: 900px) { .tuiles-bilan { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .carte { border: 0; padding: 0; }
  .tuile { border: 1px solid #999; }
  .table a { text-decoration: none; }
}

/* ---------- Filtres repliables (repliés par défaut sur téléphone) ---------- */
.repli-filtres > summary { display: none; }
.repli-filtres { margin-bottom: 1.1rem; }
.repli-filtres .filtres { margin-bottom: 0; }

/* ---------- Tablettes et téléphones ---------- */
@media (max-width: 900px) {
  /* En-tête : le menu passe sous le nom de l'agence, sur toute la largeur */
  .entete-int { gap: .5rem 1rem; }

  /* Listes (immeubles, entreprises, utilisateurs) : une fiche par ligne au lieu d'un tableau large */
  .table-cartes, .table-cartes tbody { display: block; }
  .table-cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-cartes tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
  .table-cartes tr {
    display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: .25rem .7rem;
    padding: .9rem 0; border-bottom: 1px solid var(--trait);
  }
  .table-cartes td { display: block; flex: 1 0 100%; padding: 0; border: 0; overflow-wrap: anywhere; }
  .table-cartes td:empty { display: none; }
  .table-cartes td.c-court { flex: 0 0 auto; }
  .table-cartes td.c-titre { font-size: 1rem; }
  /* Nom + numéro + étiquette de type sur la même ligne, sans laisser de place aux compteurs */
  .table-cartes td.c-avec-tag { flex: 1 1 0; min-width: calc(100% - 7.5rem); }
  .table-cartes td.num { flex: 0 0 auto; text-align: left; color: var(--encre-2); font-size: .875rem; }
  .table-cartes td[data-label]::before { content: attr(data-label) " : "; }
  .table-cartes .actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1.1rem;
    text-align: left; min-width: 0; line-height: 1.4; margin-top: .35rem;
  }
  .table-cartes .actions form { display: contents; }
  .table-cartes .actions > *, .table-cartes .actions form > button { margin-left: 0; }
  .table-cartes .actions .lien, .table-cartes .actions .lien-danger { min-height: 36px; display: inline-flex; align-items: center; }
  .table-cartes tr.en-edition { background: var(--creme); box-shadow: 0 0 0 .5rem var(--creme); }
  .table-cartes tr.en-edition td { background: none; }
}
@media (max-width: 640px) {
  .table-cartes tbody { grid-template-columns: 1fr; }

  /* Menu : toutes les rubriques visibles, sur deux lignes */

  /* Tuiles : la première sur toute la largeur, les six autres par deux */
  .tuiles:not(.tuiles-bilan) .tuile:first-child { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: .6rem; }
  .tuile { padding: .65rem .8rem; }
  .tuile-nb { font-size: 1.45rem; }

  /* Filtres repliables */
  .repli-filtres > summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none;
    background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon);
    padding: .75rem 1rem; font-weight: 600; min-height: 44px;
  }
  .repli-filtres > summary::-webkit-details-marker { display: none; }
  .repli-filtres > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; line-height: 1; font-weight: 400; }
  .repli-filtres[open] > summary::after { content: "–"; }
  .repli-filtres[open] > summary { border-radius: var(--rayon) var(--rayon) 0 0; border-bottom: 0; }
  .repli-filtres[open] .filtres { border-radius: 0 0 var(--rayon) var(--rayon); }
  .filtres-actions .btn { flex: 1 0 100%; }

  /* Boutons pleine largeur, plus faciles à toucher */
  .lien-boutons .btn, .note-form .btn, .formulaire .btn, .envoi-ligne .fichier { width: 100%; }
  .champ-compact { width: 100%; }
  .zone-danger { text-align: left; }
  .carte-etroite { margin: 1.2rem auto; }
  .qr-grand { max-width: 100%; }
}

/* ---------- Dictée d'une intervention ---------- */
.titre-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.dictee form { display: flex; flex-direction: column; gap: .8rem; }
.dictee textarea { font-size: 1.05rem; }
.btn-micro::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; }
.btn-micro.en-ecoute { background: var(--alerte); border-color: var(--alerte); }
.etat-dictee { margin: 0; min-height: 1.2em; }
.resultat-dictee { scroll-margin-top: 1rem; }
.resultat-dictee ul { margin: .4rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.resultat-dictee .btn-mini { margin: .15rem .2rem .15rem 0; background: var(--blanc); text-align: left; }
.btn-mini.choisi { background: var(--petrole); border-color: var(--petrole); color: var(--blanc); }
@media (max-width: 640px) {
  .titre-actions { width: 100%; }
  .titre-actions .btn { flex: 1 1 0; width: auto; }
  .dictee .barre-actions .btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn-micro.en-ecoute::before { animation: ecoute 1.1s ease-in-out infinite; }
  @keyframes ecoute { 50% { opacity: .25; } }
}

/* ---------- Documents PDF ---------- */
.documents { list-style: none; margin: 0 0 1.1rem; padding: 0; }
.documents li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .55rem 0; border-top: 1px solid var(--trait); overflow-wrap: anywhere; }
.documents li:first-child { border-top: 0; }
.documents .suppr { margin-left: auto; }
.champ-fichier { flex: 1 1 14rem; }
input[type=file] { font: 400 .95rem var(--police); max-width: 100%; }
.champ-fichier input[type=file], .formulaire input[type=file] { padding: .45rem 0; }

/* ---------- Relance, garanties, import ---------- */
.relance { margin: .7rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.garanties ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.garantie-saisie { flex-wrap: wrap; margin-top: .3rem; }
.import-zone { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; white-space: pre; overflow-x: auto; }
.import-confirmer { margin-top: 1rem; }

/* ---------- Rapport annuel (impression A4 / PDF) ---------- */
.page-rapport { background: #ececE7; }
.rapport-outils { max-width: 210mm; margin: 0 auto; padding: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; }
.rapport { max-width: 210mm; margin: 0 auto 2rem; background: var(--blanc); padding: 18mm 16mm; font-size: 10.5pt; line-height: 1.45; }
.rapport h1 { font-size: 20pt; margin: .2rem 0 .5rem; }
.rapport h2 { font-size: 11.5pt; margin: 1.4rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1.5px solid var(--petrole); }
.rapport-tete { border-bottom: 3px solid var(--petrole); padding-bottom: .9rem; }
.rapport-agence { text-transform: uppercase; letter-spacing: .14em; font-size: 8.5pt; margin: 0; }
.rapport-objet { margin: 0; font-size: 11.5pt; }
.rapport-synthese { border-collapse: collapse; }
.rapport-synthese th { text-align: left; font-weight: 400; padding: .15rem 2rem .15rem 0; }
.rapport-synthese td { text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; }
.rapport-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.rapport-table th { text-align: left; font-size: 8pt; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-2); padding: .35rem .4rem; border-bottom: 1px solid var(--petrole); }
.rapport-table td { padding: .4rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.rapport-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rapport-table tfoot th { border-top: 1.5px solid var(--petrole); border-bottom: 0; font-size: 9.5pt; text-transform: none; letter-spacing: 0; color: var(--encre); }
.rapport-table .discret { font-size: 8.5pt; }
.rapport-table tr { break-inside: avoid; }
.rapport-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10mm; break-inside: avoid; }
.rapport-note { color: var(--alerte-texte); margin: .6rem 0 0; }
.rapport-pied { margin-top: 1.8rem; padding-top: .6rem; border-top: 1px solid var(--trait); font-size: 8.5pt; color: var(--encre-2); }
.rapport-pied p { margin: 0 0 .2rem; }
@media (max-width: 640px) {
  .rapport { padding: 1.2rem 1rem; }
  .rapport section { overflow-x: auto; }
  .rapport-colonnes { grid-template-columns: 1fr; }
  .rapport-table { font-size: 8.5pt; }
  .documents .suppr { margin-left: 0; }
  .envoi-document .btn { width: 100%; }
}
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  .page-rapport { background: #fff; }
  .rapport { max-width: none; margin: 0; padding: 0; }
}

/* ---------- Comparaison des devis ---------- */
.devis-ajout { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: .8rem 1rem; align-items: end; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--trait); }
.devis-ajout .devis-remarque { grid-column: 1 / 3; }
@media (max-width: 640px) {
  .devis-ajout { grid-template-columns: 1fr; }
  .devis-ajout .devis-remarque { grid-column: auto; }
  .devis-ajout .btn { width: 100%; }
}

/* ---------- Onglets par famille (PPE, locations à l'année, locations à la semaine) ---------- */
.onglets { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.onglets a {
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; min-height: 40px;
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--trait); background: var(--blanc); font-size: .94rem;
}
.onglets a:hover { border-color: var(--petrole); }
.onglets a.actif { background: var(--petrole); border-color: var(--petrole); color: var(--blanc); font-weight: 600; }
.onglet-nb { font-size: .8rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.onglets a.actif .onglet-nb { color: rgba(255, 255, 255, .8); }
@media (max-width: 640px) {
  .onglets { flex-wrap: nowrap; overflow-x: auto; margin: 0 -.8rem 1rem; padding: 0 .8rem .2rem; }
  .onglets a { white-space: nowrap; }
}

/* ---------- Logo sur l'affiche QR et le rapport ---------- */
.affiche-logo { display: block; height: 60px; width: auto; margin: 0 auto 1.8rem; }
.rapport-logo { display: block; height: 45px; width: auto; margin: 0 0 1rem; }

/* ---------- Menu principal et menu du compte ---------- */
.nav { display: flex; gap: .15rem; flex: 1; min-width: 0; }
.nav a {
  text-decoration: none; padding: .5rem .85rem; border-radius: 999px; font-size: .94rem;
  white-space: nowrap; opacity: .82;
}
.nav a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.nav a.actif { background: var(--blanc); color: var(--encre); opacity: 1; font-weight: 600; }

.compte { position: relative; margin-left: auto; }
.compte > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .55rem; min-height: 42px;
  padding: .3rem .8rem .3rem .3rem; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; font-size: .9rem;
}
.compte > summary::-webkit-details-marker { display: none; }
.compte > summary:hover, .compte[open] > summary { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.compte-actif > summary { border-color: var(--blanc); }
.compte-initiales {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blanc); color: var(--encre);
  display: grid; place-items: center; font-weight: 650; font-size: .78rem; letter-spacing: .02em;
}
.compte-nom { white-space: nowrap; }
.compte-nom::after { content: ""; display: inline-block; margin-left: .5rem; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.compte-burger, .compte-menu { display: none; }
.compte-panneau {
  position: absolute; right: 0; top: calc(100% + .55rem); min-width: 15.5rem; z-index: 31;
  background: var(--blanc); color: var(--encre); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: .4rem; display: flex; flex-direction: column;
}
.compte-panneau a, .compte-panneau button {
  display: block; width: 100%; text-align: left; text-decoration: none; padding: .6rem .8rem; border-radius: 7px;
  background: none; border: 0; cursor: pointer; color: inherit; font: 400 .95rem var(--police);
}
.compte-panneau a:hover, .compte-panneau button:hover { background: var(--creme); }
.compte-panneau a.actif { background: var(--creme); font-weight: 600; }
.compte-panneau form { margin: .3rem 0 0; padding-top: .3rem; border-top: 1px solid var(--trait); }
.compte-panneau :focus-visible { outline-color: var(--petrole); }
.compte-qui { margin: 0 0 .3rem; padding: .5rem .8rem .65rem; border-bottom: 1px solid var(--trait); font-weight: 600; line-height: 1.3; }
.compte-qui span { font-weight: 400; font-size: .85rem; color: var(--encre-2); overflow-wrap: anywhere; }
.compte-nav { display: none; }

@media (max-width: 980px) {
  .entete-int { gap: .9rem; }
  .nav a { padding: .45rem .65rem; font-size: .9rem; }
  .compte > summary { padding-right: .3rem; }
  .compte-nom { font-size: 0; }           /* nom masqué, la flèche reste */
  .compte-nom::after { margin: 0 .35rem 0 .1rem; }
}
@media (max-width: 860px) {
  /* Téléphone et tablette en portrait : un bouton « Menu » ouvre toutes les rubriques, l'en-tête reste sur une ligne */
  .nav { display: none; }
  .compte { position: static; }
  .compte > summary { padding: .3rem .9rem .3rem .8rem; gap: .6rem; min-height: 44px; }
  .compte-initiales, .compte-nom { display: none; }
  .compte-menu { display: inline; font-weight: 600; }
  .compte-burger {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
  }
  .compte-panneau {
    left: 0; right: 0; top: 100%; min-width: 0; border-radius: 0 0 14px 14px; border-width: 0 0 1px;
    padding: .5rem .8rem .8rem; max-height: calc(100vh - 4.5rem); overflow-y: auto;
  }
  .compte-nav { display: flex; flex-direction: column; margin-bottom: .4rem; padding-bottom: .4rem; border-bottom: 1px solid var(--trait); }
  .compte-panneau a, .compte-panneau button { padding: .85rem .8rem; font-size: 1.02rem; }
  .compte-nav a.actif { background: var(--petrole); color: var(--blanc); }
  .compte-qui { border-bottom: 0; margin: 0; padding-bottom: .2rem; font-size: .9rem; }
}
@media (max-width: 640px) {
  .marque-logo { height: 30px; }
}

/* ---------- Graphiques du tableau de bord ----------
   Couleurs: une seule teinte (anthracite) pour les mesures à une série ; rouge d'alerte réservé à l'état « en alerte » ;
   bleu et vert d'eau pour les deux séries du graphique d'activité (paire validée : daltonisme et vision normale). */
:root { --g-s0: var(--petrole-3); --g-s1: #2a78d6; --g-s2: #1baf7a; --g-axe: #e2e2e2; }
.graphiques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; align-items: stretch; }
.g-carte { margin: 0; display: flex; flex-direction: column; }
.g-carte h2 { margin-bottom: .2rem; }
.g-sous { margin: 0 0 .9rem; }
.g-tete { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.g-hero { font-size: 2.6rem; font-weight: 650; letter-spacing: -.02em; line-height: 1; margin-right: .15rem; }
.g-alerte {
  text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; padding: .3rem .7rem; border-radius: 999px;
  background: var(--alerte-fond); border: 1px solid oklch(0.86 0.06 28); color: var(--alerte-texte);
}
.g-alerte:hover, .g-alerte.active { background: var(--alerte); border-color: var(--alerte); color: var(--blanc); }
.g-vide { margin: 1rem 0; }

/* Barres horizontales par étape */
.g-barres { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.g-barre {
  display: grid; grid-template-columns: 8.6rem minmax(0, 1fr); align-items: center; gap: .6rem;
  text-decoration: none; padding: .32rem .4rem; margin: 0 -.4rem; border-radius: 6px; min-height: 34px;
}
.g-barre:hover, .g-barre.active { background: var(--creme); }
.g-barre.active .g-barre-lib { font-weight: 620; }
.g-barre-lib { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-barre.vide .g-barre-lib, .g-barre.vide .g-barre-val { color: var(--encre-2); }
.g-barre-piste { display: flex; align-items: center; gap: 2px; min-width: 0; padding-right: 1.6rem; position: relative; }
.g-seg { height: 14px; background: var(--g-s0); min-width: 3px; }
.g-seg:last-of-type { border-radius: 0 4px 4px 0; }
.g-seg-alerte { background: var(--alerte); }
.g-barre-val { font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: .35rem; }

/* Colonnes sur 12 mois */
.g-col { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 .45rem; height: 190px; margin-top: auto; padding-top: .6rem; }
.g-col-axe { position: relative; min-width: 1.4rem; margin-bottom: 2.1rem; }
.g-col-axe span { position: absolute; right: 0; transform: translateY(50%); font-size: .72rem; color: var(--encre-2); font-variant-numeric: tabular-nums; line-height: 1; }
.g-col-axe i { visibility: hidden; display: block; font-size: .72rem; font-style: normal; font-variant-numeric: tabular-nums; } /* réserve la largeur de la plus grande graduation */
.g-col-zone { position: relative; display: flex; flex-direction: column; min-width: 0; }
.g-col-grille { position: absolute; inset: 0 0 2.1rem 0; border-bottom: 1px solid var(--bord); }
.g-col-grille span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--g-axe); }
.g-col-mois { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; position: relative; min-height: 0; }
.g-col-mois li { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; border-radius: 4px; outline-offset: -2px; }
.g-col-mois li:hover, .g-col-mois li:focus-visible { background: oklch(0.34 0.062 228 / .07); }
.g-col-barres { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; min-height: 0; }
.g-colonne { width: min(11px, 38%); border-radius: 3px 3px 0 0; }
.g-col[style*="--n:1"] .g-colonne { width: min(18px, 62%); border-radius: 4px 4px 0 0; }
.g-col-lib { height: 2.1rem; padding-top: .3rem; font-size: .7rem; color: var(--encre-2); text-align: center; line-height: 1.15; white-space: nowrap; }
.g-col-lib small { display: block; font-size: .64rem; }
.g-s0 { background: var(--g-s0); }
.g-s1 { background: var(--g-s1); }
.g-s2 { background: var(--g-s2); }

.g-legende { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--encre-2); }
.g-legende li { display: flex; align-items: center; gap: .35rem; }
.g-pastille { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.g-table { margin-top: .6rem; font-size: .85rem; }
.g-table summary { cursor: pointer; color: var(--encre-2); text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; }
.g-table .table { font-size: .85rem; margin-top: .4rem; }
.g-table .table td, .g-table .table th { padding: .3rem .5rem; }

/* Infobulle commune (data-info) */
.infobulle {
  position: fixed; z-index: 60; pointer-events: none; max-width: 17rem; padding: .45rem .65rem; border-radius: 7px;
  background: var(--petrole); color: var(--blanc); font-size: .82rem; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.infobulle[hidden] { display: none; }

@media (max-width: 1040px) {
  .graphiques { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graphiques .g-carte:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .graphiques { grid-template-columns: 1fr; }
  .g-barre { grid-template-columns: 7.6rem minmax(0, 1fr); min-height: 40px; }
  .g-col { height: 170px; }
}
@media print { .g-table { display: none; } }

/* ---------- Page de suivi du locataire ---------- */
.suivi-resume { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 1.2rem; }
.suivi-etapes { list-style: none; margin: 0; padding: 0; }
.suivi-etapes li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .8rem; padding-bottom: 1.2rem; position: relative; }
.suivi-etapes li:last-child { padding-bottom: 0; }
.suivi-etapes li:not(:last-child)::before { content: ""; position: absolute; left: 1.05rem; top: 2.2rem; bottom: 0; width: 2px; background: var(--trait); }
.suivi-etapes li.suivi-fait:not(:last-child)::before { background: var(--petrole); }
.suivi-puce {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: .95rem;
  border: 2px solid var(--bord); color: var(--encre-2); background: var(--blanc); position: relative;
}
.suivi-fait .suivi-puce { background: var(--petrole); border-color: var(--petrole); color: var(--blanc); }
.suivi-actuel .suivi-puce { border-color: var(--petrole); color: var(--encre); box-shadow: 0 0 0 4px var(--creme); }
.suivi-texte { display: flex; flex-direction: column; padding-top: .3rem; }
.suivi-avenir .suivi-texte strong { color: var(--encre-2); font-weight: 500; }
.suivi-pied { text-align: center; margin-top: 1.2rem; }
.journal-loc { border-left-color: #c9a227 !important; }

/* ---------- Messagerie avec le locataire ---------- */
.fil { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.fil-msg {
  max-width: 85%; align-self: flex-start; display: flex; flex-direction: column; gap: .15rem;
  background: var(--creme); border: 1px solid var(--trait); border-radius: 12px 12px 12px 3px; padding: .55rem .8rem;
}
.fil-moi { align-self: flex-end; background: var(--petrole); border-color: var(--petrole); color: var(--blanc); border-radius: 12px 12px 3px 12px; }
.fil-meta { font-size: .76rem; color: var(--encre-2); }
.fil-moi .fil-meta { color: rgba(255, 255, 255, .75); }
.fil-texte { overflow-wrap: anywhere; }
.fil-nouveau { border-color: #c9a227; box-shadow: 0 0 0 2px #f6ecc4; }
.tag-message { background: #f6ecc4; border-color: #c9a227; color: #5c4a05; }
.messages-non-lus { border-left-color: #c9a227; }
.messages-non-lus ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* =====================================================================
   Thème « Pétrole » : bandeau de couleur, feuille de contenu, listes par urgence
   ===================================================================== */
h1 { font-weight: 650; letter-spacing: -.022em; font-size: 2.05rem; line-height: 1.12; }
h2 { font-weight: 650; }
strong { font-weight: 600; }
.entete { background: var(--petrole); color: var(--sur-petrole); position: static; }
.entete-int { max-width: 1080px; padding: .2rem 2rem; min-height: 70px; }
.page { max-width: 1080px; padding: 0 2rem 4.5rem; }
.public .page { padding-top: 1.6rem; }
.nav a { border-radius: 6px; }
.nav a.actif { background: oklch(1 0 0 / .13); color: inherit; }
.marque-app { display: none; }
.public .marque-app { display: block; }

/* Bandeau : le titre de la page est sur le fond de couleur, en pleine largeur */
.bandeau {
  background: var(--petrole); color: var(--sur-petrole);
  box-shadow: 0 0 0 100vmax var(--petrole); clip-path: inset(0 -100vmax);
  padding: 1.5rem 0 5rem; margin-bottom: -3.3rem;
}
.bandeau .titre-page { margin: 0; align-items: flex-end; }
.bandeau .sous-titre, .bandeau .intro-texte { color: inherit; opacity: .86; margin: .5rem 0 0; font-size: 1.02rem; }
.bandeau .retour { margin: 0 0 .7rem; }
.bandeau .retour a { opacity: .82; text-decoration: none; }
.bandeau .retour a:hover { opacity: 1; text-decoration: underline; }
.bandeau .discret { color: inherit; opacity: .8; }
.bandeau .btn { background: var(--sur-petrole); color: var(--petrole); border-color: transparent; font-weight: 650; }
.bandeau .btn:hover { background: oklch(1 0 0); }
.bandeau .btn-sec { background: transparent; color: inherit; border-color: oklch(1 0 0 / .38); }
.bandeau .btn-sec:hover { background: oklch(1 0 0 / .1); }
.bandeau :focus-visible { outline-color: var(--sur-petrole); }
.bandeau select { min-height: 40px; }
.bandeau .tag-ppe { background: oklch(1 0 0 / .16); border-color: transparent; color: inherit; }
.bandeau .tag-loc, .bandeau .tag-sai, .bandeau .tag-sem { background: transparent; border-color: oklch(1 0 0 / .45); color: inherit; }
.bandeau .statut { background: oklch(1 0 0 / .14); border-color: transparent; color: inherit; }
.bandeau .statut-alerte { background: var(--orange); color: oklch(0.2 0.03 40); }
.bandeau .statut-clos { background: oklch(0.86 0.07 160); color: oklch(0.25 0.06 160); }
.bandeau .tag-urgent { background: var(--orange); border-color: transparent; color: oklch(0.2 0.03 40); }
.apres-bandeau { position: relative; }
/* Tout ce qui suit le bandeau passe au-dessus de lui (le contenu remonte sur la couleur) */
.page > .bandeau ~ * { position: relative; z-index: 1; }
.bandeau .discret-titre { color: inherit; opacity: .6; }
.bandeau label { color: inherit; }

/* Boutons et champs */
.btn { border-radius: 8px; font-weight: 650; }
.btn-sec { border-color: var(--bord); }
.btn-mini { border-radius: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=date], select, textarea { border-radius: 8px; }
.carte { border-radius: 14px; }
.tag-ppe { background: var(--petrole); border-color: var(--petrole); }
.statut { background: var(--givre); border-color: transparent; color: var(--petrole); }
.statut-alerte { background: var(--alerte-fond); color: var(--alerte-texte); }

/* Encadrés d'information : fond teinté, sans trait latéral */
.prochaine, .messages-non-lus, .garanties {
  border: 0; border-radius: 10px; background: var(--givre); padding: .9rem 1.1rem;
}
.prochaine-alerte { background: var(--alerte-fond); border: 0; }
.messages-non-lus { background: oklch(0.95 0.045 90); }
.ligne-alerte { border-left: 1px solid var(--trait); }
.journal li { border-left: 0; margin-left: 0; padding-left: 0; border-top: 1px solid var(--trait); }
.journal li:first-child { border-top: 0; }
.journal-ent .journal-meta::before, .journal-loc .journal-meta::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; background: var(--petrole-3); }
.journal-loc .journal-meta::before { background: oklch(0.75 0.13 90); }

/* Tableau de bord : répartition par étape, dans le bandeau */
.etapes-barres { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .9rem; margin-top: 2rem; align-items: end; }
.etapes-barres a { text-decoration: none; display: flex; flex-direction: column; gap: .35rem; border-radius: 6px; }
.etapes-barres .col { height: 56px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.etapes-barres .col i { display: block; border-radius: 3px 3px 0 0; background: oklch(0.80 0.06 228); min-height: 2px; }
.etapes-barres .col i.r { background: var(--orange); }
.etapes-barres .col i + i { border-radius: 0; }
.etapes-barres b { font-weight: 650; font-variant-numeric: tabular-nums; }
.etapes-barres span.nom { font-size: .78rem; opacity: .8; line-height: 1.25; }
.etapes-barres a:hover span.nom, .etapes-barres a.actif span.nom { opacity: 1; text-decoration: underline; }
.etapes-barres a.vide b, .etapes-barres a.vide span.nom { opacity: .55; }

/* Feuille : le contenu remonte sur le bandeau */
.feuille { background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: .4rem 1.6rem 1.3rem; margin-bottom: 1.1rem; position: relative; }
.feuille .onglets { display: flex; flex-wrap: nowrap; gap: 1.5rem; border-bottom: 1px solid var(--trait); overflow-x: auto; margin: 0 -1.6rem 1.2rem; padding: 0 1.6rem; }
.feuille .onglets a { border: 0; border-radius: 0; background: none; padding: .85rem 0 .75rem; min-height: 0; color: var(--encre-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.feuille .onglets a:hover { color: var(--encre); }
.feuille .onglets a.actif { background: none; color: var(--encre); font-weight: 650; border-bottom-color: var(--petrole); }
.feuille .onglets a.actif .onglet-nb { color: var(--encre-2); }
.onglets a.actif { background: var(--petrole); border-color: var(--petrole); }
.feuille .repli-filtres { margin: 0 0 .4rem; }
.feuille .repli-filtres > summary { display: inline-flex; list-style: none; cursor: pointer; color: var(--encre-2); font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; padding: .2rem 0; border: 0; background: none; min-height: 0; font-weight: 400; gap: .5rem; align-items: center; }
.feuille .repli-filtres > summary::-webkit-details-marker { display: none; }
.feuille .repli-filtres > summary::after { content: none; }
.feuille .repli-filtres[open] > summary { border: 0; margin-bottom: .7rem; }
.feuille .filtres { border: 0; background: var(--creme); border-radius: 10px; }
.groupe { font: 650 .8rem/1.2 var(--police); letter-spacing: .08em; text-transform: uppercase; color: var(--encre-2); margin: 1.6rem 0 .3rem; display: flex; gap: .6rem; align-items: center; }
.groupe.urgent { color: var(--alerte); }
.groupe span { font-variant-numeric: tabular-nums; }
.dossiers { list-style: none; margin: 0; padding: 0; }
.dossier a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .8rem .6rem; margin: 0 -.6rem; border-radius: 10px; text-decoration: none; }
.dossier { border-bottom: 1px solid var(--trait); }
.dossier a:hover { background: var(--givre); }
.dossier strong { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.dossier .lieu { display: block; color: var(--encre-2); font-size: .9rem; overflow-wrap: anywhere; }
.dossier .quoi { text-align: right; font-size: .9rem; color: var(--encre-2); }
.dossier .quoi b { display: block; color: var(--encre); font-weight: 600; font-size: .97rem; }
.dossier.retard .quoi b { color: var(--alerte); }
.dossier.clos { opacity: .7; }
.anneau { width: 40px; height: 40px; flex: none; }
.anneau circle { fill: none; stroke-width: 4; }
.anneau .fond { stroke: var(--givre); }
.anneau .fait { stroke: var(--petrole-3); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.retard .anneau .fait { stroke: var(--alerte); }
.clos .anneau .fait { stroke: var(--ok); }
.anneau text { font: 650 11px var(--police); fill: var(--encre); text-anchor: middle; dominant-baseline: central; }
.puce-msg { display: inline-block; font-size: .78rem; font-weight: 600; background: oklch(0.95 0.045 90); color: oklch(0.36 0.07 90); padding: .08rem .55rem; border-radius: 999px; margin-left: .3rem; vertical-align: 1px; white-space: nowrap; }
.dossier .tag { margin-left: .3rem; }

/* Fiche : avancement en 9 segments dans le bandeau */
.avancement { margin-top: 1.7rem; }
.avancement .rail { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.avancement .rail i { height: 8px; border-radius: 4px; background: oklch(1 0 0 / .2); }
.avancement .rail i.f { background: oklch(0.86 0.05 228); }
.avancement .rail i.a { background: var(--sur-petrole); box-shadow: 0 0 0 2px oklch(1 0 0 / .3); }
.avancement .rail.retard i.a { background: var(--orange); box-shadow: none; }
.avancement .noms { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin-top: .45rem; font-size: .72rem; opacity: .85; line-height: 1.25; }
.avancement .noms b { font-weight: 650; }
.bandeau .etat-fiche { align-items: flex-end; }
.fiche > .barre-actions { background: var(--creme); }

/* Graphiques sous la liste */
.graphiques-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Barre du bas sur téléphone */
.bas { display: none; }

@media (max-width: 860px) {
  .entete-int { padding: .2rem 1rem; min-height: 58px; }
  .page { padding: 0 1rem 6.5rem; }
  h1 { font-size: 1.6rem; }
  .bandeau { padding: 1rem 0 4.4rem; }
  .bandeau .titre-actions, .bandeau .titre-page > .btn { width: 100%; }
  .bandeau .titre-actions .btn { flex: 1 1 auto; white-space: nowrap; padding-inline: .9rem; }
  .bandeau .titre-actions .btn-sec { flex: 0 0 auto; }
  .bandeau .titre-page > .btn { justify-content: center; }
  .etapes-barres { gap: .35rem; margin-top: 1.4rem; }
  .etapes-barres span.nom { display: none; }
  .etapes-barres .col { height: 42px; }
  .feuille { padding-inline: 1rem; border-radius: 12px; }
  .feuille .onglets { margin-inline: -1rem; padding-inline: 1rem; gap: 1.2rem; }
  .dossier a { grid-template-columns: 36px minmax(0, 1fr); row-gap: .15rem; }
  .dossier .quoi { grid-column: 2; text-align: left; }
  .dossier .quoi b { display: inline; margin-right: .45rem; }
  .anneau { width: 36px; height: 36px; }
  .avancement .noms { display: none; }
  .graphiques-2 { grid-template-columns: 1fr; }
  .fiche > .barre-actions { bottom: 58px; }
  .compte > summary { border-color: oklch(1 0 0 / .38); }
  .bas {
    display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--blanc); border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom);
  }
  .bas a, .bas button { text-decoration: none; text-align: center; padding: .8rem .2rem; font: 400 .76rem var(--police); color: var(--encre-2); background: none; border: 0; cursor: pointer; }
  .bas a.actif { color: var(--petrole); font-weight: 650; }
  .bas a.plus { width: 52px; height: 52px; border-radius: 50%; background: var(--petrole); color: var(--sur-petrole); font-size: 1.7rem; line-height: 1; padding: 0; display: grid; place-items: center; margin: -18px auto 0; }
}
@media print { .bas, .bandeau .btn { display: none !important; } .bandeau { background: none; box-shadow: none; color: inherit; padding: 0; margin: 0 0 1rem; clip-path: none; } }

/* ---------- Cas d'assurance (sinistres des PPE) ---------- */
.sinistre:not(:has(input[name="sinistre"]:checked)) .sinistre-champs { display: none; }
.sinistre-champs { margin-top: 1rem; }
.etapes-sinistre { margin: 1.1rem 0; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.decompte { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1.5rem; margin: 0; padding: .9rem 1rem; background: var(--givre); border-radius: 6px; }
.decompte dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-2); }
.decompte dd { margin: .15rem 0 0; font-variant-numeric: tabular-nums; }
.tag-sinistre { background: var(--givre); color: var(--petrole); }
.police { border: 1px solid var(--trait); border-radius: 6px; padding: .9rem 1rem 1rem; margin: 0; min-width: 0; }
.police legend { padding: 0 .4rem; font-weight: 600; }
.sinistres-liste { list-style: none; margin: .5rem 0 0; padding: 0; }
.sinistres-liste li { padding: .45rem 0; border-top: 1px solid var(--trait); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: baseline; }
.sinistres-liste li:first-child { border-top: 0; }
.sinistres-liste .quoi-sin { text-align: right; }
.sinistres-liste .retard .quoi-sin b { color: var(--alerte-texte); }
.sinistres h3 { margin: .9rem 0 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-2); font-weight: 600; }
@media (max-width: 720px) {
  .decompte { grid-template-columns: 1fr; }
  .sinistres-liste li { grid-template-columns: 1fr; }
  .sinistres-liste .quoi-sin { text-align: left; }
}

/* ---------- Déclaration d'incident par le locataire (page publique) ---------- */
.decl-langue { text-align: right; margin: 0 0 .6rem; font-size: .9rem; }
.decl-intro { margin-bottom: 1.4rem; }
.decl-intro h1 { margin-bottom: .6rem; }
.decl-urgence { background: var(--alerte-fond); color: var(--alerte-texte); border-radius: 6px; padding: .7rem 1rem; margin-top: 1rem; }
.decl-urgence a { color: inherit; font-weight: 600; white-space: nowrap; }
.decl-piege { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.decl h2 { display: flex; align-items: center; gap: .6rem; }
.decl-num { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--petrole); color: var(--blanc); display: grid; place-items: center; font-size: .85rem; font-weight: 600; }
.decl-categories { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .5rem; }
.decl-categories legend { padding: 0; margin-bottom: .5rem; font-weight: 600; }
.decl-categories label { position: relative; display: block; margin: 0; font-weight: 400; cursor: pointer; }
.decl-categories input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.decl-categories span { display: flex; align-items: center; min-height: 2.9rem; padding: .5rem .85rem; border: 1px solid var(--bord); border-radius: 6px; background: var(--blanc); line-height: 1.25; }
.decl-categories input:checked + span { border-color: var(--petrole); background: var(--givre); box-shadow: inset 0 0 0 1px var(--petrole); font-weight: 600; }
.decl-categories input:focus-visible + span { outline: 2px solid var(--petrole); outline-offset: 2px; }
.decl-envoi { margin: 1.2rem 0 2rem; }
.decl-envoi .btn { font-size: 1.05rem; padding: .8rem 1.5rem; }
.decl-envoi p { margin-top: .7rem; }
.decl-recap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1.2rem; margin: 1rem 0; padding: .9rem 1rem; background: var(--givre); border-radius: 6px; }
.decl-recap div { display: contents; }
.decl-recap dt { color: var(--encre-2); }
.decl-recap dd { margin: 0; }
.declarations .tag { margin-right: .2rem; }
#declaration .lien-champ + .lien-champ { margin-top: 1rem; }
@media (max-width: 720px) {
  .decl-envoi .btn { width: 100%; }
  .decl-categories { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) { .decl-categories { grid-template-columns: 1fr; } }

.repli-carte > summary { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; cursor: pointer; list-style: none; }
.repli-carte > summary::-webkit-details-marker { display: none; }
.repli-carte > summary::before { content: "+"; font-weight: 600; color: var(--petrole); width: 1ch; }
.repli-carte[open] > summary::before { content: "–"; }
.repli-carte > summary h2 { margin: 0; }
.repli-carte[open] > summary { margin-bottom: .9rem; }
