/* ============================================================
   EXONETIC — BIBLIOTHÈQUE DE COMPOSANTS  v1.0
   Dépend de exonetic-tokens.css (à charger avant).
   Classes simples, sans framework, patchables bloc par bloc.
   ============================================================ */

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--grey-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; }
.icon--sm { width: 15px; height: 15px; }

/* Titre de page */
.page-title { font-size: var(--text-xl); font-weight: var(--weight-heavy); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); margin: 0; }
/* Overline de section (remplace les titres emojis) */
.section-title {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--grey-500); display: flex; align-items: center; gap: var(--s-2);
}

/* ============================================================
   BARRE DE NAVIGATION
   ============================================================ */
.navbar {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #fff; border-bottom: 1px solid rgba(58,210,245,.10);
  display: flex; align-items: center; gap: var(--s-2);
  padding: 0 var(--s-5); height: 60px; white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: var(--weight-heavy); letter-spacing: .1em; font-size: 16px; margin-right: var(--s-4); }
.brand__glyph { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; border: 1px solid rgba(58,210,245,.25); box-shadow: var(--glow-brand); }
.brand__word {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nav-link {
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  padding: 7px 12px; border-radius: var(--r-full); transition: background var(--transition), color var(--transition);
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link--active {
  background: rgba(58,210,245,.12); color: var(--brand-400);
  box-shadow: inset 0 0 0 1px rgba(58,210,245,.38), 0 0 14px rgba(58,210,245,.15);
}
.nav-search {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-full); color: #fff; font: inherit; font-size: var(--text-sm);
  padding: 7px 14px; width: 170px; outline: none;
}
.nav-search::placeholder { color: rgba(255,255,255,.45); }
.nav-search:focus { border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.nav-user { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); font-weight: var(--weight-bold); color: #fff; }

/* ============================================================
   BOUTONS — 3 niveaux + 1 taille compacte. Rien d'autre.
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-size: var(--text-md); font-weight: var(--weight-semibold);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Niveau 1 — action principale (1 max par zone) */
.btn--primary {
  background: linear-gradient(180deg, #0E2C50, var(--navy-900));
  color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 1px 2px rgba(3,13,30,.25);
}
.btn--primary:hover { box-shadow: inset 0 0 0 1px rgba(58,210,245,.45), var(--glow-brand); }

/* Niveau 2 — action secondaire */
.btn--secondary { background: var(--surface); color: var(--grey-900); border-color: var(--grey-200); }
.btn--secondary:hover { border-color: var(--grey-400); background: var(--grey-50); }

/* Niveau 3 — action discrète (tableaux, liens d'action) */
.btn--ghost { background: transparent; color: var(--grey-600); }
.btn--ghost:hover { background: var(--grey-50); color: var(--grey-900); }

/* Modificateur destructif (s'applique à secondary ou ghost) */
.btn--danger { color: var(--danger-600); }
.btn--danger:hover { background: var(--danger-bg); border-color: transparent; color: var(--danger-600); }

/* Taille compacte — obligatoire dans les tableaux et cartes kanban */
.btn--sm { height: var(--hit-min); padding: 0 var(--s-3); font-size: var(--text-sm); border-radius: var(--r-sm); }

/* Bouton icône seule (fermer, supprimer une ligne…) */
.btn--icon { width: var(--hit-min); height: var(--hit-min); padding: 0; border-radius: var(--r-sm); }

/* ============================================================
   BADGES & PASTILLES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .01em;
  background: var(--grey-50); color: var(--grey-600); white-space: nowrap;
}
.badge--ok     { background: var(--ok-bg);     color: var(--ok-600); }
.badge--warn   { background: var(--warn-bg);   color: var(--warn-600); }
.badge--danger { background: var(--danger-bg); color: var(--danger-600); }
.badge--info   { background: var(--money-pot-bg); color: var(--money-pot); }
.badge--brand  { background: var(--brand-100); color: #0E6B82; }

/* Température (score /100) — s'utilise avec .badge : class="badge temp--hot" */
.temp--hot  { background: var(--temp-hot-bg);  color: var(--temp-hot); }
.temp--warm { background: var(--temp-warm-bg); color: var(--temp-warm); }
.temp--cold { background: var(--temp-cold-bg); color: var(--temp-cold); }

/* Pastille commercial — pose --com et --com-bg sur l'élément */
.com-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  color: var(--com, var(--grey-600));
}
.com-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--com, var(--grey-400)); }

/* ============================================================
   CARTES & KPI
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--grey-100);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.card--pad { padding: var(--s-5); }

/* Carte KPI : overline + valeur + légende. Pas de bordure gauche. */
.kpi { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: 2px; }
.kpi__label { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--grey-500); display: flex; align-items: center; gap: 6px; }
.kpi__value { font-size: var(--display-sm); font-weight: var(--weight-heavy); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; color: var(--grey-900); }
.kpi__hint  { font-size: var(--text-sm); color: var(--grey-500); }
.kpi--real   .kpi__value { color: var(--money-real); }  /* argent réel      */
.kpi--pot    .kpi__value { color: var(--money-pot); }   /* argent potentiel */
.kpi--danger .kpi__value { color: var(--danger-600); }
.kpi--warn   .kpi__value { color: var(--warn-600); }
.kpi--ok     .kpi__value { color: var(--ok-600); }

/* ============================================================
   PROGRESSION
   ============================================================ */
.progress { height: 8px; border-radius: var(--r-full); background: var(--grey-100); overflow: hidden; }
.progress--on-dark { background: rgba(255,255,255,.16); }
.progress__fill { height: 100%; border-radius: var(--r-full); background: var(--grad-brand); box-shadow: var(--glow-brand); transition: width 400ms ease; }
.progress__fill--real { background: var(--money-real); box-shadow: none; }
.progress__fill--pot  { background: var(--money-pot); box-shadow: none; }
.progress--lg { height: 12px; }

/* Anneau de score : SVG 2 cercles, stroke-dasharray = score, 100 (voir guide) */

/* ============================================================
   TABLEAUX (hub d'appels, inscriptions)
   ============================================================ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: .07em; text-transform: uppercase; color: var(--grey-500);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--grey-100);
}
.table td { padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--grey-50); height: var(--row-h); }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--brand-50); }
.table__name { font-weight: var(--weight-bold); font-size: var(--text-md); color: var(--grey-900); }
.table__sub  { font-size: var(--text-sm); color: var(--grey-500); }
/* En-tête de groupe dans un tableau ("Leads entrants", "En cours") */
.table__group td {
  height: auto; padding: var(--s-4); background: var(--grey-50);
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .07em;
  text-transform: uppercase; color: var(--grey-600); border-bottom: 1px solid var(--grey-100);
}
.row-actions { display: flex; gap: var(--s-2); justify-content: flex-end; align-items: center; }
.tel { font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--grey-600); text-decoration: none; font-weight: var(--weight-semibold); }
.tel:hover { color: var(--brand-600); }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.label { font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--grey-600); letter-spacing: .03em; display: block; margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 var(--s-3);
  border: 1px solid var(--grey-200); border-radius: var(--r-md);
  font: inherit; font-size: var(--text-md); color: var(--grey-900); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea { height: auto; padding: var(--s-3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--grey-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.field { display: flex; flex-direction: column; }

/* Pastilles de statut exclusives (fiche lead) */
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.seg__item {
  height: 34px; padding: 0 var(--s-3); border-radius: var(--r-full);
  border: 1px solid var(--grey-200); background: var(--surface);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--grey-600);
  cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.seg__item:hover { border-color: var(--grey-400); }
.seg__item--on { background: linear-gradient(180deg, #0E2C50, var(--navy-900)); border-color: var(--navy-900); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.09); }

/* ============================================================
   MODALE
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,27,43,.55); display: grid; place-items: center; padding: var(--s-6); }
.modal {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
  width: 100%; max-width: 1040px; max-height: 90vh; overflow: auto;
}
.modal__head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--grey-100);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal__title { font-size: var(--text-xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tight); margin: 0; }
/* Section de modale : overline + contenu, séparées par un filet */
.msection { padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--grey-50); display: flex; flex-direction: column; gap: var(--s-4); }
.msection:last-child { border-bottom: 0; }

/* ============================================================
   BANNIÈRE MISSION (hub d'appels)
   ============================================================ */
.mission {
  background:
    radial-gradient(560px 200px at 88% -40%, rgba(58,210,245,.16), transparent 70%),
    linear-gradient(120deg, var(--navy-900), var(--navy-950));
  color: #fff; border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(58,210,245,.14);
  padding: var(--s-5) var(--s-6); display: flex; align-items: center; gap: var(--s-5);
}
.mission__kicker { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .1em; text-transform: uppercase; color: var(--brand-400); }
.mission__title { font-size: var(--text-xl); font-weight: var(--weight-heavy); line-height: var(--leading-tight); }
.mission__sub { font-size: var(--text-sm); color: rgba(255,255,255,.65); }
.mission--urgent .mission__kicker { color: #FCA5A5; }

/* ============================================================
   KANBAN
   ============================================================ */
.kboard { display: flex; gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-3); }
.kcol { width: 300px; flex: none; display: flex; flex-direction: column; gap: var(--s-2); }
.kcol__head {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--kbg, var(--grey-50)); color: var(--kfg, var(--grey-600));
  border-radius: var(--r-md); padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm); font-weight: var(--weight-bold); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.kcol__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--kdot, var(--grey-400)); }
.kcol__count { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .75; }
.kcol__body { display: flex; flex-direction: column; gap: var(--s-2); overflow-y: auto; }
.kcol__total {
  margin-top: auto; padding: var(--s-2) var(--s-3); border-top: 2px solid var(--kbg, var(--grey-100));
  font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--grey-600);
  font-variant-numeric: tabular-nums; display: flex; justify-content: space-between;
}
.kcard {
  background: var(--surface); border: 1px solid var(--grey-100); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); padding: var(--s-3); cursor: grab;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.kcard:hover { border-color: var(--grey-200); box-shadow: var(--shadow-2); }
.kcard__top { display: flex; align-items: baseline; gap: var(--s-2); justify-content: space-between; }
.kcard__name { font-weight: var(--weight-bold); font-size: var(--text-sm); color: var(--grey-900); }
.kcard__sub { font-size: var(--text-xs); color: var(--grey-500); }
.kcard__amount { font-size: var(--text-sm); font-weight: var(--weight-heavy); font-variant-numeric: tabular-nums; }
.kcard__amount--real { color: var(--money-real); }
.kcard__amount--pot  { color: var(--money-pot); }
.kcard__actions { display: flex; gap: 6px; margin-top: 2px; }

/* ============================================================
   LISTES DE LIGNES (classement, leads à traiter, formations)
   ============================================================ */
.list-row {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--row-h); padding: var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--grey-50); transition: background var(--transition);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--brand-50); }
.list-row--me { background: var(--brand-50); box-shadow: inset 2px 0 0 var(--brand-500); }

/* ============================================================
   DIVERS
   ============================================================ */
.empty { color: var(--grey-400); font-size: var(--text-sm); font-style: italic; }
.divider { border: 0; border-top: 1px solid var(--grey-100); margin: 0; }
.fab {
  position: fixed; right: var(--s-5); bottom: var(--s-5);
  background: linear-gradient(180deg, #0E2C50, var(--navy-950)); color: #fff; border: 0; cursor: pointer;
  height: 48px; padding: 0 var(--s-5); border-radius: var(--r-full);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-bold);
  box-shadow: inset 0 0 0 1px rgba(58,210,245,.30), var(--shadow-2), 0 0 20px rgba(58,210,245,.18);
  display: inline-flex; align-items: center; gap: var(--s-2); color: var(--brand-400);
}
.fab:hover { box-shadow: inset 0 0 0 1px rgba(58,210,245,.55), var(--shadow-2), var(--glow-brand); }

/* Scrollbars fines (kanban, colonnes) */
.kboard::-webkit-scrollbar, .kcol__body::-webkit-scrollbar { height: 10px; width: 8px; }
.kboard::-webkit-scrollbar-thumb, .kcol__body::-webkit-scrollbar-thumb { background: var(--grey-200); border-radius: var(--r-full); }
.kboard::-webkit-scrollbar-track, .kcol__body::-webkit-scrollbar-track { background: transparent; }
