/* =============================================================================
   Gestion Locative – feuille de style unique, sans dépendance externe.
   Conception « mobile d'abord » :
     - smartphone : barre supérieure + menu latéral escamotable ;
     - à partir de 1024 px : menu latéral fixe.
   Thème clair / sombre automatique selon le réglage de l'appareil.
   ============================================================================= */

:root {
  --fond: #f4f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --texte: #172033; --discret: #5b6476;
  --bordure: #e2e6ee; --accent: #3b5bdb; --accent-doux: #e8edff; --accent-texte: #ffffff;
  --ok: #1d7a45; --ok-doux: #e3f5ea; --alerte: #a65d00; --alerte-doux: #fff3e0; --erreur: #b3261e; --erreur-doux: #fdecea;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --rayon: 12px; --largeur-menu: 260px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f131a; --surface: #171c25; --surface-2: #1c2230; --texte: #e7eaf0; --discret: #9aa4b5;
    --bordure: #2a3242; --accent: #7c95ff; --accent-doux: #1f2945; --accent-texte: #0b1020;
    --ok: #5cc98a; --ok-doux: #15301f; --alerte: #f0ad4e; --alerte-doux: #33260f; --erreur: #ff8a80; --erreur-doux: #3a1714;
    --ombre: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
code { font-size: .88em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
pre { white-space: pre-wrap; background: var(--surface-2); padding: .8rem; border-radius: 8px; border: 1px solid var(--bordure); font-size: .88rem; margin: 0; }
.icone { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- Structure : menu latéral + contenu ------------------------------------ */
.cadre { min-height: 100vh; }
.menu-lateral {
  position: fixed; inset: 0 auto 0 0; width: var(--largeur-menu); background: var(--surface); border-right: 1px solid var(--bordure);
  display: flex; flex-direction: column; z-index: 30; transform: translateX(-100%); transition: transform .2s ease;
}
.menu-ouvert .menu-lateral { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
.voile { display: none; position: fixed; inset: 0; background: rgba(15, 19, 26, .45); z-index: 25; }
.menu-ouvert .voile { display: block; }
.marque { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; font-weight: 700; font-size: 1.05rem; color: var(--texte); }
.marque .logo, .dialogue-entete .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-texte); display: grid; place-items: center; }
.marque .logo .icone, .dialogue-entete .logo .icone { width: 18px; height: 18px; }
.marque .logo.image, .dialogue-entete .logo.image { background: transparent; overflow: hidden; }
.marque .logo img, .dialogue-entete .logo img { width: 100%; height: 100%; object-fit: contain; }
.navigation { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.rubrique { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); padding: 1rem .6rem .35rem; }
.lien-menu { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 8px; color: var(--texte); font-weight: 500; }
.lien-menu:hover { background: var(--surface-2); text-decoration: none; }
.lien-menu.actif { background: var(--accent-doux); color: var(--accent); }
.pied-menu { border-top: 1px solid var(--bordure); padding: .75rem; display: flex; flex-direction: column; gap: .15rem; }
.pied-menu .version { color: var(--discret); font-size: .78rem; padding: .3rem .6rem; }

.barre-haute { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .6rem 16px;
  background: var(--surface); border-bottom: 1px solid var(--bordure); }
.barre-haute .titre-app { font-weight: 700; }
.contenu { padding: 20px 16px 48px; max-width: 1240px; margin: 0 auto; }

@media (min-width: 1024px) {
  .menu-lateral { transform: none; }
  .voile, .barre-haute { display: none !important; }
  .principal { margin-left: var(--largeur-menu); }
  .contenu { padding: 28px 32px 64px; }
}

/* --- En-tête de page ---------------------------------------------------------- */
.entete-page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.entete-page .sous-titre { color: var(--discret); margin-top: .2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* --- Cartes ------------------------------------------------------------------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); margin-bottom: 16px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 16px; }
.indicateur { display: flex; flex-direction: column; gap: .35rem; color: var(--texte); }
.indicateur:hover { text-decoration: none; border-color: var(--accent); }
.indicateur .valeur { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.indicateur .libelle { color: var(--discret); }
.indicateur.alerte .valeur { color: var(--alerte); }
.titre-groupe { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin: .5rem 0 .75rem; color: var(--discret); }
.discret { color: var(--discret); font-size: .88rem; }
.etiquette-nextcloud.introuvable { color: var(--erreur); background: var(--erreur-doux); text-decoration: none; }   /* 1.15.0 */
.etiquette-nextcloud.supprime { color: var(--discret); background: transparent; border: 1px solid currentColor; text-decoration: none; }   /* 2.34.0 : perte acceptée */
/* Version 1.16.0 : fenêtre de confirmation avec le logo (gabarits/base.html, app.js). */
.dialogue-confirmation { border: 0; border-radius: 12px; padding: 1.25rem; max-width: min(28rem, calc(100vw - 32px));
  background: var(--surface); color: var(--texte); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.dialogue-confirmation::backdrop { background: rgba(0, 0, 0, .4); }
.dialogue-entete { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: .75rem; }
.dialogue-confirmation p { margin: 0 0 1rem; white-space: pre-line; }
.dialogue-confirmation .actions { justify-content: flex-end; }
.texte-alerte { color: var(--alerte); font-weight: 600; }   /* écart positif (1.16.0) */
.texte-erreur { color: var(--erreur); font-weight: 600; }
.vide { text-align: center; color: var(--discret); padding: 2rem 1rem; }

/* --- Onglets ------------------------------------------------------------------ */
.onglets { position: relative; display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--bordure); margin-bottom: 1.25rem; scrollbar-width: thin; }
.onglets a { padding: .6rem .9rem; color: var(--discret); white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 500; }
.onglets a:hover { color: var(--texte); text-decoration: none; }
.onglets a.actif { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Tableaux : défilement horizontal sur petit écran ------------------------- */
.tableau { overflow-x: auto; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--bordure); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--discret); font-weight: 600; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
/* Texte secondaire d'une cellule, sous le texte principal. Version 2.21.0 (décision du propriétaire) : ne s'applique
   plus aux boutons « secondaires », qui gardent leur taille (avant : étirés sur toute la largeur de la cellule). */
td span.secondaire, td div.secondaire, td small.secondaire { display: block; color: var(--discret); font-size: .84rem; }
td .bouton.secondaire, td button.secondaire { font-size: .84rem; }
/* Montants : jamais coupés sur deux lignes, alignés à droite dans un tableau (version 2.21.0). */
.montant { white-space: nowrap; }
td.montant, th.montant { text-align: right; }

/* --- Formulaires ---------------------------------------------------------------- */
fieldset { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 16px 18px 4px; margin: 0 0 16px; background: var(--surface); box-shadow: var(--ombre); }
legend { font-weight: 650; padding: 0 .4rem; }
.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: 550; margin-bottom: .3rem; font-size: .92rem; }
.champ .aide { color: var(--discret); font-size: .82rem; margin-top: .25rem; }
.champ .erreurs, .erreurs { color: var(--erreur); font-size: .88rem; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=password], input[type=file], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 8px;
}
/* Version 2.21.0 (décision du propriétaire, CLAUDE.md § 4) : champs à la taille de leur contenu. Date, nombre, montant
   et code postal n'occupent plus toute la largeur ; seuls les textes (intitulé, commentaire, adresse) la prennent. */
input[type=date] { width: auto; max-width: 100%; }
input[type=number], input[inputmode=decimal], input[inputmode=numeric] { width: 9rem; max-width: 100%; }
input[name$=code_postal] { width: 7rem; max-width: 100%; }
input[type=date], input[type=number], input[inputmode=decimal], input[inputmode=numeric], input[name$=code_postal] { justify-self: start; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); vertical-align: middle; }
.champ-case label { display: flex; align-items: center; gap: .5rem; }
@media (min-width: 900px) { .grille-champs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; } .champ.large { grid-column: 1 / -1; } }
.tableau-formulaire td { padding: .4rem; }
.tableau-formulaire input, .tableau-formulaire textarea { min-width: 110px; }
.barre-enregistrer { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--fond) 30%); padding: 1rem 0 .25rem; display: flex; gap: .5rem; }

/* --- Boutons ---------------------------------------------------------------- */
.bouton, button { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; font: inherit; font-weight: 550; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-texte); cursor: pointer; text-decoration: none; line-height: 1.2; }
.bouton:hover, button:hover { filter: brightness(1.07); text-decoration: none; }
.bouton.secondaire, button.secondaire { background: var(--surface); color: var(--accent); border-color: var(--bordure); }
.bouton.discret, button.discret { background: transparent; border-color: transparent; color: var(--discret); }
button.lien { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
.bouton-menu { background: transparent; border: 1px solid var(--bordure); color: var(--texte); padding: .45rem .6rem; }
form.en-ligne { display: inline; }
.filtres { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filtres a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--bordure); background: var(--surface); color: var(--discret); font-size: .9rem; }
.filtres a.actif { background: var(--accent-doux); color: var(--accent); border-color: transparent; }

/* --- Messages et états -------------------------------------------------------- */
.message { padding: .8rem 1rem; border-radius: 10px; margin-bottom: .75rem; border: 1px solid var(--bordure); background: var(--surface); white-space: pre-line; }
.message.success { background: var(--ok-doux); border-color: transparent; }
.message.warning { background: var(--alerte-doux); border-color: transparent; }
.message.error { background: var(--erreur-doux); border-color: transparent; }
/* Version 2.28.0 (décision du propriétaire Q83) : toutes les pastilles à la taille de « PDF » et « Nextcloud »
   (texte .7rem, hauteur de ligne 1,2, marge .1rem .5rem), partout, sans exception. */
.etat { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem;
  font-weight: 600; line-height: 1.2; white-space: nowrap; vertical-align: middle; }
.etat.ok { color: var(--ok); background: var(--ok-doux); }
.etat.alerte { color: var(--alerte); background: var(--alerte-doux); }
.etat.erreur { color: var(--erreur); background: var(--erreur-doux); }
.etat.neutre { color: var(--discret); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--bordure); }   /* 2.33.0 : lisible sur une ligne survolée */
ul.problemes { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--alerte); font-size: .9rem; }
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion .carte { width: 100%; max-width: 400px; padding: 28px; }

/* --- Tableaux « empilables » : sur smartphone, chaque ligne devient une carte -----
   Chaque cellule porte data-libelle="Titre de colonne", affiché devant la valeur. */
td code { white-space: nowrap; }
@media (max-width: 720px) {
  table.empilable thead { display: none; }
  table.empilable, table.empilable tbody, table.empilable tr, table.empilable td { display: block; width: 100%; }
  table.empilable tr { padding: .6rem .9rem; border-bottom: 1px solid var(--bordure); }
  table.empilable td { border: 0; padding: .2rem 0; position: relative; }
  /* Correctif 2.24.2 : le libellé flotte dans la marge gauche (et non plus en position absolue) ; la cellule
     (flow-root) prend la hauteur du libellé s'il passe sur deux lignes (ex. « Dernière utilisation ») : plus rien
     ne le recouvre. */
  table.empilable td[data-libelle] { padding-left: 7.5rem; min-height: 1.6rem; display: flow-root; }
  table.empilable td[data-libelle]::before { content: attr(data-libelle); float: left; width: 7rem; margin-left: -7.5rem;
    padding-top: .1rem; color: var(--discret); font-size: .8rem; line-height: 1.3; text-align: left; }
  table.empilable td.case-selection { text-align: right; }
  /* Version 2.33.0 (Q216) : un montant s'aligne à gauche comme les autres valeurs de la carte. */
  table.empilable td.montant { text-align: left; }
  /* Version 2.33.0 (Q217) : pastilles du statut sur deux lignes si besoin (sur PC, elles restent sur une ligne). */
  .pastilles-une-ligne { flex-wrap: wrap; white-space: normal; }
  .barre-enregistrer { flex-wrap: wrap; }
}

/* --- États des lieux : saisie sur téléphone (grandes zones tactiles) --- */
.edl-liste { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.edl-ligne { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; min-height: 48px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); color: var(--texte); text-decoration: none; }
.edl-ligne.element { border-radius: 8px; margin: .35rem .5rem 0; }
.edl-ligne.valide { background: var(--ok-doux); border-color: var(--ok); }
.edl-piece { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding-bottom: .5rem; }
.edl-piece.complete { border-color: var(--ok); }
.edl-piece > summary { display: flex; justify-content: space-between; gap: .75rem; padding: 1rem; cursor: pointer; font-weight: 600; min-height: 48px; }
.edl-piece.complete > summary { color: var(--ok); }
.edl-piece > .edl-ligne:first-of-type { margin: 0 .5rem; border-style: dashed; }
.pastille { font-size: .8rem; color: var(--discret); text-align: right; }
.pastille.ok { color: var(--ok); }
.carte.complete { border: 1px solid var(--ok); }
.carte.reference { background: var(--surface-2); }
.choix-etat { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; border: 0; padding: 0; }
.choix-etat legend { font-weight: 600; margin-bottom: .4rem; }
.choix-etat label { display: flex; align-items: center; gap: .4rem; padding: .8rem; min-height: 48px; border: 1px solid var(--bordure);
  border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.choix-etat label:has(input:checked), .choix-etat label.choisi { border-color: var(--accent); background: var(--accent-doux); font-weight: 600; }
.champ.quantite input { max-width: 8rem; font-size: 1.3rem; }
.champ.quantite .attendu { margin-left: .75rem; }
.photos { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vignette { position: relative; margin: 0; width: 96px; height: 96px; }
.vignette img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bordure); }
.vignette .supprimer { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; padding: 0; border-radius: 50%; justify-content: center; }
.bouton-photo { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border: 2px dashed var(--accent);
  border-radius: 8px; color: var(--accent); font-weight: 600; cursor: pointer; }
.bouton-photo input { display: none; }
.etat-envoi { font-size: .85rem; color: var(--discret); }
.zone-signature { width: 100%; height: 180px; border: 1px dashed var(--bordure); border-radius: 8px; background: #fff; touch-action: none; }
.zone-signature.paraphe { height: 120px; max-width: 260px; }

button.danger { background: var(--erreur); border-color: var(--erreur); color: #fff; }

/* États des lieux (1.3.0) : rubriques de pièce, lignes d'items avec choix de l'état, navigation */
.edl-rubrique { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; min-height: 56px; background: var(--surface);
  border: 1px solid var(--bordure); border-radius: var(--rayon); color: var(--texte); text-decoration: none; }
.edl-rubrique .nom { font-weight: 650; }
.edl-rubrique.complete { background: var(--ok-doux); border-color: var(--ok); }
.manque, .item-photo.manque { color: var(--erreur); font-weight: 600; }
.carte.manque { border: 1px solid var(--erreur); }
.items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .8rem;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; }
.item.valide { background: var(--ok-doux); border-color: var(--ok); }
.item-nom { display: flex; flex-direction: column; gap: .15rem; color: var(--texte); text-decoration: none; font-weight: 600; flex: 1 1 12rem; }
.item-photo { font-size: .8rem; font-weight: 400; color: var(--discret); }
.item-photo.ok { color: var(--ok); }
.item-saisie { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.item-saisie select { min-height: 44px; min-width: 9.5rem; }
.item-quantite input { width: 4.5rem; min-height: 44px; font-size: 1.05rem; }
/* Version 1.12.0 : bouton photo sur la ligne d'un item ; comparaison au nombre de l'entrée (sortie). */
.item-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.photo-ligne { display: inline-flex; align-items: center; gap: .3rem; }
.photo-ligne .bouton-photo { width: 48px; height: 44px; border-width: 1px; font-size: 1.1rem; }
/* Version 2.7.0 : bouton commentaire à côté du bouton photo ; commentaire affiché sous la ligne (deux lignes au
   plus, le toucher ouvre la zone) ; zone de commentaire dépliée sous la ligne. */
.bouton-commentaire { width: 48px; min-height: 44px; padding: 0; justify-content: center; font-size: 1.1rem; background: transparent;
  border: 1px dashed var(--bordure); color: var(--texte); filter: grayscale(1); opacity: .6; }
.bouton-commentaire.rempli { border: 1px solid var(--accent); filter: none; opacity: 1; }
.bouton-commentaire[aria-expanded="true"] { background: var(--accent-doux); }
.item-commentaire { flex: 1 1 100%; margin: 0; padding: 0; min-height: 0; border: 0; background: none; color: var(--discret);
  font-size: .9rem; font-weight: 400; text-align: left; white-space: pre-line; justify-content: flex-start;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; cursor: pointer; }
.item-commentaire[hidden] { display: none; }
.commentaire-ligne { flex: 1 1 100%; display: grid; gap: .4rem; }
.commentaire-ligne[hidden] { display: none; }
.commentaire-ligne p { margin: 0; white-space: pre-line; }
.commentaire-ligne textarea { width: 100%; box-sizing: border-box; font-size: 1rem; }
.commentaire-pied { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; }
/* Téléphone : les boutons photo et commentaire se placent à droite du nom de l'item, sans ajouter de ligne. */
@media (max-width: 720px) {
  .item { position: relative; }
  .item-nom { padding-right: 7rem; min-height: 2.5rem; }   /* boutons d'état sous les boutons photo et commentaire */
  .photo-ligne { position: absolute; top: .5rem; right: .6rem; }
  .bouton-commentaire { position: absolute; top: .5rem; right: 3.9rem; }
}
.comparaison { font-weight: 700; margin-left: .25rem; }
.comparaison.egal { color: var(--ok); }
.comparaison.different, .comparaison.plus { color: var(--alerte); }
.comparaison.moins { color: var(--erreur); }   /* 1.16.0 : écart chiffré, négatif en rouge */
.navigation-edl { display: flex; justify-content: space-between; gap: 1rem; margin: .5rem 0 1rem; }
.navigation-edl a { padding: .6rem .2rem; font-weight: 600; }
dl.informations { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .35rem 1rem; margin: .75rem 0; }
dl.informations dt { color: var(--discret); }
dl.informations dd { margin: 0; }
.bouton.danger, button.danger { background: var(--erreur); border-color: var(--erreur); color: #fff; }
/* Boutons d'une ligne de tableau (1.7.0) : compacts ; suppression en contour rouge, discrète. */
.bouton.petit, button.petit { padding: .2rem .55rem; font-size: .8rem; font-weight: 500; border-radius: 6px; }
.bouton.danger.contour, button.danger.contour { background: transparent; color: var(--erreur); }
@media (max-width: 640px) { dl.informations { grid-template-columns: 1fr; gap: 0; } dl.informations dd { margin-bottom: .5rem; } }

/* Boutons d'état (couleur réglée dans l'échelle d'état) et lignes cliquables (1.4.0) */
.etats-boutons { display: flex; flex-wrap: wrap; gap: .3rem; }
.etat-bouton { padding: .35rem .5rem; min-height: 40px; font-size: .78rem; font-weight: 600; border-radius: 8px;
  background: var(--surface); color: var(--texte); border: 2px solid var(--bordure); opacity: .75; }
.etat-bouton.choisi { opacity: 1; box-shadow: 0 0 0 2px var(--texte) inset; }
.couleur-vert { border-color: #1d7a45; } .etat-bouton.couleur-vert.choisi, .choix-etat label.couleur-vert.choisi { background: #1d7a45; color: #fff; }
.couleur-vert_pale { border-color: #7cc49a; } .etat-bouton.couleur-vert_pale.choisi, .choix-etat label.couleur-vert_pale.choisi { background: #b9e4c9; color: #10301c; }
.couleur-orange { border-color: #e08a00; } .etat-bouton.couleur-orange.choisi, .choix-etat label.couleur-orange.choisi { background: #f5a623; color: #2b1a00; }
.couleur-rouge { border-color: #c62828; } .etat-bouton.couleur-rouge.choisi, .choix-etat label.couleur-rouge.choisi { background: #c62828; color: #fff; }
.couleur-gris { border-color: #9aa4b5; } .etat-bouton.couleur-gris.choisi, .choix-etat label.couleur-gris.choisi { background: #9aa4b5; color: #111; }
.choix-etat label { border-width: 2px; }
tr[data-lien] { cursor: pointer; }
tr[data-lien]:hover td { background: var(--surface-2); }

/* Fiche du bail (1.11.0) : tuile « Paiements » et bloc « Quittances » mois par mois. */
.tuile-paiements .libelle { display: flex; justify-content: space-between; gap: .5rem; }
.tuile-paiements > span { display: block; }
.tuile-paiements > span.etat { display: inline-block; align-self: flex-start; }   /* pastille « À jour » à sa taille */
table.derniers-paiements { width: 100%; margin-top: .4rem; font-size: .85rem; border-collapse: collapse; }
table.derniers-paiements { table-layout: auto; }
table.derniers-paiements td { padding: .15rem .3rem .15rem 0; border: 0; }
table.derniers-paiements td.n { text-align: right; white-space: nowrap; padding-right: 0; }
tr.a-venir td { color: var(--discret); }
tr.impaye td:first-child { border-left: 3px solid var(--erreur); }
details.corriger-attendu summary { list-style: none; cursor: pointer; }
details.corriger-attendu summary::-webkit-details-marker { display: none; }
details.corriger-attendu form { display: grid; gap: .4rem; margin-top: .4rem; min-width: 14rem; }
/* Page Quittances, actions dépliables d'une ligne (version 1.12.0) : correction de l'attendu, « hors appli. ». */
details.action-ligne { display: inline-block; vertical-align: top; }
details.action-ligne summary { list-style: none; cursor: pointer; }
details.action-ligne summary::-webkit-details-marker { display: none; }
details.action-ligne[open] { display: grid; gap: .4rem; margin: .4rem 0; min-width: 14rem; }

/* Liste déroulante compacte à choix multiples (filtre Locataires des quittances, version 1.12.0) :
   petits boutons à cocher, panneau superposé à la page. */
details.liste-deroulante { position: relative; flex-basis: 100%; margin: .5rem 0; }   /* ligne à part : panneau jamais hors écran */
details.liste-deroulante > summary { display: inline-block; list-style: none; cursor: pointer; border: 1px solid var(--bordure, #ccc); border-radius: 8px;
  padding: .45rem 2rem .45rem .75rem; background: var(--surface, #fff); position: relative; }
details.liste-deroulante > summary::-webkit-details-marker { display: none; }
details.liste-deroulante > summary::after { content: "▾"; position: absolute; right: .7rem; }
details.liste-deroulante > .panneau { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: min(36rem, 100%); box-sizing: border-box;
  max-height: 60vh; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--bordure, #ccc); border-radius: 8px;
  padding: .6rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.puces { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.puce { display: inline-flex; align-items: center; font-size: .85rem; padding: .2rem .55rem; border: 1px solid var(--bordure, #ccc);
  border-radius: 999px; cursor: pointer; }
.puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.puce:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.puce:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Aperçu des e-mails de quittance avant envoi (version 1.12.0). */
.apercu-email { scroll-margin-top: 4.5rem; }   /* ancre #q-… visible sous l'en-tête fixe du téléphone */
.apercu-email h2 { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
dl.entetes-email { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .5rem 0; }
dl.entetes-email dt { color: var(--discret); }
dl.entetes-email dd { margin: 0; overflow-wrap: anywhere; }
.corps-email { border: 1px solid var(--bordure); border-radius: 8px; padding: .75rem; background: var(--surface-2); margin: .5rem 0; overflow-wrap: anywhere; }
.formulaire-email { display: grid; gap: .5rem; }
.formulaire-email label { display: grid; gap: .2rem; }
.formulaire-email input, .formulaire-email textarea { width: 100%; box-sizing: border-box; }
details.envoi-email > summary { cursor: pointer; }
/* Fiche du locataire : état du dossier Nextcloud (version 1.13.0). */
.etat-dossier code { overflow-wrap: anywhere; }
.dossier-ok { color: var(--ok); font-weight: 700; }
.dossier-absent { color: var(--erreur); font-weight: 700; }
.dossier-incomplet { color: var(--alerte); margin: .3rem 0; }
/* Étiquette « Nextcloud » : fichier rangé dans Nextcloud, lu par l'application (version 1.13.0). */
.etiquette-nextcloud { display: inline-block; font-size: .7rem; font-weight: 600; line-height: 1.2; padding: .1rem .5rem;
  margin-left: .3rem; border-radius: 999px; background: var(--ok-doux); color: var(--ok); vertical-align: middle; }   /* vert (1.14.1) */
/* Un fieldset ne se rétrécit pas sous la largeur de son contenu (min-inline-size: min-content par défaut) : sur
   téléphone, un tableau éditable large élargissait toute la page. Le tableau défile dans son cadre (version 1.13.0). */
fieldset { min-width: 0; }
/* Correctif 1.13.1 : quittance validée pas encore dans Nextcloud. */
.pas-sur-nextcloud { display: inline-block; font-size: .7rem; font-weight: 600; line-height: 1.2; padding: .05rem .4rem;
  margin-left: .3rem; border-radius: 999px; background: var(--alerte-doux); color: var(--alerte); vertical-align: middle; }
.pas-sur-nextcloud-detail { color: var(--alerte); }
/* Bouton « + Ajouter un document » (correctif 1.13.1) : champ fichier caché mais atteignable au clavier. */
.ajout-fichier { position: relative; cursor: pointer; }
.ajout-fichier input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ajout-fichier:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* État de la dernière synchronisation (version 1.14.0). */
.synchro { font-weight: 600; margin: .3rem 0; }
.synchro-ok { color: var(--ok); }
.synchro-partielle { color: var(--alerte); }
.synchro-impossible { color: var(--erreur); }
/* Version 2.33.0 (Q207, Q208) : compte rendu de synchronisation par niveau puis par module, volets repliables. */
.compte-rendu-synchro { margin-top: .4rem; font-size: .9rem; }
.compte-rendu-synchro .resume-synchro { margin: 0 0 .3rem; color: var(--discret); }
.compte-rendu-synchro details { margin: .15rem 0; }
.compte-rendu-synchro summary { cursor: pointer; }
.compte-rendu-synchro .module-synchro { margin-left: 1.1rem; }
.compte-rendu-synchro .module-synchro > summary { color: var(--texte); font-weight: 600; font-size: .85rem; }
.compte-rendu-synchro ul { margin: .15rem 0 .3rem 1.1rem; padding-left: 1rem; }
.compte-rendu-synchro li { overflow-wrap: anywhere; }
/* Correctif 1.14.1 : lien « PDF » (et « Word ») en pastille, même gabarit que l'étiquette « Nextcloud », en bleu. */
a.pastille-pdf { display: inline-block; font-size: .7rem; font-weight: 600; line-height: 1.2; padding: .1rem .5rem;
  border-radius: 999px; background: var(--accent-doux); color: var(--accent); text-decoration: none; vertical-align: middle; }
a.pastille-pdf:hover { background: var(--accent); color: var(--accent-texte); }
/* Version 1.15.0 : colonne « Statut » : pastille et date sur la même ligne ; pastilles PDF / Nextcloud en dessous. */
.statut-ligne { display: block; white-space: nowrap; margin-bottom: .2rem; }
.statut-ligne .discret { font-size: .8rem; }

/* Version 1.17.0 — page Quittances : pastilles de statut sur une même ligne, menu « … » des actions secondaires et
   pastilles « ! » / « i ». Les cadres (classe « flottant ») sont placés par app.js au-dessus de la page ; sans
   JavaScript, ils s'ouvrent simplement sous leur bouton. */
.pastilles { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; }
.pastilles .discret { font-size: .8rem; white-space: nowrap; }
.actions-ligne { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
details[data-flottant] { display: inline-block; vertical-align: middle; }
details[data-flottant] > summary { list-style: none; cursor: pointer; }
details[data-flottant] > summary::-webkit-details-marker { display: none; }
.flottant { background: var(--surface); color: var(--texte); border: 1px solid var(--bordure); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: .4rem; z-index: 50; max-width: min(22rem, calc(100vw - 16px));
  max-height: calc(100vh - 16px); overflow: auto; box-sizing: border-box; }
.flottant.place { position: fixed; }
/* Correctif 1.17.2 : avec JavaScript (classe « js » posée par app.js), le cadre n'entre JAMAIS dans la page : il
   reste invisible, hors du flux, jusqu'à ce qu'app.js l'ait placé. Avant, il s'affichait un instant dans la cellule,
   agrandissait la ligne et faisait « sauter » la page, ce qui le refermait aussitôt (il fallait cliquer plusieurs fois). */
.js details[data-flottant] > .flottant { position: fixed; top: 0; left: 0; visibility: hidden; }
.js details[data-flottant] > .flottant.place { visibility: visible; }
.actions-ligne { flex-wrap: nowrap; }
/* Version 1.18.0 : titres de colonnes cliquables (tri) de la page Quittances. */
.apercu-logo { max-height: 64px; max-width: 160px; }   /* Paramètres > Général, logo (1.18.0) */
th a.tri { color: inherit; text-decoration: none; white-space: nowrap; }
th a.tri:hover, th a.tri.actif { color: var(--accent); }
tr[id^="ligne-"] { scroll-margin-top: 6rem; }
details.menu-actions > summary { min-width: 2rem; text-align: center; font-weight: 700; letter-spacing: .05em; }
.menu-liste { display: flex; flex-direction: column; min-width: 14rem; gap: .1rem; }
.menu-liste hr { border: 0; border-top: 1px solid var(--bordure); margin: .3rem 0; width: 100%; }
.menu-item, button.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--texte);
  padding: .45rem .6rem; border-radius: 6px; font: inherit; font-size: .88rem; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item.danger-texte { color: var(--erreur); }
details.sous-menu > summary { list-style: none; }
details.sous-menu > summary::-webkit-details-marker { display: none; }
details.sous-menu[open] { display: grid; gap: .4rem; padding: 0 .6rem .5rem; }
details.sous-menu[open] > summary { margin: 0 -.6rem; font-weight: 600; }
details.signal > summary { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 999px;
  font-size: .78rem; font-weight: 800; font-family: Georgia, serif; line-height: 1; }
details.signal-erreur > summary { color: var(--erreur); background: var(--erreur-doux); border: 1px solid var(--erreur); }
details.signal-info > summary { color: var(--alerte); background: var(--alerte-doux); border: 1px solid var(--alerte); font-style: italic; }
.signal-cadre { padding: .6rem .75rem; font-size: .85rem; min-width: 14rem; }
.signal-cadre ul { margin: .35rem 0 0; padding-left: 1.1rem; }
details.signal-erreur .signal-cadre strong { color: var(--erreur); }
details.signal-info .signal-cadre strong { color: var(--alerte); }
/* Version 2.0.0 — lignes déplaçables (poignée ⋮⋮, app.js). Sans JavaScript, la poignée est masquée. */
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.colonne-poignee { width: 2.2rem; }
.poignee { cursor: grab; touch-action: none; user-select: none; background: none; border: 1px solid transparent; color: var(--discret);
  font-size: 1.1rem; line-height: 1; padding: .35rem .45rem; min-width: 2rem; min-height: 2rem; letter-spacing: -.15em; }
.poignee:hover, .poignee:focus-visible { border-color: var(--accent); color: var(--accent); }
html:not(.js) .poignee { display: none; }
tr.en-deplacement { opacity: .65; outline: 2px dashed var(--accent); }
tr.en-deplacement .poignee { cursor: grabbing; }
/* Récapitulatifs de l'inventaire : élément propre à une chambre. */
.etiquette-chambre { display: inline-block; font-size: .7rem; font-weight: 600; line-height: 1.2; padding: .05rem .4rem;
  margin-left: .3rem; border-radius: 999px; background: var(--accent-doux); color: var(--accent); vertical-align: middle; }
/* Récapitulatif d'une caution (version 2.1.0). */
dl.resume { display: grid; grid-template-columns: minmax(10rem, max-content) 1fr; gap: .35rem 1rem; margin: .8rem 0 0; }
dl.resume dt { color: var(--discret); }
dl.resume dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { dl.resume { grid-template-columns: 1fr; } dl.resume dd { margin-bottom: .4rem; } }
/* Paramètres > Envois d'e-mails (version 2.3.0). */
.choix-envois { padding: .8rem 1rem; }
.pilules { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pilule { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--bordure); border-radius: 999px;
  background: var(--surface); color: var(--texte); font-weight: 500; }
.pilule:hover { text-decoration: none; border-color: var(--accent); }
.pilule.actif { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.pilule .nb { font-size: .7rem; background: var(--ok-doux); color: var(--ok); border-radius: 999px; padding: 0 .4rem; }
.bandeau { margin-top: .7rem; padding: .55rem .8rem; border-left: 3px solid var(--accent); background: var(--accent-doux); border-radius: 6px; font-size: .88rem; }
.envois { display: grid; gap: 1rem; margin-top: 1rem; }
.envoi h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .2rem; font-size: 1.05rem; }
.envoi .pour { color: var(--discret); font-size: .85rem; margin: 0 0 .8rem; }
.envoi .bascule { display: flex; align-items: center; gap: .4rem; font-size: .85rem; margin-left: auto; font-weight: 500; }
.flux { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .8rem; }
.flux .bout { border: 1px solid var(--bordure); border-radius: 10px; padding: .6rem .7rem; background: var(--surface-2); min-width: 0; }
.flux .bout small { display: block; color: var(--discret); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; }
.flux .fleche { color: var(--accent); font-size: 1.4rem; }
.flux select, .flux input, .copies input { width: 100%; }
.puce { display: inline-block; background: var(--accent-doux); color: var(--accent); border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; margin: .1rem .2rem .1rem 0; }
.puce.fiche { background: var(--surface); border: 1px dashed var(--bordure); color: var(--texte); }
.copies { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .7rem; }
.copies label { font-size: .8rem; color: var(--discret); }
.envoi.herite .flux, .envoi.herite .copies { opacity: .55; }
.verrou { display: flex; align-items: center; gap: .3rem; margin: .6rem 0 0; font-size: .8rem; color: var(--discret); }
@media (max-width: 700px) {
  .flux { grid-template-columns: 1fr; } .flux .fleche { transform: rotate(90deg); justify-self: center; }
  .copies { grid-template-columns: 1fr; } .envoi .bascule { margin-left: 0; }
}
/* Pastille grise « i » (version 2.3.0) : information sans erreur (ex. paiement modifié par l'import). */
details.signal-note > summary { color: var(--discret); background: var(--surface-2); border: 1px solid var(--bordure); font-style: italic; }
.choix-adresse { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.choix-adresse span { white-space: nowrap; }
/* Version 2.8.0 : choix d'un PDF de caution ; celui déjà relié à l'autre bloc est grisé, non sélectionnable. */
.champ-case.indisponible label { color: var(--discret); cursor: not-allowed; }
/* Version 2.5.0 : page de signature en haut de l'écran, centrée ; fenêtre d'attente (formulaire data-attente). */
.connexion.page-signature { place-items: start center; padding-top: 2rem; }
.connexion.page-signature .carte { max-width: 640px; }
/* Version 2.6.0 : code de signature affiché une seule fois, avec un bouton « Copier ». */
.code-signature { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.code-signature output { font: 700 2rem/1.2 ui-monospace, monospace; letter-spacing: .3rem; padding: .25rem .75rem; border: 1px solid var(--bordure); border-radius: 6px; user-select: all; }
.attente { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(0, 0, 0, .45); }
.attente-cadre { max-width: 340px; margin: 16px; padding: 24px; border-radius: var(--rayon); background: var(--surface); color: var(--texte);
  text-align: center; box-shadow: var(--ombre); }
.attente-sablier { display: inline-block; font-size: 2rem; animation: sablier 1.6s ease-in-out infinite; }
@keyframes sablier { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
/* Version 2.11.0 : petits boutons d'une ligne (annexes et états des lieux de la fiche du bail), pour ne pas
   surcharger le tableau ; ils passent à la ligne si la cellule est étroite. */
.bouton.mini, button.mini { padding: .1rem .4rem; font-size: .72rem; font-weight: 500; border-radius: 5px; line-height: 1.3; }
.actions-mini { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.actions-mini form { display: inline; margin: 0; }
/* Version 2.11.0 : galerie des photos d'un état des lieux ; photo agrandie par la cible d'ancre (#photo-…), sans
   JavaScript : le cadre plein écran s'affiche quand son ancre est visée, « ✕ » revient à la galerie. */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.galerie figure { margin: 0; }
.galerie figure img, .apercu-indisponible { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px;
  background: var(--surface-2); display: block; }
.apercu-indisponible { display: flex; align-items: center; justify-content: center; text-align: center; font-size: .8rem;
  color: var(--texte-discret, #666); padding: .5rem; box-sizing: border-box; }
.galerie figcaption { font-size: .8rem; margin-top: .25rem; overflow-wrap: anywhere; }
.agrandie { display: none; }
.agrandie:target { display: flex; flex-direction: column; align-items: center; justify-content: center; position: fixed;
  inset: 0; z-index: 100; background: rgba(0, 0, 0, .9); padding: 2.5rem 1rem 1rem; box-sizing: border-box; }
.agrandie img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; }
.agrandie .legende-agrandie { color: #fff; margin-top: .5rem; text-align: center; }
.agrandie .legende-agrandie a { color: #fff; }
.agrandie .fermer { position: absolute; top: .5rem; right: 1rem; color: #fff; font-size: 1.6rem; text-decoration: none; }
.etat-remplace { opacity: .6; }
/* Ligne d'un état des lieux de la fiche du bail (2.11.0) : titre, statut, pastilles et petits boutons sur une même
   ligne qui passe à la ligne élément par élément (et non bloc par bloc). */
.ligne-edl { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .4rem; margin: 0 0 .8rem; }
.ligne-edl .actions-mini, .ligne-edl form { display: contents; }

/* Version 2.14.0 : environnement de test, bandeau en haut de chaque page. */
.bandeau-test { background: #b42318; color: #fff; text-align: center;
  font-weight: 700; padding: .35rem .75rem; letter-spacing: .02em; }
.sablier { display: inline-block; }

/* Version 2.16.0 (décision du propriétaire) : mention « 📷 Photo* » d'un item dont la photo obligatoire n'est pas
   prise, en rouge vif et une taille au-dessus ; redevient normale une fois la photo prise (classe .ok). */
.item-photo.photo-a-prendre { color: #e60000; font-size: 1rem; font-weight: 700; }
@media (prefers-color-scheme: dark) { .item-photo.photo-a-prendre { color: #ff5c5c; } }
/* Version 2.16.0 : retour d'un item vers sa pièce (ancre #element-N) : l'item est centré à l'écran, et non plus
   placé tout en haut, sous l'en-tête fixe. */
.item { scroll-margin-top: calc(50vh - 2.5rem); }

/* Version 2.16.0 : tuile « Alertes » de l'accueil (rouge : expiré ; orange : à faire bientôt). */
.tuile-alertes ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.tuile-alertes li { margin: .2rem 0; }
.tuile-alertes li a { color: inherit; }

/* Version 2.17.0 : page « Obligations du bailleur » (logements dépliables, validation sur la ligne, annulation discrète). */
.volet-obligations { margin: .5rem 0; border-top: 1px solid var(--bordure); padding-top: .4rem; }
.volet-obligations > summary { cursor: pointer; padding: .3rem 0; }
/* Version 2.18.0 : lignes plus basses ; boutons sur la même ligne (largeur des champs et des boutons : règles générales
   de la version 2.21.0). */
.volet-obligations td { padding-top: .45rem; padding-bottom: .45rem; }
.actions-obligation { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.valider-obligation { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; margin: 0; }
.valider-obligation input[type="date"] { padding: .25rem .4rem; min-height: 0; font-size: .85rem; }
.actions-obligation .secondaire, .commentaire-obligation .secondaire { font-size: .72rem; }
.zone-obligation > summary, .commentaire-obligation > summary { list-style: none; cursor: pointer; }
.zone-obligation > summary::-webkit-details-marker, .commentaire-obligation > summary::-webkit-details-marker { display: none; }
.zone-obligation[open] { flex-basis: 100%; }
.zone-obligation form, .commentaire-obligation form { margin-top: .35rem; display: grid; gap: .35rem; }
.commentaire-obligation { margin-top: .25rem; }
.commentaire-obligation > summary { font-size: .82rem; color: var(--discret); }
.fichier-obligation { margin-top: .2rem; font-size: .82rem; }
button.lien-discret { background: none; border: 0; padding: 0; color: var(--discret); font-size: .8rem;
  text-decoration: underline; cursor: pointer; min-height: 0; }
.volet-obligations .etat { white-space: normal; }
.ajout-commentaire { display: inline-block; margin-left: .3rem; vertical-align: middle; }
.ajout-commentaire[open] { display: block; margin: .3rem 0 0; }
.ajout-commentaire .secondaire { font-size: .72rem; }
@media (min-width: 700px) {
  .actions-obligation { flex-wrap: nowrap; }
  .actions-obligation:has(details[open]) { flex-wrap: wrap; }
}
.actions-obligation button, .actions-obligation summary { white-space: nowrap; }

/* Version 2.19.0 : filtre par locataire de la liste des états des lieux. */
.filtre-locataire { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.filtre-locataire select { width: auto; min-width: 14rem; }
.historique-repliable > summary { cursor: pointer; }

/* Version 2.20.0 : item de sortie dont l'état diffère de l'entrée (orange, comme l'écart de quantité). */
.item-photo.etat-different { color: var(--alerte); font-weight: 600; }

/* Version 2.20.0 : explorateur Nextcloud commun (documents/_explorateur.html). */
.explorateur .fil-dossier { font-size: .9rem; }
.explorateur .liste-dossiers { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .25rem; }
.explorateur .depot-explorateur { margin-top: 1rem; border-top: 1px solid var(--bordure); padding-top: .75rem; }

/* Version 2.21.0 : page d'un solde de tout compte. Ligne d'édition dépliée sous la ligne du tableau (data-deplier,
   app.js), sur toute la largeur : texte à gauche, montant à droite ; colonne « Constat » du bilan plus large ;
   adresse du courrier en champs séparés. */
.cellule-bouton { width: 1%; white-space: nowrap; }
.ligne-edition > td { background: var(--surface-2); }
.ligne-edition form { display: grid; gap: .5rem; }
.ligne-edition label, .edition-montant label { display: grid; gap: .2rem; font-weight: 550; font-size: .88rem; }
.edition-colonnes { display: grid; gap: .75rem; }
.edition-texte { align-content: start; }
.edition-montant { display: grid; gap: .5rem; align-content: start; }
@media (min-width: 700px) { .edition-colonnes { grid-template-columns: minmax(0, 1fr) auto; } }
.zone-ligne > form { margin-top: .5rem; }
.col-constat { min-width: 14rem; }
.adresse-postale { margin: .25rem 0; line-height: 1.45; }
.grille-adresse { display: grid; gap: 0 1rem; margin-top: .6rem; }
.grille-adresse .champ { margin-bottom: .6rem; }
@media (min-width: 700px) { .grille-adresse { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
  .grille-adresse .champ.large, .grille-adresse .actions-mini { grid-column: 1 / -1; } }
.formulaire-en-ligne { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; }
.formulaire-en-ligne .champ { margin-bottom: 0; }
.sens-ligne { border: 0; box-shadow: none; background: none; padding: 0; margin: 0; }
.edition-montant .sens-ligne label { display: flex; align-items: center; gap: .4rem; font-weight: 400; }

/* Version 2.22.0 : archivage d'un locataire (bandeau des fiches, carte de la fiche du locataire). */
.bandeau-archive { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.bandeau-archive { white-space: normal; }
.bandeau-archive > span { flex: 1 1 20rem; }
.bandeau-archive form, .archivage-locataire form { margin: 0; }
.archivage-locataire { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.archivage-locataire p { margin: 0; }

/* Version 2.23.0 : lien vers un site extérieur (ouvert dans un nouvel onglet), toujours souligné. */
a.lien-externe { text-decoration: underline; }

/* Version 2.25.0 : bloc « Contrat de bail » de la fiche du bail sur une ligne (état, PDF, actions, menu « … ») ;
   les signataires dépliés et les alertes passent dessous. */
.ligne-contrat { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.ligne-contrat h2 { margin: 0 .3rem 0 0; font-size: 1.05rem; }
.ligne-contrat form { margin: 0; }
.signataires-bail > summary, .versions-bail > summary { cursor: pointer; }
.signataires-bail[open] { flex-basis: 100%; order: 99; }
.signataires-bail ol { margin: .3rem 0 0; }
.bloc-contrat .problemes, .bloc-contrat > p, .bloc-contrat > form, .versions-bail { margin-top: .5rem; margin-bottom: 0; }

/* Version 2.26.0 : fiche du bail. Barre fine qui reste en haut au défilement (nom, âge, état) ; sur petit écran, sous
   la barre du menu. Blocs compacts : changements de chambre, création d'un état des lieux, révisions. */
.titre-fixe { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem;
  background: var(--fond); padding: .45rem 0; margin: -.45rem 0 .2rem; }
.titre-fixe h1 { margin: 0; }
.titre-fixe .age { color: var(--discret); font-size: .95rem; font-weight: 400; }
/* Sous la barre du haut des petits écrans (hauteur mesurée : 54,6 px ≈ 3,41rem ; 3,4rem évite tout liseré). */
@media (max-width: 1023px) { .titre-fixe { top: 3.4rem; } }
.entete-sous-titre { margin-top: 0; }
/* Version 2.27.0 : référence collée au nom (le texte n'est plus centré sur la hauteur des boutons voisins). */
.titre-fixe { margin-bottom: 0; }
.entete-sous-titre { align-items: flex-start; }
.entete-sous-titre .sous-titre { margin-top: 0; }
.ligne-vide-bouton { display: inline-block; margin: 0 .75rem .4rem 0; vertical-align: middle; }
details.nouveau-changement { display: inline-block; margin-top: .75rem; vertical-align: middle; }
.ligne-vide-bouton + details.nouveau-changement { margin-top: 0; }
details.nouveau-changement[open] { display: block; }
form.creation-edl select { width: auto; max-width: 100%; }
.actions-revision { margin-top: .6rem; align-items: flex-end; }
.actions-revision form { margin: 0; }
.actions-revision form.actions { align-items: flex-end; }
button.croix-supprimer { background: none; border: 0; padding: 0 .3rem; min-height: 0; color: var(--erreur); font-size: 1.15rem;
  font-weight: 700; line-height: 1; cursor: pointer; vertical-align: middle; }
button.croix-supprimer:hover { filter: none; background: var(--erreur-doux); border-radius: 4px; }
/* Version 2.26.0 : liste des baux (9 colonnes) : les titres triables passent à la ligne entre les mots (la flèche reste
   collée au dernier mot) pour que le tableau tienne sur un écran de PC sans défilement horizontal. */
table.liste-baux th a.tri { white-space: normal; }
table.liste-baux th, table.liste-baux td { padding-left: .45rem; padding-right: .45rem; }
/* Version 2.27.0 : état des lieux, photos des clés et des compteurs côte à côte sur grand écran. */
.blocs-photos { display: grid; gap: 0 16px; }
@media (min-width: 900px) { .blocs-photos { grid-template-columns: 1fr 1fr; align-items: start; } }
/* Version 2.27.0 : liste des pièces d'un état des lieux, sur grand écran : nom et avancement sur une seule ligne. */
@media (min-width: 700px) {
  .edl-rubrique { flex-direction: row; align-items: center; justify-content: space-between; gap: .5rem 1rem;
    padding: .55rem 1rem; min-height: 0; }
}
/* Version 2.27.0 : nom de la pièce visible en haut au défilement (barre fine, sous la barre de menu sur smartphone). */
.titre-piece { position: sticky; top: 0; z-index: 15; background: var(--fond); padding: .35rem 0; margin: -.35rem 0 .6rem; }
.titre-piece h1 { margin: 0; font-size: 1.15rem; }
@media (max-width: 1023px) { .titre-piece { top: 3.4rem; } }
/* Version 2.27.0 : page de validation de l'import d'un inventaire (une case par changement). */
.liste-import { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.liste-import label { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.liste-import input[type=checkbox] { margin-top: .2rem; flex: none; }
.liste-import li.enfant { padding-left: 1.6rem; }
/* Version 2.28.0 : lignes d'un module sous ses tuiles de l'accueil (ex. états des lieux prévus). */
.complement-accueil { margin-top: .75rem; }
.complement-accueil h3 { margin: 0 0 .4rem; font-size: .95rem; }
.complement-accueil ul { margin: 0; padding-left: 1.1rem; }
/* Version 2.29.0 : champ mis à jour sur la page par la saisie d'un autre utilisateur (modifications simultanées). */
.mis-a-jour { outline: 2px solid var(--alerte); outline-offset: 1px; }
/* Version 2.30.0 (Q101) : accueil, une seule grille ; nom du module en petit dans chaque tuile. */
.grille-accueil { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.module-tuile { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--discret); font-weight: 600; }
.module-tuile .icone { width: 14px; height: 14px; }
/* Version 2.30.0 : un conteneur de pastilles (ex. « PDF » + « Nextcloud » sur la ligne du contrat) centre ses pastilles
   au lieu de les aligner sur le texte : l'alignement ne dépend plus des proportions de la police du poste. */
span:has(> .pastille-pdf), span:has(> .etiquette-nextcloud), span:has(> .etat) {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; vertical-align: middle; }
span:has(> .pastille-pdf) > .etiquette-nextcloud, span:has(> .etat) > .etiquette-nextcloud { margin-left: 0; }
/* Version 2.31.0 (décisions du propriétaire Q123 à Q127, règle « hauteur des lignes ») — tableaux de saisie compacts
   (table.tableau-compact, solde de tout compte) : cellules serrées, champs de la hauteur du texte (32 px sur PC, 40 px
   sur smartphone), intitulé de pièce sur une ligne au-dessus de ses items, icônes d'action avec bulle au survol.
   Sur smartphone, une ligne d'item tient sur deux lignes d'écran (pas une ligne par champ). */
.tableau-compact th, .tableau-compact td { padding: .3rem .6rem; vertical-align: middle; }
.tableau-compact input:not([type=checkbox]), .tableau-compact select, .tableau-compact textarea {
  padding: .2rem .45rem; min-height: 0; height: 2rem; line-height: 1.3; }
.tableau-compact textarea { height: auto; min-height: 2rem; resize: vertical; }
.tableau-compact select { width: auto; max-width: 100%; }
.tableau-compact .champ-montant { width: 6.5rem; }
.tableau-compact tr.groupe-piece th { background: var(--surface-2); color: var(--texte); font-size: .8rem; letter-spacing: .03em;
  padding: .3rem .6rem; text-transform: uppercase; }
.tableau-compact td.col-actions { white-space: nowrap; text-align: right; }
.tableau-compact .col-constat .discret { display: block; font-size: .82rem; }
.tableau-compact tr.ligne-complement td { padding-top: 0; }
.tableau-compact tr.ligne-complement textarea { width: 100%; box-sizing: border-box; }
.tableau-compact .col-intitule { width: 100%; }
.tableau-compact .col-intitule textarea { width: 100%; box-sizing: border-box; min-width: 12rem; }
.apercu-complement { display: block; font-size: .82rem; color: var(--discret); white-space: pre-line;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.apercu-complement[hidden] { display: none; }
.icone-action { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; min-height: 0;
  padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: inherit; font-size: 1rem;
  text-decoration: none; cursor: pointer; position: relative; list-style: none; }
.icone-action::-webkit-details-marker { display: none; }
.icone-action:hover { background: var(--surface-2); filter: none; }
.icone-action.rempli { border-color: var(--accent); }
.icone-action.danger { color: var(--erreur); font-size: 1.2rem; font-weight: 600; }
.photos-comparees { display: inline-block; vertical-align: middle; }
.groupe-chiffrage + .groupe-chiffrage { margin-top: 1rem; }
.tableau-chiffrage .col-item { width: 100%; }
/* Bulle au survol (data-bulle) : texte de l'attribut, au-dessus de l'élément (Q127). */
[data-bulle] { position: relative; }
[data-bulle]:hover::after, [data-bulle]:focus-visible::after { content: attr(data-bulle); position: absolute; bottom: calc(100% + 6px);
  right: 0; z-index: 20; white-space: nowrap; padding: .25rem .5rem; border-radius: 6px; font: 500 .78rem/1.3 sans-serif;
  color: var(--surface); background: var(--texte); pointer-events: none; }
@media (max-width: 700px) {
  .tableau-compact input:not([type=checkbox]), .tableau-compact select { height: 2.5rem; }
  .tableau-compact textarea { min-height: 2.5rem; }
  .icone-action { width: 2.5rem; height: 2.5rem; }
  .tableau-compact thead { display: none; }
  .tableau-compact, .tableau-compact tbody, .tableau-compact tfoot { display: block; width: 100%; }
  .tableau-compact tr.groupe-piece, .tableau-compact tr.groupe-piece th { display: block; }
  .tableau-compact tr.ligne-item, .tableau-compact tr.ligne-chiffrage, .tableau-compact tr.ligne-libre, .tableau-compact tr.ligne-recap,
  .tableau-compact tfoot tr {
    display: grid; gap: .3rem .5rem; align-items: center; padding: .4rem .6rem; border-bottom: 1px solid var(--bordure); }
  .tableau-compact tr td, .tableau-compact tfoot th { display: block; border: 0; padding: 0; }
  /* Tableau du solde : 1. item et constat ; 2. catégorie et actions. */
  .tableau-compact tr.ligne-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "item item" "constat constat" "categorie actions"; gap: .15rem .5rem; }
  .tableau-compact tr.ligne-item .col-item { grid-area: item; }
  .tableau-compact tr.ligne-item .col-item { font-weight: 600; }
  .tableau-compact tr.ligne-item .col-constat { grid-area: constat; font-size: .88rem; min-width: 0; }
  .tableau-compact tr.ligne-item .col-constat .discret { display: inline; }
  .tableau-compact tr.ligne-item .col-constat .discret::before { content: " · "; }
  .tableau-compact tr.ligne-item .col-categorie { grid-area: categorie; min-width: 0; }
  .tableau-compact tr.ligne-item .col-categorie select { width: 100%; max-width: none; }
  .tableau-compact tr.ligne-item .col-actions { grid-area: actions; justify-self: end; }
  .tableau-compact tr.ligne-complement { display: block; padding: 0 .6rem .4rem; }
  .tableau-compact tr.ligne-complement[hidden] { display: none; }
  .tableau-compact tr.ligne-complement td { display: block; padding: 0; }
  /* Chiffrage : item, montant et case sur une ligne. */
  .tableau-compact tr.ligne-chiffrage { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "item montant visible"; }
  .tableau-compact tr.ligne-chiffrage .col-item { grid-area: item; }
  .tableau-compact tr.ligne-chiffrage .col-montant { grid-area: montant; text-align: left; }
  .tableau-compact tr.ligne-chiffrage .col-visible { grid-area: visible; }
  .tableau-compact tfoot tr { grid-template-columns: 1fr auto; }
  .tableau-compact tfoot tr td:last-child { grid-column: 1 / -1; }
  /* Lignes libres : 1. intitulé ; 2. date et montant ; 3. sens et actions. */
  .tableau-compact tr.ligne-libre { grid-template-columns: auto 1fr; grid-template-areas: "intitule intitule" "date montant" "sens actions"; }
  .tableau-compact tr.ligne-libre .col-intitule { grid-area: intitule; }
  .tableau-compact tr.ligne-libre .col-date { grid-area: date; }
  .tableau-compact tr.ligne-libre .col-montant { grid-area: montant; }
  .tableau-compact tr.ligne-libre .col-sens { grid-area: sens; min-width: 0; }
  .tableau-compact tr.ligne-libre .col-sens select { width: 100%; }
  .tableau-compact tr.ligne-libre .col-actions { grid-area: actions; }
  .tableau-compact .champ-montant { width: 5.5rem; }
  /* Débit / crédit (tableau et récapitulatif du solde) : 1. intitulé et montant ; 2. date en petit. Le montant porte
     « Débit » ou « Crédit » devant lui (une seule des deux cellules est remplie). */
  .tableau-compact tr.ligne-recap { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "intitule debit credit" "date date date"; }
  .tableau-compact tr.ligne-recap .col-intitule { grid-area: intitule; }
  .tableau-compact tr.ligne-recap .col-debit { grid-area: debit; }
  .tableau-compact tr.ligne-recap .col-credit { grid-area: credit; }
  .tableau-compact tr.ligne-recap .col-date { grid-area: date; font-size: .8rem; color: var(--discret); }
  .tableau-compact tr.ligne-recap .col-debit:not(:empty)::before { content: "Débit "; font-size: .75rem; color: var(--discret); }
  .tableau-compact tr.ligne-recap .col-credit:not(:empty)::before { content: "Crédit "; font-size: .75rem; color: var(--discret); }
  .tableau-compact tr.ligne-recap .col-debit:empty, .tableau-compact tr.ligne-recap .col-credit:empty { display: none; }
  .tableau-compact tr.ligne-total { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .3rem .6rem; padding: .4rem .6rem; }
  .tableau-compact tr.ligne-total .col-debit::before { content: "Débit "; font-size: .75rem; color: var(--discret); }
  .tableau-compact tr.ligne-total .col-credit::before { content: "Crédit "; font-size: .75rem; color: var(--discret); }
}
/* Version 2.31.0 : les icônes d'action restent des icônes (le style général des boutons, « danger » compris, ne s'applique pas). */
button.icone-action, button.icone-action.danger, summary.icone-action { background: none; border-color: transparent; box-shadow: none; }
button.icone-action.rempli { border-color: var(--accent); }
button.icone-action.danger { color: var(--erreur); }
button.icone-action:hover, summary.icone-action:hover { background: var(--surface-2); }
.tableau-compact .col-categorie select { max-width: 16rem; }
.tableau-compact tfoot td, .tableau-compact tfoot th { white-space: nowrap; }
.apercu-complement { font-weight: 400; }
/* Version 2.31.0 (Q134) : zone de dépôt d'un document, même allure que « + Photo » : pointillés, à la taille du contenu,
   une ligne de haut ; couleur de survol quand un fichier passe au-dessus ; nom du fichier une fois choisi. */
.zone-depot { position: relative; display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; min-height: 2.5rem;
  border: 2px dashed var(--accent); border-radius: 8px; color: var(--accent); font-weight: 600; cursor: pointer; max-width: 100%; }
.zone-depot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.zone-depot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.zone-depot.survol { background: var(--accent-doux); border-style: solid; }
.zone-depot.rempli { border-style: solid; }
.zone-depot-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-depot-precision { font-weight: 400; font-size: .82rem; color: var(--discret); }
.etiquette-champ { display: block; font-weight: 600; margin-bottom: .3rem; }
.bouton-photo.survol { background: var(--accent-doux); border-style: solid; }
/* Version 2.31.0 : un élément en position absolue d'un tableau (texte visuellement caché d'un en-tête, case masquée)
   s'échappait du cadre défilant et élargissait toute la page sur smartphone : le cadre devient son repère. */
.tableau { position: relative; }
/* Version 2.31.0 : une balise longue ({{SOLDE_MONTANT_LETTRES_MIN}}…) dans un texte d'aide ou une légende ne
   s'élargit plus au-delà de l'écran du smartphone. */
.aide, legend, .champ label { overflow-wrap: anywhere; }
/* Version 2.31.0 : page Modules compacte (description en petit à la suite du nom ; smartphone : 1. poignée, nom et
   case ; 2. nom affiché). */
.tableau-modules .col-module .discret { font-size: .82rem; }
.tableau-modules .col-libelle input { min-width: 10rem; }
@media (max-width: 700px) {
  .tableau-compact tr.ligne-module { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .5rem;
    grid-template-areas: "poignee module actif" "poignee libelle libelle"; align-items: center; padding: .4rem .6rem;
    border-bottom: 1px solid var(--bordure); }
  .tableau-compact tr.ligne-module .colonne-poignee { grid-area: poignee; }
  .tableau-compact tr.ligne-module .col-module { grid-area: module; }
  .tableau-compact tr.ligne-module .col-libelle { grid-area: libelle; }
  .tableau-compact tr.ligne-module .col-libelle input { width: 100%; min-width: 0; }
  .tableau-compact tr.ligne-module .col-actif { grid-area: actif; }
}
/* Version 2.32.1 : pastilles d'un statut (état, PDF, Nextcloud) sur une seule ligne. */
.pastilles-une-ligne { display: flex; flex-wrap: nowrap; align-items: center; gap: .3rem; white-space: nowrap; }
.pastilles-une-ligne > * { margin: 0; }
.pastilles-une-ligne .etiquette-nextcloud { margin-left: 0; }
/* Version 2.32.1 : titre de bloc suivi de sa pastille d'état sur la même ligne (assurance habitation). */
.titre-avec-etat { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-bottom: .6rem; }
.titre-avec-etat h2 { margin: 0; }
/* Version 2.32.1 : bloc Quittances de la fiche du bail : mois, mention de correction et bouton sans retour à la ligne. */
#quittances td[data-libelle="Mois"], #quittances td[data-libelle="Attendu"] .secondaire,
#quittances .corriger-attendu > summary { white-space: nowrap; }
/* Version 2.32.1 (demande du propriétaire) : intitulé de pièce plus gros et bien distinct des items (solde de tout
   compte, tableau et chiffrage) : texte plus grand et gras, fond accentué, filet à gauche, espace au-dessus. */
.tableau-compact tr.groupe-piece th { font-size: .95rem; font-weight: 700; letter-spacing: .02em; color: var(--texte);
  background: var(--accent-doux); border-left: 4px solid var(--accent); padding: .5rem .7rem; }
.tableau-compact tbody + tbody tr.groupe-piece th { border-top: 2px solid var(--bordure); }
/* Version 2.32.1 (Q154) : ligne retrouvée après une action (app.js, ancre « #surligner-… »), 3 s en orange pâle. */
.surbrillance, .surbrillance > td, .surbrillance > th { background: var(--alerte-doux) !important; transition: background .4s; }
/* Version 2.32.2 (Q171 à Q177) : items écartés du solde, regroupés par pièce (petit titre gras sans fond), lignes à la
   hauteur du texte : item et constat en très petit, début de la justification coupé par « … » (clic : zone complète
   sous la ligne), 💬, 📷, « rétablir ». */
.items-ecartes { margin: .3rem 0 .6rem; }
.items-ecartes > p { margin: 0 0 .15rem; }
.tableau-ecartes { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .85rem; }
.tableau-ecartes th, .tableau-ecartes td { padding: .1rem .3rem; vertical-align: middle; border: 0; }
.tableau-ecartes tr.piece-ecartee th { text-align: left; font-size: .78rem; font-weight: 700; padding-top: .35rem; background: none; color: var(--texte); text-transform: none; letter-spacing: 0; }
.tableau-ecartes col.col-nom { width: 46%; }
.tableau-ecartes col.col-icones { width: 4.4rem; }
.tableau-ecartes col.col-retablir { width: 4.2rem; }
.tableau-ecartes .ecarte-nom { overflow-wrap: anywhere; }
.tableau-ecartes .ecarte-actions { white-space: nowrap; }
.tableau-ecartes .ecarte-retablir { text-align: right; }
.constat-mini { font-size: .7rem; color: var(--discret); white-space: nowrap; }
.texte-depliant { display: block; width: 100%; min-height: 1.2em; background: none; border: 0; padding: 0; text-align: left;
  color: var(--texte); font: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.texte-depliant span { white-space: nowrap; }
.tableau-ecartes tr.ligne-complement td { padding: 0 .3rem .3rem; }
.tableau-ecartes tr.ligne-complement textarea { width: 100%; box-sizing: border-box; font-size: .85rem; }
@media (max-width: 640px) {   /* smartphone : la justification passe sous le nom, sur toute la largeur */
  .tableau-ecartes, .tableau-ecartes tbody { display: block; }
  .tableau-ecartes colgroup { display: none; }
  .tableau-ecartes tr.ligne-ecartee { display: grid; grid-template-columns: 1fr auto auto; align-items: center; }
  .tableau-ecartes tr.ligne-ecartee .ecarte-justification { grid-column: 1 / -1; grid-row: 2; }
  .tableau-ecartes tr.ligne-ecartee .ecarte-justification:has(span:empty) { display: none; }
  .tableau-ecartes tr.piece-ecartee, .tableau-ecartes tr.ligne-complement { display: block; }
  .tableau-ecartes tr.ligne-complement[hidden] { display: none; }
  .tableau-ecartes tr.piece-ecartee th, .tableau-ecartes tr.ligne-complement td { display: block; }
}
/* Version 2.32.2 (Q173, Q177) : photos d'entrée et de sortie en vignettes de 56 px, côte à côte ; clic : photo en grand
   dans un autre onglet (original JPEG/PNG, sinon aperçu 1 600 px). */
.comparaison-photos { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .2rem; }
.comparaison-photos > div { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.comparaison-photos strong { font-size: .75rem; margin-right: .2rem; }
.comparaison-photos img { height: 56px; width: auto; max-width: 84px; object-fit: cover; border-radius: 4px; border: 1px solid var(--bordure); display: block; }
.comparaison-photos p { margin: 0; font-size: .75rem; }
.items-ecartes textarea { flex: 1 1 auto; min-width: 6rem; padding: .1rem .35rem; font-size: .85rem; min-height: 0; }
.items-ecartes button { flex: 0 0 auto; }
/* Version 2.33.0 (Q218) : bloc Quittances de la fiche du bail, carte compacte sur smartphone : mois et écart (s'il
   n'est pas nul), puis attendu, payé et date sur une ligne (libellés en petit au-dessus), puis le statut ; plus de
   blanc sous le statut quand il n'y a aucun bouton. */
@media (max-width: 720px) {
  table.quittances-compactes tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .6rem; row-gap: .15rem;
    padding: .45rem .7rem; }
  table.quittances-compactes td[data-libelle] { padding: 0; min-height: 0; }
  table.quittances-compactes td[data-libelle]::before { float: none; display: block; width: auto; margin: 0; padding: 0;
    font-size: .68rem; line-height: 1.1; }
  table.quittances-compactes td[data-libelle="Mois"] { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  table.quittances-compactes td[data-libelle="Attendu"] { grid-area: 2 / 1; }
  table.quittances-compactes td[data-libelle="Payé"] { grid-area: 2 / 2; }
  table.quittances-compactes td[data-libelle="Le"] { grid-area: 2 / 3; }
  table.quittances-compactes td[data-libelle="Mois"]::before,
  table.quittances-compactes td[data-libelle="Statut"]::before,
  table.quittances-compactes td[data-libelle="Écart"]::before { display: none; }
  table.quittances-compactes td[data-libelle="Écart"] { grid-area: 1 / 3; text-align: right; }
  table.quittances-compactes td.ecart-nul { visibility: hidden; }
  table.quittances-compactes td[data-libelle="Statut"] { grid-area: 3 / 1 / 4 / -1; }
  table.quittances-compactes td.col-actions { grid-area: 4 / 1 / 5 / -1; }
  table.quittances-compactes td.sans-action { display: none; }
  table.quittances-compactes td .secondaire { display: block; font-size: .72rem; white-space: normal; }
  table.quittances-compactes td.statut-vide { display: none; }
  table.quittances-compactes td.col-actions details { display: inline-block; }
  table.quittances-compactes td.col-actions summary { width: auto; display: inline-block; }
}
/* Version 2.33.0 : sur un écran tactile, une ligne touchée ne reste pas « survolée » (fond plus clair, pastille grise
   confondue avec lui : liste des baux sur iPhone). */
@media (hover: none) { tbody tr:hover { background: inherit; } }
/* Version 2.33.0 (Q219) : zone qui grandit avec son contenu (app.js) : pas de barre de défilement intérieure. */
textarea.auto-hauteur { overflow-y: hidden; }
/* Version 2.33.0 (Q205, Q206) : sur PC (à partir de 1 024 px), les onglets (Paramètres, fiche logement, Informations,
   Envois d'e-mails) forment une colonne à gauche, qui reste visible au défilement ; le titre et les messages gardent
   toute la largeur. En dessous de 1 024 px : onglets en ligne, comme avant. */
@media (min-width: 1024px) {
  main.contenu:has(> nav.onglets) { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 1.75rem; align-items: start; }
  main.contenu:has(> nav.onglets) > * { grid-column: 2; min-width: 0; }
  main.contenu:has(> nav.onglets) > .message, main.contenu:has(> nav.onglets) > .entete-page { grid-column: 1 / -1; }
  main.contenu > nav.onglets { grid-column: 1; grid-row-end: span 400; align-self: start; position: sticky; top: 1rem;
    flex-direction: column; gap: 0; overflow: visible; border-bottom: 0; border-left: 1px solid var(--bordure); margin: 0; }
  main.contenu > nav.onglets a { white-space: normal; border-bottom: 0; border-left: 2px solid transparent; margin-left: -1px;
    padding: .45rem .8rem; line-height: 1.25; }
  main.contenu > nav.onglets a.actif { border-left-color: var(--accent); background: var(--accent-doux); }
}
/* Version 2.33.0 : champs courts côte à côte (dates du bloc Informations du solde). */
.champs-en-ligne { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: flex-start; }
.champs-en-ligne .champ .aide { display: block; }
/* Version 2.33.0 (Q194) : sablier du bouton pendant un traitement long (génération). */
.sablier { display: inline-block; animation: sablier-tourne 1.6s linear infinite; }
@keyframes sablier-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sablier { animation: none; } }
/* Version 2.33.0 (Q185 à Q188) : versions du courrier du solde, une ligne basse chacune. */
.versions-courrier { margin-top: .75rem; }
.versions-courrier h3 { margin: 0; font-size: 1rem; }
.liste-versions { list-style: none; margin: .3rem 0 0; padding: 0; }
.liste-versions li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .25rem 0; border-top: 1px solid var(--bordure); }
.liste-versions li.derniere .version-date { font-weight: 700; }
.liste-versions form.en-ligne { display: inline; margin: 0; }
/* Version 2.33.1 : balises de montant à copier sous la conclusion du solde. */
.aide-balises ul { list-style: none; margin: .2rem 0 .4rem; padding: 0; }
.aide-balises li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; font-size: .85rem; padding: .05rem 0; }
.aide-balises code { user-select: all; }
/* Version 2.33.1 (Q225, Q226) : tableau transposé (civilités) : libellés en première colonne, fixes au défilement
   horizontal (smartphone) ; en tête de colonne, flèches ← → et croix ×. */
.tableau-defilant { overflow-x: auto; }
.tableau-transpose th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; font-size: .85rem;
  position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tableau-transpose th[scope="row"] { vertical-align: middle; text-transform: none; letter-spacing: 0; color: var(--texte); }
.tableau-transpose td { min-width: 8.5rem; }
@media (max-width: 720px) {
  .tableau-transpose th[scope="row"] { white-space: normal; width: 6.2rem; min-width: 6.2rem; max-width: 6.2rem; font-size: .75rem; line-height: 1.2; }
  .tableau-transpose td { min-width: 7rem; }
  .tableau-transpose th, .tableau-transpose td { padding: .3rem .35rem; }
}
.tableau-transpose .actions-colonne { display: inline-flex; align-items: center; gap: .15rem; }
.fleche-colonne { background: none; border: 1px solid var(--bordure); border-radius: 6px; padding: 0 .35rem; min-height: 0;
  line-height: 1.4; font-size: .85rem; color: var(--texte); cursor: pointer; }

/* Version 2.35.0 : avancement de la synchronisation, alertes acquittables (Paramètres > Général). */
.avancement-synchro { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin: .5rem 0; }
.avancement-synchro progress { width: 14rem; max-width: 100%; height: .8rem; accent-color: var(--accent, #6366f1); }
.alerte-acquittable { display: inline; font-weight: normal; cursor: pointer; }
.alerte-acquittable input { width: auto; margin: 0 .35rem 0 0; vertical-align: middle; }
.acquitter-alertes .actions { margin: .4rem 0 0; }
.alertes-acquittees ul { margin: .4rem 0; }
.alertes-acquittees li { margin: .15rem 0; }
.alertes-acquittees form.en-ligne { display: inline; margin-left: .4rem; }
