/* Tracking : styles propres au suivi commercial, sur la base graphique d'Institute (app.css, institute.css inchangés).
   Mêmes couleurs de thème : --c-plan, --c-live, --c-assign, --c-close, --c-doc, --c-safe. */
.k-plan { --k: var(--c-plan); --k-bg: var(--c-plan-bg); } .k-live { --k: var(--c-live); --k-bg: var(--c-live-bg); }
.k-assign { --k: var(--c-assign); --k-bg: var(--c-assign-bg); } .k-close { --k: var(--c-close); --k-bg: var(--c-close-bg); }
.k-doc { --k: var(--c-doc); --k-bg: var(--c-doc-bg); } .k-safe { --k: var(--c-safe); --k-bg: var(--c-safe-bg); }
.nowrap { white-space: nowrap; }
.bloc { display: block; color: var(--muted); font-size: 0.8rem; }
.alerte { color: var(--warning); font-weight: 650; }
.carte-suite { margin-top: var(--space-4); }

/* Filtres du tableau de bord */
.filtres { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.filtres .chips { margin: 0; }
.filtre-mois { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filtre-mois select { width: auto; max-width: 260px; min-height: 40px; }
.filtre-seul { margin-bottom: var(--space-4); }

/* Tuiles d'indicateurs */
.kpi-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.kpi-tuile { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-tuile header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.kpi-tuile .tile-ico { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--k-bg); color: var(--k); }
.kpi-tuile .tile-ico .icon { width: 22px; height: 22px; }
.kpi-tuile h2 { margin: 0; font-size: 0.92rem; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.kpi-valeur { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-objectif { margin: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 650; color: var(--muted); }
.kpi-objectif .icon { width: 14px; height: 14px; }
.kpi-tuile.is-ok .kpi-objectif { color: var(--success); }
.kpi-tuile.is-loin .kpi-objectif { color: var(--warning); }
.kpi-detail { margin: auto 0 0; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 1250px) { .kpi-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpi-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } .kpi-tuile { padding: 14px; } .kpi-valeur { font-size: 1.4rem; } }
@media (max-width: 380px) { .kpi-grille { grid-template-columns: minmax(0, 1fr); } }

/* Funnel */
.funnel { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.funnel-etape { flex: 1 1 120px; min-width: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--navy-50); display: flex; flex-direction: column; gap: 2px; }
.funnel-etape strong { font-size: 1.45rem; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.funnel-nom { font-size: 0.84rem; font-weight: 650; color: var(--muted); }
.funnel-taux { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel-etape.f2 { background: var(--c-plan-bg); } .funnel-etape.f3 { background: var(--c-assign-bg); } .funnel-etape.f4 { background: var(--c-safe-bg); }
.funnel-etape.f5 { background: var(--c-live-bg); } .funnel-etape.f6 { background: var(--c-live-bg); }

/* À faire */
.faire { list-style: none; margin: 0; padding: 0; }
.faire a { display: flex; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 10px; color: inherit; text-decoration: none; }
.faire a:hover { background: var(--navy-50); }
.faire small { display: block; color: var(--muted); }
.faire-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--k-bg); color: var(--k); }
.faire-ico .icon { width: 18px; height: 18px; }

/* Deux colonnes de cartes empilées */
.pile-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-4); align-items: start; margin-top: var(--space-4); }
.pile { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (max-width: 1000px) { .pile-grille { grid-template-columns: minmax(0, 1fr); } }

/* Graphique */
.graph-cadre { overflow-x: auto; }
.graph { width: 100%; height: auto; max-height: 280px; min-width: 480px; display: block; }
.graph-axe { stroke: var(--border-strong); stroke-width: 1; }
.graph-zone { fill: transparent; } .graph g:hover .graph-zone { fill: var(--navy-50); }
.b-dep { fill: var(--c-doc); } .b-cash { fill: var(--c-live); }
.graph text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.graph .graph-valeur { font-weight: 700; fill: var(--text); } .graph .graph-mois { font-weight: 650; fill: var(--text); } .graph .graph-ventes { font-size: 9.5px; }
.graph-legende { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; font-size: 0.85rem; color: var(--muted); }
.graph-legende li { display: inline-flex; align-items: center; gap: 6px; }
.puce { width: 10px; height: 10px; border-radius: 3px; } .p-dep { background: var(--c-doc); } .p-cash { background: var(--c-live); }

/* Tableaux des contacts : en-tête et première colonne restent visibles */
.suivi-carte { padding: 0; overflow: hidden; }
.suivi-cadre { overflow: auto; max-height: 72vh; }
.suivi-table { border-collapse: separate; border-spacing: 0; }
.suivi-table th, .suivi-table td { padding: 10px 8px; } .suivi-table th:first-child { padding-left: 16px; } .suivi-table td:last-child { padding-right: 16px; }
.suivi-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.suivi-table .col-nom { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: var(--text); white-space: normal; }
.suivi-table thead .col-nom { z-index: 3; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.suivi-table tbody tr:hover .col-nom { background: #f9fbfe; }
.suivi-table .col-nom a { font-weight: 700; text-decoration: none; } .suivi-table .col-nom a:hover { text-decoration: underline; }
.suivi-table .col-nom small { display: block; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.suivi-table td { vertical-align: middle; } .suivi-table tbody th { vertical-align: middle; font-weight: 600; }
.mini { width: 138px; min-height: 34px; padding: 4px 28px 4px 10px; font-size: 0.84rem; margin-top: 4px; display: block; }
.mini-n { width: 84px; min-height: 38px; padding: 4px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.table-insta td { padding-top: 6px; padding-bottom: 6px; } .table-insta form { margin: 0; }

.appels { display: inline-flex; align-items: center; gap: 6px; }
.appels-n { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--muted); } .appels-n b { color: var(--text); }
.geste { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.geste .icon { width: 17px; height: 17px; }
.g-oui { color: var(--c-live); } .g-oui:hover { background: var(--c-live-bg); border-color: var(--c-live); }
.g-non { color: var(--c-close); } .g-non:hover { background: var(--c-close-bg); border-color: var(--c-close); }
.geste:disabled, .jour-puce:disabled { opacity: 0.5; cursor: default; }
.barre-appels { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.jours { display: flex; gap: 4px; margin-top: 4px; }
.jour-puce { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: 0.84rem; font-weight: 700; cursor: pointer; }
.jour-puce[aria-pressed="true"] { background: var(--c-live); border-color: var(--c-live); color: #fff; }

.badge.q-froid { background: var(--c-plan-bg); color: var(--c-plan); } .badge.q-tiede { background: var(--c-assign-bg); color: var(--warning); } .badge.q-chaud { background: var(--c-close-bg); color: #a93624; }
.badge.s-a_appeler { background: #eef0f4; color: #4b5568; } .badge.s-a_rappeler { background: var(--c-assign-bg); color: var(--warning); }
.badge.s-joint { background: var(--c-plan-bg); color: var(--c-plan); } .badge.s-r2_fixe { background: var(--c-doc-bg); color: var(--c-doc); }
.badge.s-r2_honore { background: var(--c-safe-bg); color: #0a6670; } .badge.s-absent, .badge.s-perdu { background: var(--c-close-bg); color: #a93624; }
.badge.s-clos { background: var(--success-bg); color: var(--success); }

/* Fiche */
.fiche-form .optional { display: none; } /* presque tout est facultatif : le dire partout gêne la lecture */
.fiche-corps { border: 0; margin: 0; padding: 0; min-width: 0; }
.fiche-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.fiche-grille .card { margin: 0; } .fiche-grille h2 { margin-bottom: var(--space-4); }
@media (max-width: 1000px) { .fiche-grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .fiche-grille .field-row { grid-template-columns: minmax(0, 1fr); } }
.barre-fixe { position: -webkit-sticky; position: sticky; bottom: 0; z-index: 4; margin-top: var(--space-4); padding: var(--space-3) 0; background: var(--bg); border-top: 1px solid var(--border); }
.carte-vente { border-color: #b4e6cb; }
.zone-suppr { margin-top: var(--space-5); }
.campagnes { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
.campagnes li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.empty { text-align: center; padding: var(--space-7) var(--space-5); }
