/* ===== STYLES GÉNÉRAUX ===== */
body {
    font-family: 'Inter', sans-serif;
    background: #e2e8f0;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Login page background */
body.login-bg {
    background: #f8fafc;
}

/* ===== NAVBAR ===== */
.navbar-glass {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar-link {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.navbar-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@keyframes navbar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.animate-navbar {
    animation: navbar 3s ease-in-out infinite;
}

/* Styles pour les liens actifs de la navbar desktop */
#link-tableau.active,
#link-carte.active,
#link-categories.active,
#link-statistiques.active {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* Styles pour les liens actifs de la navbar mobile - TOUTE LA LIGNE */
@media (max-width: 767px) {
    #link-tableau-mobile.active,
    #link-carte-mobile.active,
    #link-categories-mobile.active,
    #link-statistiques-mobile.active {
        background: #e5e7eb !important;
        color: #374151 !important;
        width: 100% !important;
        margin: 0 !important;
        border-left: 3px solid #9ca3af !important;
        box-shadow: none !important;
    }
    
    #link-tableau-mobile.active .material-symbols-outlined,
    #link-carte-mobile.active .material-symbols-outlined,
    #link-categories-mobile.active .material-symbols-outlined,
    #link-statistiques-mobile.active .material-symbols-outlined {
        color: #374151 !important;
        filter: none !important;
    }
    
    #link-tableau-mobile.active span:last-child,
    #link-carte-mobile.active span:last-child,
    #link-categories-mobile.active span:last-child,
    #link-statistiques-mobile.active span:last-child {
        color: #374151 !important;
    }
}

/* Navbar desktop - visible sur PC uniquement */
.desktop-navbar {
    display: block;
}

/* Bouton burger mobile - caché sur PC */
.mobile-burger-btn {
    display: none;
}

/* Navbar mobile - cachée par défaut */
.mobile-navbar {
    display: none;
}

/* Sur mobile uniquement */
@media (max-width: 767px) {
    /* Cacher COMPLÈTEMENT la navbar desktop sur mobile */
    .desktop-navbar,
    .desktop-navbar * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        width: 0 !important;
        pointer-events: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Afficher le bouton burger flottant */
    .mobile-burger-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 9999 !important;
    }
    
    /* Navbar mobile cachée par défaut */
    .mobile-navbar.hidden {
        display: none !important;
    }
    
    /* Navbar mobile visible quand on clique sur le burger */
    .mobile-navbar:not(.hidden) {
        display: flex !important;
    }
}

/* Sur PC - FORCER la disparition du menu burger et navbar mobile */
@media (min-width: 768px) {
    .mobile-burger-btn,
    .mobile-navbar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* S'assurer que la navbar desktop est visible sur PC */
    .desktop-navbar {
        display: block !important;
    }
    
    /* Navbar desktop toujours sticky sur PC */
    .desktop-navbar {
        position: sticky !important;
        top: 0 !important;
    }
}

/* Animation pour la navbar mobile - DESCEND DE HAUT EN BAS */
@media (max-width: 767px) {
    .mobile-navbar {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-in-out;
        transform: translateY(-100%);
        opacity: 0;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-navbar.hidden {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }
    
    .mobile-navbar.mobile-navbar-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    /* Overlay gris transparent avec animation */
    .mobile-overlay {
        transition: opacity 0.4s ease-in-out, backdrop-filter 0.4s ease-in-out;
        background-color: rgba(17, 24, 39, 0.3) !important; /* gray-900/30 - Plus clair */
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .mobile-navbar.hidden .mobile-overlay {
        opacity: 0;
        pointer-events: none;
    }
    
    .mobile-navbar.mobile-navbar-open .mobile-overlay {
        opacity: 1;
        pointer-events: all;
    }
    
    /* Container du menu */
    .mobile-menu-container {
        width: 100%;
        max-height: 90vh;
        animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes slideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .mobile-navbar.hidden .mobile-menu-container {
        animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
    
    /* En-tête du menu */
    .mobile-menu-header {
        position: relative;
    }
    
    .mobile-menu-header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.3), transparent);
    }
    
    /* Liens du menu */
    .mobile-menu-link {
        position: relative;
        border-left: 3px solid transparent;
    }
    
    .mobile-menu-link:hover {
        border-left-color: #3b82f6;
        transform: translateX(4px);
    }
    
    .mobile-menu-link:active {
        transform: translateX(2px) scale(0.98);
    }
    
    /* Animation pour le bouton burger/croix */
    .mobile-burger-btn #burgerIcon,
    .mobile-burger-btn #closeIcon {
        position: absolute;
        transition: opacity 0.3s ease-in-out, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-burger-btn #burgerIcon.hidden {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    
    .mobile-burger-btn #closeIcon.hidden {
        opacity: 0;
        transform: rotate(180deg) scale(0.5);
    }
    
    .mobile-burger-btn #burgerIcon:not(.hidden),
    .mobile-burger-btn #closeIcon:not(.hidden) {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ===== CONTAINERS ===== */
.main-container {
    background: #f8fafc;
    min-height: 100vh;
    padding-top: 0;
}

/* Styles spécifiques pour la page categories sur mobile UNIQUEMENT - Identique à PC */
@media (max-width: 767px) {
    /* Container principal */
    body.page-categories .main-container main {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* En-tête */
    body.page-categories .main-container .text-center.mb-12 {
        margin-bottom: 3rem !important;
    }
    
    /* Titre principal */
    body.page-categories .main-container h1 {
        font-size: 2.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    body.page-categories .main-container h1 .material-symbols-outlined {
        font-size: 3rem !important;
    }
    
    /* Sous-titre */
    body.page-categories .main-container p {
        font-size: 1.125rem !important;
    }
    
    /* Container formulaires */
    body.page-categories .main-container .flex.flex-col.md\:flex-row.gap-8.mb-12 {
        gap: 2rem !important;
        margin-bottom: 3rem !important;
    }
    
    /* Titres de sections */
    body.page-categories .main-container .flex-1 > h2 {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    body.page-categories .main-container .flex-1 > h2 .material-symbols-outlined {
        font-size: 1.25rem !important;
    }
    
    /* FORMULAIRES MOBILE - DESIGN COMPLÈTEMENT REFONDU, MODERNE ET COMPACT */
    body.page-categories .main-container .mobile-form {
        display: flex !important;
        flex-direction: column !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
        border-radius: 0.875rem !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
        padding: 0 !important;
        border: 1px solid #e2e8f0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        gap: 0 !important;
    }
    
    /* Override TOUTES les classes Tailwind qui ajoutent des espaces */
    body.page-categories .main-container .mobile-form.p-6 {
        padding: 0 !important;
    }
    
    body.page-categories .main-container .mobile-form.gap-4 {
        gap: 0 !important;
    }
    
    /* Conteneur pour chaque champ - DESIGN MODERNE COMPACT */
    body.page-categories .main-container .mobile-form .mobile-form-field {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem 0.75rem !important;
        padding-bottom: 0.25rem !important;
        background: transparent !important;
        flex: none !important;
        min-width: 0 !important;
    }
    
    /* Dernière div avant le bouton */
    body.page-categories .main-container .mobile-form .mobile-form-field:last-of-type {
        padding-bottom: 0.25rem !important;
    }
    
    /* LABELS - DESIGN MODERNE */
    body.page-categories .main-container .mobile-form .mobile-form-label {
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        margin: 0 !important;
        margin-bottom: 0.25rem !important;
        padding: 0 !important;
        display: block !important;
        line-height: 1.2 !important;
        letter-spacing: 0.01em !important;
    }
    
    /* Override mb-1 de Tailwind */
    body.page-categories .main-container .mobile-form .mobile-form-label.mb-1 {
        margin-bottom: 0.25rem !important;
    }
    
    /* INPUTS ET SELECTS - DESIGN MODERNE */
    body.page-categories .main-container .mobile-form .mobile-form-input {
        font-size: 0.875rem !important;
        padding: 0.5rem 0.75rem !important;
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0.5rem !important;
        border: 1.5px solid #cbd5e1 !important;
        background: #ffffff !important;
        line-height: 1.4 !important;
        transition: all 0.2s ease !important;
        color: #1e293b !important;
    }
    
    /* Override px-3 py-2 de Tailwind */
    body.page-categories .main-container .mobile-form .mobile-form-input.px-3,
    body.page-categories .main-container .mobile-form .mobile-form-input.py-2 {
        padding: 0.5rem 0.75rem !important;
    }
    
    body.page-categories .main-container .mobile-form .mobile-form-input:focus {
        outline: none !important;
        border-color: #3b82f6 !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
        transform: translateY(-1px) !important;
    }
    
    /* BOUTON - DESIGN MODERNE, COLLÉ EN BAS */
    body.page-categories .main-container .mobile-form .mobile-form-button {
        width: 100% !important;
        font-size: 0.875rem !important;
        padding: 0.625rem 0.75rem !important;
        margin: 0 !important;
        margin-top: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        border-radius: 0 !important;
        border-bottom-left-radius: 0.875rem !important;
        border-bottom-right-radius: 0.875rem !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
        color: #ffffff !important;
        border: none !important;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
    }
    
    /* Override py-2 px-4 de Tailwind */
    body.page-categories .main-container .mobile-form .mobile-form-button.py-2,
    body.page-categories .main-container .mobile-form .mobile-form-button.px-4 {
        padding: 0.625rem 0.75rem !important;
    }
    
    body.page-categories .main-container .mobile-form .mobile-form-button:active {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
        transform: scale(0.98) !important;
        box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3) !important;
    }
    
    /* Icône dans le bouton */
    body.page-categories .main-container .mobile-form .mobile-form-button .material-symbols-outlined {
        font-size: 1.125rem !important;
    }
    
    /* Supprimer TOUS les espaces - override complet */
    body.page-categories .main-container .mobile-form > * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Pas d'espace entre les divs */
    body.page-categories .main-container .mobile-form .mobile-form-field + .mobile-form-field {
        margin-top: 0 !important;
        padding-top: 0.125rem !important;
    }
    
    /* Le bouton est directement collé après la dernière div */
    body.page-categories .main-container .mobile-form .mobile-form-field:last-of-type + .mobile-form-button {
        margin-top: 0 !important;
        padding-top: 0.375rem !important;
    }
    
    /* Supprimer tout padding-bottom du formulaire */
    body.page-categories .main-container .mobile-form {
        padding-bottom: 0 !important;
    }
    
    /* Override flex-row items-end pour mobile */
    body.page-categories .main-container .mobile-form.flex-row {
        flex-direction: column !important;
    }
    
    body.page-categories .main-container .mobile-form.items-end {
        align-items: stretch !important;
    }
    
    /* Container listes */
    body.page-categories .main-container .flex.flex-col.md\:flex-row.gap-8:last-child {
        gap: 2rem !important;
    }
    
    /* En-têtes bleus */
    body.page-categories .main-container .bg-blue-600 {
        padding: 1rem !important;
    }
    
    body.page-categories .main-container .bg-blue-600 h2 {
        font-size: 1.125rem !important;
    }
    
    body.page-categories .main-container .bg-blue-600 .material-symbols-outlined {
        font-size: 1.25rem !important;
    }
    
    /* Cards blanches */
    body.page-categories .main-container .bg-white.rounded-b-2xl {
        padding: 1rem !important;
    }
    
    /* Hauteur minimale */
    body.page-categories .main-container .min-h-\[400px\] {
        min-height: 400px !important;
    }
    
    /* Espacement dans les listes */
    body.page-categories .main-container #categoriesTable,
    body.page-categories .main-container #subcategoriesTable {
        gap: 0.75rem !important;
    }
}

/* ===== CARDS ===== */
.card-glass {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ===== TABLEAUX ===== */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Mode compact pour réduire la hauteur globale des lignes du tableau */
.compact-table table {
    font-size: 0.8125rem; /* ~13px */
}

.compact-table thead th {
    padding: 0.5rem 0.5rem; /* réduit l'en-tête */
    font-size: 0.8125rem;  /* texte d'en-tête plus petit */
}

.compact-table tbody td {
    padding: 0.5rem 0.5rem; /* réduit les cellules */
}

.compact-table .status-badge {
    padding: 0.25rem 0.5rem; /* badges plus petits */
    font-size: 0.65rem;
}

.compact-table .action-btn,
.compact-table .download-btn,
.compact-table .delete-btn,
.compact-table .play-pause-btn {
    padding: 0.35rem 0.5rem;
    min-height: 30px;
    min-width: 30px;
    font-size: 0.75rem;
}

.compact-table .material-symbols-outlined {
    font-size: 18px; /* icônes un peu plus petites */
}

/* Colonne Objectif: entrée et barre plus compactes */
.compact-table .goal-wrapper input.editable-goal {
    width: 56px; /* plus étroit */
    height: 30px; /* plus bas */
    padding: 0.25rem 0.375rem;
    font-size: 0.875rem;
}

.compact-table .goal-display {
    font-size: 0.7rem;
}

.compact-table .progress-bar-container {
    height: 6px; /* barre plus fine */
}

/* pas d'effet sur mobile */

/* Taille des chiffres dans les badges (FACTURABLES, INVALIDES, TÉL., UNIQUES) */
.facturables-link,
td span.bg-green-50.rounded-full,
td span.bg-red-50.rounded-full,
td span.bg-blue-50.rounded-full,
td span.bg-purple-50.rounded-full {
    font-size: 0.9375rem !important; /* 15px au lieu de 14px (text-sm) */
}

.table-container.leads-table {
    max-height: calc(100vh - 200px);
    overflow: auto;
}

.table-header {
    background: #94a3b8;
    color: white;
}

.table-row:hover {
    background: #f8fafc;
}

/* ===== BOUTONS D'ACTION ===== */
.action-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.play-pause-btn {
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.play-pause-btn .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1;
    line-height: 1;
}

.play-pause-btn.play {
    background: #dc2626; /* rouge plus soutenu */
    color: #ffffff;      /* icône blanche */
}

.play-pause-btn.play:hover {
    background: #b91c1c;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.play-pause-btn.pause {
    background: #10b981; /* vert un peu plus clair */
    color: #ffffff;      /* icône blanche */
}

.play-pause-btn.pause:hover {
    background: #0ea371;
    box-shadow: 0 2px 6px rgba(14, 163, 113, 0.25);
}

/* Animation douce lors du switch play/pause */
@keyframes fadeSwap {
    0% { opacity: 0.65; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.play-pause-btn.switching {
    animation: fadeSwap 0.18s ease-in-out;
}

/* Style mobile pour les boutons play/pause */
.mobile-action-btn.play-pause-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 8px 12px;
}

.mobile-action-btn.play-pause-btn .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1;
}

.delete-btn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.delete-btn:hover {
    background: #fee2e2;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-btn {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.download-btn:hover {
    background: #dbeafe;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.purge-btn {
    background: #fbbf24;
    color: #92400e;
    border: 1px solid #f59e0b;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-weight: 600;
    opacity: 0.9;
}

.purge-btn:hover {
    background: #f59e0b;
    color: #78350f;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.hide-non-facturables-btn {
    background: #ea580c;
    color: white;
    border: 1px solid #c2410c;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 600;
}

.hide-non-facturables-btn:hover {
    background: #c2410c;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.restore-btn {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.restore-btn:hover {
    background: #dcfce7;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== BOUTONS TOGGLE ===== */
.toggle-pile-btn {
    transition: all 0.2s ease;
}

.toggle-pile-btn.active {
    background: #10b981;
    border-color: #059669;
}

.toggle-pile-btn.inactive {
    background: #ef4444;
    border-color: #dc2626;
}

.toggle-archive-btn {
    transition: all 0.2s ease;
}

.toggle-archive-btn.active {
    background: #6b7280;
    border-color: #4b5563;
}

.toggle-archive-btn.inactive {
    background: #f59e0b;
    border-color: #d97706;
}

/* ===== BARRES DE PROGRESSION ===== */
.progress-bar-container {
    width: 100px;
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin: 4px 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* ===== LIENS ===== */
.invisible-link {
    color: inherit;
    text-decoration: none;
}

.invisible-link:hover {
    text-decoration: underline;
}

/* ===== INPUTS ÉDITABLES ===== */
.editable-cell {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editable-cell:hover {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.editable-cell.editing {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.editable-goal {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.editable-nom {
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.editable-nom:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.editable-nom:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.goal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.goal-display {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* ===== FILTRES ===== */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-input {
    transition: all 0.2s ease;
}

.filter-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.filter-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transition: all 0.3s ease;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-label {
    transition: color 0.2s ease;
}

.filter-input:focus + .filter-label,
.filter-input:not(:placeholder-shown) + .filter-label {
    color: #2563eb;
}

/* ===== PAGINATION ===== */
.pagination-btn {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== MODALES ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOGIN ===== */
.login-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-field {
    background: #ffffff;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.input-field:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
    background: #3b82f6;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===== COMPTE ===== */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===== TOOLTIPS ===== */
.dept-badge-hover {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dept-badge-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dept-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dept-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.dept-badge-hover:hover .dept-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* ===== STATISTIQUES ===== */
.campaign-name-with-stats {
    position: relative;
    transition: all 0.3s ease;
}

.campaign-name-with-stats:hover {
    text-decoration: underline;
    transform: scale(1.02);
}

.campaign-name-with-stats[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-line;
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.campaign-name-with-stats[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
}

/* ===== ANIMATIONS ===== */
.badge-animation {
    animation: none !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes pulse-green {
    0%, 100% { 
        box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
    }
    50% { 
        box-shadow: 0 2px 4px rgba(5, 150, 105, 0.4), 0 0 0 4px rgba(5, 150, 105, 0.1);
    }
}

.bg-green-50 {
    animation: none !important;
    box-shadow: none !important;
}

.bg-red-50 {
    animation: none !important;
    box-shadow: none !important;
}

@keyframes pulse-red {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }
    50% { 
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

/* ===== LEADS SPECIFIC STYLES ===== */
.checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.checkbox-item label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.save-all-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.4);
}

.save-all-btn:active {
    transform: translateY(0);
}

.save-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== CATEGORIES SPECIFIC STYLES ===== */
.category-card {
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.category-hover-list {
    position: absolute;
    left: 0;
    top: 110%;
    min-width: 180px;
    max-height: 220px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    padding: 1rem;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.2s ease;
    overflow-y: auto;
}

.category-hover-list-top {
    top: auto;
    bottom: 110%;
    box-shadow: 0 -16px 48px rgba(59,130,246,0.18), 0 -2px 8px rgba(0,0,0,0.10);
}

.group:hover .category-hover-list,
.group:focus-within .category-hover-list {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.category-hover-list::before {
    content: '';
    position: absolute;
    left: 24px;
    top: -10px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
    z-index: 1;
    box-shadow: -1px -1px 3px rgba(0,0,0,0.05);
}

.category-hover-list-top::before {
    top: auto;
    bottom: -10px;
    border-left: 1px solid #dbeafe;
    border-bottom: 1px solid #dbeafe;
    border-top: none;
    box-shadow: -2px 2px 8px rgba(59,130,246,0.08);
}

@media (max-width: 600px) {
    .category-hover-list, .category-hover-list-top {
        left: auto;
        right: 0;
        min-width: 140px;
        padding: 0.7rem 0.7rem 0.7rem 0.7rem;
    }
    .category-hover-list::before, .category-hover-list-top::before {
        left: auto;
        right: 24px;
    }
}

/* Tooltip pour les sous-catégories dans le badge */
.subcategory-hover-list {
    position: absolute;
    left: 0;
    bottom: 100%;
    margin-bottom: 8px;
    min-width: 200px;
    max-width: 280px;
    max-height: 300px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    padding: 12px;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: all 0.25s ease;
    overflow-y: auto;
}

.subcategory-badge-trigger:hover .subcategory-hover-list {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.subcategory-hover-list::before {
    content: '';
    position: absolute;
    left: 20px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
    z-index: 1;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.subcategory-hover-list .space-y-1 > div {
    margin-bottom: 4px;
}

.subcategory-hover-list .space-y-1 > div:last-child {
    margin-bottom: 0;
}

/* ===== MAP SPECIFIC STYLES ===== */
.sidebar-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.map-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#map {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px;
    background: transparent !important;
}

.leaflet-control-container {
    z-index: 1000;
}

.dep-badge-geo {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(16,185,129,0.3);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 10;
    position: relative;
}

.dep-badge-geo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dep-badge-geo.occupied {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}

.dep-badge-geo.occupied::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.dep-badge-hover {
    transform: scale(1.15);
    box-shadow: 0 8px 32px rgba(16,185,129,0.4);
}

.dep-badge-geo.occupied.dep-badge-hover {
    box-shadow: 0 8px 32px rgba(239,68,68,0.4);
}

.dep-popup {
    border-radius: 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15) !important;
    font-family: 'Inter', sans-serif;
    min-width: 280px;
    max-width: 360px;
    border: none !important;
}

.dept-number-label {
    pointer-events: auto;
    background: transparent;
}

.dept-number-label .dep-badge {
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dept-number-label .dep-badge.free {
    background-color: #2ecc71;
}

.dept-number-label .dep-badge.taken {
    background-color: #e74c3c;
}

.dept-number-label .dep-badge:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
    /* Container principal mobile */
    .main-container {
        padding: 0.5rem;
    }
    
    main {
        padding: 0.5rem !important;
    }

    /* Titre mobile */
    h1 {
        font-size: 1.875rem !important; /* text-3xl */
        gap: 0.5rem !important;
    }
    
    h1 .material-symbols-outlined {
        font-size: 2.25rem !important; /* text-4xl */
    }

    /* Compteurs mobiles */
    .table-header .flex.items-center.justify-between {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
    }
    
    .table-header .flex.items-center.gap-4 {
        flex-direction: row !important;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
    }
    
    .table-header .bg-white\/20 {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    .table-header .bg-white\/20 .material-symbols-outlined {
        font-size: 1rem !important;
    }

    /* Boutons mobiles */
    .flex.justify-center.gap-3 {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0 1rem;
    }
    
    .flex.justify-center.gap-3 button {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Tableau mobile - masquer le tableau desktop */
    .table-container .overflow-x-auto {
        display: none !important;
    }

    .nav-buttons-container {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .nav-buttons-container .nav-button {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
    }

    .nav-button-text {
        opacity: 1;
        max-width: 200px;
        margin-left: 8px;
    }

    .add-button-wrapper {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin-top: 0.75rem;
        justify-content: center;
    }

    .add-button {
        width: 100%;
        justify-content: center;
    }

    .global-objectif-card {
        margin: 0.75rem 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .global-objectif-value {
        font-size: 1rem;
    }

    /* Cartes mobiles */
    .mobile-cards-container {
        display: block !important;
        background: white;
    }

    .mobile-card {
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem;
        background: white;
    }

    .mobile-card:last-child {
        border-bottom: none;
    }

    /* En-tête carte mobile */
    .mobile-card-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .mobile-card-icon {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-card-title {
        font-weight: 600;
        color: #1f2937;
        flex: 1;
    }

    /* Stats en grille mobile */
    .mobile-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 0.75rem 0;
    }

    .mobile-stat {
        text-align: center;
        padding: 0.5rem;
        border-radius: 0.5rem;
        background: #f9fafb;
    }

    .mobile-stat-value {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }

    .mobile-stat-label {
        font-size: 0.75rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Départements mobile */
    .mobile-departments {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin: 0.5rem 0;
    }

    .mobile-dept-badge {
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
        font-size: 0.75rem;
        font-weight: 500;
        border: 1px solid;
    }

    /* Actions mobiles */
    .mobile-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 0.75rem;
        justify-content: center;
    }

    .mobile-action-btn {
        padding: 0.5rem;
        border-radius: 0.5rem;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 2.5rem;
        height: 2.5rem;
    }

    /* Modal mobile */
    .modal-content {
        width: 95% !important;
        padding: 1rem !important;
        margin: 1rem !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    .modal-content h2 {
        font-size: 1.25rem !important;
    }

    .modal-content .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .modal-content button {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    /* Login responsive */
    .login-container {
        max-width: 20rem !important;
        padding: 1.5rem !important;
        min-height: 420px !important;
    }
    
    .login-container .text-center {
        margin-bottom: 1.5rem !important;
    }
    
    .login-container .text-center .w-20 {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    .login-container .text-center .text-4xl {
        font-size: 1.875rem !important;
    }
    
    .login-container .text-center .text-lg {
        font-size: 0.875rem !important;
    }

    /* Map responsive styles */
    body {
        overflow-x: hidden !important;
    }

    .flex.flex-row {
        flex-direction: column !important;
        height: 100vh !important;
    }

    /* Sidebar mobile - ultra compacte */
    aside {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 30vh !important;
        overflow: visible !important;
        padding: 0.5rem !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        flex-shrink: 0 !important;
    }

    /* Titre sidebar mobile - plus petit */
    aside h2 {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
        text-align: center !important;
    }

    /* Filtres mobile - ultra compacts */
    aside .space-y-6 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    aside .space-y-6 > div {
        margin-bottom: 0 !important;
    }

    aside label {
        font-size: 0.7rem !important;
        margin-bottom: 0.2rem !important;
    }

    aside select {
        padding: 0.4rem !important;
        font-size: 0.7rem !important;
        height: 2rem !important;
    }

    /* Statistiques mobile - ultra compactes */
    aside .bg-gradient-to-r {
        margin-top: 0.5rem !important;
        padding: 0.5rem !important;
    }

    aside .bg-gradient-to-r h3 {
        font-size: 0.75rem !important;
        margin-bottom: 0.3rem !important;
    }

    aside .space-y-3 > div {
        margin-bottom: 0.2rem !important;
    }

    aside .space-y-3 span {
        font-size: 0.7rem !important;
    }

    /* Légende mobile - ultra compacte */
    aside .mt-6 {
        margin-top: 0.5rem !important;
        padding: 0.4rem !important;
    }

    aside .mt-6 h4 {
        font-size: 0.7rem !important;
        margin-bottom: 0.3rem !important;
    }

    aside .mt-6 .space-y-2 > div {
        margin-bottom: 0.2rem !important;
    }

    aside .mt-6 .space-y-2 span {
        font-size: 0.7rem !important;
    }

    aside .mt-6 .w-4.h-4 {
        width: 0.75rem !important;
        height: 0.75rem !important;
    }

    /* Section carte mobile - maximum d'espace */
    .flex-1.h-full.flex.flex-col {
        height: 70vh !important;
        min-height: 70vh !important;
    }

    /* En-tête carte mobile */
    .bg-gradient-to-r {
        padding: 1rem !important;
    }

    .bg-gradient-to-r h1 {
        font-size: 1.25rem !important;
        text-align: center !important;
    }

    /* Carte mobile */
    #map {
        min-height: 100% !important;
        border-radius: 0 !important;
    }

    .leaflet-container {
        border-radius: 0 !important;
    }

    /* Marqueurs département mobile */
    .dep-badge-geo {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Popup mobile */
    .dep-popup {
        min-width: 250px !important;
        max-width: 300px !important;
    }
}

/* Masquer les cartes mobiles sur desktop */
@media (min-width: 769px) {
    .mobile-cards-container {
        display: none !important;
    }
}

/* ===== LEADS TABLE STYLES ===== */
/* Amélioration du tableau des leads */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.table-container table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1200px;
}

.table-container thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1rem 0.75rem;
    white-space: nowrap;
}

.table-container tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    min-height: 80px; /* Hauteur minimale pour les lignes avec départements */
}

.table-container tbody tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-container tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-container tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

.table-container td {
    padding: 1.25rem 0.75rem; /* Augmenté pour plus d'espace vertical */
    vertical-align: top; /* Aligné en haut pour les départements */
    /* suppression des barres entre colonnes */
    border-right: none;
    max-width: 200px;
    word-wrap: break-word;
}

.table-container td:last-child {
    border-right: none;
}

/* ===== MODERN TABLE STYLES ===== */
.modern-table {
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table thead,
.modern-table-header {
    border: none !important;
}

.modern-table thead th,
.modern-table-header th {
    border: none !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: 2px solid #e5e7eb !important;
    border-style: none none solid none !important;
}

.modern-table thead th:first-child,
.modern-table-header th:first-child {
    border-left: none !important;
}

.modern-table thead th:last-child,
.modern-table-header th:last-child {
    border-right: none !important;
}

.modern-table tbody td {
    border-right: none !important;
    border-left: none !important;
    border-bottom: none !important;
    border-top: none !important;
}

.modern-table-row {
    border-bottom: 1px solid #e5e7eb;
}

.modern-table-row:last-child {
    border-bottom: none;
}

.modern-table-row:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ===== ELEGANT TABLE HEADER STYLES ===== */
.elegant-table-header {
    background: transparent !important;
}

.elegant-header-row {
    background: transparent !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.elegant-table-header th {
    background: transparent !important;
    border: none !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    letter-spacing: 0 !important;
}

.elegant-table-header th:not(:last-child)::after {
    display: none;
}

.elegant-table-header th:first-child {
    padding-left: 1.5rem !important;
}

.elegant-table-header th:last-child {
    padding-right: 1.5rem !important;
}

/* Style plus fluide - les colonnes se fondent naturellement */
.elegant-table-header th {
    transition: color 0.2s ease;
}

.elegant-table-header th:hover {
    color: #374151 !important;
}

/* Réduire la largeur de la colonne Objectif */
.elegant-table-header th:nth-child(8),
.modern-table tbody td:nth-child(8) {
    max-width: 200px;
    width: 200px;
}

/* Boutons plus gros et plus beaux */
.modern-table .download-btn,
.modern-table .hide-non-facturables-btn,
.modern-table .purge-btn,
.modern-table .archive-btn,
.modern-table .unarchive-btn,
.modern-table .visible-in-map-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
}

.modern-table .play-pause-btn {
    min-width: 42px;
    min-height: 42px;
}

.modern-table .play-pause-btn .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1;
}

/* Cellules éditables - styles améliorés */
.editable-cell {
    display: block;
    min-height: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.editable-cell:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.editable-cell:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.editable-cell:hover:before {
    left: 100%;
}

.editable-cell.editing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: scale(1.02);
}

/* Input dans les cellules éditables */
.editable-cell input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    resize: none;
    min-height: 1.5rem;
    line-height: 1.5;
}

.editable-cell input:focus {
    outline: none;
    box-shadow: none;
}

/* Champs email avec texte long */
.editable-cell[data-field="email"] {
    max-width: 300px;
    min-height: 3rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.editable-cell[data-field="email"] input {
    min-height: 3rem;
    resize: vertical;
}

/* Statuts (Transmis/Visible) - styles améliorés */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-badge.transmitted {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.status-badge.transmitted:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.status-badge.not-transmitted {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #ef4444;
}

.status-badge.not-transmitted:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Boutons d'action améliorés */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.delete-lead-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #ef4444;
}

.delete-lead-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Indicateur de modification */
.cell-modified {
    position: relative;
}

.cell-modified:after {
    content: '●';
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    color: #f59e0b;
    font-size: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Bouton de sauvegarde amélioré */
.save-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.save-all-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.save-all-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.save-all-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.save-all-btn:hover:not(:disabled):before {
    left: 100%;
}

/* Animation de chargement pour le bouton */
.save-all-btn .animate-spin {
    animation: spin 1s linear infinite;
}

/* Animation pour le bouton ajouter */
.add-button {
    position: relative;
    overflow: hidden;
}

.add-button-text {
    display: inline-block;
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.4s ease-in-out, max-width 0.4s ease-in-out, margin-left 0.4s ease-in-out;
}

.add-button:hover .add-button-text {
    opacity: 1;
    max-width: 200px;
    margin-left: 8px;
}

/* Animation pour les boutons de navigation */
.nav-buttons-container {
    position: relative;
}

.nav-button {
    position: relative;
    overflow: hidden;
}

.nav-button-text {
    display: inline-block;
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.4s ease-in-out, max-width 0.4s ease-in-out, margin-left 0.4s ease-in-out;
}

.nav-button:hover .nav-button-text {
    opacity: 1;
    max-width: 150px;
    margin-left: 8px;
}

.nav-buttons-container:hover .nav-button:not(:hover) {
    opacity: 0.3;
}

.global-objectif-card {
    margin: 1rem 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(120deg, rgba(59,130,246,0.15), rgba(147,197,253,0.4));
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #1e293b;
}

/* Cacher la carte de progression globale sur desktop */
@media (min-width: 768px) {
    .global-objectif-card {
        display: none !important;
    }
}

.global-objectif-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.global-objectif-value {
    font-size: 1.25rem;
    font-weight: 700;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive pour le tableau */
@media (max-width: 768px) {
    .table-container {
        font-size: 0.875rem;
    }
    
    .table-container th,
    .table-container td {
        padding: 0.5rem 0.375rem;
    }
    
    .editable-cell {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .status-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
    
    .save-all-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* ===== TRI ===== */
.sort-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
}

.sort-btn:hover {
    color: #374151;
}

.sort-icon {
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sort-btn:hover .sort-icon {
    opacity: 1;
}

.sort-icon.asc {
    opacity: 1;
    color: #3b82f6;
}

.sort-icon.desc {
    opacity: 1;
    color: #3b82f6;
}

/* Boutons de tri mobile */
.mobile-sort-btn {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mobile-sort-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-sort-btn.active {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #2563eb;
}

.mobile-sort-btn .sort-icon {
    font-size: 0.75rem;
}

/* Styles pour la validation des dates */
.border-red-500 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

/* Message d'erreur pour les champs de date */
input:invalid {
    border-color: #ef4444 !important;
}

input:invalid:focus {
    box-shadow: 0 0 0 1px #ef4444 !important;
}
