/* ===== STYLES POUR LA GESTION DES PROFILS UTILISATEURS ===== */

.update-filter-modal {
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInModal var(--transition-slow) ease-out;
}

.update-filter-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-filter-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.update-filter-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color var(--transition-fast);
}

.update-filter-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.update-filter-modal .modal-content {
    padding: var(--spacing-xl);
}

.current-filters-summary {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-blue);
}

.current-filters-summary h4 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
}

.update-tabs-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.update-tab-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--blue-25, #f0f6ff);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.04);
}

/* Hover state */
.update-tab-item:hover:not(.disabled) {
    border-color: var(--primary-blue);
    background: var(--blue-200, #bfdbfe);
    color: var(--primary-blue-dark, #1e40af);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Selected state */
.update-tab-item.selected {
    border-color: var(--primary-blue-dark, #1e40af);
    background: var(--blue-400, #60a5fa);
    color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    font-weight: 700;
}

/* Disabled state */
.update-tab-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Active state */
.update-tab-item.active {
    border-color: var(--primary-blue-dark, #1e40af);
    background: linear-gradient(90deg, var(--blue-500, #3b82f6) 80%, var(--success-green, #10b981) 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

/* Active indicator */
.update-tab-item.active::after {
    content: "✅ Actuel";
    font-size: 12px;
    color: #fff;
    font-weight: 700;
    background: var(--success-green, #10b981);
    border-radius: 8px;
    padding: 2px 8px;
    margin-left: 12px;
}

.tab-info {
    flex: 1;
}

.tab-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.tab-preview {
    font-size: 12px;
    color: var(--gray-600);
    opacity: 0.8;
}

.update-filter-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--spacing-lg);
}

.update-filter-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    border: none;
    padding: 10px var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.update-filter-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue-darker));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
}

.update-filter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== SYSTÈME DE PROFILS UTILISATEURS AMÉLIORÉ ===== */

.profile-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: var(--z-profile-modal);
    padding: var(--spacing-xl);
    animation: fadeInOverlay var(--transition-slow) ease-out;
}

.profile-selection-modal {
    background: white;
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideInProfile 0.4s ease-out;
}

.profile-header {
    background: var(--profile-purple-gradient);
    color: white;
    padding: var(--spacing-2xl);
    text-align: center;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    position: relative;
}

.profile-header h2 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 28px;
    font-weight: 700;
}

/* Boutons du header des profils */
.profile-header-buttons {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
}

.profile-reorder-btn,
.profile-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.profile-reorder-btn:hover,
.profile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-reorder-btn:active,
.profile-close-btn:active {
    transform: scale(0.95);
}

/* État actif du bouton de réorganisation */
.profile-reorder-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--success-green);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.profile-reorder-btn.active:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--success-green-dark);
}

.profile-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
}

.profile-content {
    padding: var(--spacing-2xl);
}

.profile-info {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

.enterprise-badge {
    background: linear-gradient(135deg, var(--success-green), var(--success-green-dark));
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.profile-explanation {
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    background: var(--gray-50);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--profile-purple);
}

.profile-selection-container {
    margin-bottom: var(--spacing-2xl);
}

.profile-selection-container h4 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.profiles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.profile-option {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.profile-option:hover {
    border-color: var(--profile-purple);
    background: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.profile-option.selected {
    background: var(--profile-purple-gradient);
    border-color: var(--profile-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.profile-option.selected::after {
    content: '✓';
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--profile-purple);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Style pour le profil actuellement actif (différent de selected) */
.profile-option.active {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.profile-option.active::before {
    content: '✓ Actif';
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    z-index: 5;
}

.profile-option.active .profile-option-name {
    color: #065f46;
    font-weight: 700;
}

.profile-option.active .profile-option-email {
    color: #047857;
}

.profile-option-icon {
    font-size: 36px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.8;
}

.profile-option.selected .profile-option-icon {
    opacity: 1;
}

.profile-option-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-800);
    margin: 0;
}

.profile-option.selected .profile-option-name {
    color: white;
}

.profile-option.active.selected .profile-option-name {
    color: #065f46;
}

/* Conteneur pour nom + email du profil */
.profile-option-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Style pour l'email du profil */
.profile-option-email {
    font-size: 13px;
    color: var(--gray-600);
    opacity: 0.8;
    margin: 0;
}

.profile-option.selected .profile-option-email {
    color: rgba(255, 255, 255, 0.9);
}

.profile-option.active.selected .profile-option-email {
    color: #047857;
}

/* Boutons d'action sur les profils */
.profile-option .rename-profile-btn,
.profile-option .delete-profile-btn {
    position: absolute;
    top: var(--spacing-sm);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 10;
}

.profile-option .rename-profile-btn {
    left: var(--spacing-sm);
    background: var(--primary-blue);
}

.profile-option .delete-profile-btn {
    left: calc(var(--spacing-sm) + 32px);
    /* 24px width + 8px gap */
    background: var(--danger-red);
}

.profile-option:hover .rename-profile-btn,
.profile-option:hover .delete-profile-btn {
    opacity: 1;
}

.profile-option.selected .rename-profile-btn,
.profile-option.selected .delete-profile-btn {
    background: rgba(255, 255, 255, 0.9);
}

.profile-option.selected .rename-profile-btn {
    color: var(--primary-blue);
}

.profile-option.selected .delete-profile-btn {
    color: var(--danger-red);
}

.rename-profile-btn:hover {
    background: var(--primary-blue-dark);
    transform: scale(1.1);
}

.delete-profile-btn:hover {
    background: var(--danger-red-dark);
    transform: scale(1.1);
}

.profile-option.selected .rename-profile-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--primary-blue-dark);
}

.profile-option.selected .delete-profile-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--danger-red-dark);
}

/* ==========================================
   STYLES POUR LE DRAG & DROP DES PROFILS
   ========================================== */

/* Mode réorganisation activé */
.profiles-list.reorder-mode {
    background: linear-gradient(135deg, #fefbf3, #fef7e6);
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.profiles-list.reorder-mode::before {
    content: "✏️ Mode réorganisation actif - Glissez les profils";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #f59e0b;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Animation de tremblement pour les profils déplaçables */
.profile-option.shake {
    animation: profileShake 0.5s ease-in-out infinite alternate;
    border: 2px solid #f59e0b !important;
    cursor: grab;
    transform-origin: center;
}

.profile-option.shake:active {
    cursor: grabbing;
}

@keyframes profileShake {
    0% {
        transform: translateX(-1px) rotate(-0.5deg);
    }

    100% {
        transform: translateX(1px) rotate(0.5deg);
    }
}

/* Profil en cours de drag */
.profile-option.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    animation: none;
    border: 2px dashed #3b82f6 !important;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

/* Indicateurs de drop */
.profile-option.drag-over {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe) !important;
    border: 2px solid #0ea5e9 !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.profile-option.drag-over-left {
    border-left: 4px solid #0ea5e9 !important;
    margin-left: 8px;
}

.profile-option.drag-over-right {
    border-right: 4px solid #0ea5e9 !important;
    margin-right: 8px;
}

/* Placeholder de drop - Plus utilisé, on peut le supprimer ou le cacher */
.profile-drop-placeholder {
    display: none !important;
}

/* Bouton de réorganisation */
.profile-reorder-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-reorder-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.profile-reorder-btn.active {
    background: #10b981;
    border-color: #059669;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: reorderActivePulse 2s ease-in-out infinite;
}

@keyframes reorderActivePulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    }
}

/* Amélioration des boutons header */
.profile-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.profile-close-btn {
    background: #ef4444;
    border: 1px solid #dc2626;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-close-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* États désactivés pendant la réorganisation */
.profiles-list.reorder-mode .add-profile-option {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
}

.profiles-list.reorder-mode .rename-profile-btn,
.profiles-list.reorder-mode .delete-profile-btn {
    display: none !important;
}

/* Messages d'aide */
.reorder-help-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    animation: helpTextFadeIn 0.5s ease-out 1s forwards;
}

@keyframes helpTextFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .profile-option.shake {
        animation: none;
        /* Pas d'animation sur mobile pour éviter les conflits tactiles */
    }

    .profiles-list.reorder-mode::before {
        content: "✏️ Glissez pour réorganiser";
        font-size: 11px;
        padding: 3px 8px;
    }

    .drop-indicator-line {
        font-size: 12px;
    }
}

/* Amélioration de l'accessibilité */
.profile-option[draggable="true"] {
    touch-action: none;
    /* Améliore le drag sur mobile */
}

.profile-option:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Feedback visuel pour les actions */
.profile-action-success {
    animation: successFlash 0.6s ease-out;
}

@keyframes successFlash {
    0% {
        background: #10b981;
        transform: scale(1);
    }

    50% {
        background: #059669;
        transform: scale(1.05);
    }

    100% {
        background: initial;
        transform: scale(1);
    }
}

/* Nouveau style pour le bouton d'ajout */
.add-profile-option {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-normal);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.add-profile-option:hover {
    border-color: var(--success-green);
    background: linear-gradient(135deg, var(--success-green-dark), var(--success-green));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.add-profile-option:hover .add-profile-icon {
    transform: scale(1.1);
}

.add-profile-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
    transition: all var(--transition-normal);
}

.add-profile-option:hover .add-profile-icon {
    opacity: 1;
}

.add-profile-text {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-600);
    margin: 0;
    transition: color var(--transition-normal);
}

.add-profile-option:hover .add-profile-text {
    color: white;
}

/* Actions de la modal */
.profile-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    padding-top: var(--spacing-xl);
}

.confirm-profile-btn {
    background: linear-gradient(135deg, var(--success-green), var(--success-green-dark));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    min-width: 200px;
}

.confirm-profile-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-green-dark), var(--success-green-darker));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.confirm-profile-btn:disabled {
    background: var(--gray-300) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.view-stats-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.view-stats-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Modal d'ajout de profil */
.add-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: calc(var(--z-profile-modal) + 1);
}

.add-profile-modal.show {
    display: flex;
}

.add-profile-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: slideInModal 0.3s ease-out;
}

.add-profile-modal h3 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--gray-800);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.add-profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.add-profile-form input {
    padding: var(--spacing-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: border-color var(--transition-normal);
}

.add-profile-form input:focus {
    outline: none;
    border-color: var(--profile-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-profile-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.add-profile-actions button {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.add-profile-actions .cancel-btn {
    background: var(--gray-200);
    color: var(--gray-700);
}

.add-profile-actions .cancel-btn:hover {
    background: var(--gray-300);
}

.add-profile-actions .create-btn {
    background: var(--success-green);
    color: white;
}

.add-profile-actions .create-btn:hover {
    background: var(--success-green-dark);
}

/* Modal de renommage de profil */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: calc(var(--z-profile-modal) + 2);
}

.profile-modal-overlay.show {
    display: flex;
}

.profile-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: slideInModal 0.3s ease-out;
}

.profile-modal-content h3 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--gray-800);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.profile-modal-content .form-group {
    margin-bottom: var(--spacing-lg);
}

.profile-modal-content label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
    font-weight: 500;
}

.profile-modal-content input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: border-color var(--transition-normal);
}

.profile-modal-content input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.profile-modal-content .modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.profile-modal-content .modal-actions button {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.profile-modal-content .modal-actions button[type="button"] {
    background: var(--gray-200);
    color: var(--gray-700);
}

.profile-modal-content .modal-actions button[type="button"]:hover {
    background: var(--gray-300);
}

.profile-modal-content .modal-actions button[type="submit"] {
    background: var(--primary-blue);
    color: white;
}

.profile-modal-content .modal-actions button[type="submit"]:hover {
    background: var(--primary-blue-dark);
}

/* Masquer la section admin (plus nécessaire) */
.admin-section {
    display: none !important;
}

/* Animation pour la modal d'ajout */
@keyframes slideInModal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Messages d'état */
.no-profiles-message {
    text-align: center;
    padding: 40px var(--spacing-xl);
    color: var(--gray-500);
    font-style: italic;
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
}

.no-profiles-message p {
    margin: 0 0 var(--spacing-sm) 0;
}

.no-profiles-message p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .profiles-list {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .profile-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .confirm-profile-btn,
    .view-stats-btn {
        width: 100%;
    }

    .add-profile-modal-content {
        margin: var(--spacing-lg);
        width: calc(100% - 2 * var(--spacing-lg));
    }
}

@media (max-width: 480px) {
    .profile-header h2 {
        font-size: 24px;
    }

    .profile-subtitle {
        font-size: 14px;
    }

    .profile-option {
        min-height: 100px;
        padding: var(--spacing-lg);
    }

    .profile-option-icon {
        font-size: 28px;
    }

    .profile-option-name {
        font-size: 14px;
    }

    .add-profile-icon {
        font-size: 36px;
    }

    .add-profile-text {
        font-size: 14px;
    }
}

/* Groupe d'actions Gmail */
.gmail-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
}

/* Bouton Voir sur Gmail */
.gmail-view-btn {
    background: linear-gradient(135deg, #ea4335, #fbbc05);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px 0 0 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.2);
}

.gmail-view-btn:hover {
    background: linear-gradient(135deg, #d93025, #f9ab00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(234, 67, 53, 0.3);
}

.gmail-view-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.2);
}

/* Bouton copier ID */
.copy-id-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-id-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.copy-id-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

/* Animation lors du clic sur copier */
.copy-id-btn.copying {
    background: #10b981;
    animation: copyPulse 0.3s ease;
}

@keyframes copyPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Ajuster l'espacement dans email-info */
.email-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.email-info strong {
    margin-right: 8px;
    min-width: 80px;
}

.email-info span {
    flex: 1;
    word-break: break-word;
}

/* Exception : le badge SaveToDrive ne doit pas prendre toute la largeur */
.email-info span.savetodrive-badge {
    flex: none !important;
}

/* Responsive pour les petits écrans */
@media (max-width: 768px) {
    .gmail-actions-group {
        margin-left: 8px;
        gap: 1px;
    }

    .gmail-view-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .copy-id-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .email-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .gmail-actions-group {
        margin-left: 0;
        margin-top: 4px;
    }
}

/* Styles pour l'option "Aucun libellé" */
.suggestion-item.special-option {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 4px;
}

.suggestion-item.special-option:hover {
    background: linear-gradient(135deg, #fde68a, #fcd34d);
    border-color: #d97706;
}

.selected-label-item.special-label {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border: 1px solid #f59e0b;
    color: #92400e;
}

.selected-label-item.special-label .label-name {
    font-weight: 600;
}

.selected-label-item.special-label .label-remove {
    color: #92400e;
    font-weight: bold;
}

.selected-label-item.special-label .label-remove:hover {
    background: #f59e0b;
    color: white;
}

.active-label-tag.special {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border: 1px solid #f59e0b;
    color: #92400e;
    font-weight: 600;
}

/* ===== MODAL DE STATISTIQUES ===== */

.profile-stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: var(--z-stats-modal);
    padding: var(--spacing-xl);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-stats-overlay.show {
    display: flex;
    opacity: 1;
}

.profile-stats-modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.profile-stats-overlay.show .profile-stats-modal {
    transform: scale(1) translateY(0);
}

.stats-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: var(--spacing-xl) var(--spacing-2xl);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.stats-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all var(--transition-normal);
}

.stats-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.stats-content {
    padding: var(--spacing-2xl);
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.stats-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.stats-summary h3 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--gray-800);
    font-size: 18px;
}

.stats-summary .total-count {
    font-size: 32px;
    font-weight: 700;
    color: #3b82f6;
}

.profile-stat-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-normal);
}

.profile-stat-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.profile-stat-info {
    flex: 1;
}

.profile-stat-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.profile-stat-details {
    font-size: 13px;
    color: var(--gray-500);
}

.profile-stat-count {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    min-width: 60px;
}

/* ===== AVATARS DE PROFIL AVEC INITIALES ===== */

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.profile-option:hover .profile-avatar {
    transform: scale(1.05);
}

.profile-initials {
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-option.selected .profile-avatar {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Responsive pour les petits écrans */
@media (max-width: 768px) {
    .profile-avatar {
        width: 40px;
        height: 40px;
    }

    .profile-initials {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 36px;
        height: 36px;
    }

    .profile-initials {
        font-size: 14px;
    }
}

/* ===== INDICATEUR DE PROFIL ACTUEL ===== */

.current-profile-indicator {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-slow);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: profileIndicatorAppear var(--transition-slow) ease-out;
    white-space: nowrap;
}

.current-profile-indicator:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.current-profile-indicator::before {
    content: '👤 ';
}

.current-profile-indicator .profile-icon {
    font-size: 16px;
}

.current-profile-indicator .profile-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-profile-indicator .profile-change {
    font-size: 12px;
    opacity: 0.8;
}

.current-profile-indicator.no-profile-selected {
    background: rgba(245, 158, 11, 0.9);
    color: white;
    animation: pulse 2s infinite;
}

.current-profile-indicator.no-profile-selected:hover {
    background: rgba(217, 119, 6, 0.9);
}

/* ===== SCROLLBARS PERSONNALISÉES ===== */

.filter-tabs-list::-webkit-scrollbar,
.existing-profiles::-webkit-scrollbar,
.existing-emails::-webkit-scrollbar,
.profile-stats-modal::-webkit-scrollbar {
    width: 6px;
}

.filter-tabs-list::-webkit-scrollbar-track,
.existing-profiles::-webkit-scrollbar-track,
.existing-emails::-webkit-scrollbar-track,
.profile-stats-modal::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.filter-tabs-list::-webkit-scrollbar-thumb,
.existing-profiles::-webkit-scrollbar-thumb,
.existing-emails::-webkit-scrollbar-thumb,
.profile-stats-modal::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.filter-tabs-list::-webkit-scrollbar-thumb:hover,
.existing-profiles::-webkit-scrollbar-thumb:hover,
.existing-emails::-webkit-scrollbar-thumb:hover,
.profile-stats-modal::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== ANIMATIONS ===== */

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInBadge {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInSuggestion {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInProfile {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes profileIndicatorAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ÉTATS DE FOCUS POUR L'ACCESSIBILITÉ ===== */

.filter-tab:focus-within,
.add-tab-btn:focus,
.tab-action-btn:focus,
.suggestion-btn:focus,
.profile-option:focus,
.confirm-profile-btn:focus,
.modal-close:focus,
.stats-close:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.filter-tab.active:focus-within {
    outline-color: white;
}

/* ===== ÉTATS DE CHARGEMENT ===== */

.profiles-list.loading,
.admin-controls.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== DESIGN RESPONSIVE ===== */

@media (max-width: 768px) {
    :root {
        --spacing-xs: 3px;
        --spacing-sm: 6px;
        --spacing-md: 10px;
        --spacing-lg: 14px;
        --spacing-xl: 18px;
        --spacing-2xl: 20px;
    }

    .filter-tabs-container {
        padding: var(--spacing-md);
    }

    .filter-tabs-header h4 {
        font-size: 13px;
    }

    .add-tab-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .tab-content {
        padding: 10px;
        min-height: 50px;
    }

    .tab-name {
        font-size: 12px;
    }

    .filter-badge {
        font-size: 9px;
        padding: 1px 3px;
    }

    .suggestion-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .suggestion-btn.create {
        width: 100%;
        text-align: center;
    }

    .create-tab-modal,
    .profile-selection-modal,
    .profile-stats-modal {
        margin: 10px;
    }

    .modal-header,
    .profile-header,
    .stats-header {
        padding: var(--spacing-md);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}