/* ============================================================
   c3c-modules.css — Styles des nouveaux modules
   ------------------------------------------------------------
   Fichier ADDITIF : app.css n'est jamais modifié.
   À charger APRÈS app.css. Réutilise ses design tokens.
   ============================================================ */

/* ---------- Bouton "Transformer en affaire" (carte prospect) ---------- */
.btn-affaire{
  width:100%;margin-top:8px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
}
.btn-affaire .btn-ico{width:15px;height:15px;flex:0 0 auto}
.btn-affaire:disabled{opacity:.6;cursor:wait}

/* ---------- Grille générique ---------- */
.mod-grid{display:grid;gap:18px}
.mod-grid.cols-2{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.mod-grid.cols-3{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.mod-grid.cols-4{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}

.mod-card{
  background:var(--paper);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:20px;box-shadow:var(--shadow-soft);
}
.mod-card h2,.mod-card h3{margin:0 0 12px}
.mod-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.mod-card-head h2,.mod-card-head h3{margin:0}

.mod-empty{
  padding:36px 20px;text-align:center;color:var(--muted);
  border:1px dashed var(--line);border-radius:var(--radius-sm);
}

/* ---------- KPI ---------- */
.mod-kpi{
  background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:16px 18px;box-shadow:var(--shadow-soft);
}
.mod-kpi .k-label{font-size:.74rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700}
.mod-kpi .k-value{font-size:1.75rem;font-weight:850;color:var(--green-950);margin-top:6px;line-height:1.1}
.mod-kpi .k-sub{font-size:.82rem;color:var(--muted);margin-top:4px}
.mod-kpi .k-sub.up{color:#137a24;font-weight:700}
.mod-kpi .k-sub.down{color:#b91c1c;font-weight:700}

/* ---------- Pipeline kanban ----------
   7 étapes (voir C3CCRM.ETAPES). En colonnes rigides de 288px, le board
   déborde (7 x 288 + gaps ~ 2100px) et impose un scroll horizontal qui
   coupe les cartes de droite. On repasse donc en WRAP : les colonnes
   s'adaptent à la largeur et redescendent sur une 2e ligne si besoin.
   Plus de scroll-snap ni d'overflow-x : tout est visible d'un coup. */
.pipe-board{
  display:flex;flex-wrap:wrap;gap:14px;padding:4px 4px 18px;
  align-items:flex-start;
}
.pipe-col{
  /* Élastique : grandit pour occuper la ligne, se réduit jusqu'à 260px,
     puis passe à la ligne suivante. */
  flex:1 1 260px;min-width:260px;
  background:rgba(1,27,1,.035);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:12px;display:flex;flex-direction:column;
}
.pipe-col.drop-hover{background:rgba(246,97,3,.10);border-color:var(--orange-600)}
.pipe-col-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.pipe-col-head strong{font-size:.9rem;color:var(--green-950)}
.pipe-count{
  background:var(--green-900);color:#fff;border-radius:999px;
  padding:2px 9px;font-size:.72rem;font-weight:800;
}
.pipe-col-total{font-size:.78rem;color:var(--muted);margin-bottom:10px;font-weight:700}
/* min-height : en wrap, une colonne vide s'écraserait à quelques pixels
   et deviendrait une cible de drop inatteignable. On lui garantit une
   surface de dépôt. flex:1 la fait ensuite grandir avec son contenu. */
.pipe-cards{display:flex;flex-direction:column;gap:10px;min-height:120px;flex:1}

.deal-card{
  background:var(--paper);border:1px solid var(--line);border-radius:12px;
  padding:12px;cursor:grab;box-shadow:0 2px 8px rgba(1,27,1,.06);
  transition:transform .12s,box-shadow .12s;
}
.deal-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-soft)}
.deal-card.dragging{opacity:.45;cursor:grabbing}
.deal-card .d-name{font-weight:800;color:var(--green-950);font-size:.92rem;margin-bottom:6px}
.deal-card .d-amount{font-weight:850;color:var(--orange-600);font-size:1.02rem}
.deal-card .d-meta{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-size:.76rem;color:var(--muted)}

.deal-card .d-stale{color:#b91c1c;font-weight:800}

/* ---------- Badges température / statut ---------- */
.tag{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.72rem;font-weight:800;letter-spacing:.02em}
.tag-chaud{background:#fde3d0;color:#9a3412}
.tag-tres-chaud{background:#fdd0d0;color:#991b1b}
.tag-moyen{background:#fdf0cf;color:#854d0e}
.tag-froid{background:#dbeafe;color:#1e40af}
.tag-gagne{background:#d1fae5;color:#065f46}
.tag-perdu{background:#e5e7eb;color:#374151}
.tag-chef{background:var(--green-900);color:#fff}
.tag-manager{background:#145b12;color:#fff}
.tag-commercial{background:#fde3d0;color:#9a3412}
.tag-observateur{background:#e5e7eb;color:#374151}

/* ---------- Timeline d'activités ---------- */
.timeline{list-style:none;margin:0;padding:0;position:relative}
.timeline::before{content:"";position:absolute;left:15px;top:8px;bottom:8px;width:2px;background:var(--line)}
.tl-item{position:relative;padding:0 0 20px 42px}
.tl-dot{
  position:absolute;left:6px;top:2px;width:20px;height:20px;border-radius:50%;
  background:var(--paper);border:2px solid var(--green-700);
  display:grid;place-items:center;color:var(--green-700);
}
.tl-dot svg{width:11px;height:11px}
.tl-item.type-vente .tl-dot{border-color:var(--orange-600);color:var(--orange-600)}
.tl-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.tl-head strong{font-size:.9rem;color:var(--green-950)}
.tl-time{font-size:.75rem;color:var(--muted)}
.tl-body{font-size:.88rem;color:var(--ink);margin-top:4px;line-height:1.5}
.tl-ia{
  margin-top:8px;padding:9px 12px;border-left:3px solid var(--orange-600);
  background:rgba(246,97,3,.06);border-radius:0 8px 8px 0;font-size:.84rem;color:var(--ink);
}

/* ---------- Gamification ---------- */
.xp-bar{height:11px;border-radius:999px;background:rgba(1,27,1,.10);overflow:hidden;margin:8px 0}
.xp-fill{
  height:100%;border-radius:999px;
  background:linear-gradient(90deg,var(--orange-600),var(--orange-500));
  transition:width .6s cubic-bezier(.22,1,.36,1);
}
.niveau-badge{
  width:60px;height:60px;border-radius:16px;display:grid;place-items:center;
  background:var(--green-950);color:#fff;font-weight:850;line-height:1;flex:0 0 auto;
}
.niveau-badge span{font-size:1.4rem}
.niveau-badge small{font-size:.58rem;opacity:.75;text-transform:uppercase;letter-spacing:.08em}

.streak{
  display:inline-flex;align-items:center;gap:6px;font-weight:850;color:var(--orange-600-text);
}

.momentum{
  display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;
  background:var(--green-950);color:#fff;font-weight:850;
}
.momentum .m-x{color:var(--orange-500-on-dark);font-size:1.15rem}
.momentum-bar{flex:1;height:6px;border-radius:999px;background:rgba(255,255,255,.18);overflow:hidden;min-width:70px}
.momentum-fill{height:100%;background:var(--orange-500);transition:width .3s linear}

.badge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:12px}
.badge{
  text-align:center;padding:12px 6px;border-radius:12px;border:1px solid var(--line);
  background:var(--paper);
}
.badge.locked{opacity:.34;filter:grayscale(1)}
.badge .b-ico{font-size:1.7rem;line-height:1}
.badge .b-name{font-size:.7rem;font-weight:800;color:var(--green-950);margin-top:6px;line-height:1.25}

/* ---------- Classement ---------- */
.rank-list{list-style:none;margin:0;padding:0}
.rank-row{
  display:flex;align-items:center;gap:12px;padding:11px 12px;
  border-bottom:1px solid var(--line);border-radius:10px;
}
.rank-row:last-child{border-bottom:0}
.rank-row.me{background:rgba(246,97,3,.08);border:1px solid var(--orange-600)}
.rank-pos{width:30px;font-weight:850;color:var(--muted);text-align:center;flex:0 0 auto}
.rank-row:nth-child(1) .rank-pos{color:#b8860b;font-size:1.1rem}
.rank-row:nth-child(2) .rank-pos{color:#71717a;font-size:1.05rem}
.rank-row:nth-child(3) .rank-pos{color:#a16207;font-size:1.02rem}
.rank-av{
  width:34px;height:34px;border-radius:9px;background:var(--green-900);color:#fff;
  display:grid;place-items:center;font-weight:850;font-size:.78rem;flex:0 0 auto;
}
.rank-name{flex:1;font-weight:700;color:var(--green-950);font-size:.9rem;min-width:0}
.rank-name small{display:block;font-weight:600;color:var(--muted);font-size:.74rem}
.rank-xp{font-weight:850;color:var(--orange-600);flex:0 0 auto}

/* ---------- Boss de fin de mois ---------- */
.boss{
  background:linear-gradient(135deg,var(--green-950),var(--green-800));
  color:#fff;border-radius:var(--radius-sm);padding:22px;
}
.boss h3{color:#fff;margin:0 0 4px}
.boss .boss-sub{opacity:.78;font-size:.85rem;margin-bottom:14px}
.boss-hp{height:16px;border-radius:999px;background:rgba(255,255,255,.16);overflow:hidden}
.boss-hp-fill{
  height:100%;background:linear-gradient(90deg,#dc2626,var(--orange-500));
  transition:width .8s cubic-bezier(.22,1,.36,1);
}
.boss-foot{display:flex;justify-content:space-between;margin-top:9px;font-size:.8rem;opacity:.88;font-weight:700}

/* ---------- Table équipe ---------- */
.mod-table{width:100%;border-collapse:collapse;font-size:.9rem}
.mod-table th{
  text-align:left;padding:11px 12px;font-size:.72rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--muted);border-bottom:2px solid var(--line);font-weight:800;
}
.mod-table td{padding:13px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
.mod-table tr:last-child td{border-bottom:0}
.mod-table .cell-user{display:flex;align-items:center;gap:10px}

/* ---------- Code d'invitation ---------- */
.invite-code{
  display:flex;align-items:center;gap:12px;padding:14px 18px;
  background:var(--green-950);color:#fff;border-radius:14px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:1.4rem;font-weight:850;letter-spacing:.16em;
}
.invite-code button{
  margin-left:auto;background:var(--orange-600);color:#fff;border:0;
  padding:8px 14px;border-radius:9px;font-weight:800;cursor:pointer;
  font-family:inherit;font-size:.8rem;letter-spacing:normal;
}

/* ---------- Choix de profil (inscription) ---------- */
.choix-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin:22px 0}
.choix{
  padding:22px;border:2px solid var(--line);border-radius:var(--radius-sm);
  background:var(--paper);cursor:pointer;text-align:left;transition:border-color .15s,transform .15s;
}
.choix:hover{transform:translateY(-2px)}
.choix.on{border-color:var(--orange-600);background:rgba(246,97,3,.05)}
.choix .c-ico{font-size:1.9rem;line-height:1}
.choix h3{margin:10px 0 6px}
.choix p{margin:0;font-size:.86rem;color:var(--muted);line-height:1.5}

/* ---------- Coach IA ---------- */
.coach-action{
  display:flex;gap:12px;padding:14px;border:1px solid var(--line);
  border-radius:12px;background:var(--paper);margin-bottom:10px;align-items:flex-start;
}
.coach-urg{
  width:5px;border-radius:999px;flex:0 0 auto;align-self:stretch;background:var(--line);
}
.coach-urg.u5,.coach-urg.u4{background:#dc2626}
.coach-urg.u3{background:var(--orange-600)}
.coach-urg.u2,.coach-urg.u1{background:var(--green-700)}
.coach-body{flex:1;min-width:0}
.coach-body strong{display:block;color:var(--green-950);font-size:.92rem}
.coach-why{font-size:.82rem;color:var(--muted);margin-top:3px;line-height:1.45}

/* ---------- Rappel IA ---------- */
.ia-note{
  display:flex;gap:10px;align-items:flex-start;padding:12px 14px;
  border-radius:12px;background:rgba(1,27,1,.04);border:1px solid var(--line);
  font-size:.84rem;color:var(--muted);line-height:1.5;
}
.ia-note svg{width:17px;height:17px;flex:0 0 auto;margin-top:1px;color:var(--green-700)}

/* ---------- Toast XP ---------- */
.xp-toast{
  position:fixed;bottom:26px;right:26px;z-index:9999;
  background:var(--green-950);color:#fff;padding:13px 20px;border-radius:14px;
  font-weight:850;box-shadow:var(--shadow);
  transform:translateY(140%);transition:transform .4s cubic-bezier(.22,1,.36,1);
}
.xp-toast.show{transform:translateY(0)}
.xp-toast .xp-plus{color:var(--orange-500)}

/* ---------- Responsive ---------- */
@media (max-width:760px){
  .pipe-col{flex:0 0 84vw;min-width:84vw}
  .mod-table thead{display:none}
  .mod-table tr{display:block;border-bottom:1px solid var(--line);padding:10px 0}
  .mod-table td{display:flex;justify-content:space-between;border:0;padding:6px 2px;gap:12px}
  .mod-table td::before{content:attr(data-th);font-weight:800;color:var(--muted);font-size:.76rem}
  .xp-toast{left:16px;right:16px;bottom:16px}
}

/* ============================================================
   Fiche prospect étoffée — sections, adresse BAN, localisation
   ------------------------------------------------------------
   Complète .fiche-edit (défini dans app.css). Aucune règle
   existante n'est redéfinie ici.
   ============================================================ */

/* --- Titres de section dans la fiche --- */
.fiche-edit .fe-sect{
  margin:14px 0 -2px;
  font-size:.74rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  padding-bottom:7px;
  border-bottom:1px solid rgba(1,27,1,.10);
}
.fiche-edit .fe-sect:first-of-type{margin-top:6px}

.fiche-edit textarea{
  width:100%;
  min-height:84px;
  resize:vertical;
  font:inherit;
  padding:11px 13px;
  border:1px solid rgba(1,27,1,.16);
  border-radius:12px;
  background:#fff;
  color:var(--ink);
}
.fiche-edit textarea:focus{
  outline:none;
  border-color:var(--orange-600);
  box-shadow:0 0 0 3px rgba(234,88,12,.14);
}

.fiche-edit .fe-hint{
  display:block;
  margin-top:5px;
  font-size:.74rem;
  font-weight:600;
  color:var(--muted);
}

/* --- Autocomplétion d'adresse (Base Adresse Nationale) --- */
.adr-field{position:relative}

.adr-suggest{
  position:absolute;
  z-index:40;
  top:100%;
  left:0;
  right:0;
  margin:4px 0 0;
  padding:5px;
  list-style:none;
  background:#fff;
  border:1px solid rgba(1,27,1,.14);
  border-radius:12px;
  box-shadow:0 16px 40px rgba(1,27,1,.16);
  max-height:236px;
  overflow-y:auto;
}
.adr-suggest li{
  padding:9px 11px;
  border-radius:9px;
  font-size:.86rem;
  font-weight:600;
  color:var(--ink);
  cursor:pointer;
}
.adr-suggest li:hover,
.adr-suggest li.is-active{
  background:rgba(234,88,12,.10);
  color:var(--orange-600);
}

/* --- Bloc localisation (coordonnées + liens Maps) --- */
.fiche-geo{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:11px 13px;
  border-radius:12px;
  background:rgba(1,27,1,.04);
  border:1px solid rgba(1,27,1,.08);
}
.fiche-geo .geo-coords{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:.82rem;
  font-weight:800;
  color:var(--green-950);
  font-variant-numeric:tabular-nums;
}
.fiche-geo .geo-coords svg{width:15px;height:15px;flex:none;color:var(--orange-600)}
.fiche-geo .geo-vide{
  font-size:.8rem;
  font-weight:600;
  color:var(--muted);
  line-height:1.45;
}

/* --- Pied de fiche : transformation en affaire --- */
.fiche-edit .fe-affaire{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:4px;
  padding-top:15px;
  border-top:1px solid rgba(1,27,1,.10);
}
.fiche-edit .fe-affaire-note{
  flex:1;
  min-width:190px;
  font-size:.76rem;
  font-weight:600;
  color:var(--muted);
  line-height:1.45;
}

@media (max-width:640px){
  .fiche-geo{align-items:stretch;flex-direction:column}
  .fiche-geo .btn{justify-content:center;text-align:center}
  .fiche-edit .fe-affaire{align-items:stretch;flex-direction:column}
  .fiche-edit .fe-affaire .btn{justify-content:center;text-align:center}
}

/* ============================================================
   AGENT PROSPECTOR — mise en scène du formulaire
   Sections thématiques + barre de progression narrative.
   Ajouté sans toucher aux styles .field/.check-pill d'app.css
   (réutilisés tels quels). Couleurs = charte C3C.
   ============================================================ */

/* ---- Barre de progression narrative ---- */
.agent-quete{
  margin:0 0 22px;padding:18px 20px;border-radius:20px;
  background:linear-gradient(135deg,rgba(20,80,26,.05),rgba(254,131,4,.04));
  border:1px solid var(--line);
}
.aq-top{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}
.aq-msg{display:flex;align-items:center;gap:11px;font-weight:800;color:var(--green-950);font-size:.96rem}
.aq-bot{width:38px;height:38px;flex:none;border-radius:12px;background:var(--green-950);display:grid;place-items:center;animation:aq-bob 2.6s ease-in-out infinite}
.aq-bot svg{width:24px;height:24px}
@keyframes aq-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.aq-count{font-weight:900;font-size:1.4rem;color:var(--orange-600);white-space:nowrap;line-height:1}
.aq-count small{font-size:.8rem;color:var(--muted);font-weight:800}
.aq-bar{height:12px;border-radius:999px;background:rgba(20,80,26,.10);overflow:hidden;position:relative}
.aq-fill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--green-700),var(--orange-500));transition:width .5s cubic-bezier(.2,.9,.3,1);position:relative}
.aq-fill::after{content:"";position:absolute;inset:0;border-radius:999px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);animation:aq-shine 1.8s linear infinite}
@keyframes aq-shine{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){.aq-bot,.aq-fill::after{animation:none}}

/* ---- Sections thématiques ---- */
.agent-section{
  margin-top:16px;border:1px solid var(--line);border-radius:18px;overflow:hidden;
  background:var(--paper);transition:border-color .2s, box-shadow .2s;
}
.agent-section:first-of-type{margin-top:0}
.agent-section:hover{border-color:rgba(20,80,26,.28);box-shadow:0 6px 20px rgb(20 80 26 / .07)}
.as-head{display:flex;align-items:center;gap:13px;padding:15px 18px;background:linear-gradient(135deg,var(--sec-tint),transparent)}
.as-ic{width:42px;height:42px;flex:none;border-radius:13px;display:grid;place-items:center;background:var(--sec-solid);color:#fff;box-shadow:0 4px 12px var(--sec-glow)}
.as-ic svg{width:23px;height:23px}
.as-titles{flex:1;min-width:0}
.as-titles strong{display:block;font-size:1rem;font-weight:850;color:var(--green-950);line-height:1.2}
.as-titles span{display:block;font-size:.79rem;color:var(--muted);font-weight:600;margin-top:2px}
.as-tick{width:26px;height:26px;flex:none;border-radius:999px;border:2px solid var(--line);display:grid;place-items:center;color:transparent;transition:.25s}
.as-tick svg{width:15px;height:15px}
.agent-section.done .as-tick{background:var(--green-700);border-color:var(--green-700);color:#fff}
.as-body{padding:6px 18px 20px}

/* accents par section */
.agent-section.s-cible{--sec-solid:var(--green-800);--sec-tint:rgba(47,148,51,.09);--sec-glow:rgba(47,148,51,.3)}
.agent-section.s-profil{--sec-solid:var(--green-700);--sec-tint:rgba(63,156,58,.09);--sec-glow:rgba(63,156,58,.3)}
.agent-section.s-offre{--sec-solid:var(--orange-500);--sec-tint:rgba(254,131,4,.09);--sec-glow:rgba(254,131,4,.3)}
.agent-section.s-canal{--sec-solid:var(--orange-600);--sec-tint:rgba(246,97,3,.09);--sec-glow:rgba(246,97,3,.3)}

/* ---- Champs vivants (complète app.css, ne le remplace pas) ---- */
.agent-section .field label{display:flex;align-items:center;gap:7px}
.agent-section .field label svg{width:15px;height:15px;color:var(--green-700);flex:none}
.agent-section .field.filled input[type=text],
.agent-section .field.filled select{border-color:var(--green-700);background:rgba(63,156,58,.04)}
.agent-section input[type=text]:hover,
.agent-section select:hover{border-color:rgba(20,80,26,.3)}
.agent-section .check-pill:hover{border-color:rgba(246,97,3,.4);transform:translateY(-1px)}
.agent-section .check-pill:has(input:checked){box-shadow:0 3px 10px rgba(246,97,3,.15)}
