:root {
  /* Identité Swiss-Courtage Sàrl */
  --rouge: #cd3a3a;
  --rouge-fort: #a82c2c;
  --rouge-clair: #fbeded;
  --anthracite: #1f1f23;
  --anthracite-clair: #2b2b31;

  --fond: #f5f5f7;
  --carte: #ffffff;
  --bord: #e2e2e6;
  --texte: #1f1f23;
  --doux: #6c6c78;
  --accent: var(--rouge);
  --accent-clair: var(--rouge-clair);
  --accent-fort: var(--rouge-fort);
  --lateral: var(--anthracite);
  --ok: #1d7a4c;
  --alerte: var(--rouge-fort);
  --avert: #9a6b00;
  --neutre: #c4c4cc;
  --ombre: 0 1px 2px rgba(31, 31, 35, .06), 0 4px 14px rgba(31, 31, 35, .07);
  --r: 8px;
}

/*
 * Theme sombre. Il s'applique dans deux cas :
 *   - le poste est regle en sombre ET l'utilisateur n'a pas impose « clair » ;
 *   - l'utilisateur a explicitement choisi « sombre ».
 * Le choix est memorise dans le navigateur, poste par poste.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --fond: #141417;
    --carte: #1c1c20;
    --bord: #303038;
    --texte: #ececf0;
    --doux: #9a9aa6;
    --accent: #ef6a6a;
    --accent-clair: #331f20;
    --accent-fort: #f58a8a;
    --lateral: #16161a;
    --ok: #4cc38a;
    --alerte: #ef8080;
    --avert: #e3b341;
    --neutre: #4a4a55;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="sombre"] {
  --fond: #141417;
  --carte: #1c1c20;
  --bord: #303038;
  --texte: #ececf0;
  --doux: #9a9aa6;
  --accent: #ef6a6a;
  --accent-clair: #331f20;
  --accent-fort: #f58a8a;
  --lateral: #16161a;
  --ok: #4cc38a;
  --alerte: #ef8080;
  --avert: #e3b341;
  --neutre: #4a4a55;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}

/* Choix du thème, dans le pied de la barre latérale. */
.pied .themes { display: flex; gap: 4px; margin: 8px 0 6px; }
.pied .themes button {
  flex: 1; padding: 5px 0; font-size: 11px; background: transparent;
  border: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .65);
}
.pied .themes button:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.pied .themes button.actif {
  background: rgba(255, 255, 255, .14); color: #fff;
  border-color: rgba(255, 255, 255, .45);
}

/* Mode discret : dans le train, l'écran se lit par-dessus l'épaule. Tout ce
   qui est de l'argent est flouté ; le survol le révèle, le temps de le lire.
   Le flou n'est pas une sécurité — c'est une politesse envers le voisin. */
.pied .discret-bascule { margin-top: 6px; }
.pied .discret-bascule.actif {
  background: rgba(255, 255, 255, .16); color: #fff;
  border-color: rgba(255, 255, 255, .45);
}
/*
 * TOUT CE QUI EST DE L'ARGENT, ET RIEN D'AUTRE.
 *
 * Cette liste s'allonge a chaque ecran neuf, et c'est normal : un montant qui
 * n'y figure pas reste lisible par-dessus l'epaule alors que le bouton
 * annonce le contraire. Un masquage qui laisse passer est pire que pas de
 * masquage — on se croit protege.
 *
 * Un controle de livraison ouvre les ecrans en mode discret et cherche tout
 * texte qui ressemble a un montant sans etre floute.
 */
:root[data-discret] .argent,
:root[data-discret] .montant-masquable,
:root[data-discret] .tuile .valeur,
:root[data-discret] .tuile .detail,
:root[data-discret] .camembert-total,
:root[data-discret] .camembert-part .valeur,
:root[data-discret] .barres .montant,
:root[data-discret] .colonnes .nb,
:root[data-discret] .pagination span {
  /*
   * Six pixels de flou suffisaient sur du texte de treize pixels, pas sur un
   * chiffre de vingt-huit : les grands nombres du tableau de bord restaient
   * parfaitement lisibles par-dessus l'epaule, alors que le bouton annoncait
   * le contraire. Un masquage qui laisse passer est pire que pas de masquage.
   *
   * Le flou doit donc suivre la taille du texte, pas rester fixe.
   */
  filter: blur(10px);
  transition: filter .12s;
  cursor: help;
}
/* les grands chiffres : ceux qu'on lit de loin, donc ceux qu'il faut le plus
   brouiller */
:root[data-discret] .tuile .valeur,
:root[data-discret] .camembert-total { filter: blur(16px); }
/* et les moyens */
:root[data-discret] .camembert-part .valeur,
:root[data-discret] .barres .montant,
:root[data-discret] .colonnes .nb { filter: blur(12px); }
:root[data-discret] .argent:hover,
:root[data-discret] .montant-masquable:hover,
:root[data-discret] .tuile .valeur:hover,
:root[data-discret] .tuile .detail:hover,
:root[data-discret] .camembert-total:hover,
:root[data-discret] .camembert-part .valeur:hover,
:root[data-discret] .barres .montant:hover,
:root[data-discret] .colonnes .nb:hover,
:root[data-discret] .pagination span:hover,
:root[data-discret] .tuile .valeur:hover,
:root[data-discret] .camembert-total:hover { filter: none; }
@media print {
  /* à l'impression on ne floute rien : le papier n'est pas dans le train */
  :root[data-discret] .argent,
  :root[data-discret] .montant-masquable,
  :root[data-discret] .tuile .valeur,
  :root[data-discret] .tuile .detail,
  :root[data-discret] .camembert-total,
  :root[data-discret] .camembert-part .valeur,
  :root[data-discret] .barres .montant,
  :root[data-discret] .colonnes .nb,
  :root[data-discret] .pagination span { filter: none; }
}

/* Copie d'essai : un bandeau et une teinte differente, pour qu'on ne s'y
   trompe pas une seule seconde. */
.bandeau-essai {
  position: sticky; top: 0; z-index: 60;
  background: repeating-linear-gradient(45deg, #9a6b00, #9a6b00 12px,
    #7d5700 12px, #7d5700 24px);
  color: #fff; padding: 7px 18px; font-size: 13px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.bandeau-essai strong { letter-spacing: .6px; white-space: nowrap; }
.bandeau-essai span { opacity: .92; }
body.essai .lateral { background: #2c2410; }
body.essai .entete { border-bottom-color: #9a6b00; }

/* Barre de progression : la base tourne sur le serveur, certaines opérations
   prennent plusieurs secondes. Sans elle, l'écran semble figé. */
.chargement {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.chargement.actif { opacity: 1; }
.chargement .trait {
  height: 100%; width: 40%; background: var(--accent);
  animation: glisse 1.1s ease-in-out infinite;
}
@keyframes glisse {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ------------------------------------------------------------ connexion */

.connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.connexion .boite {
  width: min(420px, 100%);
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 12px;
  box-shadow: var(--ombre);
  padding: 32px;
}

.connexion h1 { margin: 0 0 4px; font-size: 21px; }
.connexion .sous { color: var(--doux); margin: 0 0 24px; font-size: 13px; }

/* ------------------------------------------------------------ structure */

.appli { display: flex; min-height: 100vh; }

.lateral {
  width: 232px;
  flex: 0 0 232px;
  background: var(--lateral);
  color: #d9d9de;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.lateral .marque {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.lateral .marque strong { display: block; font-size: 15px; color: #fff; letter-spacing: .2px; }
.lateral .marque span { font-size: 11px; opacity: .7; }

/* ------------------------------------------------------------------ logo */

/* Le vrai logo, en image : plus de couleurs a piloter, il porte les siennes.
   Elles conviennent aux deux fonds — le gris-bleu des lettres se lit sur le
   blanc des cartes comme sur l'anthracite du menu. */
.logo-sc { display: block; height: auto; max-width: 100%; }

.connexion .logo-sc { margin: 0 auto 20px; }

.lateral nav { padding: 10px 8px; overflow-y: auto; flex: 1; }

.lateral nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lateral nav button:hover { background: rgba(255, 255, 255, .09); }
.lateral nav button.actif { background: rgba(255, 255, 255, .17); color: #fff; font-weight: 600; }
.lateral nav button .ic { width: 18px; text-align: center; opacity: .9; }

.lateral .pied {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
}
.lateral .pied .qui { color: #fff; font-weight: 600; }
.lateral .pied .role { opacity: .7; }
.lateral .pied button {
  margin-top: 8px; width: 100%; padding: 6px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .25); background: transparent;
  color: #d9d9de; cursor: pointer; font: inherit; font-size: 12px;
}
.lateral .pied button:hover { background: rgba(255, 255, 255, .1); }

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

.entete {
  background: var(--carte);
  border-bottom: 1px solid var(--bord);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.entete h1 { font-size: 17px; margin: 0; flex-shrink: 0; }
.entete .fil { color: var(--doux); font-size: 13px; }

.recherche-globale { margin-left: auto; position: relative; width: min(360px, 40vw); }
.recherche-globale input { width: 100%; }
.resultats-globaux {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0;
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r);
  box-shadow: var(--ombre); max-height: 420px; overflow: auto; z-index: 40;
}
.resultats-globaux .titre {
  padding: 7px 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--doux); background: var(--fond);
}
.resultats-globaux button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 12px; cursor: pointer; font: inherit; color: inherit;
  border-bottom: 1px solid var(--bord);
}
.resultats-globaux button:hover { background: var(--accent-clair); }
.resultats-globaux small { color: var(--doux); display: block; }

.contenu { padding: 22px; flex: 1; }

/* ------------------------------------------------------------ composants */

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--r);
  box-shadow: var(--ombre);
  margin-bottom: 18px;
}
.carte > header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--bord);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.carte > header h2 { margin: 0; font-size: 14px; letter-spacing: .2px; }
.carte > .corps { padding: 16px; }

.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/*
 * La grille d'un tableau de bord, faite pour du 16:9.
 *
 * C'est le format de tous les ecrans du bureau — 1920x1080, 1366x768. En deux
 * colonnes seulement, un 1920 laisse des cartes larges d'un metre et vides au
 * milieu, et il faut defiler pour voir le bas. Trois a quatre colonnes
 * remplissent la largeur, et l'essentiel tient dans la hauteur d'ecran.
 *
 * `auto-fit` fait le reste : quatre colonnes sur un grand ecran, deux sur un
 * portable, une sur une fenetre etroite — sans que rien ne soit ecrit en dur.
 */
.grille.tableau-bord {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

/*
 * Une carte de tableau de bord ne monte pas au-dela de ce qui se lit.
 *
 * Une liste de quarante lignes dans une carte fait descendre toute la rangee
 * suivante : on defile pour retrouver ce qui devait sauter aux yeux. La carte
 * garde donc sa hauteur, et c'est SON contenu qui defile.
 */
.grille.tableau-bord > .carte > .corps,
.grille.tableau-bord > .carte > .tableau-defilant {
  max-height: 340px;
  overflow: auto;
}

/*
 * Un élément de grille ou de flexbox vaut par défaut `min-width: auto` : il
 * refuse de devenir plus étroit que son contenu. Un tableau large le fait donc
 * grandir au-delà de l'écran, et le conteneur défilant qui l'entoure n'a jamais
 * l'occasion de défiler. Cette ligne est ce qui permet à la mise en page de
 * s'adapter au lieu de déborder.
 */
.appli > *, main.principal > *, .grille > *, .champs > *,
.carte > header > *, .barre > *, .filtres > * { min-width: 0; }

/* une liste déroulante se dimensionne sur son option la plus longue :
   sans cette limite, un nom de société à rallonge élargit tout l'écran */
select { max-width: 100%; }

.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r);
  padding: 16px; box-shadow: var(--ombre); }
.tuile .valeur { display: block; font-size: 26px; font-weight: 600;
  letter-spacing: -.5px; }
/* Les trois lignes sont des <span> : sans `block`, le libelle et la valeur se
   suivraient sur la meme ligne — « A CORRIGER16 496 ». */
.tuile .libelle { display: block; color: var(--doux); font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.tuile .detail { display: block; color: var(--doux); font-size: 12px;
  margin-top: 4px; }
.tuile.ok .valeur { color: var(--ok); }
.tuile.err .valeur { color: var(--alerte); }

/* Pastille d'etat : resultat d'une ligne importee, mention « annule »… */
.etiquette { display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--fond); color: var(--doux);
  border: 1px solid var(--bord); white-space: nowrap; }
.etiquette.ok { background: rgba(29, 122, 76, .12); color: var(--ok); }
.etiquette.err { background: rgba(180, 65, 31, .12); color: var(--alerte); }

/* Ligne ou texte de second plan : deja traite, sans action a entreprendre. */
.discret, td.discret { color: var(--doux); }
tr.discret td { color: var(--doux); background: var(--fond); }

button, .bouton {
  font: inherit; padding: 7px 13px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte);
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primaire {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500;
}
button.primaire:hover { background: var(--accent-fort); border-color: var(--accent-fort); color: #fff; }
button.danger { color: var(--alerte); border-color: var(--bord); }
button.danger:hover { border-color: var(--alerte); background: rgba(180, 65, 31, .08); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.lien { border: 0; background: none; color: var(--accent); padding: 2px 4px; }

input, select, textarea {
  font: inherit; padding: 7px 9px; border: 1px solid var(--bord);
  border-radius: 6px; background: var(--carte); color: var(--texte); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-clair); border-color: var(--accent);
}
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox] { width: auto; }

label.champ { display: block; margin-bottom: 12px; }
label.champ > .nom { display: block; font-size: 12px; color: var(--doux); margin-bottom: 4px; }
label.champ > .nom .req { color: var(--alerte); }
label.champ .aide { font-size: 11px; color: var(--doux); margin-top: 3px; display: block; }
label.champ.case { display: flex; align-items: center; gap: 8px; }
label.champ.case > .nom { margin: 0; color: var(--texte); font-size: 13px; }

/* Adresses mail et sites web : une ligne suffit, inutile d'occuper la place
   d'un champ de saisie libre. */
input.etroit { max-width: 260px; }

/* Résumé d'une ligne de décompte : ce qu'il faut savoir en une ligne. */
.resume-ligne {
  margin: 10px 0; padding: 8px 12px; background: var(--fond);
  border-radius: var(--r); font-size: 13px;
}
.resume-ligne strong { font-size: 15px; }

/* Détail d'une ligne d'import : le message peut être long et porter un
   bouton. Il passe à la ligne au lieu d'être tronqué. */
.donnees td.detail-import {
  white-space: normal; max-width: none;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Aperçu du fichier importé : replié par défaut, on l'ouvre pour vérifier
   quelle colonne est laquelle. */
.apercu-fichier { margin-top: 14px; }
.apercu-fichier > summary {
  cursor: pointer; font-size: 12px; color: var(--doux); padding: 6px 0;
}
.apercu-fichier > summary:hover { color: var(--texte); }
.apercu-fichier .donnees { font-size: 11px; }
.apercu-fichier .donnees td { white-space: nowrap; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; }

/* Recherche d'un client par écrit : une liste déroulante de mille noms ne se
   parcourt pas, on tape ce qu'on cherche. */
.champ-client { position: relative; display: block; }
.resultats-client {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 50; background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--r); box-shadow: var(--ombre);
  max-height: 300px; overflow: auto;
}
.resultats-client.ouvert { display: block; }
.resultats-client button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 12px; cursor: pointer; font: inherit; color: inherit;
  border-bottom: 1px solid var(--bord);
}
.resultats-client button:last-child { border-bottom: 0; }
.resultats-client button:hover { background: var(--fond); }
.resultats-client button strong { display: block; font-weight: 600; font-size: 13px; }
.resultats-client button small { color: var(--doux); font-size: 11px; }
.resultats-client .vide { padding: 10px 12px; color: var(--doux); font-size: 12px; }

/* Maquettes de saisie : ce qu'on attend d'un champ, et ce qui est une faute.
   L'erreur est en rouge et empêche d'enregistrer ; l'avis est un simple
   renseignement — un code postal étranger n'est pas une faute. */
.champ-maquette { display: block; }
label.champ .message-champ { min-height: 14px; }
label.champ .message-champ.err { color: var(--alerte); }
label.champ .message-champ.avis { color: var(--avert); }
input.champ-faux { border-color: var(--alerte); }
input.champ-faux:focus { outline-color: var(--alerte); }

fieldset.groupe {
  border: 1px solid var(--bord); border-radius: var(--r); padding: 14px 16px 2px;
  margin: 0 0 16px;
}
fieldset.groupe > legend {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--accent); padding: 0 6px;
}
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.champs .large { grid-column: 1 / -1; }

table.donnees { width: 100%; border-collapse: collapse; font-size: 13px; }
table.donnees th, table.donnees td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--bord);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
table.donnees th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--doux); background: var(--fond); position: sticky; top: 0; cursor: pointer;
}
table.donnees th:hover { color: var(--accent); }
table.donnees tbody tr:hover { background: var(--accent-clair); }
table.donnees tbody tr.selectionnable { cursor: pointer; }
table.donnees td.num, table.donnees th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau-defilant { overflow: auto; max-height: 62vh; }

.pagination { display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-top: 1px solid var(--bord); font-size: 13px; color: var(--doux); }
.pagination .espace { margin-left: auto; }

/*
 * LA BARRE D'ONGLETS RESTE EN HAUT QUAND ON FAIT DEFILER.
 *
 * C'etait le geste le plus penible de la journee : on ouvre le Portefeuille,
 * on descend dans les lignes, et pour passer aux Sinistres il fallait remonter
 * jusqu'en haut de la page — en repassant devant l'en-tete et la famille, cinq
 * cents pixels a franchir deux fois.
 *
 * `top: 0` et non une valeur calculee : rien d'autre n'est fixe en haut de
 * cette application. Le fond opaque est indispensable — sans lui, le contenu
 * defile en transparence derriere les onglets et plus rien ne se lit.
 */
.onglets { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--bord);
  padding: 0 12px; background: var(--carte); border-radius: var(--r) var(--r) 0 0;
  position: sticky; top: 0; z-index: 30; }
/* l'ombre n'apparait que lorsque la barre s'est detachee du haut de sa carte :
   elle dit « il y a quelque chose au-dessus », et rien le reste du temps */
.onglets.detachee { box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .35); }
.onglets button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  padding: 10px 12px; color: var(--doux); font-size: 13px;
}
.onglets button.actif { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.onglets button .compte {
  display: inline-block; margin-left: 5px; font-size: 11px; background: var(--fond);
  border: 1px solid var(--bord); border-radius: 9px; padding: 0 6px;
}

/* --------------------------------------------------------------------------
   Une page d'administration et son sommaire

   L'administration tenait sur seize onglets, dont huit parlaient des memes
   personnes. Elle tient maintenant sur quatre pages, chacune faite de
   sections qui s'enchainent. Le sommaire reste colle a gauche et se marque
   au defilement : on sait toujours ce que contient la page et ou l'on en est,
   ce qu'une rangee d'onglets ne dit jamais.
   -------------------------------------------------------------------------- */
.page-sections { display: grid; grid-template-columns: 208px minmax(0, 1fr);
  gap: 24px; align-items: start; margin-top: 14px; }
.sommaire-admin { position: sticky; top: 52px; display: flex; flex-direction: column;
  gap: 1px; padding: 4px 0; }
.sommaire-admin button {
  text-align: left; border: 0; border-left: 2px solid var(--bord); border-radius: 0;
  background: none; padding: 7px 12px; color: var(--doux); font-size: 13px;
  line-height: 1.35;
}
.sommaire-admin button:hover { color: var(--encre); background: var(--carte); }
.sommaire-admin button.actif {
  color: var(--accent); border-left-color: var(--accent); font-weight: 600;
}
.bloc-admin + .bloc-admin { margin-top: 28px; }

/* sous 1100 px le sommaire passe au-dessus, en rangee : une colonne de 208 px
   prise sur une fenetre etroite laisserait les tableaux illisibles */
@media (max-width: 1100px) {
  .page-sections { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sommaire-admin { position: static; flex-direction: row; flex-wrap: wrap;
    border-bottom: 1px solid var(--bord); padding-bottom: 2px; }
  .sommaire-admin button { border-left: 0; border-bottom: 2px solid transparent;
    padding: 7px 10px; }
  .sommaire-admin button.actif { border-left: 0; border-bottom-color: var(--accent); }
}

/* --------------------------------------------------------------------------
   L'inventaire d'un depart

   Deux colonnes : ce qui part, et combien. Les coller l'un a l'autre donnait
   « Dossier RH1 » — un nombre qui se lit comme la fin du mot.
   -------------------------------------------------------------------------- */
.liste-depart { list-style: none; margin: 6px 0 14px; padding: 0;
  border: 1px solid var(--bord); border-radius: 5px; overflow: hidden; }
.liste-depart li { display: flex; align-items: baseline; gap: 12px;
  padding: 6px 12px; font-size: 13px; }
.liste-depart li:nth-child(even) { background: var(--fond); }
.liste-depart li .compte { margin-left: auto; font-variant-numeric: tabular-nums;
  color: var(--doux); }
/* un zero ne merite pas l'attention qu'un nombre attire */
.liste-depart li .compte:empty::after { content: "0"; }

/* --------------------------------------------------------------------------
   Les campagnes de l'année

   C'était une pile de lignes séparées par un filet, toutes de la même
   couleur : on lisait quatorze fenêtres pour trouver les deux qui concernent
   aujourd'hui. Or c'est la seule chose qu'on vient chercher ici.

   Les ouvertes passent en tête, sur fond clair et bordure accentuée ; les
   autres restent en dessous, discrètes, avec leurs dates. Le reste de la
   page ne change pas : ce n'est pas un thème, c'est une hiérarchie.
   -------------------------------------------------------------------------- */
.grille-campagnes {
  display: grid; gap: 12px; margin: 14px 0 4px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.campagne {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; border: 1px solid var(--bord); border-radius: 6px;
  background: var(--fond);
}
.campagne header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0; border: 0; background: none; }
.campagne h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.campagne .point {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--bord);
}
.campagne .quand { font-size: 11px; color: var(--doux); white-space: nowrap; }
.campagne .pourquoi { margin: 0; font-size: 12.5px; color: var(--doux); flex: 1; }
.campagne button { align-self: flex-start; }

/* celle qu'on peut envoyer aujourd'hui */
.campagne.ouverte { background: var(--carte); border-color: var(--accent); }
.campagne.ouverte .point { background: var(--ok); }
.campagne.ouverte h3 { color: var(--encre); }

.titre-rang {
  margin: 22px 0 0; font-size: 12px; font-weight: 600; color: var(--doux);
  text-transform: uppercase; letter-spacing: 1.2px;
}

/* ==========================================================================
   LA SEANCE DE RENDEZ-VOUS

   Pensee pour une tablette posee entre le conseiller et le client. Trois
   regles, et elles expliquent toutes les tailles qui suivent :

   1. UN DOIGT N'EST PAS UNE SOURIS. Les champs font 46 points de haut et
      l'ecriture 16 : en dessous, on se trompe de case et l'on passe le
      rendez-vous a corriger.
   2. L'ECRAN PREND TOUT. Une fiche client derriere, avec ses onglets,
      invite a cliquer ailleurs au milieu d'une phrase.
   3. CE QUI COMPTE EST EN HAUT. Le temps ecoule et « Terminer » ne se
      cherchent pas : un rendez-vous qui s'etire finit sans signature.
   ========================================================================== */
.sans-defilement { overflow: hidden; }

.seance-fond {
  position: fixed; inset: 0; z-index: 120;
  background: var(--fond); display: flex;
}
.seance { display: flex; flex-direction: column; width: 100%; height: 100%; }

.seance-tete {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--carte);
  border-bottom: 1px solid var(--bord);
}
.seance-tete strong { font-size: 17px; display: block; }
.seance-tete .aide { font-size: 12px; }
.seance-tete button { min-height: 42px; padding: 0 18px; font-size: 14px; }
.seance-minuteur {
  font: 600 15px/1 ui-monospace, Menlo, monospace; color: var(--accent);
  padding: 8px 12px; border: 1px solid var(--bord); border-radius: 5px;
}
.seance-etat { font-size: 12px; color: var(--doux); }

/* les trois etapes, dans l'ordre du rendez-vous */
.seance-etapes {
  display: flex; gap: 2px; padding: 0 12px; background: var(--carte);
  border-bottom: 1px solid var(--bord); overflow-x: auto;
}
.seance-etapes button {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 12px 18px; border: 0; border-bottom: 3px solid transparent;
  background: none; color: var(--doux); text-align: left;
}
.seance-etapes .num {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; border: 1px solid var(--bord);
  font: 600 13px/1 "Open Sans", Arial, sans-serif;
}
.seance-etapes .txt strong { display: block; font-size: 14px; }
.seance-etapes .txt small { display: block; font-size: 11px; opacity: .8; }
.seance-etapes button.actif { color: var(--encre); border-bottom-color: var(--accent); }
.seance-etapes button.actif .num {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/*
 * SUR UN iPAD TENU DEBOUT, LES QUATRE ETAPES DOIVENT TENIR.
 *
 * La barre defile horizontalement — mais personne ne pense a faire glisser
 * une barre d'onglets, et « La signature » restait hors de l'ecran : on
 * croyait l'etape disparue. La ligne d'aide s'efface donc sous 900 px, et
 * les quatre tiennent en largeur.
 */
@media (max-width: 900px) {
  .seance-etapes button { padding: 10px 12px; gap: 7px; }
  .seance-etapes .txt small { display: none; }
  .seance-etapes .txt strong { font-size: 13px; }
}

.seance-corps { flex: 1; overflow: auto; padding: 20px; }
.seance-section {
  max-width: 1100px; margin: 0 auto 20px; padding: 18px 20px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 6px;
}
.seance-section h3 { margin: 0 0 4px; font-size: 16px; }
.seance-section > .aide { margin: 0 0 14px; display: block; }

.seance-champs { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .seance-champs { grid-template-columns: 1fr 1fr; } }

.seance-champ { display: flex; flex-direction: column; gap: 5px; }
.seance-champ.decale { padding-left: 22px; }
.seance-champ > .nom { font-size: 13.5px; color: var(--encre); line-height: 1.35; }
.seance-champ .q {
  display: inline-block; margin-right: 7px; padding: 1px 7px;
  background: var(--accent); color: #fff; border-radius: 3px; font-size: 11px;
}
/* 46 points : la hauteur sous laquelle un doigt se trompe de case */
.seance-champ input, .seance-champ textarea, .seance-champ select {
  min-height: 46px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--bord); border-radius: 5px;
  background: var(--fond); color: var(--encre); width: 100%;
}
.seance-champ textarea { min-height: 86px; line-height: 1.5; }
.seance-champ .echeance {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--doux);
}
.seance-champ .echeance input { min-height: 36px; max-width: 110px; font-size: 14px; }
/* la note sous une assurance : plus discrete que la couverture, mais la */
.seance-champ textarea.note-couverture {
  min-height: 56px; resize: vertical; font-size: 15px; line-height: 1.45;
  background: var(--fond-doux, var(--fond)); border-style: dashed;
}
.seance-champ textarea.note-couverture:focus { border-style: solid; }
/* le courriel d'apres rendez-vous */
.courriel-suite .champs { grid-template-columns: 1fr; }
.courriel-suite textarea { min-height: 180px; line-height: 1.5; }
.courriel-suite .pieces-jointes li { padding: 3px 0; }
.courriel-suite > .champ { margin-bottom: 8px; }
.etapes-courriel { margin: 8px 0 12px 18px; padding: 0; line-height: 1.9; }
.etapes-courriel button { margin-left: 4px; }
/* relue : la note sous la valeur, en plus petit */
.note-relue {
  display: block; margin-top: 3px; font-size: 12.5px; color: var(--doux);
  white-space: pre-wrap; font-style: italic;
}

/* les raccourcis vers le dossier, en haut des outils */
.seance-raccourcis {
  max-width: 1100px; margin: 0 auto 16px; display: flex; gap: 10px; flex-wrap: wrap;
}
.seance-raccourcis button { min-height: 46px; padding: 0 18px; font-size: 14px; }
.seance-outils { max-width: 1400px; margin: 0 auto; }

/* l'avancement, dans l'onglet « L'entretien » : combien de cases remplies */
.seance-avancement { font-variant-numeric: tabular-nums; }
/* le serveur n'a pas repondu : ce n'est pas perdu, ce n'est pas parti */
.seance-etat.hors-ligne { color: var(--avert); font-weight: 600; }

/* ce qui manque au socle, en tete de l'entretien */
.seance-manque { border-left: 3px solid var(--avert); }
.seance-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* rouvrir un rendez-vous depuis son rapport de visite */
.rdv-relu-tete { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px; }
.rdv-relu-grille { display: grid; gap: 14px; }
@media (min-width: 900px) { .rdv-relu-grille { grid-template-columns: 1fr 1fr; } }
.rdv-relu-section h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1.1px; color: var(--doux); }
.rdv-relu-section h4 .aide { text-transform: none; letter-spacing: 0; }
.rdv-relu-section ul { list-style: none; margin: 0; padding: 0; }
.rdv-relu-section li { display: flex; gap: 12px; padding: 4px 0;
  border-bottom: 1px solid var(--bord); font-size: 13px; }
.rdv-relu-section .quoi { color: var(--doux); flex: 1; }
.rdv-relu-section .quoi-valeur { font-weight: 600; text-align: right;
  max-width: 58%; }
.rdv-relu-vides .quoi-valeur { font-weight: 400; color: var(--doux);
  font-style: italic; }

/* la relecture avant signature */
.seance-relecture { display: grid; gap: 16px; }
@media (min-width: 900px) { .seance-relecture { grid-template-columns: 1fr 1fr; } }
.seance-relecture h4 {
  margin: 0 0 6px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--doux);
}
.seance-relecture ul { list-style: none; margin: 0; padding: 0; }
.seance-relecture li {
  display: flex; gap: 12px; padding: 5px 0;
  border-bottom: 1px solid var(--bord); font-size: 13.5px;
}
.seance-relecture .quoi { color: var(--doux); flex: 1; }
.seance-relecture .quoi-valeur { font-weight: 600; text-align: right; }

/* le trace : fond blanc, toujours — on signe sur du papier, pas sur du noir */
.seance-toile {
  display: block; width: 100%; max-width: 900px; height: 200px;
  margin: 10px 0; background: #fff;
  border: 1px dashed var(--bord); border-radius: 6px;
  touch-action: none; cursor: crosshair;
}

/* l'entree de l'onglet : le bouton qui ouvre tout cela */
.carte-rdv-depart { border-left: 3px solid var(--accent); }
button.grand { min-height: 48px; padding: 0 22px; font-size: 15px; }

.etiq { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
  border: 1px solid var(--bord); }
.etiq.ok { color: var(--ok); border-color: currentColor; }
.etiq.non { color: var(--alerte); border-color: currentColor; }
.etiq.att { color: var(--avert); border-color: currentColor; }

.vide { padding: 34px; text-align: center; color: var(--doux); }
/* un message peut tenir en plusieurs paragraphes : ils doivent se voir */
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px;
  white-space: pre-line; }
.msg.err { background: rgba(180, 65, 31, .1); color: var(--alerte); border: 1px solid currentColor; }
.msg.ok { background: rgba(29, 122, 76, .1); color: var(--ok); border: 1px solid currentColor; }
/* « att » existait pour les etiquettes, pas pour les messages : un avertissement
   sortait donc sans couleur, et ne se distinguait plus du texte courant. */
.msg.att { background: rgba(176, 122, 0, .1); color: var(--avert); border: 1px solid currentColor; }
.msg.info { background: var(--accent-clair); color: var(--accent); border: 1px solid var(--bord); }

.barre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.barre .espace { margin-left: auto; }

.doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--bord); border-radius: 6px; margin-bottom: 6px; font-size: 13px; }
.doc .chemin { color: var(--doux); font-size: 11px; word-break: break-all; }
.doc .grand { flex: 1; min-width: 0; }

/* ------------------------------------------------ le portefeuille en cartes */

.portefeuille .pf-bascule { padding: 12px 16px 0; }
.bascule-vue { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--bord);
  border-radius: 8px; background: var(--carte); }
.bascule-vue button { border: 0; padding: 5px 12px; font-size: 13px; border-radius: 6px;
  background: none; color: var(--doux); }
.bascule-vue button.actif { background: var(--accent-clair); color: var(--accent-fort);
  font-weight: 600; }
.pf-resume { padding: 12px 16px 0; }
.pf-resume .tuile .valeur { font-size: 22px; }
.tuile.att .valeur { color: var(--avert); }
.pf-liste { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }

/* une carte : chez qui et quoi | jusqu'a quand | combien | gestes, puis les pastilles */
.contrat {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, .9fr) auto;
  gap: 10px 22px; align-items: start; padding: 14px 16px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r);
  box-shadow: var(--ombre); cursor: pointer; transition: border-color .15s;
}
.contrat:hover, .contrat:focus-visible { border-color: var(--accent); outline: none; }
.contrat.eteint { background: var(--fond); box-shadow: none; }
.contrat.eteint .compagnie, .contrat.eteint .prime { color: var(--doux); }
.contrat .compagnie { font-size: 15px; font-weight: 600; }
.contrat .produit { margin-top: 2px; }
.contrat .description { margin-top: 2px; color: var(--doux); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrat .mini { color: var(--doux); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; }
.contrat .police { font-variant-numeric: tabular-nums; }
.contrat .combien { text-align: right; }
.contrat .prime { font-size: 19px; font-weight: 600; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums; }
.contrat .gestes { display: flex; gap: 2px; align-items: center; }
.contrat .etats, .contrat-entete .etats {
  grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding-top: 10px; border-top: 1px solid var(--bord);
}
.pieces { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
button.piece { padding: 3px 10px; font-size: 12px; border-radius: 999px; background: var(--fond); }
button.piece.seule { border-style: dashed; }
button.piece.manque { border-style: dashed; color: var(--accent); background: var(--carte); }

/* la meme lecture, en tete de la fenetre d'un contrat */
.contrat-entete { display: grid; gap: 12px; padding: 14px 16px; margin-bottom: 14px;
  border: 1px solid var(--bord); border-radius: var(--r); background: var(--fond); }
.contrat-entete .compagnie { font-size: 17px; font-weight: 600; }
.contrat-entete .produit { color: var(--doux); margin-top: 2px; }
.chiffres-contrat { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px; }

@media (max-width: 900px) {
  .contrat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .contrat .combien { text-align: left; }
  .contrat .gestes { grid-column: 1 / -1; }
}

.barres { display: grid; gap: 7px; }
.barres .ligne { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto;
  gap: 10px; align-items: center; font-size: 13px; }
.barres .piste { background: var(--fond); border-radius: 4px; height: 16px; overflow: hidden;
  border: 1px solid var(--bord); }
.barres .remplissage { height: 100%; background: var(--accent); }
.barres .montant { font-variant-numeric: tabular-nums; color: var(--doux); }

/* AU-DESSUS DE TOUT, Y COMPRIS DU RENDEZ-VOUS.
   L'ecran plein du rendez-vous est a 120 : une fenetre ouverte depuis la
   seance — le recapitulatif de cloture, un PV — s'ouvrait DERRIERE lui.
   On cliquait, et il ne se passait rien. */
.modale-fond { position: fixed; inset: 0; background: rgba(12, 20, 32, .55);
  display: grid; place-items: center; padding: 20px; z-index: 140; }
.modale { background: var(--carte); border-radius: 10px; box-shadow: var(--ombre);
  width: min(980px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--bord); }
.modale > header { padding: 14px 18px; border-bottom: 1px solid var(--bord);
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--carte); }
.modale > header h2 { margin: 0; font-size: 15px; }
.modale > .corps { padding: 18px; }
.modale > footer { padding: 12px 18px; border-top: 1px solid var(--bord);
  display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0;
  background: var(--carte); }

/* Le masque d'entretien : beaucoup de cases, remplies pendant qu'on parle.
   Une ligne par question, le libelle a gauche, la saisie a droite — l'oeil
   descend une seule colonne au lieu de balayer un formulaire en damier. */
.masque { display: grid; gap: 16px; }
.masque > section { border: 1px solid var(--bord); border-radius: 8px; }
.masque > section > h3 { margin: 0; padding: 9px 14px; font-size: 13px;
  border-bottom: 1px solid var(--bord); background: var(--fond);
  border-radius: 8px 8px 0 0; display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap; }
.masque > section > h3 small { font-weight: 400; color: var(--doux); font-size: 11px; }
.masque .lignes { padding: 2px 14px 10px; }
.masque .l { display: grid; grid-template-columns: minmax(150px, 270px) 1fr;
  gap: 2px 14px; align-items: start; padding: 6px 0;
  border-bottom: 1px solid var(--bord); }
.masque .l:last-child { border-bottom: 0; }
.masque .l > .et { font-size: 12.5px; padding-top: 6px; line-height: 1.35; }
.masque .l > .et .num { color: var(--accent); font-weight: 600; margin-right: 5px; }
.masque .l.decale > .et { padding-left: 20px; color: var(--doux); }
.masque .l .saisie { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.masque .l .saisie input[type="text"], .masque .l .saisie textarea { flex: 1;
  min-width: 190px; }
.masque .l .saisie textarea { min-height: 56px; }
.masque .l .ech { display: flex; align-items: center; gap: 5px; font-size: 11.5px;
  color: var(--doux); white-space: nowrap; }
.masque .l .dou { grid-column: 2; font-size: 11px; color: var(--doux);
  padding-bottom: 2px; }
/* une couverture sans rien en face n'est pas un oubli : c'est le sujet suivant */
.masque .l.aborder > .et { color: var(--avert); font-weight: 600; }
.masque .autres { font-size: 12px; color: var(--doux); padding: 8px 14px 12px; }
.masque .autres div { padding: 2px 0; }

/* L'onglet publicite : une ligne par sujet, qu'on ouvre d'un clic.
   La pile d'argumentaires deplies etait juste, mais illisible — on ne lit pas
   quatre textes complets pour decider lequel envoyer. */
.ligne-accroche { display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-accroche:last-child { border-bottom: 0; }
.ligne-accroche:hover { background: var(--accent-clair); }
.ligne-accroche.pale { opacity: .62; }
.ligne-accroche .etiq { flex-shrink: 0; }
.ligne-accroche button { flex-shrink: 0; }

/* L'encadre destine au bas d'une note de prime : on le montre tel qu'il sera
   imprime, pour qu'on juge de sa longueur avant de le coller. */
.encadre-note { border: 1px dashed var(--bord); border-radius: 6px;
  padding: 14px 16px; background: var(--fond); font-size: 13px;
  line-height: 1.55; }

.etiquettes-planche { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.etiquettes-planche .et { border: 1px dashed var(--bord); border-radius: 4px; padding: 12px;
  min-height: 96px; font-size: 13px; }

.menu-access { display: grid; gap: 8px; }
.menu-access .bloc { border: 1px solid var(--bord); border-radius: var(--r); overflow: hidden; }
.menu-access .bloc > h3 { margin: 0; padding: 10px 14px; font-size: 13px;
  background: var(--fond); border-bottom: 1px solid var(--bord); }
.menu-access .bloc button { display: block; width: 100%; text-align: left; border: 0;
  border-radius: 0; border-bottom: 1px solid var(--bord); background: none; padding: 9px 14px; }
.menu-access .bloc button:last-child { border-bottom: 0; }

@media print {
  .lateral, .entete, .pagination, .barre, .onglets, button { display: none !important; }
  .contenu, .carte, body { padding: 0; margin: 0; background: #fff; box-shadow: none; border: 0; }
  .tableau-defilant { max-height: none; overflow: visible; }
  /* le bloc du logo est rouge : sans cela, le navigateur l'imprime en gris */
  .logo-sc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.donnees th { position: static; }
  table.donnees th, table.donnees td { white-space: normal; }
  .imprimable { display: block !important; }
}

.imprimable { display: none; }

/* --------------------------------------------------------- conformité FINMA */

.voyants { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.voyant {
  border: 1px solid var(--bord); border-left-width: 4px; border-radius: var(--r);
  padding: 12px 14px; background: var(--carte);
}
.voyant.conforme { border-left-color: var(--ok); }
.voyant.attention { border-left-color: var(--avert); }
.voyant.manquant { border-left-color: var(--rouge); }
.voyant .tete { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.voyant .etat { margin-left: auto; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; }
.voyant.conforme .etat { color: var(--ok); }
.voyant.attention .etat { color: var(--avert); }
.voyant.manquant .etat { color: var(--rouge); }
.voyant p { margin: 6px 0 0; font-size: 12px; color: var(--doux); }
.voyant .ref { display: block; margin-top: 4px; font-size: 11px; color: var(--doux);
  font-style: italic; }

.document-legal {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r);
  padding: 30px 34px; max-width: 820px; line-height: 1.6;
}
.document-legal h3 { margin: 0 0 4px; font-size: 16px; }
.document-legal h4 { margin: 20px 0 4px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--rouge); }
.document-legal p { margin: 0 0 8px; font-size: 13px; }
.document-legal .entete-doc { display: flex; align-items: flex-start; gap: 20px;
  border-bottom: 2px solid var(--rouge); padding-bottom: 14px; margin-bottom: 18px; }
.document-legal dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 2px 14px; margin: 0 0 8px; font-size: 13px; }
.document-legal dt { color: var(--doux); }
.document-legal dd { margin: 0; }
.document-legal .signature { margin-top: 34px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 30px; font-size: 12px; color: var(--doux); }
.document-legal .signature div { border-top: 1px solid var(--bord); padding-top: 6px; }

@media print {
  .document-legal { border: 0; padding: 0; max-width: none; }
}

@media (max-width: 860px) {
  .appli { flex-direction: column; }
  .lateral { width: 100%; flex: none; height: auto; position: static; }
  .lateral nav { display: flex; overflow-x: auto; }
  .lateral nav button { width: auto; white-space: nowrap; }
  .recherche-globale { width: 100%; margin-left: 0; }
  .entete { flex-wrap: wrap; }
}

/* ------------------------------------------------------------ fiche courtier */

.identifiants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.ident {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--bord); border-radius: var(--r);
  padding: 8px 10px; background: var(--fond);
}
.ident .etiquette {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--doux); flex: 0 1 auto; max-width: 46%;
}
.ident .valeur {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 600; margin-left: auto; text-align: right;
  overflow-wrap: anywhere;
}
.ident .valeur.absente { color: var(--doux); font-weight: 400; font-style: italic; }
.ident .valeur:not(.absente) { cursor: text; user-select: all; }
.ident .valeur::selection { background: var(--rouge); color: #fff; }
.ident .copier {
  flex: 0 0 auto; padding: 3px 9px; font-size: 11px; border-radius: 5px;
}
.ident .copier.ok { color: var(--ok); border-color: var(--ok); }

.acces {
  border: 1px solid var(--bord); border-left: 3px solid var(--rouge);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px;
}
.acces .tete {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  flex-wrap: wrap; font-size: 14px;
}
.acces .tete a { font-size: 12px; }

/* ------------------------------------------------- composition d'un rapport */

.ligne-compo {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap;
}
.ligne-compo > select,
.ligne-compo > input { flex: 1 1 150px; min-width: 120px; }
.ligne-compo .rang {
  flex: 0 0 22px; text-align: center; font-size: 11px; color: var(--doux);
  background: var(--fond); border: 1px solid var(--bord); border-radius: 4px;
}
.ligne-compo .demande {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--doux); white-space: nowrap;
}
.ligne-compo .demande input { width: auto; }
.note {
  margin: 8px 0 0; font-size: 12px; color: var(--doux);
  border-left: 3px solid var(--accent); padding-left: 10px;
}

/* --------------------------------------------------- client résilié, à faire */

table.donnees tbody tr.resilie { color: var(--doux); }
table.donnees tbody tr.resilie td { font-style: italic; }
table.donnees tbody tr.resilie:hover { background: var(--fond); }

.a-faire { display: grid; gap: 6px; }
.a-faire .item {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--bord); border-left-width: 3px; border-radius: 6px;
  background: var(--carte); text-align: left; width: 100%;
}
.a-faire .item:hover { background: var(--accent-clair); border-color: var(--bord); }
/* la ligne entière ouvre la fiche ; le « × » de retrait reste distinct */
.a-faire .item .ouvrir {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0; margin: 0;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.a-faire .item .retirer {
  border: 0; background: none; color: var(--doux); font-size: 17px; line-height: 1;
  padding: 0 4px; cursor: pointer; opacity: .45;
}
.a-faire .item .retirer:hover { opacity: 1; color: var(--alerte); background: none; }
.a-faire .item.retard { border-left-color: var(--rouge); }
.a-faire .item.proche { border-left-color: var(--avert); }
.a-faire .item.ouvert { border-left-color: var(--doux); }
.a-faire .item .quoi { font-weight: 600; font-size: 13px; }
.a-faire .item .qui { color: var(--doux); font-size: 12px; }
.a-faire .item .quand {
  margin-left: auto; font-size: 12px; color: var(--doux); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.a-faire .item.retard .quand { color: var(--rouge); font-weight: 600; }

/* zones de texte plus confortables */
textarea { min-height: 110px; line-height: 1.5; }
label.champ.large textarea { min-height: 150px; }

/* Champ « document » : le chemin, ce qu'on peut en faire, et son état. */
.champ-document { display: grid; gap: 5px; }
/* Un chemin s'ouvre, il ne se retape pas. */
/* Un bouton d'action secondaire : visible sans crier. */
button.action {
  background: var(--accent-clair); border-color: var(--accent);
  color: var(--accent-fort); font-weight: 600;
}
button.action:hover { background: var(--accent); color: #fff; }

button.chemin {
  display: block; width: 100%; text-align: left; padding: 6px 9px;
  font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
  background: var(--fond); border: 1px solid var(--bord); border-radius: 6px;
  color: var(--texte); cursor: pointer; word-break: break-all;
}
button.chemin:hover { border-color: var(--accent); color: var(--accent); }
.champ-document .actions-doc { display: flex; gap: 10px; flex-wrap: wrap; }
.champ-document .actions-doc button { padding: 0; font-size: 12px; }
.champ-document .etat-doc { font-size: 11px; color: var(--doux);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.champ-document .etat-doc .aide { margin: 0; }

/* suggestions de l'assistant : des phrases toutes faites, cliquables */
.exemples { display: flex; flex-wrap: wrap; gap: 6px; }
.exemples button {
  font-size: 12px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--bord); background: var(--fond); color: var(--doux);
}
.exemples button:hover { color: var(--accent); border-color: var(--accent); }

.msg.avert { background: rgba(154, 107, 0, .12); color: var(--avert);
  border: 1px solid currentColor; }

.filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.filtres select { max-width: 230px; flex: 0 1 auto; }

/* ----------------------------------------------- assistant de création */

.choix-type { display: grid; gap: 10px; }
.choix-type .type-client {
  display: flex; align-items: flex-start; gap: 14px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--bord); border-radius: var(--r);
  background: var(--carte); width: 100%; cursor: pointer;
}
.choix-type .type-client:hover {
  border-color: var(--accent); background: var(--accent-clair);
}
.choix-type .type-client .ic { font-size: 26px; line-height: 1; }
.choix-type .type-client strong { display: block; font-size: 15px; }
.choix-type .type-client small { color: var(--doux); font-size: 12px; }

/* ------------------------------------------------- en-tête d'impression */

.entete-impression .bandeau {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; border-bottom: 2px solid var(--rouge);
  padding-bottom: 12px; margin-bottom: 16px;
}
.entete-impression .coordonnees {
  text-align: right; font-size: 11px; line-height: 1.5; color: var(--doux);
}
.entete-impression .coordonnees strong {
  display: block; font-size: 13px; color: var(--texte);
}
.entete-impression .titre-doc { margin: 0; font-size: 17px; }
.entete-impression .sous-titre-doc {
  font-size: 11px; color: var(--doux); margin-bottom: 14px;
}

@media print {
  @page { margin: 14mm 12mm; }
  .entete-impression { display: block !important; }
  .entete-impression .bandeau { break-inside: avoid; }
  table.donnees { font-size: 10px; }
  table.donnees thead { display: table-header-group; }
  table.donnees tr { break-inside: avoid; }
  .tuile, .voyant, .carte { break-inside: avoid; }
}

/*
 * Un dossier fige : mandat resilie.
 *
 * On grise et l'on rend inerte tout le contenu de l'onglet, sauf le bandeau
 * qui dit pourquoi. `pointer-events` suffit a bloquer les clics ET la saisie
 * au clavier, puisqu'on ne peut plus atteindre les champs a la souris ; la
 * tabulation, elle, reste possible — le serveur refuse de toute facon.
 */
.fige > *:not(.bandeau-fige) {
  opacity: .5;
  pointer-events: none;
  user-select: none;
  filter: grayscale(1);
}
.bandeau-fige { margin-bottom: 10px; }

/*
 * Une barre d'onglets qui suit le defilement, dans une fenetre.
 *
 * Le formulaire d'un vehicule fait quarante champs : cocher une case tout en
 * bas faisait apparaitre un onglet tout en haut, hors de l'ecran. La barre
 * reste desormais visible.
 */
.modale .onglets.collant {
  position: sticky;
  /* sous l'en-tete de la fenetre, lui-meme collant : sinon elle passe dessous */
  top: 66px;
  z-index: 3;
  background: var(--carte);
  margin: -18px -18px 12px;
  padding: 8px 18px 0;
}

/*
 * Les intertitres du menu.
 *
 * Dix-sept entrees d'affilee obligent a tout relire pour en trouver une. Un
 * intertitre discret suffit a rendre la liste parcourable d'un coup d'oeil.
 */
nav .groupe-menu {
  padding: 14px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--doux);
  opacity: .75;
}
nav .groupe-menu:first-child { padding-top: 4px; }

/*
 * Un bouton qui ouvre une petite liste de gestes.
 *
 * C'est ce qui fait passer la barre d'une fiche client de huit boutons a
 * trois. Chaque entree porte sa phrase d'explication — dans une barre, cette
 * phrase n'avait nulle part ou tenir.
 */
.menu-deroulant { position: relative; display: inline-block; }
.menu-chevron { margin-left: 6px; opacity: .6; font-size: 10px; }
.menu-liste {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 250px;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 8px;
  box-shadow: var(--ombre);
  padding: 4px;
}
.menu-deroulant.ouvert .menu-liste { display: block; }
.menu-entree {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.menu-entree:hover { background: var(--fond); }
.menu-nom { display: block; font-size: 13px; }
.menu-aide {
  display: block;
  font-size: 11px;
  color: var(--doux);
  margin-top: 2px;
}

/*
 * Le bas de la barre laterale, replie.
 *
 * Onze boutons employes trois fois l'an occupaient la moitie de la hauteur,
 * en face du menu qui sert tous les jours.
 */
.pied-entete {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
  color: inherit;
}
.pied-entete:hover { color: var(--texte); }
.pied-entete .qui { font-weight: 600; }
.pied-chevron { margin-left: auto; opacity: .6; font-size: 11px; }
.pied-contenu { display: none; }
.pied.ouvert .pied-contenu { display: block; }
.pied-sortie { width: 100%; margin-top: 6px; }

/* ------------------------------------------------------- camemberts */

.camembert-bloc { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.camembert { width: 150px; height: 150px; flex: 0 0 auto; }
.camembert-total { font-size: 13px; font-weight: 700; fill: var(--texte); }
.camembert-unite { font-size: 8px; fill: var(--doux); }
.camembert-legende { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.camembert-part {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.camembert-part .pastille { width: 10px; height: 10px; border-radius: 3px; }
.camembert-part .nom {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.camembert-part .valeur { color: var(--doux); font-variant-numeric: tabular-nums; }
.camembert-part .pourcent {
  font-weight: 600; min-width: 38px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------- les echeances mois par mois */

.colonnes { display: flex; gap: 6px; align-items: flex-end; height: 130px; }
.colonnes .colonne {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; height: 100%;
}
.colonnes .nb { font-size: 11px; color: var(--doux); }
.colonnes .tige {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
}
.colonnes .haut {
  width: 100%; background: var(--accent); border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.colonnes .mois { font-size: 10px; color: var(--doux); }

/* « à faire » ne se cache jamais, et se voit : un liseré le distingue */
.carte-a-faire { border-left: 3px solid var(--accent); }
.carte.pleine { grid-column: 1 / -1; }

/* ============================================ durant le rendez-vous === */

/*
 * L'ecran est tourne vers le client : ce qu'on saisit reste petit a gauche,
 * ce qu'on montre prend toute la place a droite. En 16:9 — le format de
 * presque tous les ecrans du bureau — la colonne de saisie tient sur un tiers
 * et le dessin sur deux.
 */
.rdv-grille {
  display: grid; grid-template-columns: minmax(230px, 1fr) 2.1fr; gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .rdv-grille { grid-template-columns: 1fr; } }

.rdv-colonne-saisie {
  border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px;
  background: var(--fond2);
  /* les chiffres du client restent sous les yeux quand on fait defiler */
  position: sticky; top: 8px;
}
.rdv-colonne-saisie h4, .carte-interne h4 {
  margin: 0 0 10px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--doux);
}
.rdv-colonne-saisie .champ { margin-bottom: 9px; }
.rdv-colonne-saisie .champ .nom { font-size: 12px; }
.rdv-colonne-visuel { display: flex; flex-direction: column; gap: 14px; }

.carte-interne {
  border: 1px solid var(--bord); border-radius: 10px; padding: 14px;
  background: var(--fond2);
}

/* --- la barre des trois sujets --- */
/*
 * La barre des sujets du rendez-vous ne colle PAS : deux barres empilees en
 * haut de l'ecran mangeraient quatre-vingts pixels, et l'ecran du rendez-vous
 * est justement celui qu'on veut voir en entier.
 */
.onglets.rdv-sous { margin-bottom: 14px; position: static; box-shadow: none; }

/* --- les grands chiffres --- */
.rdv-chiffres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.rdv-chiffre {
  border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px;
  background: var(--fond2);
}
.rdv-chiffre-libelle {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--doux);
}
.rdv-chiffre-valeur {
  font-size: 30px; font-weight: 600; line-height: 1.15; margin-top: 4px;
  white-space: nowrap;
}
.rdv-chiffre-valeur .rdv-unite { font-size: 14px; font-weight: 400; color: var(--doux); }
.rdv-chiffre-detail { font-size: 12px; color: var(--doux); margin-top: 3px; }

/* --- les barres de couverture --- */
.rdv-barre-bloc { margin-bottom: 14px; }
.rdv-barre-bloc:last-child { margin-bottom: 0; }
.rdv-barre-tete {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 4px;
}
.rdv-barre-nom { font-weight: 600; font-size: 13px; }
.rdv-barre-chiffres { font-size: 12px; color: var(--doux); white-space: nowrap; }
.rdv-barre {
  display: flex; height: 26px; border-radius: 6px; overflow: hidden;
  background: var(--bord);
}
/*
 * Deux pixels de fond entre le couvert et le manque : sans ce trait, le vert
 * et le rouge se touchent et la frontiere se lit mal — c'est pourtant elle
 * qu'on vient montrer.
 */
.rdv-barre-couvert, .rdv-barre-manque {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; min-width: 0;
  transition: width .18s;
}
.rdv-barre-couvert { background: #1D7A4C; box-shadow: 2px 0 0 var(--fond2); }
.rdv-barre-manque { background: #B4411F; }
.rdv-barre-pied { font-size: 11.5px; color: var(--doux); margin-top: 4px; }

/* --- la courbe du 3a --- */
.rdv-courbe { width: 100%; height: auto; display: block; }

/* --- le financement empile --- */
.rdv-pile {
  display: flex; height: 32px; border-radius: 6px; overflow: hidden;
  background: var(--bord);
}
.rdv-pile-part {
  display: flex; align-items: center; justify-content: center; min-width: 0;
  font-size: 11px; font-weight: 600; color: #fff;
  box-shadow: 2px 0 0 var(--fond2);
}
.rdv-pile-part:last-child { box-shadow: none; }
.rdv-legende {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px;
  font-size: 12px; color: var(--doux);
}
.rdv-legende-item { display: inline-flex; align-items: center; gap: 6px; }
.rdv-legende-item i {
  width: 11px; height: 11px; border-radius: 3px; display: inline-block;
}

/* --- la jauge de charge --- */
.rdv-jauge-bloc { margin-bottom: 14px; }
.rdv-jauge {
  position: relative; height: 22px; border-radius: 6px;
  background: var(--bord); overflow: visible;
}
.rdv-jauge-remplie { height: 100%; border-radius: 6px 0 0 6px; transition: width .18s; }
/* le trait de la limite est dessine, pas seulement dit : c'est lui qui fait
   refuser les dossiers */
.rdv-jauge-limite {
  position: absolute; top: -5px; bottom: -5px; width: 2px;
  background: var(--texte);
}
.rdv-jauge-limite span {
  position: absolute; top: -16px; left: 4px; white-space: nowrap;
  font-size: 10px; color: var(--doux);
}
.rdv-jauge-pied { font-size: 12px; color: var(--doux); margin-top: 12px; }

/* --- les verdicts --- */
.rdv-verdicts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin-top: 12px;
}
.rdv-verdict {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px;
  border-radius: 8px; border: 1px solid;
}
.rdv-verdict.ok { border-color: var(--ok); background: rgba(29, 122, 76, .08); }
.rdv-verdict.non { border-color: var(--alerte); background: rgba(180, 65, 31, .08); }
.rdv-verdict-icone { font-weight: 700; font-size: 15px; line-height: 1.3; }
.rdv-verdict.ok .rdv-verdict-icone { color: var(--ok); }
.rdv-verdict.non .rdv-verdict-icone { color: var(--alerte); }
.rdv-verdict-titre { font-weight: 600; font-size: 12.5px; }
.rdv-verdict-detail { font-size: 11.5px; color: var(--doux); }

/*
 * Le mode discret floute les montants : ceux de cet onglet aussi. Un
 * conseiller qui montre un revenu dans un train est le cas meme pour lequel
 * ce mode existe.
 */
:root[data-discret] .rdv-chiffre-valeur,
:root[data-discret] .rdv-barre-chiffres,
:root[data-discret] .rdv-barre-couvert span,
:root[data-discret] .rdv-barre-manque span {
  filter: blur(12px); transition: filter .12s; cursor: help;
}
:root[data-discret] .rdv-chiffre-valeur:hover,
:root[data-discret] .rdv-barre-chiffres:hover,
:root[data-discret] .rdv-barre-couvert span:hover,
:root[data-discret] .rdv-barre-manque span:hover { filter: none; }

/* --- les trois piliers empilés --- */

/*
 * En bas l'AVS, au milieu la caisse de pension, en haut le 3e pilier — l'ordre
 * du systeme suisse. La HAUTEUR de chaque etage est proportionnelle a ce qu'il
 * rapporte : trois blocs de meme taille avec des chiffres dedans ne montreraient
 * rien, or ce qu'on vient montrer c'est que le premier pilier ne suffit pas.
 */
.pile-piliers { padding: 8px 0 4px; }
.pile-colonne {
  position: relative; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 3px; min-height: 320px;
  max-width: 460px; margin: 0 auto;
}
.pile-etage {
  border-radius: 6px; color: #fff; padding: 7px 12px; min-height: 26px;
  display: flex; flex-direction: column; justify-content: center;
  transition: height .2s;
}
.pile-etage.vide {
  background: transparent; border: 1px dashed var(--bord);
  color: var(--doux); height: 40px; align-items: center;
  justify-content: center; font-size: 12px;
}
/* un etage court porte son nom et son montant sur une seule ligne */
.pile-etage.court {
  flex-direction: row; align-items: baseline; gap: 8px;
  justify-content: space-between; padding: 4px 12px;
}
.pile-etage.court .pile-montant { font-size: 14px; }
/*
 * Le manque, hachure. Entre le sommet de la pile et le trait de l'objectif il
 * y avait du blanc, que l'oeil lit comme une marge et non comme un trou —
 * alors que c'est la seule chose que le client doit emporter.
 */
.pile-manque {
  border: 1px dashed var(--alerte); border-radius: 6px;
  background: repeating-linear-gradient(135deg,
    rgba(180, 65, 31, .10) 0 7px, transparent 7px 14px);
  display: flex; align-items: center; justify-content: center;
  color: var(--alerte); font-size: 12px; font-weight: 600;
}
.pile-nom { font-size: 12px; font-weight: 600; opacity: .95; }
.pile-montant { font-size: 17px; font-weight: 600; line-height: 1.25; }
.pile-part { font-size: 11px; opacity: .85; }
/* le trait de l'objectif : sans repere, une pile de blocs colores ne dit pas
   si elle est haute ou basse */
.pile-objectif {
  position: absolute; left: -6px; right: -6px; height: 0;
  border-top: 2px dashed var(--texte); pointer-events: none;
}
.pile-objectif span {
  position: absolute; right: 0; top: -16px; font-size: 11px;
  color: var(--texte); background: var(--fond2); padding: 0 5px;
  border-radius: 3px;
}
.pile-echelle {
  text-align: center; font-size: 12px; color: var(--doux); margin-top: 10px;
}
.pile-sources {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bord);
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; color: var(--doux);
}

/* --- les autres assurances --- */
.rdv-sous-titre {
  margin: 14px 0 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--accent); font-weight: 600;
}
.rdv-colonne-saisie .rdv-sous-titre:first-child { margin-top: 0; }

/* la démonstration de la règle proportionnelle : trois nombres côte à côte */
.menage-demo {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 12px;
}
.menage-demo > div {
  background: var(--fond2); border: 1px solid var(--bord);
  border-radius: 8px; padding: 8px 10px;
}
.menage-demo-lib {
  display: block; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .4px; color: var(--doux);
}
.menage-demo-val { display: block; font-size: 19px; font-weight: 600; }

/* la matrice des garanties : on suit une ligne du doigt */
table.garanties td, table.garanties th { vertical-align: top; }
.garantie-tete { text-align: center; white-space: nowrap; }
.garantie-case { text-align: center; font-weight: 700; font-size: 15px; }
.garantie-case.oui { color: var(--ok); }
.garantie-case.non { color: var(--bord); }
.garantie-note { font-size: 11px; color: var(--doux); margin-top: 2px; }
tr.garantie-clef { background: rgba(176, 122, 0, .07); }
.rdv-legende-actif { font-weight: 600; color: var(--texte); }

:root[data-discret] .pile-montant,
:root[data-discret] .menage-demo-val {
  filter: blur(12px); transition: filter .12s; cursor: help;
}
:root[data-discret] .pile-montant:hover,
:root[data-discret] .menage-demo-val:hover { filter: none; }

/* --- la barre des sujets : huit onglets ne tiennent pas sur une ligne étroite --- */
.onglets.rdv-sous { flex-wrap: wrap; row-gap: 2px; }

/* --- l'échelle de la responsabilité civile --- */

/*
 * Personne n'a d'idee de ce que coute un dommage cause a autrui : on pense au
 * vase casse chez le voisin. On met donc une echelle sous les yeux, du plus
 * petit au plus grand, et ce qui depasse la couverture passe en rouge.
 */
.rc-echelle { display: flex; flex-direction: column; gap: 13px; }
.rc-tete {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
}
.rc-nom { font-size: 13px; font-weight: 600; }
.rc-montant { font-size: 13px; color: var(--doux); white-space: nowrap; }
.rc-barre {
  height: 12px; border-radius: 6px; background: var(--bord);
  margin: 4px 0 3px; overflow: hidden;
}
.rc-barre-remplie { height: 100%; border-radius: 6px; transition: width .18s; }
.rc-detail { font-size: 11.5px; color: var(--doux); }
.rc-ligne.hors .rc-nom { color: var(--alerte); }

/* --- l'entreprise --- */
.poste-facultatif td { color: var(--doux); }

/*
 * Ce qui est en place, ce qui manque. La case cochee passe en vert, un manque
 * OBLIGATOIRE en rouge — un manque facultatif reste neutre : ce n'est pas un
 * defaut, c'est une conversation a avoir.
 */
.couverture {
  display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--bord); border-radius: 8px; margin-bottom: 7px;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.couverture:hover { background: var(--fond); }
.couverture input { margin-top: 2px; flex: none; }
.couverture.en-place { border-color: var(--ok); background: rgba(29, 122, 76, .07); }
.couverture.trou { border-color: var(--alerte); background: rgba(180, 65, 31, .07); }
.couverture-titre { font-size: 12.5px; font-weight: 600; }
.couverture-detail { font-size: 11.5px; color: var(--doux); margin-top: 2px; }

:root[data-discret] .rc-montant { filter: blur(12px); cursor: help; }
:root[data-discret] .rc-montant:hover { filter: none; }

/*
 * La pastille du menu « ⋯ Autres » : combien d'onglets non vides sont rangés
 * derrière. « Autres (9) » ne disait rien — neuf onglets vides et neuf pleins
 * portaient la même étiquette, et ce qui n'est pas découvert n'est jamais
 * remonté en tête par celui qui s'en servirait.
 */
.menu-deroulant .menu-pastille {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* --- la carte « Famille et entourage », repliable --- */
.famille .famille-tete { cursor: pointer; user-select: none; }
.famille .famille-tete:hover h2 { color: var(--accent); }
.famille-resume { color: var(--doux); font-size: 12.5px; }
.famille-bascule { font-size: 15px; line-height: 1; padding: 2px 6px; }
.famille-chevron { display: inline-block; }

/*
 * Ce qui part avec un compte, et ce qui reste.
 *
 * Desactiver quelqu'un ferme aussi sa fiche de conformite et son dossier RH.
 * La peur, en cliquant, est de perdre le portefeuille - alors les deux listes
 * se font face : ce qui se ferme, ce qui ne bouge pas.
 */
.cascade {
  border-left: 3px solid var(--alerte);
  background: color-mix(in srgb, var(--alerte) 6%, transparent);
  border-radius: 0 4px 4px 0;
  padding: 10px 14px;
  margin: 12px 0;
}
.cascade.garde {
  border-left-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 7%, transparent);
}
.cascade .titre {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--alerte);
}
.cascade.garde .titre { color: var(--ok); }
.cascade ul { margin: 0; padding-left: 18px; }
.cascade li { margin: 2px 0; }

/* l'interrupteur qui ramene les personnes sorties dans une liste */
.voir-sortis {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--doux); cursor: pointer;
  user-select: none;
}
.voir-sortis input { margin: 0; cursor: pointer; }

/* --------------------------------------------------------------------------
   Les identifiants d'un espace client, montres UNE SEULE FOIS.

   Ils s'affichaient dans un « div.champ », mais la regle qui met l'etiquette
   sur sa propre ligne vise « label.champ ». Le nom et la valeur se
   retrouvaient colles : « Identifiantgordon.1000287 ». Un mot de passe qu'on
   ne peut lire qu'une fois ne doit pas se dechiffrer a la loupe.

   D'ou un bloc a part, avec le bouton pour copier a cote de la valeur : le
   recopier a la main, c'est une chance sur deux de se tromper d'un caractere
   — et il n'y a pas de seconde chance.
   -------------------------------------------------------------------------- */
.secret { margin-top: 12px; }
.secret > .nom {
  display: block; font-size: 12px; color: var(--doux); margin-bottom: 5px;
}
.secret > .ligne { display: flex; align-items: stretch; gap: 8px; }
.secret code {
  flex: 1 1 auto; min-width: 0;
  padding: 9px 12px;
  background: var(--fond); border: 1px solid var(--bord); border-radius: var(--r);
  font-size: 15px; letter-spacing: .5px;
  /* un mot de passe long ne doit ni deborder ni etre coupe en silence */
  overflow-wrap: anywhere; user-select: all;
}
.secret code.grand { font-size: 17px; letter-spacing: 1px; font-weight: 600; }
.secret button {
  flex: 0 0 auto; min-width: 92px;
  border: 1px solid var(--bord); border-radius: var(--r);
  background: var(--carte); color: var(--texte);
  font-size: 13px; cursor: pointer;
}
.secret button:hover { border-color: var(--accent); color: var(--accent); }
.secret button.fait { border-color: var(--ok); color: var(--ok); }

/* l'acces existe deja : le bouton reste visible, mais ne fait plus rien */
button.deja {
  background: var(--fond); color: var(--doux);
  border: 1px solid var(--bord); cursor: default;
}
button.deja:hover { background: var(--fond); color: var(--doux); }
.recreer {
  margin-top: 8px; background: none; border: none; padding: 0;
  font-size: 12px; color: var(--doux); text-decoration: underline; cursor: pointer;
}
.recreer:hover { color: var(--alerte); }

/* Le rappel discret : ce que le navigateur execute n'est pas ce que le
   serveur sert. Un clic recharge. */
.version-vieille{
  display:block;margin-top:6px;padding:4px 8px;
  background:var(--avert);color:#fff;border:0;border-radius:var(--r);
  font-size:11px;cursor:pointer;text-align:left;width:100%;
}
.version-vieille:hover{filter:brightness(1.1)}

/* La pastille « espace client » de l'en-tête d'une fiche : la réponse d'un
   coup d'œil à une question qu'on se posait en ouvrant le menu « ⋯ ». */
.badge-espace{
  display:inline-block;padding:2px 9px;border-radius:999px;
  font-size:12px;font-weight:600;white-space:nowrap;
}
.badge-espace.oui{background:#e6f4ec;color:#14603a}
.badge-espace.non{background:#fbeded;color:#8c2018}
.badge-espace.inconnu{background:var(--fond);color:var(--doux);font-weight:400}

/* --------------------------------------------------------------------------
   Le panneau « Espace client » d'un client.

   Il presentait ses trois gestes — creer l'acces, cocher, envoyer — a la
   suite, separes par des paragraphes, sous un tableau de contrats qui
   remplissait l'ecran. On ouvrait la fenetre et l'on voyait le portefeuille,
   pas ce qu'il y avait a faire.

   D'ou trois etapes numerotees, chacune avec son etat, le tableau replie. Le
   filet qui relie les numeros n'est pas un ornement : il dit que l'ordre
   compte — sans acces, cocher ne publie rien.
   -------------------------------------------------------------------------- */
.ec { font-size: 13.5px; }
.ec > .msg { margin-bottom: 14px; }

.ec-etapes { list-style: none; margin: 0; padding: 0; }
.ec-etape { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }
.ec-etape:last-child { padding-bottom: 14px; }
.ec-etape:not(:last-child)::before {
  content: ''; position: absolute; left: 13px; top: 32px; bottom: 4px;
  width: 2px; background: var(--bord);
}
.ec-etape[data-etat="fait"]:not(:last-child)::before {
  background: var(--ok); opacity: .4;
}

.ec-num {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: var(--carte); color: var(--doux);
  border: 1.5px solid var(--bord);
}
/* `var(--carte)` et non `#fff` : en theme sombre, un blanc pose sur le vert
   clair du mode nuit ne se lirait plus. La carte suit le theme, le contraste
   tient des deux cotes. */
.ec-etape[data-etat="fait"] .ec-num {
  background: var(--ok); border-color: var(--ok); color: var(--carte);
}
.ec-etape[data-etat="a-faire"] .ec-num {
  border-color: var(--accent); color: var(--accent);
}

.ec-bloc { flex: 1 1 auto; min-width: 0; padding-top: 3px; }
.ec-titre {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 22px;
}
.ec-titre h3 { margin: 0; font-size: 14.5px; }
.ec-bloc > p, .ec-bloc > .msg, .ec-bloc > label, .ec-bloc > details,
.ec-bloc > .ec-actions, .ec-bloc > .ec-remise, .ec-bloc > .vide {
  margin-top: 10px;
}
.ec-ligne { margin: 0; color: var(--texte); max-width: 64ch; }
.ec-bloc .aide { margin: 6px 0 0; font-size: 12px; color: var(--doux);
  max-width: 64ch; }
.ec-sous-case { margin-top: 4px; padding-left: 26px; }

.ec-pastille {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid currentColor;
}
.ec-pastille.ok  { color: var(--ok);    background: rgba(29, 122, 76, .1); }
.ec-pastille.att { color: var(--avert); background: rgba(154, 107, 0, .12); }
.ec-pastille.non { color: var(--doux);  background: var(--fond); font-weight: 500; }

.ec-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ec-actions .recreer { margin-top: 0; }

.ec-resume {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0 0;
  font-size: 12.5px; color: var(--doux);
}
.ec-resume > span + span::before { content: '·'; margin-right: 10px; }

/* La remise des identifiants : le seul moment ou le mot de passe existe
   ailleurs que dans la tete de celui qui le lit. Le cadre vert dit « c'est
   fait » ; le reste dit « notez-le, il ne reviendra pas ». */
.ec-remise {
  border: 1px solid var(--ok); border-left-width: 3px;
  border-radius: var(--r); padding: 14px 16px;
  background: rgba(29, 122, 76, .05);
}
.ec-remise > .msg { margin-bottom: 10px; }
.ec-fort { margin: 0; font-weight: 600; }
.ec-remise-pied {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px;
}
.ec-remise-pied .aide { margin: 0; flex: 1 1 200px; }

.ec details > summary {
  cursor: pointer; font-size: 12.5px; color: var(--doux);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.ec details > summary::-webkit-details-marker { display: none; }
.ec details > summary::before { content: '\25B8'; font-size: 11px; opacity: .8; }
.ec details[open] > summary::before { content: '\25BE'; }
.ec details > summary:hover { color: var(--accent); }
.ec details > summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px;
}
.ec details > *:not(summary) { margin-top: 10px; }

.ec-pied {
  border-top: 1px solid var(--bord); padding-top: 12px;
}
.ec-pied p { margin: 0 0 6px; font-size: 12px; color: var(--doux);
  max-width: 72ch; }
.ec-pied p:last-child { margin-bottom: 0; }
.ec-pied code { font-size: 12px; }

/* Plusieurs actions sur une même ligne de tableau : elles doivent rester
   côte à côte, sans se coller ni passer à la ligne au premier rétrécissement. */
.actions-ligne{display:inline-flex;gap:10px;align-items:center;white-space:nowrap}

/* ================================================= l'accueil en un écran (V6.3) */

/*
 * « Ma journée » : les tâches d'abord, et tout tient dans un écran.
 *
 * Les postes du bureau sont en Full HD. L'ancien accueil s'etirait sur deux
 * ecrans : on defilait pour retrouver l'agenda, puis on remontait pour les
 * taches. Ici, trois colonnes remplissent la hauteur de la fenetre et chaque
 * bloc defile CHEZ LUI quand il deborde — la page, elle, ne bouge plus.
 *
 * En dessous de 1500 px de large ou de 760 de haut (un portable), la page
 * redevient une page qui defile : trois colonnes serrees y seraient
 * illisibles.
 */
.accueil { display: flex; flex-direction: column; gap: 14px; }
.accueil .carte { margin-bottom: 0; }
.a-droite { margin-left: auto; }

.journee { display: flex; flex-direction: column; gap: 10px; }
.journee-haut { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.journee-haut .espace { margin-left: auto; }
.journee .surtitre {
  margin: 0 0 2px; font-size: 12px; color: var(--doux);
  text-transform: uppercase; letter-spacing: .6px;
}
.journee .salut { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.journee .salut .chaud { color: var(--alerte); }

.filtres-taches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filtres-taches .separe { width: 1px; height: 20px; background: var(--bord); margin: 0 4px; }
.filtres-taches select { width: auto; padding: 4px 8px; font-size: 13px; }
.puce {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px;
  border-radius: 999px; font-size: 13px;
}
.puce b { font-weight: 600; font-variant-numeric: tabular-nums; }
.puce.actif, .puce.actif:hover {
  background: var(--texte); border-color: var(--texte); color: var(--carte);
}
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--doux); flex: none; }
.point.retard { background: var(--rouge); }
.point.jour { background: var(--avert); }
.point.semaine, .point.plus_tard { background: var(--neutre); }

.accueil-corps {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.accueil-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.accueil-barre { display: flex; align-items: center; gap: 8px; }
.accueil-barre h2 { margin: 0; font-size: 14px; letter-spacing: .2px; }
.accueil-barre .lien { display: inline-flex; align-items: center; gap: 5px; }
.tuiles-accueil > .corps { padding: 0; }
.accueil .tuile { padding: 12px 14px; }
.accueil .tuile .valeur { font-size: 21px; }

/* ------------------------------------------------------------ les tâches */

.accueil .carte-a-faire > header { flex-wrap: nowrap; }
.taches-liste { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.groupe-taches {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 2px 2px; border: 0; border-radius: 0; background: none;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--doux); text-align: left;
}
.groupe-taches:hover { color: var(--texte); }
.groupe-taches .n {
  color: var(--texte); font-weight: 600; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.groupe-taches .trait { flex: 1; height: 1px; background: var(--bord); }
.groupe-taches.retard { color: var(--alerte); }
.groupe-taches.jour { color: var(--avert); }

.tache {
  display: grid; grid-template-columns: minmax(0, 1fr) 84px auto;
  align-items: center; gap: 10px; padding: 7px 8px 7px 9px;
  border: 1px solid var(--bord); border-left: 3px solid var(--neutre);
  border-radius: 6px; background: var(--carte);
}
.tache:hover { background: var(--accent-clair); }
.tache.retard { border-left-color: var(--rouge); }
.tache.jour { border-left-color: var(--avert); }
.tache.relance, .tache.suivi, .tache.recontact { border-left-color: var(--doux); }
.tache .ouvrir {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  border: 0; background: none; padding: 0; text-align: left; color: inherit;
}
.tache .ouvrir:hover { color: inherit; }
.tache .ouvrir:hover .quoi { color: var(--accent); }
.genre {
  width: 30px; height: 30px; flex: none; border-radius: 6px;
  background: var(--fond); color: var(--doux);
  display: flex; align-items: center; justify-content: center;
}
.tache .texte { display: flex; flex-direction: column; min-width: 0; }
.tache .quoi, .tache .qui { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tache .quoi { font-weight: 600; font-size: 13px; }
.tache .qui { color: var(--doux); font-size: 12px; }
.tache .quand {
  font-size: 12px; color: var(--doux); text-align: right; line-height: 1.35;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tache .quand small { display: block; font-size: 11px; font-weight: 400; }
.tache.retard .quand { color: var(--alerte); font-weight: 600; }
.tache.jour .quand { color: var(--avert); font-weight: 600; }
.tache .gestes { display: flex; align-items: center; gap: 4px; }
.tache .petit {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap;
}
.tache .petit.seul { width: 28px; padding: 0; color: var(--doux); }
.tache .petit.seul:hover { color: var(--accent); }
.tache .petit.retirer { border-color: transparent; background: none; font-size: 17px; }
.tache .petit.retirer:hover { color: var(--alerte); }
.tache .place { width: 28px; }
.resume-groupe {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 12px; border: 1px dashed var(--bord);
  background: none; color: var(--doux); font-size: 12px; text-align: left;
}
.resume-groupe b { color: var(--texte); font-weight: 600; }
.resume-groupe .lien-txt { color: var(--accent); white-space: nowrap; }
.vide-etat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 34px 20px; text-align: center; color: var(--doux); font-size: 13px;
}
.vide-etat .rond {
  width: 44px; height: 44px; border-radius: 50%; margin-bottom: 6px;
  background: rgba(29, 122, 76, .12); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.vide-etat strong { color: var(--texte); font-size: 15px; }

/* ---------------------------------------------- la semaine, les rappels */

.agenda-semaine { display: flex; flex-direction: column; }
.jour-agenda {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--bord);
}
.jour-agenda:first-child { border-top: 0; padding-top: 0; }
.jour-nom {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--doux); line-height: 1.25;
}
.jour-nom b {
  display: block; font-size: 20px; letter-spacing: -.3px; color: var(--texte);
  font-weight: 600;
}
.jour-nom.auj, .jour-nom.auj b { color: var(--accent); }
.rdv { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rdv-ligne {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px;
  width: 100%; padding: 6px 10px; border: 0; border-radius: 6px;
  background: var(--fond); color: inherit; text-align: left;
}
.rdv-ligne:hover { background: var(--accent-clair); color: inherit; }
.rdv-ligne .h { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rdv-ligne .texte { min-width: 0; }
.rdv-ligne .client, .rdv-ligne .objet {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rdv-ligne .client { font-weight: 600; font-size: 13px; }
.rdv-ligne .objet { font-size: 12px; color: var(--doux); }

.rappels { display: flex; flex-direction: column; }
.rappel {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px; gap: 10px;
  align-items: center; width: 100%; padding: 9px 0; border: 0;
  border-top: 1px solid var(--bord); border-radius: 0; background: none;
  color: inherit; text-align: left;
}
.rappel:first-child { border-top: 0; padding-top: 0; }
.rappel:hover { color: inherit; border-color: var(--bord); }
.rappel:hover .titre { color: var(--accent); }
.rappel .texte { min-width: 0; }
.rappel .titre { display: block; font-weight: 600; font-size: 13px; }
.rappel .sous { display: block; font-size: 12px; color: var(--doux); }
.rappel .fleche { color: var(--doux); }

.raccourcis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.raccourci {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  font-size: 13px; text-align: left;
}
.raccourci .ic { color: var(--accent); flex: none; }

/* ---------------------------------------- le menu « reporter », les listes */

.menu-flottant {
  position: absolute; z-index: 60; width: 250px; padding: 6px;
  background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--r); box-shadow: var(--ombre);
}
.menu-flottant .opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 7px 10px; border: 0; border-radius: 5px;
  background: none; color: var(--texte); font-size: 13px; text-align: left;
}
.menu-flottant .opt:hover, .menu-flottant .opt:focus-visible {
  background: var(--accent-clair); color: var(--texte);
}
.menu-flottant .opt small { color: var(--doux); font-size: 12px; font-variant-numeric: tabular-nums; }
.menu-flottant .trait { height: 1px; background: var(--bord); margin: 4px 2px; }
.menu-flottant input[type=date] { width: auto; padding: 3px 6px; font-size: 12px; }

.liste-rappel {
  display: flex; flex-direction: column; max-height: 60vh; overflow: auto;
  border: 1px solid var(--bord); border-radius: 6px;
}
.ligne-rappel {
  display: flex; justify-content: space-between; gap: 12px; width: 100%;
  padding: 8px 12px; border: 0; border-bottom: 1px solid var(--bord);
  border-radius: 0; background: none; text-align: left;
}
.ligne-rappel:last-child { border-bottom: 0; }
.ligne-rappel .detail { color: var(--doux); font-size: 12px; white-space: nowrap; }

/* ---------------------------------------- le menu latéral, la recherche */

.lateral nav button .ic svg { display: block; margin: 0 auto; }
.lateral nav button .compte {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
  background: rgba(255, 255, 255, .12); color: #fff; font-variant-numeric: tabular-nums;
}
.recherche-globale input { padding-right: 28px; }
.recherche-globale .touche {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; line-height: 17px; padding: 0 5px; color: var(--doux);
  border: 1px solid var(--bord); border-radius: 4px; pointer-events: none;
}
.recherche-globale input:focus ~ .touche { display: none; }

/* ------------------------------------------------ selon la taille d'écran */

@media (max-width: 1499px) {
  .accueil-corps { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .accueil-portefeuille {
    grid-column: 1 / -1; display: grid; gap: 16px; align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  .accueil-portefeuille > .accueil-barre,
  .accueil-portefeuille > .tuiles-accueil { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .accueil-corps { grid-template-columns: minmax(0, 1fr); }
}

/* Full HD et plus : un écran, pas une ligne de plus. */
@media (min-width: 1500px) and (min-height: 760px) {
  .principal:has(> .contenu > .accueil) { height: 100vh; }
  .contenu:has(> .accueil) { display: flex; flex-direction: column; min-height: 0; }
  .accueil { flex: 1; min-height: 0; }
  .accueil-corps {
    flex: 1; min-height: 0; align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
  }
  .accueil-col { min-height: 0; overflow: auto; }
  .accueil .carte-a-faire { display: flex; flex-direction: column; min-height: 0; }
  .accueil .carte-a-faire > .taches-liste { flex: 1; min-height: 0; overflow: auto; }
  .accueil .carte-semaine {
    flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column;
  }
  .accueil .carte-semaine > .corps { flex: 1; min-height: 0; overflow: auto; }
}

/* ------------------------------------------------- le temps passé par client */

/*
 * La montre, en haut de la fiche.
 *
 * Elle doit se voir sans crier : c'est un outil qu'on presse, pas une alerte.
 * Au repos elle a le fond doux des autres bandeaux ; quand elle TOURNE, un
 * liseré vert la distingue — c'est le seul moment où l'on a besoin de la
 * repérer d'un coup d'œil depuis l'autre bout de l'écran, pour ne pas
 * l'oublier en partant.
 */
.temps-bloc {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 12px;
  border: 1px solid var(--bord); border-left: 3px solid var(--neutre);
  border-radius: var(--r); background: var(--fond);
}
.temps-bloc.tourne { border-left-color: var(--ok); background: var(--carte); }
.temps-bloc.oubli { border-left-color: var(--avert); }
.temps-titre {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--doux); font-weight: 600;
}
/* le compteur est un chiffre qu'on lit en bougeant : chasse fixe, sinon il
   tremble à chaque seconde qui change de largeur */
.temps-bloc .montre {
  font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600;
  letter-spacing: .01em; min-width: 86px;
}
.temps-bloc.tourne .montre { color: var(--ok); }
.temps-bloc.oubli .montre { color: var(--avert); }
.temps-gestes { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.temps-resume { font-size: 12.5px; }

/* le bilan de l'accueil */
.tuiles-temps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.tableau-temps { font-size: 13px; }
.tableau-temps tbody tr { cursor: pointer; }
.tableau-temps tbody tr:hover { background: var(--accent-clair); }
.tableau-temps .droite { text-align: right; font-variant-numeric: tabular-nums; }
.tableau-temps th.droite { text-align: right; }

@media (max-width: 700px) {
  .tuiles-temps { grid-template-columns: 1fr; }
}

/* ------------------------------------------ les adresses à valider */

/*
 * Deux colonnes, séparées par une flèche : « ce que dit la fiche » et « ce
 * qu'il demande ». Seules les lignes qui CHANGENT sont marquées ; les autres
 * restent là pour qu'on voie qu'elles ne bougent pas — une comparaison qui
 * n'affiche que les différences laisse croire qu'on a tout vu.
 */
.tableau-compare {
  margin: 16px 0; border: 1px solid var(--bord); border-radius: var(--r);
  overflow: hidden; background: var(--carte);
}
.comparee {
  display: grid; grid-template-columns: 96px 1fr 22px 1fr;
  gap: 10px; align-items: baseline; padding: 10px 14px;
  border-bottom: 1px solid var(--bord); font-size: 14px;
}
.comparee:last-child { border-bottom: 0; }
.comparee.entete {
  background: var(--fond); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--doux);
}
.comparee .nom { color: var(--doux); }
.comparee .avant { color: var(--doux); }
.comparee .fleche { color: var(--accent); text-align: center; font-weight: 600; }
.comparee .apres { color: var(--texte); }
.comparee.change { background: var(--accent-clair); }
.comparee.change .apres { font-weight: 600; color: var(--texte); }
.comparee.change .avant { text-decoration: line-through; }

@media (max-width: 620px) {
  .comparee { grid-template-columns: 1fr; gap: 2px; }
  .comparee .fleche { display: none; }
  .comparee.entete { display: none; }
  .comparee .nom { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
}

/* ce que le client a écrit, tel quel — pas reformaté, pas résumé */
.mot-du-client {
  margin: 16px 0 0; padding: 14px 18px;
  background: var(--fond); border-radius: var(--r);
  border-left: 3px solid var(--accent);
}
.mot-du-client > span {
  display: block; margin-bottom: 6px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--doux);
}
.mot-du-client p {
  margin: 0; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap;
}

/* ------------------------------------------- le suivi d'un sinistre */

/*
 * Une échelle, pas une liste à puces : on doit voir d'un coup d'œil combien
 * de marches sont derrière et laquelle vient. Le trait qui relie les
 * pastilles fait le reste — il dit « c'est un parcours ».
 */
.suivi-sinistre .echelle-suivi {
  list-style: none; margin: 0 0 22px; padding: 0; position: relative;
}
.suivi-sinistre .echelle-suivi li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 0 0 18px; position: relative;
}
.suivi-sinistre .echelle-suivi li::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 1px; background: var(--bord);
}
.suivi-sinistre .echelle-suivi li:last-child::before { display: none; }
.suivi-sinistre .pastille {
  flex: none; width: 27px; height: 27px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: var(--fond);
  border: 1px solid var(--bord); color: var(--doux); position: relative; z-index: 1;
}
.suivi-sinistre li.faite .pastille {
  background: var(--ok); border-color: var(--ok); color: #fff;
}
.suivi-sinistre li.prochaine .pastille {
  border-color: var(--accent); color: var(--accent); border-width: 2px;
}
.suivi-sinistre .texte { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.suivi-sinistre .texte b { display: block; font-size: 15px; color: var(--texte); }
.suivi-sinistre li:not(.faite):not(.prochaine) .texte b { color: var(--doux); }
.suivi-sinistre .quand {
  display: block; font-size: 12.5px; color: var(--doux);
  font-variant-numeric: tabular-nums;
}
.suivi-sinistre .mot {
  display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.6;
  color: var(--texte); padding-left: 10px; border-left: 2px solid var(--bord);
}
.suivi-sinistre .poser-etape {
  padding: 16px 18px; background: var(--fond); border-radius: var(--r);
}
.suivi-sinistre .poser-etape .primaire { margin-top: 10px; }
.suivi-sinistre .poser-etape textarea { width: 100%; box-sizing: border-box; }
/* la sortie de route : présente, jamais à la hauteur des autres */
.suivi-sinistre .sortie-route { margin: 14px 0 0; }
.suivi-sinistre .sortie-route .lien { color: var(--alerte); font-size: 13px; }

/* ===================================================== LES APPELS AUX CLIENTS
 *
 * Une ligne par appel, lisible en diagonale : la date, ce que ça a donné,
 * et ce qu'il reste à faire. Le retard se voit sans qu'on ait à lire — c'est
 * la seule chose qui doive sauter aux yeux dans cette liste.
 */
.appels { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.appel {
  position: relative;
  border: 1px solid var(--trait);
  border-left: 3px solid var(--trait);
  border-radius: 6px;
  padding: 12px 36px 12px 14px;
  background: var(--fond);
}
.appel.du-retard { border-left-color: var(--rouge-lisible, #d3241a); }

.appel header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
}
.appel .quand { font-weight: 600; }
.appel .resultat {
  font-size: 13px; padding: 1px 8px; border-radius: 999px;
  background: var(--fond-doux); color: var(--texte);
}
.appel .par { margin-left: auto; font-size: 12px; color: var(--doux); }

.appel .motif { margin: 6px 0 0; color: var(--texte); }
.appel .mot {
  margin: 8px 0 0; padding: 8px 12px;
  border-left: 2px solid var(--trait); color: var(--texte);
  font-style: italic;
}
.appel .rdv, .appel .rappel {
  margin: 8px 0 0; font-size: 13px; display: flex; gap: 10px;
  align-items: baseline;
}
.appel .rdv { color: var(--encre); font-weight: 600; }
.appel.du-retard .rappel { color: var(--rouge-lisible, #d3241a); font-weight: 600; }

/* le retrait se tient à l'écart du reste : on ne le frôle pas par mégarde */
.appel .retirer {
  position: absolute; top: 8px; right: 8px;
  font-size: 18px; line-height: 1; color: var(--doux); padding: 2px 6px;
}
.appel .retirer:hover { color: var(--rouge-lisible, #d3241a); }

/* le texte d'un courriel qu'on n'a pas pu ouvrir : à copier tel quel */
.texte-courriel {
  white-space: pre-wrap; font-family: inherit; font-size: 13px;
  background: var(--fond-doux); padding: 12px; border-radius: 4px;
  max-height: 40vh; overflow: auto;
}

/* ------------------------------------- comparatif : la nature des lignes
 *
 * Quatre natures cohabitent dans la meme colonne de chiffres : une prime
 * s'additionne, une franchise se paie au sinistre, un taux est un
 * pourcentage, une couverture est comprise ou non. Sans marque visible, le
 * courtier additionne de tete ce que l'application n'additionne pas — et
 * doute du total. Le filet de gauche porte la nature ; la couverture, qui
 * est le cas ordinaire, n'en porte aucun pour ne pas bruiter la grille.
 */
:root { --taux: #6f5bd0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --taux: #a08ff0; }
}
:root[data-theme="sombre"] { --taux: #a08ff0; }

.nat-prime     { border-left: 3px solid var(--accent); }
.nat-franchise { border-left: 3px solid var(--avert); }
.nat-taux      { border-left: 3px solid var(--taux); }
.nat-couverture{ border-left: 3px solid transparent; }

.etiq-nature {
  font-size: 9px; text-transform: uppercase; letter-spacing: .06em;
  margin-left: 6px; padding: 1px 5px; border-radius: 3px;
  border: 1px solid currentColor; opacity: .75; white-space: nowrap;
}
.etiq-prime     { color: var(--accent); }
.etiq-franchise { color: var(--avert); }
.etiq-taux      { color: var(--taux); }

/* le chiffre lui-meme : compte, ou ne compte pas */
input.val-prime     { font-weight: 700; }
input.val-franchise { color: var(--avert); }
input.val-taux      { color: var(--taux); }

.legende-nature {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 12px; color: var(--doux); margin: 0 0 8px;
}
.legende-nature b { color: var(--texte); }
.legende-nature .puce {
  display: inline-block; width: 3px; height: 12px; margin-right: 6px;
  vertical-align: -2px; border-radius: 2px;
}

/* ------------------------------- comparatif : la grille des prestataires
 *
 * Dix colonnes de chiffres ne tiennent pas dans un ecran. Elles defilent
 * donc dans leur cadre — jamais dans la page — et trois reperes restent
 * en place pendant qu'on fait defiler : le nom de la garantie a gauche,
 * le nom de la compagnie en haut, et le total en bas. Sans eux, on remplit
 * une case sans plus savoir ni quoi ni chez qui.
 */
.grille-comparatif { padding: 0; margin-bottom: 14px; overflow: hidden; }
.defilement-comparatif { overflow: auto; max-height: 64vh; }

.table-comparatif { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.table-comparatif th, .table-comparatif td { border-bottom: 1px solid var(--bord); }

.table-comparatif thead th { position: sticky; top: 0; z-index: 2; background: var(--carte); }
/*
 * La colonne de gauche doit tenir « Nouveau conducteur (-2 ans) » ET son
 * etiquette de nature sur une seule ligne. A 230 px l'etiquette sortait du
 * cadre fige et s'affichait « FRANC » : une nature a moitie lue ne dit
 * plus rien.
 */
.table-comparatif .fige-1 { position: sticky; left: 0; z-index: 1; background: var(--carte);
  min-width: 274px; white-space: nowrap; }
.table-comparatif .fige-2 { position: sticky; left: 274px; z-index: 1; background: var(--carte);
  min-width: 80px; border-right: 2px solid var(--bord); }
.table-comparatif thead .fige-1, .table-comparatif thead .fige-2 { z-index: 3; }

/*
 * LE PIED NE COLLE PAS EN BAS.
 *
 * Toutes ses lignes collees au meme `bottom: 0` se superposaient : on ne
 * voyait plus que la derniere, « Service apres-vente », par-dessus le
 * total et le rang. Le classement se lit de toute facon dans le bandeau
 * « Meilleure offre » au-dessus de la grille ; le pied se laisse atteindre
 * en descendant, et seules ses etiquettes restent calees a gauche.
 */
.table-comparatif tfoot td { background: var(--carte); }
.table-comparatif tfoot .fige-1 {
  position: sticky; left: 0; z-index: 2; text-align: right;
}
.fige-pied { border-right: 2px solid var(--bord); }

.tete-assureur { min-width: 128px; text-align: center; padding: 4px 6px !important; }
.tete-assureur.gagne { outline: 2px solid var(--ok); outline-offset: -2px; }
.tete-assureur input:focus { border-color: var(--accent); background: var(--carte) !important; }

.case-comparatif { padding: 2px; }
.table-comparatif .souhait { color: var(--doux); font-size: .9em; text-align: center; }

.bande-section {
  text-align: left; font-weight: 700;
  background: var(--fond); color: var(--texte);
  border-top: 1px solid var(--bord);
}
/* le bandeau fait toute la largeur : c'est le MOT qui doit rester a gauche */
.bande-section > span { position: sticky; left: 0; display: inline-block; }

/* ------------------- comparatif : rubriques refusables et suppléments */
.bascule-rubrique {
  border: 1px solid var(--bord); background: var(--carte); color: var(--doux);
  border-radius: 4px; width: 20px; height: 20px; line-height: 1; padding: 0;
  margin-right: 8px; cursor: pointer; font-size: 12px; vertical-align: -3px;
}
.bascule-rubrique.ouverte { border-color: var(--ok); color: var(--ok); }
.bascule-rubrique:not(.ouverte) { border-color: var(--accent); color: var(--accent); }
.refusee {
  margin-left: 10px; font-weight: 400; font-size: 11px; color: var(--doux);
  text-transform: uppercase; letter-spacing: .06em;
}

/* le second chiffre d'une case : la prime d'une variante, un surcoût */
input.sup-comparatif {
  width: 100%; box-sizing: border-box; text-align: right;
  font-size: .86em; padding: 1px 5px;
  border-style: dashed; color: var(--accent); font-variant-numeric: tabular-nums;
}

/*
 * `width: auto` n'est pas un detail : la regle commune donne 100 % a tout
 * `select`, et celui-ci chassait alors l'etiquette de nature hors de la
 * colonne figee, jusque dans la case du premier prestataire.
 */
.choix-ligne {
  width: auto; max-width: 110px; flex: none;
  margin-left: 6px; padding: 0 2px; font-size: 11px; height: 19px;
  border: 1px solid var(--bord); border-radius: 3px; background: var(--carte);
  color: var(--texte); vertical-align: 1px;
}

/* la rubrique retenue le dit, a l'ecran seulement */
.souhaitee {
  margin-left: 10px; font-weight: 400; font-size: 11px; color: var(--ok);
  text-transform: uppercase; letter-spacing: .06em;
}

/* une somme de garantie est un renseignement : ni grasse, ni soulignée */
.nat-somme { border-left: 3px solid var(--neutre); }
.etiq-somme { color: var(--doux); }
input.val-somme { color: var(--doux); }

/* ------------------------------------- partenariats et menus déroulants */

.deux-colonnes.partenariats {
  display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px; align-items: start;
}
@media (max-width: 900px) { .deux-colonnes.partenariats { grid-template-columns: 1fr; } }

.colonne-liste { display: flex; flex-direction: column; gap: 6px; }
.colonne-liste .barre-outils { flex-wrap: wrap; margin-bottom: 6px; }
.ligne-liste {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--bord); border-radius: var(--r);
  background: var(--carte); color: var(--texte); font: inherit;
}
.ligne-liste:hover { border-color: var(--accent); }
.ligne-liste.actif { border-color: var(--accent); background: var(--accent-clair); }
.ligne-liste.inactif { opacity: .55; }
.ligne-liste .nom { font-weight: 600; }
.ligne-liste .sous { font-size: 12px; color: var(--doux); }

.colonne-detail { display: flex; flex-direction: column; gap: 14px; }
.entete-detail h2 { margin: 0; }
.grille-champs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}
.cases { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }

.bloc-contrat { margin-top: 12px; }
.contrat-pose { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.carte-liste { margin-bottom: 14px; }
.carte-liste header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.carte-liste h3 { margin: 0; }
.titre-groupe { margin: 20px 0 8px; font-size: 15px; color: var(--doux); }
.valeurs-liste { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.valeur-ligne { display: flex; align-items: center; gap: 7px; }
.valeur-ligne input { flex: 1 1 200px; min-width: 0; }
.valeur-ligne .usage {
  flex: none; min-width: 108px; text-align: right;
  font-size: 11.5px; color: var(--doux); font-variant-numeric: tabular-nums;
}
.valeur-ligne .usage.nul { opacity: .55; }

/* ------------------------------------- comment les relevés partent au site */
.modes-envoi {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px; margin: 12px 0;
}
.mode-envoi {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px;
  align-items: start; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--bord); border-radius: var(--r); background: var(--carte);
}
.mode-envoi.actif { border-color: var(--accent); background: var(--accent-clair); }
.mode-envoi input { width: auto; grid-row: span 2; margin-top: 3px; }
.mode-envoi .titre { font-weight: 600; }
.mode-envoi .aide { grid-column: 2; }

/* un menu déroulant qui n'est pas une liste de valeurs : on dit où il vit */
.carte-table, .carte-fichier { border-style: dashed; }
.carte-fichier { opacity: .78; }

/* ======================================================= sur une tablette */
/*
 * L'APPLICATION TOURNE AUSSI SUR UN iPAD, ET PAS SEULEMENT « À PEU PRÈS ».
 *
 * Le rendez-vous se mène tablette en main : on remplit la trame pendant
 * qu'on parle, on tend l'écran au client, il signe au doigt. Trois choses
 * s'y jouaient contre nous, et chacune est corrigée ici.
 *
 * 1. SAFARI AGRANDIT LA PAGE quand on touche un champ dont le texte fait
 *    moins de 16 px — et il ne la réduit jamais. On passait le rendez-vous
 *    à pincer l'écran pour revenir en arrière. Tous les champs sont donc à
 *    16 px au doigt : c'est la seule taille que Safari laisse
 *    tranquille.
 * 2. UNE CIBLE DE 28 PIXELS NE SE TOUCHE PAS. Un doigt couvre une
 *    quarantaine de points ; en dessous, on vise. 44 points est le minimum
 *    d'Apple, et c'est aussi le bon sens.
 * 3. LES COINS ARRONDIS ET LA BARRE D'ACCUEIL mangent le contenu quand la
 *    page passe dessous (« viewport-fit=cover »). Les marges de sécurité
 *    les rendent.
 *
 * « pointer: coarse » vise le doigt, pas la petite fenêtre : un portable
 * avec une souris garde ses tailles compactes.
 */
@media (pointer: coarse) {
  /* 1. plus de zoom intempestif à la saisie */
  input, select, textarea, .seance-champ input, .seance-champ textarea,
  .seance-champ select { font-size: 16px; }

  /* 2. de quoi viser avec un doigt */
  button, .lien, .menu-entree, select,
  input[type="checkbox"], input[type="radio"] { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] {
    min-width: 24px; width: 24px; height: 24px; min-height: 24px;
  }
  .onglets button, .seance-etapes button { min-height: 52px; }
  td button, .table-liste button { min-height: 38px; }

  /* le défilement d'un panneau ne doit pas emporter la page derrière lui */
  .seance-corps, .modale, .table-enveloppe { overscroll-behavior: contain; }

  /*
   * Le tracé de la signature est plus haut : on signe avec le bras, pas
   * avec le poignet, et une bande de 200 px rend un paraphe écrasé.
   */
  .seance-toile { height: 260px; }
}

/* 3. les marges de sécurité de l'écran */
@supports (padding: env(safe-area-inset-left)) {
  .seance-tete, .seance-etapes {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .seance-corps {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .modale-fond { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/*
 * INSTALLÉE SUR L'ÉCRAN D'ACCUEIL, elle n'a plus la barre d'adresse de
 * Safari : la barre du haut doit donc descendre sous l'horloge et le
 * niveau de batterie, sinon le nom du client s'écrit dessous.
 */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .seance-fond { padding-top: env(safe-area-inset-top); }
}

/* les trois gestes pour installer l'application sur une tablette */
.liste-numerotee { margin: 0 0 12px; padding-left: 22px; line-height: 1.7;
  font-size: 13.5px; }
.liste-numerotee li { margin-bottom: 4px; }

/* « l'exemplaire signé », sous la date du mandat : un lien, pas un bouton */
.lien-mandat {
  background: none; border: 0; padding: 0; margin-top: 2px;
  color: var(--accent); font-size: 12px; text-align: left;
  text-decoration: underline; min-height: 0; cursor: pointer;
}
.lien-mandat:hover { color: var(--encre); }

/* ======================================================== la visionneuse PDF */
/*
 * Un document s'ouvrait dans un onglet du navigateur : on quittait la fiche,
 * et sur une tablette le second onglet ne se refermait jamais. Il s'affiche
 * ici, par-dessus, avec le bouton qui l'enregistre pour qui veut le garder.
 *
 * La hauteur est en « vh » et non en pixels : un mandat de quatre pages doit
 * remplir l'écran d'un 27 pouces comme celui d'un iPad, sans régler quoi que
 * ce soit.
 */
.pdf-vue { display: flex; flex-direction: column; gap: 10px; }
.pdf-barre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pdf-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 40%; }
.pdf-note { margin: 0; }
.pdf-cadre {
  height: min(72vh, 900px); min-height: 320px;
  border: 1px solid var(--bord); border-radius: 6px;
  background: #525659;        /* le gris des lecteurs de PDF, pour la lecture */
  overflow: hidden;
}
.pdf-cadre iframe { width: 100%; height: 100%; border: 0; display: block; }
.pdf-attente { display: grid; place-items: center; height: 100%;
  color: #fff; font-size: 13px; }

/* sur une tablette, la fenêtre prend tout : lire un mandat demande la place */
@media (pointer: coarse) {
  .pdf-cadre { height: min(68vh, 900px); }
}

/*
 * LA LIGNE QUI SÉPARE LE PORTEFEUILLE DE CE QUI N'EN EST PLUS.
 *
 * Les contrats résiliés étaient mêlés aux autres : on additionnait leurs
 * primes de tête. Ils passent sous ce trait, repliés, avec leur total à
 * part — et la phrase qui dit que ce total ne compte nulle part.
 */
.separateur-resilies {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 16px 0; padding: 10px 0 8px;
  border-top: 1px dashed var(--bord);
  color: var(--doux); font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px;
}
.separateur-resilies button { text-transform: none; letter-spacing: 0; }

/*
 * LE CHEMIN D'UN DOCUMENT SE TAPE À NOUVEAU.
 *
 * Il avait été mis dans un champ caché : on ne pouvait plus que téléverser.
 * Or la moitié des mandats sont déjà sur le partage, rangés à la main depuis
 * quinze ans — on veut les DÉSIGNER, pas en faire une seconde copie.
 *
 * Monospace et retour à la ligne : un chemin réseau fait cent caractères et
 * se relit lettre par lettre quand il ne mène nulle part.
 */
.chemin-saisie {
  width: 100%; font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: 11.5px; line-height: 1.5; resize: vertical;
  word-break: break-all; white-space: pre-wrap;
}
.champ-document .actions-doc { display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; }

/* « Le dirigeant, à titre privé » : la frontière entre la société et l'homme */
.rdv-sous .rdv-sous-separateur {
  align-self: center; margin: 0 4px 0 10px; padding-left: 12px;
  border-left: 1px solid var(--bord);
  color: var(--doux); font-size: 11px; text-transform: uppercase;
  letter-spacing: .7px; white-space: nowrap;
}

/* --------------------------------- primes du portefeuille (accueil) */
.primes-detail { display: flex; flex-direction: column; gap: 6px; }
.primes-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.primes-libelle { display: flex; flex-direction: column; }
.primes-libelle small { color: var(--doux); font-size: 11px; }
.primes-valeur { font-variant-numeric: tabular-nums; white-space: nowrap; }
.primes-ligne.total .primes-libelle { font-weight: 600; }
.primes-ligne.total .primes-valeur { font-size: 20px; font-weight: 600; }
.primes-ligne.uniques { color: var(--doux); }
.primes-barre { display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: var(--bord); margin: 2px 0 4px; }
.primes-barre .net { background: var(--accent); }
.primes-barre .apporteurs { background: #e9a23b; }
.primes-ligne.net .primes-libelle::before,
.primes-ligne.apporteurs .primes-libelle::before { content: ''; }
.primes-separe { border-top: 1px solid var(--bord); margin: 4px 0; }

/* --------------------------------- revenus par mois (accueil) */
.revenus-tete { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 6px; }
.revenus-tete strong { font-size: 18px; }
.revenus-svg { width: 100%; height: auto; display: block; }
.revenus-svg .rv-net { fill: var(--accent); }
.revenus-svg .rv-apporteurs { fill: #e9a23b; }
.revenus-svg .rv-an-passe { stroke: var(--doux); stroke-width: 1.5; stroke-dasharray: 3 2; }
.revenus-svg .rv-axe { stroke: var(--bord); stroke-width: 1; }
.revenus-svg .rv-mois { font-size: 9px; fill: var(--doux); text-anchor: middle; }
.revenus-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px;
  color: var(--doux); margin-top: 4px; }
.revenus-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 5px; vertical-align: -1px; }
.revenus-legende .pastille-net { background: var(--accent); }
.revenus-legende .pastille-apporteurs { background: #e9a23b; }
.revenus-legende .trait-an-passe { height: 0; border-top: 1.5px dashed var(--doux);
  border-radius: 0; vertical-align: 3px; }
:root[data-discret] .primes-valeur,
:root[data-discret] .revenus-tete strong,
:root[data-discret] .revenus-legende b { filter: blur(10px); }
:root[data-discret] .revenus-svg { filter: blur(10px); }

/* --------------------------------- mails et courriers types */
.modale.modale-courrier { width: min(1040px, 100%); }
.courrier-choix { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
  margin-bottom: 12px; }
.courrier-choix .champ { min-width: 220px; flex: 1; }
.courrier-choix .champ.court { flex: 0 0 110px; min-width: 110px; }
.courrier-branches { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 16px;
  align-items: center; }
.courrier-branches .nom { font-size: 12px; color: var(--doux); flex-basis: 100%; }
.courrier-onglets { margin-bottom: 10px; }
.courrier-ligne { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.courrier-texte { width: 100%; font-family: inherit; font-size: 13.5px; line-height: 1.5; }
.courrier-dest { width: 100%; font-family: inherit; }
.courrier-corps .barre { margin-top: 10px; flex-wrap: wrap; gap: 8px; align-items: center; }
.courrier-pied { margin-top: 12px; }
.courrier-modele { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 12px;
  margin: 0 0 10px; }
.courrier-modele > summary { cursor: pointer; font-weight: 600; }
.courrier-modele .champ { display: block; margin: 10px 0; }
.courrier-modele textarea, .courrier-modele input[type=text] { width: 100%; }
.courrier-variables { margin: 8px 0 14px; }
@media (max-width: 760px) { .courrier-ligne { grid-template-columns: 1fr; } }

/* --------------------------------- le sentiment du client */
.sentiment { --s: var(--doux); }
.sentiment-tres-bon { --s: #1b8a4b; }
.sentiment-bon { --s: #5aa864; }
.sentiment-pas-regardant { --s: #2f86c9; }
.sentiment-regardant { --s: #c9a227; }
.sentiment-pointilleux { --s: #e08a1e; }
.sentiment-avare { --s: #d0612a; }
.sentiment-mefiant { --s: #cf3a3a; }
.sentiment-ferme { --s: #7a2430; }
select.sentiment-entete {
  width: auto; min-width: 0; max-width: 190px; flex: none; margin: 0;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2;
  padding: 3px 22px 3px 10px; border-radius: 999px;
  border: 1.5px solid var(--s); color: var(--s);
  background: color-mix(in srgb, var(--s) 14%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888'/%3E%3C/svg%3E")
    no-repeat right 8px center;
}
select.sentiment-entete.sentiment-aucun { border-style: dashed; font-weight: 500; }
select.sentiment-entete option { color: var(--texte, #222); background: var(--carte, #fff); }
.etiq.sentiment { color: var(--s); border-color: var(--s);
  background: color-mix(in srgb, var(--s) 14%, transparent); font-weight: 600; }
select.sentiment-choix { border-left: 6px solid var(--s); }

/* --------------------------------- prospects et contrats non geres : le bleu */
:root { --prospect: #2f6fd6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) { --prospect: #6ea2ff; } }
:root[data-theme="sombre"] { --prospect: #6ea2ff; }
table.donnees tbody tr.prospect td,
table.donnees tbody tr.non-gere td { color: var(--prospect); }
table.donnees tbody tr.prospect td:first-child,
table.donnees tbody tr.non-gere td:first-child { box-shadow: inset 3px 0 0 var(--prospect); }
.etiq.prospect { color: var(--prospect); border-color: var(--prospect);
  background: color-mix(in srgb, var(--prospect) 14%, transparent); font-weight: 600; }
.carte.fiche-prospect { border-color: var(--prospect);
  box-shadow: 0 0 0 1px var(--prospect) inset; }
.carte.fiche-prospect > header h2 { color: var(--prospect); }
.bouton-devenir-client { background: var(--prospect); color: #fff; border-color: var(--prospect);
  font-weight: 600; }
.bouton-devenir-client:hover { filter: brightness(1.08); }
.groupe-prospect.actif, .groupe-non-gere.actif { border-color: var(--prospect);
  background: color-mix(in srgb, var(--prospect) 7%, transparent); }
.groupe-prospect.actif legend, .groupe-non-gere.actif legend { color: var(--prospect); }
.separateur-non-geres { margin: 16px 0 6px; padding: 6px 10px; border-radius: 6px;
  color: var(--prospect); font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--prospect) 10%, transparent); }
article.contrat.non-gere { border-color: var(--prospect);
  box-shadow: inset 4px 0 0 var(--prospect); }
article.contrat.non-gere .compagnie, article.contrat.non-gere .prime { color: var(--prospect); }

/* Prospect café : un carnet par conseiller, quand l'administrateur les range ainsi */
.carnet-titre {
  margin: 18px 0 6px; padding-bottom: 4px; font-size: 13.5px;
  border-bottom: 1px solid var(--bord); color: var(--encre);
}
.carnet-titre:first-child { margin-top: 0; }

/* la lettre de l'agence : ses seize cases, sur deux colonnes comme le papier */
.lettre-cases {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px;
  padding: 8px 10px; border: 1px solid var(--bord); border-radius: 6px;
}
.lettre-case { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.lettre-case input[type="checkbox"] { width: auto; margin: 0; }
.lettre-case .lettre-selon { width: 110px; padding: 2px 6px; font-size: 12px; }
.lettre-encart { display: block; margin: 8px 0 4px; font-size: 13px; }
.lettre-encart input { width: auto; }
@media (max-width: 700px) { .lettre-cases { grid-template-columns: 1fr; } }

/* une touche du clavier, dans une consigne */
kbd.touche {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--bord);
  border-bottom-width: 2px; border-radius: 5px; font: 600 13px/1.4 inherit;
  background: var(--carte); white-space: nowrap;
}

/* ---- Décomptes de commissions, en un geste (6.6.8) ---- */
.depot-decomptes { border: 2px dashed var(--bord); border-radius: 10px; padding: 22px 18px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: border-color .15s, background .15s; }
.depot-decomptes:hover, .depot-decomptes.survol { border-color: var(--accent, #c8102e);
  background: rgba(200, 16, 46, .04); }
.depot-decomptes .depot-icone { font-size: 30px; line-height: 1; }
.depot-decomptes .aide { max-width: 560px; }
.decomptes-liste { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.decompte { border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px; }
.decompte-tete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  align-items: flex-start; }
.decompte-titre { font-weight: 600; font-size: 15px; }
.decompte-somme { text-align: right; }
.decompte-somme strong { font-size: 17px; }
.decompte-groupes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.decompte-groupes .groupe { border-left: 3px solid var(--bord); padding: 4px 10px; }
.decompte-groupes .groupe.ok { border-left-color: var(--ok); }
.decompte-groupes .groupe.alerte { border-left-color: var(--alerte, #b3261e); }
.decompte-groupes summary { cursor: pointer; }
.decompte-groupes table { margin-top: 6px; }
.etiquette.alerte { background: rgba(179, 38, 30, .12); color: var(--alerte, #b3261e); }
.imports-avances { margin: 14px 0; }
.imports-avances > summary { cursor: pointer; color: var(--doux); padding: 6px 0; }

/* --- comptes internes et signatures (6.6.9) --- */
.reglage-acces { display: flex; flex-direction: column; gap: 10px; }
.cases-conseillers, .cases-ecrans {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px;
}
.toile-signature {
  width: 100%; max-width: 420px; height: auto; aspect-ratio: 600 / 180;
  border: 1px dashed var(--bord, #c8ccd4); border-radius: 6px; background: #fff;
  touch-action: none; cursor: crosshair; display: block;
}
.apercu-signature {
  margin: 0; white-space: pre-wrap; font: 13px/1.45 var(--police, system-ui);
  color: var(--texte);
}
.signe-par { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.actions-decompte { white-space: nowrap; }
.actions-decompte button + button { margin-left: 6px; }
.liste-contrats-lier { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.contrat-lier { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px;
  border: 1px solid var(--bord, #dde1e7); border-radius: 6px; cursor: pointer; }
.contrat-lier:has(input:checked) { border-color: var(--accent, #1a5fb4); background: var(--fond-doux, #f3f6fb); }
.contrat-lier.meme-compagnie strong::after { content: ' ★'; color: var(--accent, #1a5fb4); }
.contrat-lier.resilie { opacity: .65; }
