/* ==========================================
   VARIABLES & BASICS
   ========================================== */
:root {
    --bg-color: #f4f6f9;
    --card-color: #ffffff;
    --text-main: #2d3748;
    --primary: #4a5568;
    --accent: #3182ce;
    --success: #38a169;
    --red: #e53e3e;
    --black: #1e1e1e;
    --yellow: #FFD700;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: var(--bg-color); 
    color: var(--text-main); 
    margin: 0; 
    padding: 20px; 
}

header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #e2e8f0; 
    padding-bottom: 15px; 
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 32px;       /* Ajustez la hauteur selon les proportions de votre logo */
    width: auto;        /* Conserve le ratio de l'image */
    object-fit: contain;
}

.controls { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
}

.global-leads-badge {
    background-color: #f1f5f9; /* Fond gris clair doux */
    color: #475569;            /* Texte ardoise */
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 8px;        /* Même arrondi que vos boutons */
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#globalLeadsCount {
    color: #0f172a;            /* Met en valeur le chiffre brut en plus foncé */
    font-weight: 800;
}

.pipeline-selector select { 
    padding: 8px 16px; 
    border-radius: 6px; 
    border: 1px solid #cbd5e0; 
    font-size: 16px; 
    font-weight: 600; 
    color: var(--primary); 
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-add { 
    background: var(--yellow); 
    color: var(--black); 
    border: none; 
    padding: 10px 18px; 
    border-radius: 6px; 
    font-size: 14px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: all 0.2s; 
}

.btn-add:hover { 
    opacity: 0.8;
}

.btn-cancel { 
    background: #e2e8f0; 
    color: #4a5568; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
}

.btn-save { 
    background: var(--accent); 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
}

.website-link {
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.card-actions {
    position: absolute;
    bottom: 0px;
    right: 4px;
    display: flex;
    gap: 6px;
    cursor: pointer;
    font-size: 6px;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.card-actions button {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    transition: all 0.3s ease;
}

.card-actions button:hover, .website-link:hover  {
    background-color: #dee3e8;
}

/* Boutons d'action inter-pipelines générés en JS */
.action-pipeline-btn {
    margin-top: 10px; 
    width: 100%; 
    border: none; 
    padding: 5px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: bold; 
    cursor: pointer;
    color: white;
}

.btn-promote { background: #3182ce; }
.btn-onboarding { background: #38a169; }

/* ==========================================
   STATS
   ========================================== */

/* Bouton Statistiques dans le Header */
.btn-stats {
    background: var(--black);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-stats:hover {
    background: #2d3748;
}

/* Ajustement largeur modal pour les statistiques */
.modal-stats-width {
    width: 450px !important;
}

/* Grille de cartes KPI */
.stats-grid {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    flex: 1;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-card.card-won-bg {
    background: #f0fff4;
    border-color: #c6f6d5;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #718096;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.stat-card.card-won-bg .stat-value {
    color: #22543d;
}

/* Lignes de répartition par pipeline */
.stats-pipeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #edf2f7;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.badge-count {
    background: #3182ce;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

/* Conteneur pour limiter la hauteur à environ 3 éléments */
.stats-scroll-list {
    max-height: 140px;          /* Hauteur idéale pour afficher environ 3 lignes */
    overflow-y: auto;           /* Active le scroll vertical si ça dépasse */
    border: 1px solid #e2e8f0;  /* Fine bordure pour délimiter la zone de scroll */
    border-radius: 6px;
    padding: 8px 12px;
    background-color: #f8fafc;  /* Léger fond gris pour l'effet "zone dédiée" */
    margin-top: 8px;
    margin-bottom: 15px;
}

/* Style des lignes à l'intérieur de la liste */
.stats-row-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.stats-row-item:last-child {
    border-bottom: none; /* Supprime la bordure sur le dernier élément */
}


/* Force le scroll sur le bloc des industries et des rôles */
.stats-scroll-list {
    max-height: 160px !important;   /* Hauteur fixe pour afficher environ 2 à 3 lignes max */
    overflow-y: auto !important;    /* Force l'apparition du scroll vertical */
    display: block !important;
    border: 1px solid #e2e8f0;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

/* Style de la barre de défilement pour qu'elle soit visible et propre */
.stats-scroll-list::-webkit-scrollbar {
    width: 5px;
}
.stats-scroll-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}
.stats-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}


/* ==========================================
   KANBAN BOARD & COLUMNS
   ========================================== */
.kanban-board { 
    display: flex; 
    gap: 20px; 
    overflow-x: auto; 
    padding-bottom: 15px; 
    align-items: flex-start; 
}

.kanban-column { 
    background: #edf2f7;
    max-height: 80vh;
    display: flex;
    flex-direction: column; 
    min-width: 280px; 
    width: 280px; 
    border-radius: 8px; 
    padding: 15px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    border: none;
    opacity: 1;
}

.column-static-header {
    flex-shrink: 0;
}

.active-pipeline-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 0 10px;
}

.active-pipeline-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
}

.pipeline-main-badge {
    background-color: #3b82f6; /* Bleu moderne */
    color: white;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

#btnClearFilters:hover {
    background-color: #dc2626 !important; /* Rouge un peu plus foncé au survol */
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 8px; /* Espace entre le texte et le badge */
}

.stage-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pousse le tooltip tout à droite */
    margin-bottom: 5px;
    position: relative;
    gap: 10px;
}

.column-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #cbd5e0;
    color: #4a5568;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 14px;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
}

/* Optionnel : Si tu veux que le badge s'adapte visuellement aux colonnes de Victoire (Vert) */
.kanban-column.column-victory .column-badge {
    background-color: #98e6b1;
    color: #22543d;
}

/* Optionnel : Si tu veux que le badge s'adapte visuellement aux colonnes Archivées (Gris/Rouge) */
.kanban-column.column-archived .column-badge {
    background-color: #cbd5e0;
    color: #718096;
}

.kanban-column h3 { 
    margin: 0; 
    padding: 0; 
    font-size: 14px;
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-column.column-default h3 { color: #2d3748; }

.kanban-column.column-archived {
    background-color: #e2e8f0; 
    opacity: 0.75;            
    border: 1px solid red;
}
.kanban-column.column-archived h3 { color: #4a5568; }

.kanban-column.column-victory {
    background-color: #c6f6d5; 
    border: 2px solid #68d391; 
    opacity: 1;
}
.kanban-column.column-victory h3 { color: #22543d; }

.stage-definition {
    font-size: 11px; 
    color: #718096; 
    margin-bottom: 12px; 
    font-style: italic; 
    line-height: 1.3; 
    border-bottom: 2px solid #cbd5e0;
    padding-bottom: 10px;
}

.kanban-cards { 
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    min-height: 400px;
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}
.kanban-cards::-webkit-scrollbar {
    width: 5px;
}

.kanban-cards::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

/* ==========================================
   CARDS
   ========================================== */
.card * {
    pointer-events: auto;
}

.card button, 
.card select, 
.card input {
    pointer-events: auto;
}

.card { 
    background: var(--card-color); 
    padding: 15px; 
    border-radius: 6px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    cursor: grab; 
    border-left: 4px solid var(--accent); 
    transition: transform 0.2s, box-shadow 0.2s; 
    position: relative;
    padding-right: 30px;
}

.card:active { 
    cursor: grabbing; 
}

.card.dragging {
    opacity: 0.4;
    border: 2px dashed #a0aec0;
    background: #f7fafc;
}

.column-count {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    margin-left: 5px;
}

.card h4 { 
    margin: 0 0 5px 0; 
    color: #2d3748; 
    font-size: 14px;
}

.card h4 span {
    font-size: 11px; 
    color: #718096; 
    font-weight: normal;
}

.card p { 
    margin: 0; 
    color: #4a5568; 
    font-size: 12px; 
    line-height: 1.4;
}
.card p strong { 
    font-size: 13px;
}
.card p strong span { 
    font-size: 11px;
    font-weight: normal;
}

/* Style du conteneur d'email cliquable */
.email-click-to-copy {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #475569;
    transition: color 0.2s ease;
    padding: 2px 4px;
    margin-left: -4px;
    border-radius: 4px;
}

/* Effet de survol sur l'email */
.email-click-to-copy:hover {
    color: #3b82f6; /* Devient bleu au survol */
    background-color: #eff6ff; /* Léger fond bleu */
}

/* Style de base de l'info-bulle (masquée par défaut) */
.copy-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%; /* Se place juste au-dessus du texte */
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b; /* Fond ardoise foncé */
    color: #ffffff;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Petit triangle sous l'info-bulle */
.copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Affichage de l'info-bulle au survol */
.email-click-to-copy:hover .copy-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Style vert de succès lorsque l'email est copié */
.copy-tooltip.tooltip-success {
    background-color: #16a34a; /* Fond vert */
    visibility: visible;
    opacity: 1;
}
.copy-tooltip.tooltip-success::after {
    border-color: #16a34a transparent transparent transparent;
}

/* Variations de cartes */
.card.card-archived {
    background-color: #f7fafc;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.card.card-victory {
    border-left: 5px solid #38a169; 
}

.required-asterisk {
    color: var(--red);
    margin-left: 3px;
    font-weight: bold;
}

/* ==========================================
   TOOLTIPS
   ========================================== */
.info-tooltip {
    cursor: help;
    background: #cbd5e0;
    color: #4a5568;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.info-tooltip .tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #2d3748;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 999;
    top: 100%;
    right: 0;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    font-weight: normal;
    font-style: normal;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.info-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 4px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #2d3748 transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ==========================================
   MODAL & FORMS
   ========================================== */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
}

.modal-content {
    max-height: 85vh;
    overflow-y: auto !important;
    position: relative;
    margin: auto;
    background: white; 
    padding: 25px; 
    border-radius: 12px; 
    width: 100%;
    width: 400px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.modal-content h3 { 
    margin-top: 0; 
    margin-bottom: 15px; 
    color: var(--primary); 
    font-size: 25px;
}

.form-group { 
    margin-bottom: 15px; 
}

.form-group label { 
    display: block; 
    font-size: 13px; 
    font-weight: 600; 
    margin-bottom: 5px; 
    color: #4a5568; 
}

.form-group label.bold-label {
    font-weight: bold;
}

.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #cbd5e0; 
    border-radius: 4px; 
    box-sizing: border-box; 
}
.form-group textarea, .form-group textarea::placeholder {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

.phone-container {
    display: flex; 
    gap: 10px;
}

.phone-prefix {
    background: white;
}

.phone-number {
    width: 65% !important;
}

.modal-actions { 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-top: 20px; 
}


.no-scroll {
    overflow: hidden !important;
}



/*TOAST NOTIFICATIONS*/
/* Conteneur global */
#toastContainer {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Style de base d'une notification (Style Clair & Lumineux) */
.toast-notification {
    background: #ffffff; /* Fond blanc moderne */
    color: #1e293b; /* Texte sombre pour un fort contraste */
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500; /* Texte légèrement plus épais */
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 380px;
    
    /* Animation d'entrée */
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    
    /* Transition de sortie */
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    
    /* Grosse bordure à gauche pour imposer la couleur */
    border-left: 6px solid #64748b; 
    
    /* Ombre portée douce par défaut */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* --- VARIANTES AVEC COULEURS TRÈS PRÉSENTES --- */

/* Succès (Vert CRM) */
.toast-notification.success { 
    border-left-color: #10b981;
    background: #f0fdf4; /* Fond teinté de vert très clair */
    color: #14532d; /* Texte vert très foncé */
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.2); /* Lueur verte */
}

/* Erreur (Rouge Alerte) */
.toast-notification.error { 
    border-left-color: #ef4444;
    background: #fef2f2; /* Fond teinté de rouge très clair */
    color: #7f1d1d; /* Texte rouge très foncé */
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.2); /* Lueur rouge */
}

/* Info / Suppression (Bleu) */
.toast-notification.info { 
    border-left-color: #3b82f6;
    background: #eff6ff; /* Fond teinté de bleu très clair */
    color: #1e3a8a; /* Texte bleu très foncé */
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.2); /* Lueur bleue */
}

/* --- ANIMATIONS --- */
@keyframes slideIn {
    from { 
        transform: translateX(120%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Classe de disparition */
.toast-notification.fade-out {
    opacity: 0 !important;
}