/* ============================================ */
/* TABS.CSS - VERSION MOBILE-FRIENDLY COMPLÈTE */
/* ============================================ */

/* ============================================ */
/* NAVIGATION DESKTOP (CONSERVÉE) */
/* ============================================ */
.dashboard-tabs {
    display: flex;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 3px solid var(--border-color);
    padding: 0 var(--spacing-lg);
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 60px;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dashboard-tabs::-webkit-scrollbar {
    display: none;
}

.dashboard-tabs::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--warning-color), var(--error-color));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.dashboard-tabs:hover::before {
    transform: scaleX(1);
}

/* Boutons d'onglets desktop */
.tab-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    white-space: nowrap;
    min-height: 60px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-shrink: 0;
}

.tab-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.tab-button:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-button:hover::before {
    transform: scaleX(0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tab-button.active::before {
    transform: scaleX(1);
    background: var(--secondary-color);
}

.tab-button.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

/* Icônes des onglets */
.tab-button .tab-icon {
    font-size: 1.1rem;
    transition: transform var(--transition-normal);
}

.tab-button:hover .tab-icon {
    transform: scale(1.1);
}

.tab-button.active .tab-icon {
    animation: tabIconPulse 2s ease-in-out infinite;
}

@keyframes tabIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================ */
/* NAVIGATION MOBILE SIDEBAR */
/* ============================================ */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    box-shadow: var(--shadow-xl);
    transition: left var(--transition-normal);
    z-index: calc(var(--z-header) + 2);
    padding-top: 80px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-header {
    padding: var(--spacing-xl) var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    margin-top: -80px;
    padding-top: calc(80px + var(--spacing-lg));
    flex-shrink: 0;
}

.mobile-sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.mobile-sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    font-weight: 500;
    font-size: 1rem;
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    transform: translateX(4px);
}

.mobile-nav-item:hover::before,
.mobile-nav-item.active::before {
    transform: scaleY(1);
}

.mobile-nav-icon {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
    transition: transform var(--transition-normal);
}

.mobile-nav-item:hover .mobile-nav-icon,
.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.1);
}

.mobile-sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: calc(var(--z-header) + 1);
    backdrop-filter: blur(2px);
}

.mobile-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================ */
/* NAVIGATION BOTTOM MOBILE */
/* ============================================ */
.mobile-bottom-tabs {
    display: none;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%) !important;
    border-top: 2px solid var(--border-color) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
    z-index: 999999 !important;
    padding: var(--spacing-xs) 0 !important;
    backdrop-filter: blur(10px) !important;
    min-height: 60px !important;
    height: 60px !important;
    max-height: 60px !important;
    pointer-events: auto !important;
    transform: translateZ(0) !important;
    will-change: transform !important;
}

.mobile-tab-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: var(--radius-md);
    margin: 0 2px;
    position: relative;
    min-height: 50px;
    justify-content: center;
}

.mobile-tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 2px 2px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.mobile-tab-button:hover,
.mobile-tab-button.active {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.mobile-tab-button.active::before {
    opacity: 1;
}

.mobile-tab-icon {
    font-size: 1.2rem;
    transition: transform var(--transition-normal);
    margin-bottom: 2px;
}

.mobile-tab-button:hover .mobile-tab-icon,
.mobile-tab-button.active .mobile-tab-icon {
    transform: scale(1.1);
}

.mobile-tab-button.active .mobile-tab-icon {
    animation: mobileTabPulse 2s ease-in-out infinite;
}

@keyframes mobileTabPulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

.mobile-tab-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* ============================================ */
/* INDICATEURS ET BADGES SUR ONGLETS */
/* ============================================ */
.tab-button .notification-dot,
.mobile-nav-item .notification-dot,
.mobile-tab-button .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error-color);
    border-radius: 50%;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.tab-button .tab-badge,
.mobile-nav-item .nav-badge,
.mobile-tab-button .tab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-lg);
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

.tab-button.active .tab-badge,
.mobile-nav-item.active .nav-badge,
.mobile-tab-button.active .tab-badge {
    background: var(--warning-color);
}

/* ============================================ */
/* ONGLETS AVEC DÉFILEMENT HORIZONTAL */
/* ============================================ */
.scrollable-tabs {
    position: relative;
    overflow: hidden;
}

.tabs-scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 40px;
}

.tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
}

.scroll-button:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-50%) scale(1.1);
}

.scroll-button.left {
    left: 8px;
}

.scroll-button.right {
    right: 8px;
}

.scroll-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-secondary);
    transform: translateY(-50%);
}

/* ============================================ */
/* ONGLETS AVEC INDICATEUR DE PROGRESSION */
/* ============================================ */
.tab-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    transition: all var(--transition-normal);
    border-radius: 0 2px 0 0;
}

/* ============================================ */
/* ONGLETS AVEC EFFET DE FERMETURE */
/* ============================================ */
.closable-tab {
    position: relative;
    padding-right: calc(var(--spacing-lg) + 24px);
}

.tab-close-btn {
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: currentColor;
    opacity: 0;
    transition: all var(--transition-normal);
}

.closable-tab:hover .tab-close-btn {
    opacity: 1;
}

.tab-close-btn:hover {
    background: var(--error-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

/* ============================================ */
/* ONGLETS AVEC RACCOURCIS CLAVIER */
/* ============================================ */
.tab-button[data-shortcut]::after {
    content: attr(data-shortcut);
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.6rem;
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
}

/* ============================================ */
/* ÉTATS DES ONGLETS */
/* ============================================ */
.tab-button.loading,
.mobile-nav-item.loading,
.mobile-tab-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tab-button.loading .tab-icon,
.mobile-nav-item.loading .mobile-nav-icon,
.mobile-tab-button.loading .mobile-tab-icon {
    animation: spin 1s linear infinite;
}

.tab-button.error,
.mobile-nav-item.error,
.mobile-tab-button.error {
    color: var(--error-color);
    border-color: var(--error-color);
}

.tab-button.error .tab-icon,
.mobile-nav-item.error .mobile-nav-icon,
.mobile-tab-button.error .mobile-tab-icon {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.tab-button.success,
.mobile-nav-item.success,
.mobile-tab-button.success {
    color: var(--success-color);
}

.tab-button.success .tab-icon,
.mobile-nav-item.success .mobile-nav-icon,
.mobile-tab-button.success .mobile-tab-icon {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================ */
/* RESPONSIVE DESIGN POUR LES ONGLETS */
/* ============================================ */

/* TABLETTES */
@media screen and (max-width: 1024px) {
    .dashboard-tabs {
        padding: 0 var(--spacing-md);
        overflow-x: auto;
    }
    
    .tab-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .tab-button .tab-icon {
        font-size: 1rem;
    }
    
    .mobile-sidebar {
        width: 260px;
        left: -260px;
    }
    
    .mobile-nav-item {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

/* MOBILE LANDSCAPE ET PETITES TABLETTES */
@media screen and (max-width: 768px) {
    /* Cacher la navigation desktop */
    .dashboard-tabs {
        display: none !important;
    }
    
    .desktop-tabs {
        display: none !important;
    }
    
    /* Afficher la navigation mobile bottom */
    .mobile-bottom-tabs {
        display: flex !important;
        height: 60px !important;
        min-height: 60px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999999 !important;
        background: white !important;
        border-top: 2px solid #dee2e6 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
    }

    .dashboard-content {
        margin-bottom: 60px !important;
        padding-bottom: 20px !important;
    }
    
    html, body {
        overflow-x: hidden !important;
        position: relative !important;
    }
    
    .mobile-sidebar {
        width: 280px;
        left: -280px;
    }
    
    .mobile-nav-item {
        padding: var(--spacing-lg) var(--spacing-md);
        font-size: 1rem;
    }
    
    .mobile-nav-icon {
        font-size: 1.2rem;
    }
    
    .mobile-tab-button {
        padding: var(--spacing-sm);
        min-height: 60px;
    }
    
    .mobile-tab-icon {
        font-size: 1.2rem;
    }
    
    .mobile-tab-label {
        font-size: 0.7rem;
    }
}

/* MOBILE PORTRAIT */
@media screen and (max-width: 480px) {
    .mobile-sidebar {
        width: 260px;
        left: -260px;
    }
    
    .mobile-sidebar-header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .mobile-sidebar-header h2 {
        font-size: 1.3rem;
    }
    
    .mobile-nav-item {
        padding: var(--spacing-md) var(--spacing-sm);
        font-size: 0.9rem;
    }
    
    .mobile-nav-icon {
        font-size: 1.1rem;
    }
    
    .mobile-bottom-tabs {
        padding: var(--spacing-xs) 0;
        min-height: 55px;
    }
    
    .mobile-tab-button {
        padding: var(--spacing-xs);
        gap: 2px;
        min-height: 50px;
    }
    
    .mobile-tab-icon {
        font-size: 1.1rem;
    }
    
    .mobile-tab-label {
        font-size: 0.6rem;
    }
    
    .tab-badge,
    .nav-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
        min-width: 16px;
    }
    
    .notification-dot {
        width: 6px;
        height: 6px;
    }
}

/* TRÈS PETITS ÉCRANS */
@media screen and (max-width: 320px) {
    .mobile-sidebar {
        width: 240px;
        left: -240px;
    }
    
    .mobile-sidebar-header {
        padding: var(--spacing-md) var(--spacing-xs);
    }
    
    .mobile-sidebar-header h2 {
        font-size: 1.1rem;
    }
    
    .mobile-nav-item {
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .mobile-nav-icon {
        font-size: 1rem;
        width: 20px;
    }
    
    .mobile-bottom-tabs {
        padding: 2px 0;
        min-height: 50px;
    }
    
    .mobile-tab-button {
        padding: 4px 2px;
        gap: 1px;
        min-height: 45px;
    }
    
    .mobile-tab-icon {
        font-size: 1rem;
    }
    
    .mobile-tab-label {
        font-size: 0.5rem;
    }
    
    .mobile-sidebar-footer {
        padding: var(--spacing-sm);
    }
}

/* ============================================ */
/* ORIENTATION LANDSCAPE MOBILE */
/* ============================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .mobile-sidebar {
        padding-top: 60px;
    }
    
    .mobile-sidebar-header {
        margin-top: -60px;
        padding-top: calc(60px + var(--spacing-sm));
    }
    
    .mobile-bottom-tabs {
        padding: 2px 0;
        min-height: 45px;
    }
    
    .mobile-tab-button {
        padding: 2px;
        gap: 1px;
        min-height: 40px;
    }
    
    .mobile-tab-icon {
        font-size: 1rem;
    }
    
    .mobile-tab-label {
        font-size: 0.55rem;
    }
    
    .dashboard-content {
        padding-bottom: 50px;
    }
}

/* ============================================ */
/* DARK MODE POUR LES ONGLETS */
/* ============================================ */
@media (prefers-color-scheme: dark) {
    .dashboard-tabs {
        background: linear-gradient(135deg, var(--dark-bg-secondary) 0%, var(--dark-bg-tertiary) 100%);
        border-bottom-color: var(--dark-border-color);
    }
    
    .tab-button {
        color: var(--dark-text-secondary);
    }
    
    .tab-button:hover {
        background: rgba(52, 152, 219, 0.2);
        color: var(--primary-color);
    }
    
    .tab-button.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        color: white;
    }
    
    .mobile-sidebar {
        background: linear-gradient(135deg, var(--dark-bg-primary) 0%, var(--dark-bg-secondary) 100%);
    }
    
    .mobile-sidebar-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    }
    
    .mobile-nav-item {
        color: var(--dark-text-primary);
        border-bottom-color: var(--dark-border-color);
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        color: white;
    }
    
    .mobile-sidebar-footer {
        background: var(--dark-bg-secondary);
        border-top-color: var(--dark-border-color);
    }
    
    .mobile-bottom-tabs {
        background: linear-gradient(135deg, var(--dark-bg-primary) 0%, var(--dark-bg-secondary) 100%);
        border-top-color: var(--dark-border-color);
    }
    
    .mobile-tab-button {
        color: var(--dark-text-secondary);
    }
    
    .mobile-tab-button:hover,
    .mobile-tab-button.active {
        color: var(--primary-color);
        background: rgba(52, 152, 219, 0.2);
    }
    
    .scroll-button {
        background: var(--dark-bg-primary);
        border-color: var(--dark-border-color);
        color: var(--dark-text-secondary);
    }
    
    .scroll-button:hover {
        background: var(--primary-color);
        color: white;
    }
    
    .tab-close-btn {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .tab-close-btn:hover {
        background: var(--error-color);
        color: white;
    }
}

/* ============================================ */
/* TOUCH IMPROVEMENTS POUR MOBILE */
/* ============================================ */
@media (hover: none) and (pointer: coarse) {
    .tab-button:hover {
        transform: none;
    }
    
    .tab-button:hover::before {
        transform: scaleX(0);
    }
    
    .mobile-nav-item:hover {
        transform: none;
    }
    
    .mobile-nav-item:hover::before {
        transform: scaleY(0);
    }
    
    .mobile-tab-button:hover {
        transform: none;
    }
    
    .tab-close-btn {
        opacity: 1;
    }
    
    .scroll-button:hover {
        transform: translateY(-50%);
    }
    
    /* Augmenter les zones de touch */
    .mobile-tab-button {
        min-height: 48px;
        min-width: 48px;
    }
    
    .mobile-nav-item {
        min-height: 48px;
    }
    
    .tab-close-btn {
        min-width: 24px;
        min-height: 24px;
    }
}

/* ============================================ */
/* ANIMATIONS RÉDUITES */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {
    .tab-button,
    .mobile-nav-item,
    .mobile-tab-button,
    .tab-icon,
    .mobile-nav-icon,
    .mobile-tab-icon,
    .notification-dot,
    .tab-close-btn,
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        animation: none !important;
        transition: none !important;
    }
    
    .tab-button:hover,
    .mobile-nav-item:hover,
    .mobile-tab-button:hover {
        transform: none;
    }
    
    .tab-button::before,
    .mobile-nav-item::before,
    .mobile-tab-button::before {
        transition: none;
    }
}

/* ============================================ */
/* FOCUS VISIBLE AMÉLIORÉ */
/* ============================================ */
.tab-button:focus-visible,
.mobile-nav-item:focus-visible,
.mobile-tab-button:focus-visible,
.scroll-button:focus-visible,
.tab-close-btn:focus-visible {
    outline: 3px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

/* ============================================ */
/* HAUTE RÉSOLUTION */
/* ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .dashboard-tabs {
        border-bottom-width: 2px;
    }
    
    .tab-button::before {
        height: 2px;
    }
    
    .mobile-nav-item::before {
        width: 2px;
    }
    
    .tab-progress {
        height: 2px;
    }
    
    .mobile-bottom-tabs {
        border-top-width: 1px;
    }
    
    .mobile-tab-button::before {
        height: 2px;
    }
}

/* ============================================ */
/* UTILITAIRES POUR LES ONGLETS */
/* ============================================ */
.tabs-hidden {
    display: none !important;
}

.tabs-visible {
    display: flex !important;
}

.tab-content-hidden {
    display: none !important;
}

.tab-content-visible {
    display: block !important;
}

/* ============================================ */
/* ACCESSIBILITÉ */
/* ============================================ */
.tab-button[aria-selected="true"],
.mobile-nav-item[aria-selected="true"],
.mobile-tab-button[aria-selected="true"] {
    font-weight: 600;
}

.tab-button[aria-disabled="true"],
.mobile-nav-item[aria-disabled="true"],
.mobile-tab-button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================ */
/* INDICATEURS VISUELS POUR L'ÉTAT DES ONGLETS */
/* ============================================ */
.tab-button .status-indicator,
.mobile-nav-item .status-indicator,
.mobile-tab-button .status-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success-color);
}

.tab-button .status-indicator.warning,
.mobile-nav-item .status-indicator.warning,
.mobile-tab-button .status-indicator.warning {
    background: var(--warning-color);
}

.tab-button .status-indicator.error,
.mobile-nav-item .status-indicator.error,
.mobile-tab-button .status-indicator.error {
    background: var(--error-color);
    animation: statusBlink 1s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.tab-button .status-indicator.processing,
.mobile-nav-item .status-indicator.processing,
.mobile-tab-button .status-indicator.processing {
    background: var(--info-color);
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ============================================ */
/* ONGLETS AVEC TRANSITION DE CONTENU */
/* ============================================ */
.tab-transition-container {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.tab-transition-content {
    transition: all 0.3s ease-in-out;
    opacity: 1;
    transform: translateX(0);
    height: 100%;
}

.tab-transition-content.slide-out-left {
    opacity: 0;
    transform: translateX(-20px);
}

.tab-transition-content.slide-out-right {
    opacity: 0;
    transform: translateX(20px);
}

.tab-transition-content.slide-in-left {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.3s ease-out forwards;
}

.tab-transition-content.slide-in-right {
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.3s ease-out forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================ */
/* ONGLETS AVEC LAZY LOADING */
/* ============================================ */
.tab-content-lazy {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content-lazy.loading {
    flex-direction: column;
    gap: var(--spacing-md);
    color: var(--text-muted);
}

.tab-content-lazy .lazy-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================ */
/* ONGLETS VERTICAUX (POUR SIDEBARS) */
/* ============================================ */
.vertical-tabs {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border-color);
    min-width: 200px;
    padding: var(--spacing-md);
    height: 100%;
}

.vertical-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    position: relative;
    overflow: hidden;
    text-align: left;
    width: 100%;
}

.vertical-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.vertical-tab:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

.vertical-tab:hover::before {
    transform: scaleY(0.3);
}

.vertical-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.vertical-tab.active::before {
    transform: scaleY(1);
    background: var(--secondary-color);
}

/* ============================================ */
/* MENU HAMBURGER POUR ONGLETS (RESPONSIVE) */
/* ============================================ */
.tabs-menu-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-md);
}

.tabs-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.tabs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    max-height: 300px;
    overflow-y: auto;
}

.tabs-dropdown .tab-button {
    width: 100%;
    justify-content: flex-start;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0;
    border-bottom: 1px solid var(--border-light);
    min-height: auto;
}

.tabs-dropdown .tab-button:last-child {
    border-bottom: none;
}

/* ============================================ */
/* ONGLETS AVEC SWIPE GESTURES (MOBILE) */
/* ============================================ */
.swipe-tabs-container {
    position: relative;
    overflow: hidden;
    touch-action: pan-x;
}

.swipe-indicator {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 8px;
}

.swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background var(--transition-normal);
}

.swipe-dot.active {
    background: var(--primary-color);
}

/* ============================================ */
/* GESTION DES OVERFLOWS */
/* ============================================ */
.tab-overflow-menu {
    position: relative;
    display: none;
}

.tab-overflow-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.tab-overflow-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-overflow-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

/* ============================================ */
/* ANIMATIONS SPÉCIFIQUES AUX ONGLETS */
/* ============================================ */
@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes mobileTabBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.tab-button.new {
    animation: tabSlideIn 0.3s ease-out;
}

.mobile-tab-button:active {
    animation: mobileTabBounce 0.3s ease;
}

.mobile-nav-item:active {
    animation: mobileTabBounce 0.3s ease;
}

/* ============================================ */
/* CONTRASTE ÉLEVÉ (ACCESSIBILITÉ) */
/* ============================================ */
@media (prefers-contrast: high) {
    .tab-button,
    .mobile-nav-item,
    .mobile-tab-button {
        border: 2px solid currentColor;
    }
    
    .tab-button.active,
    .mobile-nav-item.active,
    .mobile-tab-button.active {
        border-width: 3px;
    }
    
    .notification-dot,
    .status-indicator {
        border: 2px solid white;
    }
}

/* ============================================ */
/* PRINT STYLES POUR ONGLETS */
/* ============================================ */
@media print {
    .mobile-sidebar,
    .mobile-sidebar-overlay,
    .mobile-bottom-tabs,
    .tabs-menu-toggle,
    .scroll-button,
    .tab-close-btn {
        display: none !important;
    }
    
    .dashboard-tabs {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #000;
        background: white;
    }
    
    .tab-button {
        color: #000;
        background: white;
    }
    
    .tab-button.active {
        background: #000;
        color: white;
    }
}

/* ============================================ */
/* TRANSITIONS FLUIDES ENTRE ONGLETS */
/* ============================================ */
.tabs-content-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.tabs-content-wrapper .tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    transform: translateX(20px);
}

.tabs-content-wrapper .tab-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.tabs-content-wrapper .tab-content.prev {
    transform: translateX(-20px);
}

/* ============================================ */
/* GESTION DE LA LARGEUR DYNAMIQUE */
/* ============================================ */
@media screen and (max-width: 1200px) {
    .tab-overflow-menu {
        display: block;
    }
}

/* ============================================ */
/* OPTIMISATIONS PERFORMANCE */
/* ============================================ */
.tab-button,
.mobile-nav-item,
.mobile-tab-button {
    will-change: transform;
}

.mobile-sidebar {
    will-change: left;
}

.mobile-sidebar-overlay {
    will-change: opacity;
}

/* Désactiver les transitions pendant le redimensionnement */
.resize-animation-stopper * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* ============================================ */
/* VARIABLES CSS PERSONNALISABLES */
/* ============================================ */
:root {
    --tab-height: 60px;
    --mobile-tab-height: 60px;
    --sidebar-width: 280px;
    --tab-transition-duration: 0.3s;
    --tab-border-radius: 6px;
}

/* ============================================ */
/* COMPATIBILITÉ NAVIGATEURS */
/* ============================================ */
/* Fallback pour les navigateurs ne supportant pas backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .mobile-bottom-tabs {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .mobile-sidebar-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Fallback pour les navigateurs ne supportant pas CSS Grid */
@supports not (display: grid) {
    .stats-grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .stat-card {
        flex: 1;
        min-width: 200px;
        margin: var(--spacing-sm);
    }
}

/* ============================================ */
/* FINE TUNING POUR DIFFÉRENTS DEVICES */
/* ============================================ */
/* iPhone SE et petits écrans */
@media screen and (max-width: 375px) and (max-height: 667px) {
    .mobile-bottom-tabs {
        min-height: 55px;
    }
    
    .mobile-tab-button {
        min-height: 50px;
    }
    
    .mobile-tab-icon {
        font-size: 1rem;
    }
    
    .mobile-tab-label {
        font-size: 0.6rem;
    }
}

/* iPad et tablettes */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .tab-button {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .dashboard-tabs {
        min-height: 65px;
    }
}

/* Desktop large */
@media screen and (min-width: 1440px) {
    .tab-button {
        padding: var(--spacing-lg) var(--spacing-xl);
        font-size: 1rem;
    }
    
    .dashboard-tabs {
        min-height: 70px;
    }
}