/* ==========================================================================
   Suada Sovereign Sales Intelligence — Leads Kanban & Prospection Hub CSS
   Charte Dinia.ai / Suada : Or #CC9F33, Dark #030712, Surfaces #0F172A, Bordures #1E293B
   Règle 18 (< 800L), Règle 22 (Zero Emoji, Lucide Icons) & Règle 23 (Granularite)
   ========================================================================== */

/* --- Barre de Navigation Principale Suada (Header) --- */

.suada-nav-tabs {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.suada-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 5px 11px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.suada-nav-tab i,

.suada-nav-tab svg { width: 14px; height: 14px; stroke-width: 2.2; }

.suada-nav-tab:hover { color: #f8fafc; background: rgba(255, 255, 255, 0.04); }

.suada-nav-tab.active {
  background: var(--suada-gold, #CC9F33);
  color: #030712 !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(204, 159, 51, 0.25);
}

.nav-counter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

.suada-nav-tab.active .nav-counter-pill { background: #030712; color: var(--suada-gold, #CC9F33); }

/* --- Conteneur Vue Prospection --- */

#viewProspectionHub {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}

/* --- Header / Toolbar du Hub de Prospection --- */

.leads-hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 12px);
  padding: 12px 18px;
  backdrop-filter: blur(12px);
}

.leads-hub-title-block { display: flex; align-items: center; gap: 0.75rem; }

.leads-hub-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leads-hub-title i { color: var(--suada-gold, #CC9F33); width: 18px; height: 18px; }

.leads-hub-badge-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(204, 159, 51, 0.12);
  color: var(--suada-gold, #CC9F33);
  border: 1px solid rgba(204, 159, 51, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
}

.leads-hub-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.leads-search-box {
  position: relative;
  min-width: 260px;
  display: flex;
  align-items: center;
}

.leads-search-box i,

.leads-search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-dim, #64748b);
  pointer-events: none;
  z-index: 2;
}

.leads-search-input {
  width: 100%;
  padding: 7px 30px 7px 32px;
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm, 8px);
  color: #f8fafc;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}

.btn-search-clear:hover { background: rgba(255, 255, 255, 0.2); color: #f8fafc; }

.btn-search-clear svg, .btn-search-clear i { width: 12px; height: 12px; pointer-events: none; }

.leads-search-input:focus { border-color: var(--suada-gold, #CC9F33); box-shadow: 0 0 0 2px rgba(204, 159, 51, 0.18); }

.btn-primary-suada {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--suada-gold, #CC9F33);
  color: #030712;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm, 8px);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary-suada:hover { background: var(--suada-gold-hover, #e5b43c); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(204, 159, 51, 0.3); }

.btn-primary-suada i { width: 14px; height: 14px; stroke-width: 2.5; }

.btn-refresh-suada {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  border-radius: var(--radius-sm, 8px);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh-suada:hover { color: #f8fafc; background: rgba(255, 255, 255, 0.1); }

.btn-refresh-suada i { width: 14px; height: 14px; }

/* --- Grille / Colonnes du Kanban (5 colonnes) --- */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 0.9rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  min-height: calc(100vh - 220px);
}

/* Colonne Kanban */

.kanban-col {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md, 12px);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.kanban-col.drag-over { border-color: var(--suada-gold, #CC9F33); background: rgba(204, 159, 51, 0.05); }

/* En-tête de Colonne */

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-title-group { display: flex; align-items: center; gap: 0.5rem; }

.kanban-col-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kanban-col-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.kanban-col-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
}

/* Couleurs spécifiques par colonne */

.col-draft .kanban-col-icon { color: #94a3b8; }

.col-draft .kanban-col-header { border-top: 3px solid #94a3b8; border-top-left-radius: 12px; border-top-right-radius: 12px; }

.col-enriched .kanban-col-icon { color: #0891B2; }

.col-enriched .kanban-col-header { border-top: 3px solid #0891B2; border-top-left-radius: 12px; border-top-right-radius: 12px; }

.col-contacting .kanban-col-icon { color: var(--suada-gold, #CC9F33); }

.col-contacting .kanban-col-header { border-top: 3px solid var(--suada-gold, #CC9F33); border-top-left-radius: 12px; border-top-right-radius: 12px; }

.col-followup .kanban-col-icon { color: #A159A6; }

.col-followup .kanban-col-header { border-top: 3px solid #A159A6; border-top-left-radius: 12px; border-top-right-radius: 12px; }

.col-meeting_booked .kanban-col-icon { color: #10B981; }

.col-meeting_booked .kanban-col-header { border-top: 3px solid #10B981; border-top-left-radius: 12px; border-top-right-radius: 12px; }

/* Liste des Cartes / Drop Zone */

.kanban-cards-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-height: 200px;
}

.kanban-cards-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--text-dim, #64748b);
  font-size: 0.72rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.kanban-cards-empty i { width: 20px; height: 20px; opacity: 0.4; }

/* --- Carte Lead / Prospect (Design Dinia) --- */

.lead-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 8px);
  padding: 12px;
  cursor: grab;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.lead-card:hover { transform: translateY(-2px); border-color: rgba(204, 159, 51, 0.4); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }

.lead-card.dragging { opacity: 0.45; cursor: grabbing; transform: scale(0.98); }

/* Header Carte : Entreprise & Urgence */

.lead-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 6px;
}

.lead-company-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.lead-urgency-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.urgency-normale { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

.urgency-haute { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.28); }

.urgency-critique { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

/* Contact & Métadonnées */

.lead-contact-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}

.lead-contact-line i {
  width: 12px;
  height: 12px;
  color: var(--suada-gold, #CC9F33);
  flex-shrink: 0;
}

.lead-geo-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-dim, #64748b);
  margin-bottom: 8px;
}

.lead-geo-line i { width: 12px; height: 12px; flex-shrink: 0; }

/* Badges Personnalisés Carte (show_in_card = 1, Parité Hendrik Janus) */

.lead-card-custom-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.lead-custom-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.66rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(204, 159, 51, 0.08);
  border: 1px solid rgba(204, 159, 51, 0.22);
  color: var(--suada-gold, #CC9F33);
}

.lead-custom-pill strong { color: #f8fafc; font-weight: 600; }

/* Badge Audio / Dictée de repérage */

.lead-audio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.lead-audio-badge i { width: 11px; height: 11px; }

/* Badge Dossier BIF */

.lead-bif-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(204, 159, 51, 0.12);
  border: 1px solid rgba(204, 159, 51, 0.35);
  color: var(--suada-gold, #CC9F33);
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  width: fit-content;
}

.lead-bif-badge:hover { background: rgba(204, 159, 51, 0.25); border-color: var(--suada-gold, #CC9F33); color: #ffd875; }

.lead-bif-badge i { width: 12px; height: 12px; }

/* Footer Carte : Actions Rapides */

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lead-card-date { font-size: 0.65rem; color: var(--text-dim, #64748b); font-family: 'JetBrains Mono', monospace; }

.lead-card-actions { display: flex; align-items: center; gap: 4px; }

.btn-card-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-card-action:hover { background: rgba(255, 255, 255, 0.12); color: #f8fafc; border-color: rgba(255, 255, 255, 0.2); }

.btn-card-action i { width: 12px; height: 12px; }

.btn-card-next { color: var(--suada-gold, #CC9F33); border-color: rgba(204, 159, 51, 0.25); }

.btn-card-next:hover { background: var(--suada-gold, #CC9F33); color: #030712; }

/* --- Responsive Kanban Mobile / Tablette --- */

@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(5, minmax(260px, 1fr));
  }
.suada-nav-tabs { margin-left: 0.5rem; }
}

@media (max-width: 768px) {
  .leads-hub-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
.leads-search-box { min-width: 100%; }
.leads-hub-controls { justify-content: space-between; }
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.75rem;
    padding-bottom: 2rem;
  }
.kanban-col { min-width: 82vw; scroll-snap-align: center; }
}

/* --- Badge Date de Relance Kanban --- */

.lead-card-followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  width: fit-content;
  max-width: 100%;
}

.lead-card-followup-badge i { width: 12px; height: 12px; flex-shrink: 0; }

/* En retard (Overdue) - Rouge */

.lead-card-followup-badge.followup-overdue { background: rgba(239, 68, 68, 0.14); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.35); }

.lead-card-followup-badge.followup-overdue i { color: #EF4444; }

/* Aujourd'hui (Today) - Or / Ambre */

.lead-card-followup-badge.followup-today { background: rgba(245, 158, 11, 0.14); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.35); }

.lead-card-followup-badge.followup-today i { color: #F59E0B; }

/* À venir (Upcoming) - Vert / Cyan */

.lead-card-followup-badge.followup-upcoming { background: rgba(16, 185, 129, 0.12); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }

.lead-card-followup-badge.followup-upcoming i { color: #10B981; }

/* Sous-filtre d'action contextuel pour la colonne À Relancer */

.kanban-col-subfilter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(3, 7, 18, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.kanban-col-subfilter::-webkit-scrollbar { display: none; }

.subfilter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.subfilter-chip:hover { background: rgba(255, 255, 255, 0.09); color: #f8fafc; }

.subfilter-chip.active { background: rgba(204, 159, 51, 0.18); border-color: var(--suada-gold, #CC9F33); color: #f8fafc; }

.subfilter-chip.chip-overdue.active { background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #fca5a5; }

.subfilter-chip.chip-today.active { background: rgba(204, 159, 51, 0.22); border-color: #CC9F33; color: #ffd875; }

.subfilter-chip.chip-upcoming.active { background: rgba(16, 185, 129, 0.2); border-color: #10b981; color: #6ee7b7; }

.subfilter-chip.is-empty { opacity: 0.45; }

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-overdue { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

.dot-today { background: #CC9F33; box-shadow: 0 0 6px rgba(204, 159, 51, 0.6); }

.dot-upcoming { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }

.chip-count {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

/* État recherche sans résultat */

.kanban-search-empty-state {
  width: 100%;
  max-width: 480px;
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.search-empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(204, 159, 51, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--suada-gold, #CC9F33);
  margin-bottom: 0.75rem;
}

.search-empty-icon svg { width: 22px; height: 22px; }

.search-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 0.35rem 0;
}

.search-empty-text { font-size: 0.8rem; color: #94a3b8; margin: 0 0 1.2rem 0; }

.search-empty-text strong { color: #f8fafc; }

.btn-clear-search-action {
  background: rgba(204, 159, 51, 0.14);
  border: 1px solid var(--suada-gold, #CC9F33);
  color: var(--suada-gold, #CC9F33);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-clear-search-action:hover { background: rgba(204, 159, 51, 0.25); color: #ffd875; }

.btn-clear-search-action svg { width: 12px; height: 12px; }

/* Téléphones cliquables 1-tap direct sur la carte Kanban */
.lead-card-phones {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 6px 0;
}

.lead-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm, 6px);
  padding: 3px 8px;
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', -apple-system, monospace;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.lead-phone-link:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
  transform: translateY(-1px);
}

.lead-phone-link svg,
.lead-phone-link i {
  width: 11px;
  height: 11px;
  color: #10b981;
  flex-shrink: 0;
}
