/* 🧾 Le profil des leads, ses filtres et ses chiffres (profil.js, 24/10/2026).
 *
 * 🎨 Seulement les variables de `:root` (ecran.css) : aucune couleur, aucune
 * police en dur — le thème de l'écran change, ces pages le suivent. Les
 * cartes, boutons, pastilles et tuiles sont ceux de l'écran ; ce fichier ne
 * pose que la mise en page de ce qui est neuf. Une couleur dit « agis » ou un
 * état, jamais une décoration : les barres disent les leads (trait clair) et
 * leur part convertie (la couleur pleine), les nombres sont écrits à côté. */

/* ── Les filtres du suivi ─────────────────────────────────────────────────── */

.suivi-filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .75rem;
  margin: -.35rem 0 1rem; padding: .6rem .75rem; background: var(--fond);
  border: 1px solid var(--trait); border-radius: var(--rayon-carte); }
/* Deux filtres par ligne au téléphone, quatre sur l'ordinateur. */
.suivi-filtre { display: flex; flex-direction: column; gap: .15rem; min-width: 0;
  flex: 1 1 9rem; max-width: 15rem; }
.suivi-filtre-libelle { font-size: .74rem; font-weight: 500; color: var(--libelle); }
.suivi-filtre select { width: 100%; max-width: none; min-height: 2.2rem; font-size: .88rem; }
/* Un filtre posé : un filet d'encre, comme un compteur choisi. */
.suivi-filtre select.actif { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.suivi-garder { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.2rem;
  font-size: .88rem; }
.suivi-garder[aria-pressed="true"], .suivi-garder[aria-pressed="true"]:hover:not(:disabled) {
  border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.suivi-filtres-effacer { align-self: center; font-size: .86rem; }

/* La ligne de profil d'une carte : « Étudiant · Île-de-France · 1 300 € ». */
.lead-profil { margin: 0; font-size: .8rem; line-height: 1.35; color: var(--encre-douce);
  overflow-wrap: anywhere; }

/* ── La fiche ─────────────────────────────────────────────────────────────── */

.profil-tete { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .65rem; }
.profil-tete .fiche-bloc-titre { margin: 0; }
.fiche-profil-grille dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .35rem; }
/* Qui a rempli : « IA », « nico », « liste », « déduit ». */
.profil-marque { display: inline-flex; align-items: center; gap: .2rem; padding: 0 .4rem;
  border-radius: 999px; border: 1px solid var(--trait); background: var(--fond-doux);
  font-size: .68rem; font-weight: 500; line-height: 1.5; color: var(--libelle); white-space: nowrap; }
.profil-marque.ia::before { content: ""; width: .7rem; height: .7rem; background: currentColor;
  -webkit-mask: var(--icone-ia) no-repeat center / contain; mask: var(--icone-ia) no-repeat center / contain; }
.profil-marque.humain { color: var(--encre-douce); border-color: var(--trait-fort); }
.fiche-profil, .profil-marque {
  --icone-ia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9zM19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E"); }

.profil-historique { margin-top: .75rem; font-size: .84rem; }
.profil-historique summary { cursor: pointer; color: var(--libelle); font-weight: 500;
  border-radius: 4px; }
/* ♿ Son focus est l'anneau de l'écran (`--vert`, 5,5:1) : le contour
   champagne d'ici (1,45:1) le remplaçait — 25/10/2026. */
.profil-historique-liste { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem;
  max-height: 14rem; overflow: auto; }
.profil-historique-liste li { display: flex; flex-wrap: wrap; gap: .2rem .55rem; color: var(--encre-douce); }
.profil-historique-quand { font-family: var(--police-chiffres); color: var(--libelle); }
.profil-historique-qui { font-weight: 600; color: var(--encre); }
.profil-historique-vide { color: var(--libelle); }

/* La correction : deux colonnes, les textes longs sur toute la largeur. */
.profil-edition-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .85rem; }
.profil-champ { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.profil-champ.large { grid-column: 1 / -1; }
.profil-champ label { font-size: .76rem; font-weight: 500; color: var(--libelle); }
.profil-champ input, .profil-champ select { max-width: none; width: 100%; }
/* ♿ Le bord et le focus des champs de l'écran (25/10/2026) : « Motivation »
   et « Objections » n'étaient qu'un blanc dans le blanc à côté des menus
   voisins (1,45:1), et leur focus champagne (1,45:1) ne se voyait pas. Le
   focus est celui d'ecran.css (`textarea:focus`). */
.profil-champ textarea { font: inherit; font-size: .9rem; line-height: 1.45; width: 100%; resize: vertical;
  padding: .45rem .7rem; border-radius: var(--rayon); border: 1px solid var(--bordure-champ);
  background: var(--fond); color: var(--encre);
  transition: border-color var(--duree) ease, box-shadow var(--duree) ease; }
.profil-champ textarea:focus { border-color: var(--vert); }
.profil-edition-pied { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .85rem; }
.profil-edition-retour { font-size: .84rem; color: var(--libelle); }
.profil-edition-retour.rouge { color: var(--rouge); font-weight: 500; }
@media (max-width: 520px) { .profil-edition-grille { grid-template-columns: minmax(0, 1fr); } }

/* ── Les chiffres ─────────────────────────────────────────────────────────── */

/* Dans l'onglet Statistiques : une carte comme les autres blocs. */
#analytics > .stats-leads { background: var(--fond); border: 1px solid var(--trait);
  border-radius: var(--rayon-carte); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
#analytics > .stats-leads:empty { display: none; }
.stats-leads, .suivi-chiffres { transition: opacity .15s ease; }
.stats-leads.recharge, .suivi-chiffres.recharge { opacity: .55; }

.profil-stats-tete { margin-bottom: .85rem; }
.profil-stats-tete h3 { margin: 0; font-size: .98rem; font-weight: 600; color: var(--encre); }
.profil-stats-sous-titre { margin: .15rem 0 0; font-size: .86rem; color: var(--libelle); }
.suivi-chiffres > .profil-stats-tete h3 { font-size: 1.1rem; }
.profil-tuile-cliquable { cursor: pointer; }
.profil-tuile-cliquable:hover { border-color: var(--bordure-bouton-forte); }
.profil-tuile-cliquable:focus-visible { outline: 3px solid var(--vert); outline-offset: 1px; }

.profil-stats-grille { display: grid; gap: .85rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr)); }
.profil-repartition { min-width: 0; padding: .85rem 1rem 1rem; background: var(--fond);
  border: 1px solid var(--trait); border-radius: 14px; }
.profil-repartition-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
.profil-repartition-tete h4 { margin: 0; font-size: .92rem; font-weight: 600; color: var(--encre); }
.profil-repartition-precision { font-size: .76rem; color: var(--libelle); }
.profil-legende { display: flex; gap: .85rem; margin: .4rem 0 .55rem; font-size: .74rem; color: var(--libelle); }
.profil-cle { display: inline-flex; align-items: center; gap: .3rem; }
.profil-cle::before { content: ""; width: .7rem; height: .5rem; border-radius: 2px; }
.profil-cle.leads::before { background: var(--vert-trait); }
.profil-cle.convertis::before { background: var(--vert); }
.profil-barres { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
/* Une ligne est un bouton : elle montre ces leads dans le pipeline. */
.profil-barre-ligne { display: flex; flex-direction: column; gap: .25rem; width: 100%; padding: .35rem .45rem;
  border: 1px solid transparent; background: none; box-shadow: none; border-radius: 9px; text-align: left;
  font-weight: 400; }
.profil-barre-ligne:hover:not(:disabled) { background: var(--fond-doux); border-color: var(--trait); }
/* 📱 Les chiffres passent SOUS le libellé quand la ligne est étroite : à 320 px,
   « Indépendant » et « Auvergne-Rhône-Alpes » se cassaient en deux (24/11/2026). */
.profil-barre-haut { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0 .6rem; }
.profil-barre-libelle { font-size: .86rem; font-weight: 500; color: var(--encre); min-width: 0;
  overflow-wrap: anywhere; }
.profil-barre-nombres { flex: none; font-size: .78rem; color: var(--encre-douce);
  font-variant-numeric: tabular-nums; }
.profil-barre-piste { display: block; height: .55rem; border-radius: 999px; background: var(--fond-gris);
  overflow: hidden; }
.profil-barre-leads { display: block; height: 100%; width: calc(var(--part, 0) * 100%); min-width: 2px;
  border-radius: 999px; background: var(--vert-trait); }
.profil-barre-convertis { display: block; height: 100%; width: calc(var(--part, 0) * 100%);
  border-radius: 999px; background: var(--vert); }

/* La vue « Chiffres » du suivi, et l'icône de son bouton (un masque : la
   couleur reste celle du texte). */
.suivi-chiffres { min-width: 0; }
.suivi-bascule-choix[data-suivi-vue="chiffres"] { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M4 12h16M4 18h7'/%3E%3C/svg%3E"); }

/* ── ✅ La fiche du lead à valider après l'appel (20/11/2026) ─────────────── */

/* Une section de la carte de la personne : un filet au-dessus, pas une carte
   dans la carte. Deux colonnes, les textes longs sur la ligne. */
.fiche-lead { display: flex; flex-direction: column; gap: .7rem; min-width: 0;
  padding-top: 1rem; border-top: 1px solid var(--trait); }
.fiche-lead.cache { display: none; }
.fiche-lead-tete { display: flex; flex-direction: column; gap: .15rem; }
.fiche-lead-titre { margin: 0; font: 600 1rem/1.25 var(--police-titres, inherit); color: var(--encre); }
.fiche-lead-etat { font-size: .82rem; line-height: 1.35; color: var(--libelle); }
.fiche-lead-etat.lecture::before { content: ""; display: inline-block; width: .65rem; height: .65rem;
  margin-right: .4rem; vertical-align: -.05rem; border-radius: 50%; border: 2px solid var(--trait-fort);
  border-top-color: var(--vert); animation: fiche-lead-tourne .8s linear infinite; }
.fiche-lead-etat.validee { color: var(--vert); font-weight: 600; }
@keyframes fiche-lead-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fiche-lead-etat.lecture::before { animation: none; } }
.fiche-lead-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .65rem; }
.fiche-lead-champ { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.fiche-lead-champ.large { grid-column: 1 / -1; }
.fiche-lead-champ label { display: flex; align-items: center; gap: .3rem; min-width: 0;
  font-size: .74rem; font-weight: 500; color: var(--libelle); white-space: nowrap; }
.fiche-lead-champ label > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.fiche-lead-champ input, .fiche-lead-champ select { max-width: none; width: 100%; min-height: 2.1rem;
  font-size: .88rem; }
/* Ce que l'IA vient d'entendre : un filet de la couleur d'action, et la
   marque « IA » dans le libellé — jamais la couleur seule. */
.fiche-lead-champ.entendu input, .fiche-lead-champ.entendu select {
  border-color: var(--vert); box-shadow: inset 0 0 0 1px var(--vert); }
.fiche-lead-avant { font-size: .72rem; color: var(--libelle); overflow-wrap: anywhere; }
.fiche-lead-champ.refuse input, .fiche-lead-champ.refuse select {
  border-color: var(--rouge); box-shadow: inset 0 0 0 1px var(--rouge); }
.fiche-lead-pied { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.fiche-lead-retour { font-size: .82rem; color: var(--libelle); }
.fiche-lead-retour.rouge { color: var(--rouge); font-weight: 500; }

/* ✅ Qui a validé la fiche, sous le titre du profil du suivi. */
.profil-validee { margin: -.35rem 0 .6rem; font-size: .8rem; color: var(--libelle); }
.profil-validee.oui { color: var(--vert); font-weight: 500; }

/* La fiche du lead allonge la colonne de la personne : la hauteur en plus va
   SOUS le statut, jamais entre le résumé IA et lui (20/11/2026). */
@media (min-width: 901px) {
  #ecran.commercial.en-appel .colonne-fiche:has(> .resume-appel:not(.cache):not(.autre)) {
    grid-template-rows: auto 1fr; }
}

/* 🏷️ Le badge du réseau à côté du prénom (03/12/2026). */
.lead-nom-ligne { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; }
.badge-source { display: inline-block; padding: .08rem .45rem; border-radius: 999px; font-size: .68rem;
  font-weight: 600; line-height: 1.4; letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
  background: #e7e7ef; color: #3c3c55; }
.badge-source-instagram { background: linear-gradient(90deg, #f58529, #dd2a7b 55%, #8134af); color: #fff; }
.badge-source-tiktok { background: #111; color: #fff; box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55; }
.badge-source-youtube { background: #ff0000; color: #fff; }
h2 .badge-source { font-size: .78rem; position: relative; top: -.15em; }
