/* NIVO : style messagerie (inspire de Telegram), aux couleurs de la marque du client. */
:root {
  --accent: #618eb4;
  --encre: #1d1d1b;
  --fond: #ffffff;
  --fond-2: #f1f1f4;
  --texte: #1d1d1b;
  --texte-2: #8a8a8e;
  --filet: rgba(60, 60, 67, .14);
  --bulle-moi: color-mix(in srgb, var(--accent) 22%, #ffffff);
  --bulle-lui: #ffffff;
  --papier: color-mix(in srgb, var(--accent) 16%, #eef1f3);
  --bon: #2f9e5b;
  --attention: #c27c0e;
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #17191c; --fond-2: #22252a; --texte: #f2f2f2; --texte-2: #8d939a; --filet: rgba(255, 255, 255, .08);
    --bulle-moi: color-mix(in srgb, var(--accent) 55%, #1b2733); --bulle-lui: #24282d;
    --papier: color-mix(in srgb, var(--accent) 14%, #0f1215); color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--texte); font: 400 15px/1.35 var(--police); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
.gris { color: var(--texte-2); }
.lien { border: 0; background: none; color: var(--accent); font-weight: 500; cursor: pointer; padding: 0; }

/* Avatars ronds facon messagerie */
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; flex: none; background: var(--accent); }
.avatar.petit { width: 32px; height: 32px; font-size: 13px; background: var(--encre); }
.avatar.moyen { width: 40px; height: 40px; font-size: 16px; }
.avatar.grand { width: 54px; height: 54px; font-size: 22px; }
.avatar.grand svg { width: 26px; height: 26px; }
.avatar.moyen svg { width: 20px; height: 20px; }
.degrade { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #ffffff), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #1d1d1b)); }
.ton-encre { background: linear-gradient(160deg, #4a4a47, var(--encre)); }
.ton-clair { background: linear-gradient(160deg, #8fb3d1, #5b86ab); }
.ton-gris { background: linear-gradient(160deg, #b9bcc2, #8a8f97); }

/* Connexion */
.connexion { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--fond); }
.carte-connexion { width: 100%; max-width: 360px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.logo-rond { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #fff; margin-bottom: 8px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #1d1d1b)); box-shadow: 0 12px 32px -12px var(--accent); }
.carte-connexion h1 { margin: 0; font-size: 26px; font-weight: 700; }
.logo-rond.logo-image { width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; margin-bottom: 0; }
.logo-rond.logo-image img { display: block; width: 220px; max-width: 70vw; height: auto; }
/* Logo sombre sur fond sombre : on le passe en clair en mode nuit */
@media (prefers-color-scheme: dark) { .logo-rond.logo-image img { filter: invert(1) brightness(1.1); } }
.titre-marque:has([data-marque-nom][hidden]) { margin-top: -4px; }
.sous-titre { margin: 0 0 12px; color: var(--texte-2); }
.carte-connexion input { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--filet); background: var(--fond-2); color: var(--texte); padding: 0 16px; font: inherit; outline: none; }
.carte-connexion input:focus { border-color: var(--accent); }
.bouton-plein { width: 100%; height: 50px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; margin-top: 8px; }
.bouton-plein:active { filter: brightness(.95); }
.erreur { margin: 0; color: #d93025; font-size: 14px; }
.signature { margin: 0; color: var(--texte-2); font-size: 12px; }

/* Structure : liste a gauche, conversation a droite (bureau) */
.app { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100%; }
.liste { display: flex; flex-direction: column; border-right: 1px solid var(--filet); background: var(--fond); min-height: 0; min-width: 0; }
.tete-liste { padding: 14px 16px 8px; display: grid; gap: 8px; }
.ligne-marque { display: flex; justify-content: space-between; align-items: center; }
.marque { display: grid; line-height: 1.1; font-weight: 700; font-size: 15px; }
.marque .signature { font-weight: 400; font-size: 11px; }
.tete-liste h1 { margin: 6px 0 2px; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.recherche { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 12px; background: var(--fond-2); color: var(--texte-2); font-size: 15px; }
.recherche svg { width: 18px; height: 18px; }
.discussions { overflow-y: auto; flex: 1; padding: 4px 0; }
.discussion { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; cursor: pointer; text-align: left; }
.discussion:hover { background: var(--fond-2); }
.discussion.actif { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.corps-discussion { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 4px 0 10px; border-bottom: 1px solid var(--filet); }
.discussion:last-child .corps-discussion { border-bottom: 0; }
.haut-discussion { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.haut-discussion strong { font-weight: 600; font-size: 16px; }
.heure { font-size: 13px; color: var(--texte-2); }
.apercu { display: block; min-width: 0; max-width: 100%; color: var(--texte-2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.pied-liste { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--filet); font-size: 13px; }
.profil { display: grid; }
.profil span:first-child { font-weight: 600; }

.contenu { min-width: 0; min-height: 0; position: relative; }
.vue { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.tete-vue { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 60px; border-bottom: 1px solid var(--filet); background: color-mix(in srgb, var(--fond) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 2; }
.titre-vue { display: grid; line-height: 1.25; }
.titre-vue strong { font-size: 16px; font-weight: 600; }
.titre-vue .gris { font-size: 13px; }
#etat-agent.ecrit { color: var(--accent); }
.retour { display: none; border: 0; background: none; color: var(--accent); padding: 4px; margin-left: -8px; cursor: pointer; }
.retour svg { width: 28px; height: 28px; }

/* Fond papier peint : motifs fins de batiment, cle, outil */
.papier {
  background-color: var(--papier);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23618eb4' stroke-opacity='.22' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 46V26l12-8 12 8v20M28 46v-8h8v8'/%3E%3Ccircle cx='108' cy='30' r='6'/%3E%3Cpath d='M114 30h16M124 30v6M130 30v4'/%3E%3Cpath d='M60 112l14-14m0 0a7 7 0 1 0 6-6l-6 6z'/%3E%3Crect x='112' y='96' width='22' height='28' rx='2'/%3E%3Cpath d='M117 104h12M117 110h12M117 116h7'/%3E%3Cpath d='M24 132h22M35 121v22'/%3E%3C/svg%3E");
}
.fil { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.jour { align-self: center; margin: 8px 0; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 500; color: #fff; background: rgba(0, 0, 0, .22); }

/* Bulles */
.bulle { max-width: min(78%, 560px); padding: 7px 10px 6px 12px; border-radius: 18px; position: relative; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); animation: entree 160ms ease-out both; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.38; }
.bulle.lui { align-self: flex-start; background: var(--bulle-lui); border-bottom-left-radius: 6px; }
.bulle.moi { align-self: flex-end; background: var(--bulle-moi); border-bottom-right-radius: 6px; }
.bulle.systeme { align-self: center; background: rgba(0, 0, 0, .22); color: #fff; font-size: 13px; box-shadow: none; padding: 4px 12px; border-radius: 12px; }
.bulle .meta { float: right; margin: 6px 0 -4px 10px; font-size: 11.5px; color: var(--texte-2); display: inline-flex; align-items: center; gap: 2px; }
.bulle.moi .meta { color: color-mix(in srgb, var(--accent) 80%, #1d1d1b); }
.bulle .meta svg { width: 16px; height: 16px; stroke-width: 2; }
.canal { font-size: 12px; font-weight: 600; color: var(--accent); display: block; margin-bottom: 2px; }
@keyframes entree { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Brouillon = message de bot avec boutons dessous */
.bot { align-self: flex-start; max-width: min(86%, 560px); display: grid; gap: 4px; animation: entree 160ms ease-out both; }
.carte-brouillon { background: var(--bulle-lui); border-radius: 18px; border-bottom-left-radius: 6px; padding: 10px 12px 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); display: grid; gap: 6px; }
.etiquette { font-size: 13px; font-weight: 600; color: var(--accent); }
.titre-brouillon { font-weight: 600; font-size: 15.5px; }
.contenu-brouillon { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; max-height: 260px; overflow: auto; }
.montant { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.alerte { font-size: 13.5px; color: var(--attention); }
.alerte.verrou { color: var(--texte-2); }
.statut { font-size: 13px; color: var(--texte-2); }
.statut.valide { color: var(--bon); font-weight: 600; }
.clavier { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.clavier button { height: 40px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .2); color: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 120ms; }
.clavier button:hover { background: rgba(0, 0, 0, .3); }
.clavier button.oui { background: color-mix(in srgb, var(--accent) 88%, #000); }
.clavier button:disabled { opacity: .5; }
.clavier .seul { grid-column: span 2; }
.correction { display: flex; gap: 4px; grid-column: span 2; }
.correction input { flex: 1; height: 40px; border-radius: 10px; border: 0; padding: 0 12px; font: inherit; background: var(--bulle-lui); color: var(--texte); outline: 2px solid var(--accent); }
.bot.part { opacity: 0; transform: translateX(-12px); transition: all 200ms ease-out; }

/* Saisie */
.saisie { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--fond); border-top: 1px solid var(--filet); }
.ligne-saisie { display: flex; align-items: flex-end; gap: 6px; }
.icone-bouton { width: 40px; height: 40px; display: grid; place-items: center; color: var(--texte-2); cursor: pointer; }
.ligne-saisie textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; border-radius: 20px; border: 1px solid var(--filet); background: var(--fond); color: var(--texte); padding: 9px 14px; font: inherit; line-height: 20px; outline: none; overflow-y: hidden; }
.envoyer { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform 120ms; }
.envoyer:active { transform: scale(.92); }
.envoyer svg { width: 20px; height: 20px; stroke-width: 2.4; }
.pieces { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.piece { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: var(--fond-2); font-size: 13px; }
.piece button { border: 0; background: none; cursor: pointer; color: var(--texte-2); }

/* Listes simples (documents, consommation) */
.liste-simple { flex: 1; overflow-y: auto; background: var(--fond-2); padding: 16px; display: grid; align-content: start; gap: 1px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--fond); text-decoration: none; color: var(--texte); }
.ligne:first-child { border-radius: 12px 12px 0 0; }
.ligne:last-child { border-radius: 0 0 12px 12px; }
.ligne:only-child { border-radius: 12px; }
.ligne .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuile-fichier { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #8fb3d1, #5b86ab); font-size: 11px; font-weight: 700; flex: none; }
.carte-chiffre { background: var(--fond); border-radius: 14px; padding: 20px; display: grid; gap: 8px; }
.gros { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.jauge { height: 8px; border-radius: 4px; background: var(--fond-2); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--accent); }
.vide { margin: auto; text-align: center; color: var(--texte-2); display: grid; gap: 10px; justify-items: center; max-width: 320px; padding: 24px; }
.vide.carte { background: color-mix(in srgb, var(--fond) 70%, transparent); border-radius: 18px; color: var(--texte); }
.vide strong { font-size: 17px; }
.suggestion { border: 0; border-radius: 16px; padding: 8px 14px; background: var(--fond); color: var(--accent); font-weight: 500; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.squelette { height: 52px; margin: 6px 0; border-radius: 14px; background: linear-gradient(90deg, var(--fond-2), var(--fond), var(--fond-2)); background-size: 200% 100%; animation: brille 1.2s linear infinite; }
@keyframes brille { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: rgba(30, 30, 30, .9); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; z-index: 50; backdrop-filter: blur(12px); }
.onglets { display: none; }

/* Telephone : un ecran a la fois, onglets en bas */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .app[data-ecran="liste"] .contenu { display: none; }
  .app:not([data-ecran="liste"]) .liste { display: none; }
  .app[data-ecran="chat"] .onglets, .app[data-ecran="groupe"] .onglets { display: none; }
  .liste { border-right: 0; }
  .pied-liste { display: none; }
  .retour { display: block; }
  .onglets { display: flex; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--filet); background: color-mix(in srgb, var(--fond) 90%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .onglets button { position: relative; display: grid; justify-items: center; gap: 2px; border: 0; background: none; color: var(--texte-2); font-size: 11px; font-weight: 500; padding: 4px 12px; cursor: pointer; }
  .onglets button.actif { color: var(--accent); }
  .badge.flottant { position: absolute; top: -2px; left: calc(50% + 4px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .bulle { max-width: 84%; }
}

/* Brouillon facon messagerie : une piece jointe dans le fil, puis une question douce et deux reponses rapides */
.bot { gap: 6px; }
.piece-jointe { display: flex; align-items: center; gap: 10px; background: var(--bulle-lui); border-radius: 16px; border-bottom-left-radius: 6px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.icone-doc { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.icone-doc svg { width: 20px; height: 20px; }
.texte-doc { flex: 1; min-width: 0; display: grid; text-align: left; }
.texte-doc .titre-brouillon { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.texte-doc .gris { font-size: 13px; }
.voir { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px; }
.bot .contenu-brouillon { background: var(--bulle-lui); border-radius: 12px; padding: 10px 12px; border-left: 3px solid var(--accent); }
.question { font-size: 14px; color: var(--texte); background: var(--bulle-lui); border-radius: 16px; border-top-left-radius: 6px; padding: 8px 12px; justify-self: start; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.question.valide { color: var(--bon); font-weight: 600; }
.question:empty { display: none; }
.reponses { display: flex; gap: 6px; flex-wrap: wrap; }
.reponses:empty { display: none; }
.rapide { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--fond) 85%, transparent); color: var(--accent); border-radius: 18px; padding: 7px 16px; font-weight: 600; font-size: 14px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 120ms; }
.rapide:hover { background: color-mix(in srgb, var(--accent) 12%, var(--fond)); }
.rapide:disabled { opacity: .5; }
.bulle strong { font-weight: 650; }

.fichier-produit { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--texte); text-decoration: none; white-space: normal; }
.fichier-produit .texte-doc { display: grid; min-width: 0; }

/* Tableau de bord */
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.chiffre-carte { background: var(--bulle-lui); border-radius: 16px; padding: 12px; display: grid; gap: 2px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.chiffre-carte .gros { font-size: 24px; }
.chiffre-carte .gris { font-size: 12.5px; }
.alerte-carte { display: grid; gap: 3px; text-align: left; border: 0; cursor: pointer; background: var(--bulle-lui); border-radius: 16px; border-bottom-left-radius: 6px; padding: 10px 12px 10px 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); max-width: 560px; border-left: 4px solid var(--accent); animation: entree 160ms ease-out both; }
.alerte-carte.critique { border-left-color: #d93025; }
.alerte-carte.attention { border-left-color: var(--attention); }
.alerte-carte .niveau { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); }
.alerte-carte.critique .niveau { color: #d93025; }
.alerte-carte.attention .niveau { color: var(--attention); }
.action-alerte { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.badge.rouge { background: #d93025; }

/* Boite mail */
.courrier-carte { display: grid; gap: 3px; text-align: left; border: 0; cursor: pointer; background: var(--bulle-lui); border-radius: 16px; border-bottom-left-radius: 6px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); max-width: 560px; animation: entree 160ms ease-out both; }
.courrier-carte.cat-pub { opacity: .55; }
.haut-courrier { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.puce-cat { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.puce-cat.cat-urgent { background: rgba(217, 48, 37, .14); color: #d93025; }
.puce-cat.cat-relance { background: color-mix(in srgb, var(--attention) 16%, transparent); color: var(--attention); }
.puce-cat.cat-pub { background: var(--fond-2); color: var(--texte-2); }
.extrait { font-size: 13.5px; color: var(--texte-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Groupes, discussions privees, fiches */
.actions-tete { display: flex; align-items: center; gap: 8px; }
.icone-rond { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fond-2); color: var(--accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.icone-rond svg { width: 18px; height: 18px; }
.titre-section { padding: 14px 16px 6px; font-size: 13px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.titre-section.doc { padding: 16px 4px 6px; }
.titre-bouton { border: 0; background: none; text-align: left; cursor: pointer; padding: 0; flex: 1; min-width: 0; color: var(--texte); }
.auteur-bulle { display: block; font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.auteur-bulle.cliquable { cursor: pointer; }
.auteur-bulle.cliquable:hover { text-decoration: underline; }
.photo-lien { display: block; margin: 2px -4px 6px; }
.photo { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; object-fit: cover; }
.feuille { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 16px; }
.feuille-corps { width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto; background: var(--fond); border-radius: 18px; padding: 8px 0 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: entree 160ms ease-out both; }
.feuille-tete { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--filet); position: sticky; top: 0; background: var(--fond); }
#feuille-contenu { display: grid; gap: 2px; padding: 8px 0; }
#feuille-contenu .bouton-plein { width: calc(100% - 32px); margin: 12px 16px 0; }
.personne { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--texte); }
.personne:hover { background: var(--fond-2); }
.personne input { width: 20px; height: 20px; accent-color: var(--accent); }
.action-groupe strong { color: var(--accent); }
.petit-texte { font-size: 13px; }
.champ { margin: 8px 16px; height: 44px; border-radius: 12px; border: 1px solid var(--filet); background: var(--fond-2); color: var(--texte); padding: 0 14px; font: inherit; outline: none; }
.champ:focus { border-color: var(--accent); }
.fiche { display: grid; justify-items: center; gap: 6px; padding: 8px 16px 0; text-align: center; }
.avatar.tres-grand { width: 88px; height: 88px; font-size: 32px; margin-bottom: 6px; }
.fiche-nom { font-size: 21px; }
.fiche-lignes { width: 100%; margin-top: 12px; display: grid; background: var(--fond-2); border-radius: 12px; overflow: hidden; }
.fiche-lignes div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--filet); text-align: right; }
.fiche-lignes div:last-child { border-bottom: 0; }
.fiche .bouton-plein { margin: 16px 0 0 !important; width: 100% !important; }
/* Documents classes */
.barre-documents { display: flex; gap: 8px; padding: 10px 16px; background: var(--fond-2); flex-wrap: wrap; }
.barre-documents input { flex: 1; min-width: 160px; height: 38px; border-radius: 12px; border: 1px solid var(--filet); background: var(--fond); color: var(--texte); padding: 0 12px; font: inherit; outline: none; }
.bascule { display: flex; background: var(--fond); border-radius: 12px; padding: 3px; border: 1px solid var(--filet); }
.bascule button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--texte-2); font-size: 14px; }
.bascule button.actif { background: var(--accent); color: #fff; }
.liste-simple { display: block; padding-top: 0; }
.bloc-lignes { display: grid; gap: 1px; border-radius: 12px; overflow: hidden; }
.bloc-lignes .ligne { border-radius: 0 !important; }
.ligne .texte-doc { display: grid; min-width: 0; flex: 1; }
.grille-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; margin-bottom: 6px; }
.grille-photos a { aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: block; background: var(--fond); }
.grille-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vue, .contenu, .liste-simple { overflow-x: hidden; }

.icone-rond.ajout { background: var(--accent); color: #fff; width: 38px; height: 38px; }

/* Immeubles */
.immeuble-carte { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer; background: var(--bulle-lui); color: var(--texte); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); max-width: 640px; width: 100%; font: inherit; animation: entree 160ms ease-out both; }
.immeuble-carte:hover { background: color-mix(in srgb, var(--accent) 6%, var(--bulle-lui)); }
.tuile-immeuble { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; }
.chevron { margin-left: auto; color: var(--texte-2); font-size: 22px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.puce { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 10px; background: var(--fond-2); color: var(--texte-2); white-space: nowrap; }
.puce.rouge { background: rgba(217, 48, 37, .12); color: #d93025; }
.puce.orange { background: color-mix(in srgb, var(--attention) 16%, transparent); color: var(--attention); }
.puce.vert { background: rgba(46, 160, 67, .14); color: #2e8540; }
.pastille { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--texte-2); }
.pastille.rouge { background: #d93025; } .pastille.orange { background: var(--attention); } .pastille.vert { background: #2ea043; } .pastille.bleu { background: var(--accent); } .pastille.gris { background: var(--filet); }
.carte-immeuble { display: grid; gap: 6px; background: var(--bulle-lui); border-radius: 16px; padding: 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); max-width: 640px; }
.chiffre-carte.rouge .gros { color: #d93025; }
button.chiffre-carte { border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.actions-immeuble { display: flex; flex-wrap: wrap; gap: 8px; max-width: 640px; }
.puce-action { border: 1px solid var(--filet); background: var(--bulle-lui); color: var(--texte); border-radius: 18px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.puce-action:hover { border-color: var(--accent); color: var(--accent); }
.puce-action.fort { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.retour-parc { justify-self: start; padding: 0 2px; }
#bloc-immeubles .bloc-lignes { max-width: 640px; width: 100%; }
#bloc-immeubles button.ligne { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
#bloc-immeubles .ligne .puce { margin-left: auto; }
.formulaire { display: grid; gap: 4px; padding: 8px 0; }
.formulaire label { display: grid; gap: 2px; padding: 0 16px; }
.formulaire .champ { margin: 4px 0 8px; width: 100%; box-sizing: border-box; }
.formulaire textarea.champ { height: auto; padding: 10px 14px; resize: vertical; }
.formulaire .case { display: flex; align-items: center; gap: 10px; padding: 6px 16px; }

/* Operations */
.etapes { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.etape { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--fond-2); color: var(--texte-2); }
.etape.faite { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.etape.en-cours { background: var(--accent); color: #fff; }
.barre { display: block; height: 6px; border-radius: 3px; background: var(--fond-2); overflow: hidden; margin-top: 6px; min-width: 80px; }
.barre > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ligne > .barre { margin-left: auto; width: 90px; flex: none; margin-top: 0; }
#bloc-operations .bloc-lignes { max-width: 640px; width: 100%; }
#bloc-operations button.ligne { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
#bloc-operations .ligne .puce { margin-left: auto; }
#bloc-operations .texte-doc { flex: 1; min-width: 0; }

/* Tout ce qui se touche se voit : chevron, survol, appui */
.cliquable { cursor: pointer; transition: background 140ms ease-out, transform 120ms ease-out; }
.cliquable:active { transform: scale(.985); }
button.ligne.cliquable:hover, a.ligne.cliquable:hover { background: color-mix(in srgb, var(--accent) 7%, var(--fond)); }
.chevron-ligne { flex: none; margin-left: 6px; color: var(--texte-2); font-size: 20px; line-height: 1; opacity: .7; }
.chiffre-carte.cliquable { position: relative; border: 0; text-align: left; font: inherit; color: inherit; }
.chiffre-carte.cliquable:hover { background: color-mix(in srgb, var(--accent) 7%, var(--bulle-lui)); }
.fleche-chiffre { position: absolute; top: 8px; right: 10px; color: var(--texte-2); font-size: 16px; opacity: .6; }
.etape.cliquable { border: 0; font-family: inherit; }
.etape.cliquable:hover { filter: brightness(.95); outline: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.a-aide { cursor: pointer; }
.a-aide strong::after { content: 'i'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1.5px solid var(--texte-2); color: var(--texte-2); font-size: 10px; font-weight: 700; font-style: italic; vertical-align: 2px; }
.surligne { animation: surligne 1.2s ease-out; }
@keyframes surligne { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
/* Fiche de detail */
.detail-etat { display: flex; align-items: center; gap: 8px; padding: 6px 16px 2px; font-size: 15px; }
.detail-texte { margin: 6px 16px; line-height: 1.45; color: var(--texte); }
.detail-texte.gris { color: var(--texte-2); font-size: 13.5px; }
.detail-champs { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 0; margin: 8px 16px; border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; }
.detail-champs dt, .detail-champs dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--filet); font-size: 14px; }
.detail-champs dt { color: var(--texte-2); background: var(--fond-2); }
.detail-champs dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail-champs dt:nth-last-child(2), .detail-champs dd:last-child { border-bottom: 0; }
.bouton-second { width: calc(100% - 32px); margin: 8px 16px 0; height: 46px; border-radius: 12px; border: 1px solid var(--filet); background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.bouton-second:hover { border-color: var(--accent); }
.liste-feuille { display: grid; gap: 8px; padding: 8px 16px; }
.legende { display: grid; gap: 8px; padding: 4px 16px 8px; font-size: 14px; }
.legende > span { display: flex; align-items: center; gap: 10px; }

/* Photos de profil et icone de Nivo */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.avec-photo { background: var(--fond-2) !important; }
.avatar .etincelle { width: 56%; height: 56%; fill: #fff; stroke: none; }
button.avatar { border: 0; padding: 0; font: inherit; cursor: pointer; }
.avatar.tres-grand.cliquable:hover { filter: brightness(.92); }
.fiche .lien { margin-top: -2px; }
.fiche .bouton-second { width: 100%; margin: 8px 0 0; }

/* Securite et donnees */
.liste-secu { margin: 2px 16px 6px; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; font-size: 14px; }
.lien-source { display: block; margin: 8px 16px 0; }
.lien-secu { margin-top: 10px; font-size: 13px; }

.bandeau-confiance { display: grid; gap: 8px; width: 100%; margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--filet)); border-radius: 14px; background: color-mix(in srgb, var(--accent) 6%, var(--fond)); color: var(--texte); font: inherit; text-align: left; cursor: pointer; transition: background 140ms ease-out; }
.bandeau-confiance:hover { background: color-mix(in srgb, var(--accent) 11%, var(--fond)); }
.confiance-titre { font-weight: 600; font-size: 14px; }
.puces-confiance { display: flex; flex-wrap: wrap; gap: 6px; }
.puce-confiance { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 10px; background: var(--fond); border: 1px solid var(--filet); color: var(--texte-2); }
.confiance-lien { font-size: 12.5px; color: var(--accent); font-weight: 600; }

/* Lecteur de mail */
.courrier-carte.traite { opacity: .7; }
.heure-mail { margin-left: auto; }
.lecteur-mail { display: grid; gap: 10px; background: var(--bulle-lui); border-radius: 16px; padding: 16px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); max-width: 720px; width: 100%; box-sizing: border-box; }
.objet-mail { margin: 0; font-size: 19px; line-height: 1.3; }
.entete-mail { margin: 0; }
.entete-mail dt { width: auto; }
.corps-mail { white-space: pre-wrap; line-height: 1.55; font-size: 15px; overflow-wrap: anywhere; padding: 4px 2px; }
.actions-mail { max-width: 720px; }
.bloc-reponse { display: grid; gap: 8px; max-width: 720px; width: 100%; }
.zone-reponse { height: auto !important; padding: 12px 14px !important; margin: 0 !important; resize: vertical; line-height: 1.5; width: 100%; box-sizing: border-box; }

/* Accueil : bonjour, recherche, raccourcis, puis les discussions */
.tete-liste h1#salut { margin-bottom: 0; }
.date-jour { margin: 0 0 10px; font-size: 13.5px; }
.recherche { cursor: text; }
.recherche input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--texte); font: inherit; font-size: 15px; }
.recherche:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.raccourcis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 6px 12px 4px; }
.discussion.tuile { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; padding: 12px 4px 10px; border-radius: 14px; background: var(--fond-2); border: 1px solid transparent; min-height: 84px; text-align: center; transition: background 140ms ease-out, transform 120ms ease-out; }
.discussion.tuile:hover { background: color-mix(in srgb, var(--accent) 9%, var(--fond-2)); }
.discussion.tuile:active { transform: scale(.97); }
.discussion.tuile.actif { background: color-mix(in srgb, var(--accent) 14%, var(--fond-2)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.discussion.tuile .apercu { display: none; }
.discussion.tuile .badge { position: absolute; top: 6px; right: 8px; }
.icone-tuile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.icone-tuile svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nom-tuile { font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--texte); }
.ton-vert { background: #2e9e5b; } .ton-bleu { background: #3b82c4; } .ton-rouge { background: #d9534f; } .ton-orange { background: #e08a2e; } .ton-violet { background: #7c5cc4; }
.icone-tuile.ton-encre { background: var(--encre, #1d1d1b); }
/* Pied : profil a gauche, liens a droite */
.pied-liste { gap: 8px; flex-wrap: wrap; }
.pied-liste .profil { border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; padding: 0; }
.liens-pied { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-left: auto; }
/* Resultats de recherche */
.resultats-recherche { overflow-y: auto; padding-bottom: 16px; flex: 1; }
.resultat { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: transparent; color: var(--texte); font: inherit; text-align: left; cursor: pointer; }
.resultat:hover { background: var(--fond-2); }
.icone-resultat { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--fond-2); font-size: 18px; }
.icone-resultat .avatar { width: 40px; height: 40px; }
.resultat .texte-doc { display: grid; min-width: 0; flex: 1; }
.resultat strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.demander-nivo { margin-top: 8px; border-top: 1px solid var(--filet); }

/* Barre du bas, aussi sur ordinateur : sous la liste, a gauche */
@media (min-width: 761px) {
  .app { grid-template-rows: minmax(0, 1fr) auto; }
  .app > .liste { grid-row: 1; grid-column: 1; }
  .app > .contenu { grid-row: 1 / span 2; grid-column: 2; }
  .onglets { display: flex; grid-row: 2; grid-column: 1; justify-content: space-around; padding: 6px 6px 8px; border-top: 1px solid var(--filet); border-right: 1px solid var(--filet); background: var(--fond); }
  .onglets button { position: relative; display: grid; justify-items: center; gap: 2px; border: 0; background: none; color: var(--texte-2); font-size: 11px; font-weight: 500; padding: 4px 8px; cursor: pointer; border-radius: 10px; }
  .onglets button:hover { background: var(--fond-2); }
  .onglets button.actif { color: var(--accent); }
  .badge.flottant { position: absolute; top: -2px; left: calc(50% + 4px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
}
.onglets svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onglets button[hidden] { display: none !important; }
.badge.flottant.rouge { background: #d93025; color: #fff; }
/* Feuille « Plus » */
.grille-plus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 16px; }
.tuile-plus { display: grid; justify-items: start; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--filet); background: var(--fond-2); color: var(--texte); font: inherit; text-align: left; cursor: pointer; transition: background 140ms ease-out, transform 120ms ease-out; }
.tuile-plus:hover { background: color-mix(in srgb, var(--accent) 8%, var(--fond-2)); }
.tuile-plus:active { transform: scale(.97); }
.tuile-plus .icone-tuile { margin-bottom: 4px; }

/* Actions suivies */
.filtres { display: flex; gap: 6px; overflow-x: auto; max-width: 720px; padding-bottom: 2px; }
.filtre { flex: none; border: 1px solid var(--filet); background: var(--bulle-lui); color: var(--texte-2); border-radius: 16px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.filtre.actif { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
#bloc-actions .bloc-lignes { max-width: 720px; width: 100%; }
#bloc-actions button.ligne { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
#bloc-actions .ligne .puce { margin-left: auto; }
.progression-statuts { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin: 4px 16px 8px; }
.progression-statuts span { height: 5px; border-radius: 3px; background: var(--fond-2); }
.progression-statuts span.faite { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.progression-statuts span.en-cours { background: var(--accent); }
.campagne { display: grid; gap: 4px; margin: 4px 16px 8px; padding: 10px 12px; border-radius: 12px; background: var(--fond-2); }
.historique { list-style: none; margin: 4px 16px 8px; padding: 0; display: grid; gap: 10px; }
.historique li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.historique .pastille { margin-top: 5px; }
.mode-histo { font-weight: 600; }
.mode-histo.vert { color: #2e8540; } .mode-histo.orange { color: var(--attention); } .mode-histo.bleu { color: var(--accent); }
/* « Votre patrimoine aujourd'hui » */
.aujourdhui { display: grid; gap: 10px; max-width: 720px; width: 100%; padding: 14px; border-radius: 16px; background: var(--bulle-lui); box-shadow: 0 1px 1px rgba(0, 0, 0, .08); box-sizing: border-box; }
.aujourdhui-titre { font-size: 17px; font-weight: 600; }
.stats-jour { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stat-jour { display: grid; gap: 2px; justify-items: start; padding: 8px 10px; border-radius: 12px; border: 0; background: var(--fond-2); color: var(--texte); font: inherit; text-align: left; }
.stat-jour strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat-jour span { font-size: 12px; color: var(--texte-2); line-height: 1.2; }
.decisions-jour { display: grid; gap: 6px; }
.decision-jour { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--attention) 40%, var(--filet)); background: color-mix(in srgb, var(--attention) 6%, var(--fond)); color: var(--texte); font: inherit; text-align: left; cursor: pointer; }
.decision-jour .texte-doc { display: grid; flex: 1; min-width: 0; }
@media (max-width: 760px) { .stats-jour { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Membres d'un groupe : retirer, quitter */
.ligne-membre { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.ligne-membre > .personne { flex: 1; min-width: 0; }
.retirer { flex: none; border: 1px solid var(--filet); background: transparent; color: #d93025; border-radius: 14px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.retirer:hover { border-color: #d93025; background: rgba(217, 48, 37, .06); }
.retirer.reactiver { color: var(--accent); }
.retirer.reactiver:hover { border-color: var(--accent); background: transparent; }
.bouton-danger { background: #d93025 !important; }
.bouton-danger-texte { color: #d93025 !important; }
.icone-tuile.ton-gris { background: #8a8a86; }

/* Messages vocaux */
.vocal { display: grid; gap: 2px; margin: 2px 0; }
.vocal audio { width: min(260px, 62vw); height: 40px; }
.duree-vocal { font-size: 12px; color: var(--texte-2); }
.micro svg { width: 22px; height: 22px; }
.saisie.enregistre .ligne-saisie { display: none; }
.barre-vocal { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.annuler-vocal { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--filet); background: var(--fond); color: #d93025; font-size: 16px; cursor: pointer; }
.point-rec { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #d93025; animation: clignote 1s ease-in-out infinite; }
@keyframes clignote { 50% { opacity: .25; } }
.temps-vocal { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.transcription-vocal { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.envoyer-vocal { flex: none; }
/* Supprimer un message */
.bulle { position: relative; }
.menu-bulle { position: absolute; top: 2px; right: 4px; border: 0; background: transparent; color: var(--texte-2); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 8px; cursor: pointer; opacity: 0; transition: opacity 120ms ease-out; }
.bulle:hover .menu-bulle { opacity: .8; }
.menu-bulle:hover { background: var(--fond-2); }
@media (hover: none) { .menu-bulle { display: none; } }
.bulle.supprime { opacity: .65; }
.bulle.supprime em { color: var(--texte-2); font-size: 14px; }
.texte-bulle { white-space: pre-wrap; }

/* Les blocs d'une vue ne s'ecrasent jamais (filtres coupes en haut des Actions suivies) */
.fil > * { flex-shrink: 0; }
.filtres { padding: 2px 0 4px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtre { white-space: nowrap; line-height: 1.2; }
/* Sur les listes de fiches : le titre passe sur deux lignes au lieu d'etre coupe */
#bloc-actions .ligne .nom, #bloc-immeubles .ligne .nom, #bloc-operations .ligne .nom { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#bloc-actions .ligne .puce, #bloc-immeubles .ligne .puce, #bloc-operations .ligne .puce { white-space: normal; text-align: center; max-width: 42%; line-height: 1.25; }
@media (max-width: 760px) {
  #bloc-actions .ligne { flex-wrap: wrap; row-gap: 6px; }
  #bloc-actions .ligne .texte-doc { flex-basis: calc(100% - 60px); }
  #bloc-actions .ligne .puce { margin-left: 22px; max-width: none; }
  #bloc-actions .ligne .chevron-ligne { position: absolute; right: 14px; }
  #bloc-actions .ligne { position: relative; padding-right: 30px; }
}

/* Reunion par la voix : plein ecran, comme un appel */
.reunion-ecran { position: fixed; inset: 0; z-index: 60; background: var(--fond); display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-sizing: border-box; animation: entree 160ms ease-out both; }
.reunion-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reunion-titre { display: grid; text-align: center; }
.reunion-chrono { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.reunion-ecran.en-pause .point-rec { animation: none; background: var(--texte-2); }
.reunion-ecran.arretee .point-rec { animation: none; background: var(--texte-2); }
.reunion-aide { margin: 0; }
.reunion-texte { flex: 1; min-height: 140px; resize: none; border: 1px solid var(--filet); border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; background: var(--fond-2); color: var(--texte); outline: none; }
.reunion-texte:focus { border-color: var(--accent); }
.reunion-provisoire { margin: 0; min-height: 1.4em; font-style: italic; }
.reunion-photos { display: flex; gap: 6px; overflow-x: auto; }
.reunion-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.reunion-bas { display: grid; gap: 8px; }
.reunion-etat { font-size: 13px; color: var(--texte-2); }
.cr-verifier { display: grid; gap: 4px; margin: 4px 16px 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--attention) 10%, var(--fond)); font-size: 14px; }
.cr-actions { display: grid; gap: 6px; padding: 0 16px; }
.cr-action { display: grid; grid-template-columns: auto minmax(70px, 1fr) minmax(120px, 2fr) auto; gap: 6px; align-items: center; }
.cr-action .champ { margin: 0; height: 38px; min-width: 0; }
@media (max-width: 760px) { .cr-action { grid-template-columns: auto 1fr; } .cr-action .champ:nth-of-type(2), .cr-action .champ:nth-of-type(3) { grid-column: 2; } }

/* ===== module esg */
/* Énergie et ESG : mini barres en CSS pur (12 mois ou 14 jours) */
.esg-tendance { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.esg-barres { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; width: 84px; flex: none; }
.esg-barres.esg-jours { width: 112px; }
.esg-barre { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.esg-barre.esg-hausse { background: var(--attention, #e8710a); }
.esg-barre.esg-anormal { background: #d93025; }
.esg-barre.esg-vide { background: var(--filet); }
.esg-fiche { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) { .esg-barres { width: 60px; } .esg-barres.esg-jours { width: 96px; } }

/* ===== module compliance */
/* Contrôles et réserves (Nivo Compliance) : uniquement des classes prefixees compliance- */
.compliance-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .compliance-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.barre.compliance-critique > span { background: #d93025; }
.compliance-campagne { margin: 4px 0 8px; }
.compliance-campagne > .barre { height: 10px; border-radius: 5px; }
.compliance-campagne > .barre > span { border-radius: 5px; }
.compliance-risques { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
@media (max-width: 760px) { .compliance-risques { grid-template-columns: 1fr; } }
.compliance-fiche { display: grid; gap: 8px; }

/* ===== module equipements */
/* Équipements et PPA */
.equipements-ppa { display: grid; gap: 8px; }
.equipements-annee { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.equipements-annee .barre { width: 72px; }
.equipements-couts { display: grid; gap: 2px; }
.equipements-criteres { display: grid; gap: 6px; width: 100%; }
.equipements-critere { display: grid; grid-template-columns: 1fr 72px; align-items: center; gap: 8px; font-size: 13px; }
@media (max-width: 760px) { .equipements-annee .barre { width: 48px; } }

/* ===== module contrats */
/* Contrats de maintenance */
.contrats-kpi { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.contrats-kpi .barre { width: 72px; }
@media (max-width: 760px) { .contrats-kpi .barre { width: 48px; } }

/* ===== module autocontroles */
/* Grilles d'autocontrôle */
.autocontroles-grille { display: grid; gap: 10px; margin: 12px 16px 0; }
.autocontroles-point { display: grid; grid-template-columns: 1fr 130px; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--fond-2); }
.autocontroles-point .nom { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.autocontroles-point .autocontroles-texte { grid-column: 1 / -1; }
.autocontroles-choix, .autocontroles-texte { height: 38px; border: 1px solid var(--filet); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--fond); color: inherit; min-width: 0; }
#feuille-contenu > .autocontroles-texte { width: calc(100% - 32px); margin: 8px 16px 0; }
@media (max-width: 760px) { .autocontroles-point { grid-template-columns: 1fr; } }

/* ===== module demandes */
/* Demandes des locataires : l’écran réutilise les classes communes (filtres, bloc-lignes, puce, actions-immeuble). Aucune règle propre nécessaire. */

/* ===== module budgets */
/* Budgets et chantiers (Nivo Finance) : uniquement des classes prefixees budgets- */
.budgets-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .budgets-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.budgets-chaine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 10px; }
@media (max-width: 760px) { .budgets-chaine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.budgets-maillon { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--fond-2); }
.budgets-maillon strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.budgets-maillon.budgets-alerte strong { color: #d93025; }
.barre.budgets-barre-risque > span { background: #d93025; }
.budgets-total { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 14px; }
.budgets-immeuble { display: contents; }

/* ===== module commandes */
/* Commandes et pénalités (Nivo Finance) : uniquement des classes prefixees commandes- */
.commandes-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .commandes-chiffres { grid-template-columns: 1fr 1fr; } }
.commandes-controle { display: grid; gap: 4px; padding: 10px 12px; margin: 6px 0 10px; border-radius: 12px; background: var(--fond-2); border-left: 4px solid #1e8e3e; }
.commandes-controle.commandes-vigilance { border-left-color: #e37400; }
.commandes-controle.commandes-depassement { border-left-color: #d93025; }
.commandes-controle.commandes-depassement > strong:last-child { color: #d93025; }

/* ===== module honoraires */
/* Honoraires (Nivo Finance) : uniquement des classes prefixees honoraires- */
.honoraires-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .honoraires-chiffres { grid-template-columns: 1fr 1fr; } }

/* ===== module sinistres */
/* Sinistres (Nivo Projects) : uniquement des classes prefixees sinistres- */
.sinistres-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .sinistres-chiffres { grid-template-columns: 1fr 1fr; } }
.sinistres-etapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 4px 0 10px; }
.sinistres-etapes > span { height: 6px; border-radius: 3px; background: var(--filet); }
.sinistres-etapes > span.sinistres-faite { background: #1e8e3e; }
.sinistres-etapes > span.sinistres-en-cours { background: #1a73e8; }

.titre-plus { padding: 12px 16px 2px; }
.titre-plus:first-child { padding-top: 4px; }

/* Reglages de l'entreprise */
.reglages { display: grid; gap: 6px; padding: 0 16px; }
.reglage-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--filet); font-size: 14px; }
.segments { display: inline-flex; border: 1px solid var(--filet); border-radius: 10px; overflow: hidden; flex: none; }
.segment { border: 0; background: transparent; color: var(--texte-2); font: inherit; font-size: 12.5px; padding: 6px 9px; cursor: pointer; }
.segment + .segment { border-left: 1px solid var(--filet); }
.segment.actif { background: var(--accent); color: #fff; font-weight: 600; }
.segment:disabled { opacity: .35; cursor: not-allowed; }
.reglage-relances { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reglage-relances .champ { margin: 2px 0; width: 100%; box-sizing: border-box; }
.reglage-curseur { display: flex; align-items: center; gap: 8px; }
.reglage-deleg { display: flex; gap: 6px; }
.reglage-deleg .champ { margin: 0; height: 36px; }
.reglage-deleg input.champ { width: 110px; }

#code-2fa { letter-spacing: .2em; text-align: center; }
.cle-2fa { font-family: ui-monospace, monospace; letter-spacing: .08em; user-select: all; }

/* ===== module ged */
/* Classement et recherche documentaire : seules les règles propres à l'écran, le reste vient des classes communes.
   Les couleurs suivent les variables de l'application (--fond, --texte, --filet, --accent), donc le mode sombre aussi. */
.ged-barre { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.ged-recherche { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 10px; background: var(--fond); color: var(--texte); }
.ged-recherche:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ged-resultats { margin: 6px 0 14px; }
.ged-resultat { display: flex; flex-direction: column; }
.ged-extrait { margin: 2px 12px 10px 30px; font-size: 13px; line-height: 1.4; color: var(--texte-2, #6b7076); }
.ged-compris { margin: 4px 2px 8px; }
.ged-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.ged-formulaire { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.ged-champ { font: inherit; padding: 9px 10px; border: 1px solid var(--filet); border-radius: 8px; background: var(--fond); color: var(--texte); width: 100%; box-sizing: border-box; }
@media (max-width: 480px) { .ged-chiffres { grid-template-columns: 1fr 1fr; } .ged-extrait { margin-left: 12px; } }

/* ===== module reporting */
/* Reporting propriétaire : uniquement des classes prefixees reporting- */
.reporting-choix-ligne { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.reporting-choix, .reporting-mois { min-width: 0; }
.reporting-tete { display: flex; align-items: center; gap: 16px; padding: 14px; margin-bottom: 10px; }
.reporting-tete .texte-doc { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reporting-tete .puce { align-self: flex-start; }
.reporting-jauge { --reporting-ton: #1a73e8; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--reporting-ton) calc(var(--reporting-pct, 0) * 1%), var(--filet, #e3e3e3) 0); }
.reporting-jauge > span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--fond, #fff); font-weight: 700; font-size: 15px; }
.reporting-jauge.vert { --reporting-ton: #1e8e3e; }
.reporting-jauge.orange { --reporting-ton: #e37400; }
.reporting-jauge.rouge { --reporting-ton: #d93025; }
.reporting-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reporting-lignes { margin: 6px 0 10px; padding-left: 18px; }
.reporting-lignes li { margin: 3px 0; line-height: 1.4; }
.reporting-mini { width: 64px; flex: none; }
@media (max-width: 760px) {
  .reporting-choix-ligne { grid-template-columns: 1fr; }
  .reporting-chiffres { grid-template-columns: 1fr 1fr; }
  .reporting-jauge { width: 64px; height: 64px; }
  .reporting-jauge > span { width: 48px; height: 48px; font-size: 13px; }
}

.reglage-par-type { margin: 6px 16px 0; }
.reglage-par-type summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.reglage-par-type .reglages { padding: 0; }
.reglage-deleg .reglage-jours { width: 64px; }

/* ===== module portail */
/* Portail prestataire : écran d'import et liens (classes préfixées portail-) */
.portail-zone { margin: 8px 0; }
.portail-apercu { overflow-x: auto; margin: 6px 0 4px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; }
.portail-table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.portail-table th, .portail-table td { padding: 6px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.portail-table th { font-weight: 600; background: rgba(0, 0, 0, .03); }
.portail-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.portail-chiffre { border-radius: 12px; padding: 10px 12px; background: rgba(0, 0, 0, .03); display: flex; flex-direction: column; }
.portail-chiffre strong { font-size: 1.4rem; line-height: 1.1; }
.portail-chiffre span { font-size: .8rem; opacity: .75; }
.portail-chiffre.vert strong { color: #1e7a3c; }
.portail-chiffre.bleu strong { color: #1f4e79; }
.portail-chiffre.rouge strong { color: #b3261e; }
.portail-erreur { color: #b3261e; }

/* ===== module flux */
/* Nivo Flux : analyse d'un mail dans le lecteur (classes prefixees flux-) */
.flux-analyse { margin-top: 12px; }
.flux-puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.flux-champs dd { white-space: pre-line; }
.flux-vide { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.flux-note { margin: 6px 0 0; }
.flux-brouillon { border: 1px solid var(--filet); border-radius: 10px; padding: 10px 12px; background: var(--fond-2, transparent); }
.flux-corps { white-space: pre-wrap; font: inherit; margin: 8px 0; line-height: 1.45; }

/* ===== module visites */
/* Visites de site et états des lieux : uniquement des classes prefixees visites- */
.visites-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.visites-ecran { overflow-y: auto; }
.visites-liste { max-height: 34vh; overflow-y: auto; }
.visites-constat { display: grid; gap: 8px; padding: 8px 0; border-top: 1px solid var(--filet); }
.visites-dictee { min-height: 110px; }
.visites-lieu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
@media (max-width: 760px) { .visites-lieu { grid-template-columns: 1fr; } }
.visites-relecture { display: grid; gap: 6px; margin: 0 16px 12px; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 12px; }
.visites-garder { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 2px 16px; }
.visites-relecture .visites-garder { margin: 0; }
.visites-grille { display: grid; gap: 6px; }
.visites-element { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--fond-2); }
.visites-etats { display: flex; flex-wrap: wrap; gap: 6px; }
.visites-etat { border: 1px solid var(--filet); background: var(--fond); color: var(--texte); border-radius: 16px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; min-height: 36px; }
.visites-etat.actif { color: #fff; font-weight: 600; border-color: transparent; }
.visites-etat.actif.vert { background: #1e8e3e; }
.visites-etat.actif.orange { background: #e37400; }
.visites-etat.actif.rouge { background: #d93025; }
.visites-chantier { margin: 8px 0; }

/* ===== module disponibilite */
/* Disponibilité des équipements */
.disponibilite-arrets { display: grid; gap: 2px; }

/* ===== module rgpd */
/* Données personnelles (RGPD) */
.rgpd-recherche { display: flex; gap: 8px; align-items: center; }
.rgpd-recherche .champ { flex: 1; min-width: 0; }
.rgpd-resultat { display: grid; gap: 8px; }
.rgpd-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rgpd-confirmation { display: grid; gap: 8px; margin-top: 12px; }
.rgpd-danger { background: #b42318; border-color: #b42318; }
.rgpd-danger:disabled { opacity: .45; cursor: not-allowed; }
.rgpd-annees { width: 88px; }
@media (max-width: 760px) { .rgpd-recherche { flex-direction: column; align-items: stretch; } }

.reglage-type-controle { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--filet); }
.reglage-type-controle label { display: grid; gap: 2px; }
.carto { display: grid; gap: 6px; max-width: 720px; }
.carto-etage { background: var(--bulle-lui); border-radius: 12px; padding: 8px 12px; }
.carto-etage summary { cursor: pointer; font-weight: 600; }
.carto-zone { display: grid; gap: 4px; padding: 6px 0 0 10px; }
.carto-local { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 10px; font-size: 14px; }
.carto-eq { border: 0; cursor: pointer; }

/* Journal : deux dates cote a cote */
.journal-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Reunion : niveau du micro (on voit qu'on est entendu) et suivi de la transcription */
.reunion-statut { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reunion-niveau { width: 64px; height: 6px; border-radius: 3px; background: var(--filet); overflow: hidden; flex: none; }
.reunion-niveau-barre { display: block; height: 100%; width: 0; background: #2e9e5b; transition: width 80ms linear; }
.reunion-suivi { flex-basis: 100%; }

.journal-niveau { margin: 12px 4px 6px; text-transform: none; }

/* Marque blanche : « Client by NIVO » sous le logo */
.titre-marque { display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap; }
.signature-titre { font-size: 13px; font-weight: 500; color: var(--texte-2); letter-spacing: .01em; }

.premier-compte { display: grid; gap: 10px; }
.premier-compte input { width: 100%; }

/* Aucun texte long (apercu d'un message, nom) n'elargit la page : tout reste dans l'ecran */
html, body { max-width: 100%; overflow-x: hidden; }
.corps-discussion > *, .haut-discussion > * { min-width: 0; }
.haut-discussion strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Installation : une etape par carte, pastille verte quand c'est fait */
.installation-etape { margin: 8px 16px 12px; padding: 12px 14px; border: 1px solid var(--filet); border-radius: 12px; background: var(--fond); display: grid; gap: 8px; }
.installation-etape .detail-texte, .installation-etape .formulaire { margin: 0; padding: 0; }
.installation-titre { display: flex; align-items: center; gap: 8px; }
.installation-etape .bouton-plein, .installation-etape .bouton-second { margin: 0; width: 100%; }
.case-dossier .texte-doc strong { word-break: break-all; font-size: 13px; }
.chemin-dossier { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.immeuble-trouve { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.immeuble-trouve .journal-dates { grid-template-columns: 110px 1fr; }

/* Nivo au travail : ce qu'il fait, en direct */
.bulle.en-cours { display: flex; align-items: center; gap: 10px; color: var(--texte-2); font-style: italic; }
.bulle.en-cours .points { display: inline-flex; gap: 3px; }
.bulle.en-cours .points i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; animation: points-nivo 1.2s infinite ease-in-out; }
.bulle.en-cours .points i:nth-child(2) { animation-delay: .2s; }
.bulle.en-cours .points i:nth-child(3) { animation-delay: .4s; }
@keyframes points-nivo { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .bulle.en-cours .points i { animation: none; } }
