/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   FICHE CLIENT — LE BLOC COUVERTURES (js/88, 20.09.2026)

   L'ancien bloc écrivait ses couleurs en dur (#4ade80, rgba(74,222,128,…)) dans des attributs
   style. Il ne suivait donc aucune des sept ambiances, restait vert pomme sur fond papier, et
   échappait à la correction de graisses de css/96. Tout passe ici par les jetons.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.cou-bloc {
  margin-bottom: var(--e-4, 16px);
  padding: var(--e-4, 16px) var(--e-5, 20px);
  border-radius: var(--r-m, 14px);
  border: 1px solid var(--border); background: var(--surface-alt);
}

/* ── L'en-tête ─────────────────────────────────────────────────────────────────────────────────── */
.cou-tete {
  display: flex; align-items: center; gap: var(--e-4, 16px); flex-wrap: wrap;
  padding-bottom: var(--e-3, 12px); margin-bottom: var(--e-3, 12px);
  border-bottom: 1px solid var(--border);
}
.cou-titre { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cou-surtitre {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-muted); font-weight: 600;
}
.cou-titre b { font-size: var(--t-xl, 19px); font-weight: var(--t-moyen, 600); letter-spacing: -0.02em; color: var(--text); }
.cou-titre small { font-size: var(--t-s, 12.5px); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Une barre plutôt qu'un « 4/9 » : un ratio écrit demande une division mentale, une barre
   remplie à moitié ne demande rien. Le pourcentage reste écrit à côté — la couleur seule ne doit
   jamais porter l'information. */
.cou-jauge-boite { display: flex; align-items: center; gap: 10px; flex: 0 1 200px; }
.cou-jauge {
  flex: 1 1 auto; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.cou-jauge i { display: block; height: 100%; border-radius: 999px; transition: width .35s ease-out; }
.cou-jauge.ton-complet i { background: var(--c-succes, #16A34A); }
.cou-jauge.ton-partiel i { background: var(--c-alerte, #F59E0B); }
.cou-jauge.ton-faible i { background: var(--c-danger, #EF4444); }
.cou-pct {
  font-size: var(--t-m, 13.5px); font-weight: var(--t-moyen, 600);
  font-variant-numeric: tabular-nums lining-nums; white-space: nowrap;
}
.cou-pct.ton-complet { color: var(--c-succes, #16A34A); }
.cou-pct.ton-partiel { color: var(--c-alerte, #F59E0B); }
.cou-pct.ton-faible { color: var(--c-danger, #EF4444); }

.cou-cct {
  padding: 4px 11px; border-radius: var(--r-rond, 999px); white-space: nowrap;
  font-size: var(--t-xs, 11px); font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.cou-cct.oui {
  background: var(--c-succes-fond); color: var(--c-succes-texte, #15803D);
  border-color: color-mix(in srgb, var(--c-succes, #16A34A) 30%, transparent);
}

/* ── Les groupes ───────────────────────────────────────────────────────────────────────────────── */
.cou-groupe + .cou-groupe { margin-top: var(--e-4, 16px); }
.cou-sous {
  display: flex; align-items: center; gap: 7px; margin: 0 0 var(--e-2, 8px);
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 600;
}
.cou-sous span {
  padding: 1px 7px; border-radius: var(--r-rond, 999px); font-size: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cou-tout { margin: 0; font-size: var(--t-m, 13.5px); color: var(--c-succes, #16A34A); }

/* align-items: start — sans cela, la grille étire toutes les cartes d'une rangée à la hauteur de
   la plus haute, et une branche à un seul contrat traîne un grand vide sous elle. */
.cou-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: var(--e-2, 8px); align-items: start; }
/* Les manques sont plus petits : ce sont des absences, ils n'ont rien à détailler. Les serrer
   permet de tous les voir d'un coup, ce qui est précisément le but. */
.cou-manque { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.cou-carte { border-radius: var(--r-s, 10px); border: 1px solid var(--border); background: var(--surface); }
.cou-carte.pleine { padding: 10px 12px; }
.cou-carte.vide {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border-style: dashed; background: transparent;
}
/* Une branche absente ne se crie pas : elle s'estompe. C'est le nombre de cases en pointillé,
   pas leur couleur, qui doit alerter. */
.cou-carte.vide .cou-ico { opacity: .45; filter: grayscale(60%); }
.cou-carte.vide .cou-nom { color: var(--text-muted); }

.cou-carte-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cou-ico { font-size: 17px; line-height: 1; flex-shrink: 0; }
.cou-nom { font-size: var(--t-s, 12.5px); font-weight: 500; color: var(--text); flex: 1 1 auto; min-width: 0; }
.cou-n {
  padding: 1px 7px; border-radius: var(--r-rond, 999px); font-size: 10px; font-weight: 500;
  background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-border);
}
.cou-prime {
  font-size: var(--t-xs, 11px); color: var(--text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}

.cou-liste { list-style: none; margin: 7px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cou-liste li {
  padding: 5px 7px; border-radius: 7px; cursor: pointer;
  border-left: 2px solid var(--c-succes, #16A34A);
  background: var(--surface-alt);
  transition: background var(--v-court, .15s);
}
.cou-liste li:hover { background: var(--surface-hover); }
/* Logo de la compagnie à gauche de chaque contrat (22.09.2026) : on reconnaît l'assureur d'un
   coup d'œil, sans lire la petite ligne. */
.cou-liste li { display: flex; align-items: center; gap: 8px; }
.cou-logo { flex-shrink: 0; display: inline-flex; line-height: 0; }
.cou-texte { min-width: 0; flex: 1; }
.cou-texte b, .cou-texte small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cou-liste li:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cou-liste b { display: block; font-size: var(--t-xs, 11px); font-weight: 500; color: var(--text); }
.cou-liste small { display: block; font-size: 10px; color: var(--text-muted); }

.cou-lien {
  margin-top: var(--e-2, 8px); padding: 0; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: var(--t-s, 12.5px); color: var(--accent);
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.cou-lien:hover { text-decoration-style: solid; }

/* ── Lisibilité (22.09.2026 — « les couvertures c'est illisible ») ─────────────────────────────────
   Trois défauts constatés sur une fiche entreprise : les logos marine (Helvetia, Baloise…)
   disparaissaient sur le fond sombre ; les branches à découvrir, grises sur gris, ne se voyaient
   plus ; et les contrats s'écrivaient en 10–11 px. */
.cou-nom { font-size: var(--t-m, 13.5px); }
.cou-prime { font-size: var(--t-s, 12.5px); color: var(--text); font-weight: 500; }
.cou-liste { gap: 5px; margin-top: 9px; }
.cou-liste li { padding: 7px 9px; gap: 10px; }
.cou-liste b { font-size: var(--t-s, 12.5px); font-weight: 600; white-space: normal; line-height: 1.3; }
.cou-liste small { font-size: var(--t-xs, 11px); color: var(--text-secondary, var(--text-muted)); margin-top: 1px; }
/* Le logo de la compagnie sur une pastille blanche : lisible dans toutes les ambiances. */
.cou-logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; align-items: center; justify-content: center;
  border: 1px solid rgba(15, 23, 42, .10); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
/* Les manques : pointillé ambre et libellé au contraste normal — ils doivent se lire, c'est eux
   qui décident du prochain appel. */
.cou-carte.vide { border-color: color-mix(in srgb, var(--c-alerte, #F59E0B) 45%, var(--border));
  background: color-mix(in srgb, var(--c-alerte, #F59E0B) 6%, transparent); }
.cou-carte.vide .cou-ico { opacity: .85; filter: none; }
.cou-carte.vide .cou-nom { color: var(--text); font-size: var(--t-s, 12.5px); line-height: 1.3; }
.cou-sous { font-size: var(--t-s, 12.5px); color: var(--text); }

/* ── Badge mandat (js/88, 22.09.2026) ── */
.cou-mandat:empty { display: none; }
.cou-mandat { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 5px; border-radius: 999px;
  white-space: nowrap; cursor: pointer; font-size: var(--t-xs, 11px); font-weight: 600; transition: transform .15s, box-shadow .15s; }
.cou-mandat img { width: 22px; height: 22px; display: block; background: #fff; border-radius: 50%; padding: 1px; }
.cou-mandat span { display: flex; flex-direction: column; line-height: 1.15; }
.cou-mandat small { font-size: 10px; font-weight: 500; opacity: .8; }
.cou-mandat.oui { background: color-mix(in srgb, #16A34A 14%, transparent); color: var(--c-succes-texte, #15803D);
  border: 1px solid color-mix(in srgb, #16A34A 40%, transparent); }
html:not([data-theme="clair"]) .cou-mandat.oui { color: #4ADE80; }
.cou-mandat.non { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }
.cou-mandat.non img { filter: grayscale(1); opacity: .55; }
.cou-mandat:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.cou-mandat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 620px) {
  .cou-jauge-boite { flex-basis: 100%; }
  .cou-grille { grid-template-columns: 1fr; }
  .cou-manque { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

/* Délai de résiliation sous chaque contrat des couvertures (22.09.2026) — repère discret. */
.cou-resil { white-space: nowrap; }
.cou-resil.proche { color: var(--c-alerte-texte, #B45309); font-weight: 600; }
.cou-resil.passe { color: var(--text-muted); text-decoration: line-through; }
