/* assets/style.css */

/* =========================================
   0. VARIABLES & THÈMES
   ========================================= */
:root {
    /* --- MODE SOMBRE (Défaut) --- */
    --bg-body: #090909;
    --bg-sidebar: #151e32;
    --bg-card: #151e32;
    --text-primary: #ffffff;
    --text-secondary: #bdc3c7;
    --accent: #3498db;
    --border-color: rgba(52, 152, 219, 0.3);
    --input-bg: #0b1121;
    --hover-bg: rgba(52, 152, 219, 0.1);
    --modal-bg: #151e32;
    --base-font-size: 16px; /* Valeur par défaut */ 
    --font-scale: 1; 
    --font-xs: 0.875rem;
    --font-sm: 0.95rem;
    --font-md: 1rem;
    --font-lg: 2.125rem;
    --font-xl: 1.25rem;

}

/* C'est ici que la magie opère */
html {
    font-size: var(--base-font-size); 
}

body {
    /* On remet 1rem (donc 100% de la variable) pour le corps */
    font-size: 1rem; 
}

/* Assurez-vous que les titres utilisent des 'rem' pour grossir proportionnellement */
h1 { font-size: 2rem; }   /* 2x la taille de base */
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

/* Pour AG Grid et les composants Dash Bootstrap */
.ag-theme-alpine, .ag-theme-alpine-dark {
    font-size: 1rem !important;
}

.btn {
    font-size: 1rem !important; /* Les boutons suivront aussi */
}


/* --- MODE CLAIR (Activé via classe) --- */
body.light-theme {
    --bg-body: #f4f6f8;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --accent: #2980b9;
    --border-color: rgba(41, 128, 185, 0.3);
    --input-bg: #ecf0f1;
    --hover-bg: rgba(41, 128, 185, 0.1);
    --modal-bg: #ffffff;

}

/* =========================================
   1. BASE & TYPOGRAPHIE
   ========================================= */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: var(--base-font-size);
    margin: 0; padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: calc(var(--base-font-size) * var(--font-scale)); 
}

h1, h2, h3, h4, h5 { margin-top: 0; font-weight: 400; color: var(--text-primary); }

/* =========================================
   2. SIDEBAR & HEADER
   ========================================= */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 80px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; align-items: center; padding: 20px 0; z-index: 1000;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.sidebar-logo { font-size: 35px; color: var(--accent); margin-bottom: 30px; }

.nav-link {
    color: var(--text-secondary); font-size: var(--font-lg);; margin-bottom: 15px;
    width: 50px; height: 50px; display: flex; justify-content: center; align-items: center;
    border-radius: 12px; transition: all 0.3s ease; text-decoration: none;
}
.nav-link:hover, .nav-link.active { background-color: var(--accent); color: white !important; }

.content-container { margin-left: 80px; padding: 30px; }

/* =========================================
   2.1 PAGE ACCUEIL - MASQUER SIDEBAR
   ========================================= */
/* Masquer la sidebar sur la page d'accueil */
.page-accueil-wrapper ~ .sidebar,
body:has(.page-accueil-wrapper) .sidebar {
    display: none !important;
}

/* Enlever le margin-left sur la page d'accueil */
.page-accueil-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
}

.page-accueil-wrapper .content-container {
    margin-left: 0 !important;
}

.top-header-container {
    background-color: var(--bg-card);
    padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid var(--accent); margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Ombre légère pro */
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}


.dashboard-title { font-size: 1.5rem; font-weight: bold; text-transform: uppercase; color: var(--text-primary); margin: 0; }
.top-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    text-decoration: none; /* IMPORTANT : Enlève le soulignement des liens */
    transition: color 0.2s ease;
    font-size: 1rem;
}

.top-nav-item:hover {
    color: var(--accent);
    transform: translateY(-2px); /* Légère remontée */
    text-decoration: none; /* Assure qu'aucun soulignement n'apparaît au survol */
}

/* Style spécifique pour la déconnexion si vous voulez qu'il soit rouge au survol */
.logout:hover {
    color: #e74c3c !important; /* Rouge pour signaler la sortie */
}

/* =========================================
   3. GRILLE & CARTES
   ========================================= */
.grid-row { display: flex; flex-wrap: wrap; gap: 25px; margin-bottom: 25px; align-items: stretch; }
.filter-row { display: flex; gap: 20px; width: 100%; margin-bottom: 15px; }
.full-width { width: 100%; }
.half-width { flex: 1; min-width: 450px; }

.card {
    background-color: var(--bg-card);
    border-radius: 15px; padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    height: 100%; box-sizing: border-box;
}

/* =========================================
   4. DROPDOWNS PRO (LARGEUR & COULEURS CORRIGÉES)
   ========================================= */

/* 1. Gestion du Conteneur (La ligne qui contient les filtres) */
.filter-row { 
    display: flex; 
    gap: 15px; 
    width: 100%; 
    margin-bottom: 15px;
    flex-wrap: wrap; /* Permet de passer à la ligne si l'écran est petit */
}

/* 2. Gestion de l'élément Dropdown lui-même */
.filter-dropdown {
    flex: 1;           /* FORCE l'élément à prendre tout l'espace disponible */
    min-width: 150px;  /* Empêche de devenir trop petit (votre problème actuel) */
}

/* 3. Style de la boîte (Conteneur visuel) */
.Select-control {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 8px !important;
    min-height: 38px !important; /* Hauteur confortable */
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

/* 4. COULEUR DU TEXTE (Le correctif "Invisible") */
/* Cible le texte sélectionné ET le texte qu'on tape */
.Select-value-label, 
.Select-input > input {
    color: var(--text-primary) !important; /* Blanc en dark mode, Noir en light mode */
    line-height: 1.5 !important;
}

/* Cible le texte "Placeholder" (ex: "Mois...", "Agence...") */
.Select-placeholder {
    color: var(--text-secondary) !important; /* Gris clair pour le différencier */
    padding-left: 10px;
}

/* 5. Menu Déroulant (La liste des options) */
.Select-menu-outer {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--accent) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 2000 !important;
}

/* Les options individuelles */
.Select-option {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 10px !important;
}



/* Couleurs adaptatives (dark / light) */
.Select,
.Select-control,
.Select-menu-outer,
.Select-value,
.Select-value-label,
.Select-input > input,
.Select-placeholder,
.Select-option,
.Select--multi .Select-value,
.Select--multi .Select-value-label,
.Select--multi .Select-value-icon {
    color: var(--text-primary) !important;        /* texte suit le thème */
    background-color: var(--bg-card) !important;  /* fond suit le thème */
}

/* Hover sur les options : texte blanc sur fond accent */
.Select-option:hover,
.Select-option.is-focused {
    background-color: var(--accent) !important;
    color: #fff !important;
}


/* 6. CORRECTION MULTI-SELECT (Les tags "Avril 2025") */
.Select--multi .Select-value {
    background-color: var(--hover-bg) !important; /* Fond bleuté transparent */
    border: 1px solid var(--accent) !important;
    color: var(--text-primary) !important;
    margin-left: 5px !important;
    margin-top: 2px !important;
}

.Select--multi .Select-value-label {
    color: var(--text-primary) !important; /* Force le blanc pour le texte du tag */
}

.Select--multi .Select-value-icon {
    border-right: 1px solid var(--accent) !important;
    color: var(--text-primary) !important; /* La petite croix de fermeture */
}

.Select--multi .Select-value-icon:hover {
    background-color: #e74c3c !important; /* Rouge au survol */
    color: white !important;
}


/* =========================================
   5. KPIs & ANALYSE
   ========================================= */
/* Conteneur principal pour la nouvelle disposition en podium */
.kpi-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

/* Première ligne : 1er KPI centré */
.kpi-row-top {
    display: flex;
    justify-content: center;
    gap: 25px;
}

/* Deuxième ligne : 2ème et 3ème KPIs côte à côte */
.kpi-row-bottom {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

/* Ancien conteneur (gardé pour compatibilité) */
.kpi-container { display: flex; gap: 25px; margin-bottom: 30px; flex-wrap: wrap; }

.kpi-card {
    flex: 1; 
    min-width: 280px; 
    max-width: 400px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color); 
    border-radius: 15px; 
    padding: 20px;
    display: flex; 
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
}

.kpi-icon { font-size: 2.5rem; margin-right: 20px; color: var(--text-primary); }
.kpi-value { font-size: 1.8rem; font-weight: 700; margin: 0; color: var(--text-primary); }

/* Wrapper de la carte KPI avec accordéon */
.kpi-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Contenu principal de la carte KPI */
.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Badge d'information sur la carte */
.kpi-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 5px 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
}

/* Bouton de l'accordéon (version externe - obsolète) */
.kpi-accordion-button {
    width: 100%;
    text-align: center;
    padding: 10px;
    background: var(--hover-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    color: var(--accent) !important;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.kpi-accordion-button:hover {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Bouton de l'accordéon intégré dans la carte */
.kpi-accordion-button-inline {
    margin-top: 10px;
    padding: 6px 12px !important;
    background: transparent !important;
    border: 1px solid var(--accent) !important;
    border-radius: 8px !important;
    color: var(--accent) !important;
    font-weight: 500;
    font-size: 0.85rem !important;
    transition: all 0.3s ease;
    text-decoration: none !important;
    width: 100%;
    text-align: center;
}

.kpi-accordion-button-inline:hover {
    background: var(--accent) !important;
    color: white !important;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.kpi-accordion-button-inline:active {
    transform: scale(0.98);
}

/* ===== NOUVELLE LIGNE DE BOUTONS "VOIR CLASSEMENT" ===== */

/* Conteneur de la ligne de boutons "voir classement" */
.kpi-ranking-buttons-row {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Carte contenant le bouton "voir classement" */
.kpi-ranking-button-card {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
}

.kpi-ranking-button-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.25);
    border-color: var(--accent);
}

/* Contenu de la carte de bouton */
.ranking-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Titre de la carte de bouton */
.ranking-button-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bouton standalone "voir classement" */
.kpi-accordion-button-standalone {
    width: 100%;
    padding: 12px 20px !important;
    background: var(--accent) !important;
    border: 2px solid var(--accent) !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.kpi-accordion-button-standalone:hover {
    background: transparent !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.4);
}

.kpi-accordion-button-standalone:active {
    transform: scale(0.98);
}

/* Responsive : réduire la taille sur mobile */
@media (max-width: 768px) {
    .kpi-ranking-buttons-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kpi-ranking-button-card {
        max-width: 100%;
        min-width: 100%;
    }
}

/* Contenu de l'accordéon */
.kpi-accordion-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 5px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Section de classement (TOP ou FLOP) */
.ranking-section {
    margin-bottom: 20px;
}

.ranking-section:last-child {
    margin-bottom: 0;
}

/* Titre de section */
.ranking-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
}

.ranking-section-title.top-section {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.ranking-section-title.flop-section {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

/* Liste des classements */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ligne de classement individuelle */
.top-ranking-row,
.flop-ranking-row {
    display: grid;
    grid-template-columns: 30px 40px 1fr 120px 60px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--hover-bg);
}

.top-ranking-row {
    border-left: 4px solid #27ae60;
}

.flop-ranking-row {
    border-left: 4px solid #e74c3c;
}

.top-ranking-row:hover,
.flop-ranking-row:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Éléments de la ligne de classement */
.ranking-icon {
    font-size: 1.3rem;
}

.ranking-number {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ranking-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-score {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
}

.top-ranking-row .ranking-score {
    color: #27ae60;
}

.flop-ranking-row .ranking-score {
    color: #e74c3c;
}

/* Barre de progression */
.ranking-progress-container {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ranking-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.flop-ranking-row .ranking-progress-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Animation de la barre de progression */
@keyframes progressAnimation {
    from {
        width: 0;
    }
}

.ranking-progress-bar {
    animation: progressAnimation 0.8s ease-out;
}

/* Section des statistiques */
.ranking-stats {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
}

.ranking-stats > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

/* Responsive pour l'accordéon */
@media (max-width: 768px) {
    .top-ranking-row,
    .flop-ranking-row {
        grid-template-columns: 25px 35px 1fr 50px;
        gap: 8px;
        padding: 10px;
    }
    
    .ranking-progress-container {
        display: none;
    }
    
    .ranking-stats {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== STYLES SIMPLIFIÉS POUR LES CLASSEMENTS ===== */

/* Lignes de classement simplifiées (TOP et FLOP) */
.top-ranking-row-simple,
.flop-ranking-row-simple {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--hover-bg);
    margin-bottom: 8px;
}

.top-ranking-row-simple {
    border-left: 3px solid #27ae60;
}

.flop-ranking-row-simple {
    border-left: 3px solid #e74c3c;
}

.top-ranking-row-simple:hover,
.flop-ranking-row-simple:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Icône triangle */
.ranking-triangle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Texte simplifié : Nom : Score% */
.ranking-simple-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
}

/* Responsive pour les classements simplifiés */
@media (max-width: 768px) {
    .top-ranking-row-simple,
    .flop-ranking-row-simple {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .ranking-triangle-icon {
        font-size: 1rem;
    }
    
    .ranking-simple-text {
        font-size: 0.9rem;
    }
}



.cdp-container {
    background-color: var(--hover-bg);
    border-radius: 12px; padding: 25px; margin-top: 20px; border-left: 4px solid var(--accent);
}
.cdp-title { color: var(--accent); font-weight: bold; text-transform: uppercase; margin-bottom: 10px; }
.cdp-text { color: var(--text-primary); line-height: 1.6; }
.badge-pos { color: #2ecc71; font-weight: bold; }
.badge-neg { color: #e74c3c; font-weight: bold; }
.badge-neu { color: #f1c40f; font-weight: bold; }

.reco-box {
    background: rgba(231,76,60,0.1); padding: 15px; border-radius: 8px; 
    border: 1px solid rgba(231,76,60,0.3); display: flex; gap: 15px; margin-top: 20px;
}
.reco-icon { font-size: 1.5rem; color: #e74c3c; }

/* =========================================
   6. MODAL & FOOTER
   ========================================= */
.modal-content {
    background-color: var(--modal-bg) !important;
    border: 1px solid var(--accent) !important;
    color: var(--text-primary) !important;
}
.close { color: var(--text-primary) !important; }

.logo-strip-container { background: #fff; padding: 15px 0; margin-top: 40px; overflow: hidden; white-space: nowrap; }
.logo-track { display: inline-block; animation: scroll 30s linear infinite; }
.partner-logo { height: 50px; margin: 0 40px; filter: grayscale(0%); }
.partner-logo:hover { filter: grayscale(0%); }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.app-footer {
    background-color: var(--bg-body); border-top: 1px solid var(--border-color);
    padding: 40px 30px; color: var(--text-secondary); display: flex; justify-content: space-between;
}

.gtitle { color: var(--accent) !important; font-family: "Segoe UI"; font-weight: 600; margin-bottom: 15px; font-size: var(--font-lg); }

/* =========================================
   7. NOUVEAUX INSIGHTS (CORRIGÉ POUR LA TAILLE)
   ========================================= */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.insight-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.insight-box:hover {
    transform: translateY(-2px);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    /* CORRECTION ICI : Utilisation de rem */
    font-size: 1.2rem; 
}

.insight-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.insight-stat-label { 
    color: var(--text-secondary); 
    /* CORRECTION ICI : rem au lieu de taille fixe/défaut */
    font-size: 0.9rem; 
}

.insight-stat-value { 
    color: var(--text-primary); 
    font-weight: bold; 
    /* CORRECTION ICI */
    font-size: 1.1rem; 
}

.insight-message {
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 10px;
    /* CORRECTION ICI */
    font-size: 1rem; 
}

.insight-recommendation {
    margin-top: 15px;
    background: var(--hover-bg);
    padding: 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
    /* CORRECTION ICI */
    font-size: 0.9rem; 
}

/* --- BOUTON DÉCONNEXION (SPÉCIFIQUE) --- */
.logout {
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.05);
    color: #e74c3c; /* Rouge doux */
}

.logout:hover {
    background: #e74c3c;
    color: white !important;
    border-color: #e74c3c;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* =========================================
   8. AG GRID CUSTOMIZATION
   ========================================= */
/* Ajustement de la hauteur pour le conteneur du tableau */
.ag-theme-alpine, .ag-theme-alpine-dark {
    height: 100% !important;
    font-family: "Segoe UI", sans-serif;
}

/* Personnalisation légère du header du tableau pour coller à votre thème */
.ag-header-cell-label {
    font-weight: 600;
}

/* En mode sombre, s'assurer que le fond est bien celui de vos cartes */
.ag-theme-alpine-dark {
    --ag-background-color: var(--bg-card);
    --ag-foreground-color: var(--text-primary);
    --ag-header-background-color: var(--hover-bg);
    --ag-odd-row-background-color: rgba(255, 255, 255, 0.02);
}

/* =========================================
   9. PAGE DE CONNEXION (LOGIN)
   ========================================= */
.login-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, var(--bg-sidebar) 0%, var(--bg-body) 100%);
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-logo {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.login-title {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1.3rem;
    margin-bottom: 30px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   10. TICKER AGENCES - BANDEAU DÉFILEMENT (L→R)
   ========================================= */

/* Conteneur principal - Fixé en bas de page */
.pdv-ticker-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card); /* Utilise la couleur de fond du thème */
    border-top: 2px solid var(--accent);
    padding: 12px 0;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(52, 152, 219, 0.2);
    color: var(--text-primary); /* S'adapte au thème */
}

/* Track de défilement */
.pdv-ticker-track {
    display: flex;
    width: fit-content;
    animation: pdv-scroll-ltr 650s linear infinite;
}

/* Animation : Gauche → Droite (LTR) */
@keyframes pdv-scroll-ltr {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Pause au survol */
.pdv-ticker-wrapper:hover .pdv-ticker-track {
    animation-play-state: paused;
}

/* Élément individuel du ticker */
.pdv-ticker-element {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 20px;
    margin-right: 10mm; /* Écart strict de 10mm entre chaque élément */
    background: rgba(52, 152, 219, 0.12);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdv-ticker-element:hover {
    background: rgba(52, 152, 219, 0.25);
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    border-left-color: #2c9bd7;
}

/* Icône du ticker */
.pdv-ticker-icon {
    margin-right: 10px;
    font-size: 18px;
    color: var(--accent);
    transition: color 0.3s ease;
}

.pdv-ticker-element:hover .pdv-ticker-icon {
    color: #2679d2;
}

/* Nom du PDV */
.pdv-ticker-name {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-right: 8px;
    letter-spacing: 0.5px;
}

/* Séparateur */
.pdv-ticker-separator {
    color: var(--text-secondary);
    margin: 0 6px;
    font-weight: bold;
}

/* Score */
.pdv-ticker-score {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #3498db;
    background: linear-gradient(135deg, #3498db, #2576f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Variantes de couleur selon le score */
.pdv-ticker-element.pdv-high-score {
    border-left-color: #1392ed;
}

.pdv-ticker-element.pdv-high-score .pdv-ticker-icon {
    color: #1392ed;
}

.pdv-ticker-element.pdv-high-score .pdv-ticker-score {
    background: linear-gradient(135deg, #1392ed, #1392ed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pdv-ticker-element.pdv-medium-score {
    border-left-color: #f39c12;
}

.pdv-ticker-element.pdv-medium-score .pdv-ticker-icon {
    color: #f39c12;
}

.pdv-ticker-element.pdv-medium-score .pdv-ticker-score {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pdv-ticker-element.pdv-low-score {
    border-left-color: #e74c3c;
}

.pdv-ticker-element.pdv-low-score .pdv-ticker-icon {
    color: #e74c3c;
}

.pdv-ticker-element.pdv-low-score .pdv-ticker-score {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive pour mobiles */
@media (max-width: 768px) {
    .pdv-ticker-element {
        padding: 6px 15px;
        margin-right: 5mm;
    }
    
    .pdv-ticker-name {
        font-size: 12px;
    }
    
    .pdv-ticker-score {
        font-size: 13px;
    }
    
    .pdv-ticker-icon {
        font-size: 15px;
    }
}




