/* Modern Sidebar with Cyan Theme */
:root {
    /* Light Theme - Teal */
    --primary: #48C9B0;
    --primary-light: #76D7C4;
    --primary-dark: #1ABC9C;
    --primary-50: #E8F8F5;
    --primary-100: #D1F2EB;
    --primary-200: #A3E4D7;
    --primary-300: #76D7C4;
    --primary-400: #48C9B0;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --border: #e2e8f0;
    --sidebar-bg: #ffffff;
    --sidebar-text: #1e293b;
    --sidebar-hover: #f8fafc;
    --nav-bg: #ffffff;
    --nav-text: #1e293b;
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --shadow: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-light: linear-gradient(135deg, var(--primary-50), var(--primary-100));
}

[data-theme="dark"],
[data-bs-theme="dark"] {
    /* Dark Theme - Teal */
    --primary: #1ABC9C;
    --primary-light: #48C9B0;
    --primary-dark: #16A085;
    --primary-50: #0B5345;
    --primary-100: #0E6655;
    --primary-200: #117864;
    --primary-300: #148F77;
    --primary-400: #1ABC9C;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    --dark: #f1f5f9;
    --light: #0f172a;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;
    --border: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f1f5f9;
    --sidebar-hover: #334155;
    --nav-bg: #1e293b;
    --nav-text: #f1f5f9;
    --main-bg: #0f172a;
    --card-bg: #1e293b;
    --shadow: rgba(0, 0, 0, 0.25);
    --shadow-lg: rgba(0, 0, 0, 0.4);
}

/* Personnalisation pagination Bootstrap */
.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.5rem;
    --bs-pagination-border-radius: 0.5rem;
}

.pagination .page-item .page-link {
    color: #abafac;
    /* bleu Bootstrap */
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    margin: 0 3px;
    transition: all 0.2s ease-in-out;
}

.pagination .page-item .page-link:hover {
    background-color: #505251;
    color: #fff;
    box-shadow: 0 0 6px rgba(13, 110, 253, 0.3);
}

.pagination .page-item.active .page-link {
    background-color: #767676;
    border-color: #898989;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 0 8px rgba(79, 80, 82, 0.4);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.6;
    pointer-events: none;
}

/* CSS Reset Modern */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Smooth transitions and fluid animations */
* {
    transition: background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        box-shadow 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* RÉDUCTION GÉNÉRALE DE LA TAILLE DES POLICES */
body {
    background: var(--main-bg);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--dark);
    line-height: 1.2;
    /* Interligne réduit */
    overflow-x: hidden;
    font-size: 0.875rem;
    /* Taille de base réduite */
}

/* RÉDUCTION DES TITRES — aligné page ordinateur (× échelle globale gpi-typography.css) */
h1 {
    font-size: 1.3rem !important;
    margin-bottom: 0.5rem !important;
}

h2 {
    font-size: 1.15rem !important;
    margin-bottom: 0.5rem !important;
}

h3 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* RÉDUCTION DU DASHBOARD */
.dashboard-header,
.main-content-modern h1,
.main-content-modern h2 {
    font-size: 1.3rem !important;
}

/* CORRECTION NAVBAR - Hauteur fixe et z-index ajusté */
.navbar-modern {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 15px var(--shadow);
    padding: 0.3rem 1rem !important;
    min-height: 50px !important;
    height: 50px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1200 !important;
    /* Z-index plus élevé que la sidebar */
    display: flex;
    align-items: center;
}

[data-theme="dark"] .navbar-modern {
    background: rgba(30, 41, 59, 0.95) !important;
}

.navbar-brand-modern {
    font-weight: 800;
    font-size: clamp(1rem, 2vw, 1.3rem);
    gap: 0.75rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--primary-50), transparent 60%);
    margin-right: auto;
}

.navbar-brand-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    transition: left 0.4s ease;
    z-index: -1;
}

.navbar-brand-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
    background: linear-gradient(135deg, var(--primary-100), transparent 40%);
}

.navbar-brand-modern:hover::before {
    left: 0;
}

.navbar-brand-modern:hover img {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.navbar-brand-modern:hover .brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.navbar-brand-modern img {
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow);
    width: 32px;
    height: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
}

.navbar-brand-modern:hover img {
    border-color: var(--primary-light);
}

.brand-text {
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    transition: all 0.4s ease;
    position: relative;
}

.brand-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
}

.navbar-brand-modern:hover .brand-text::after {
    width: 100%;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-left: 0.5rem;
    opacity: 0.8;
    transition: all 0.4s ease;
}

.navbar-brand-modern:hover .brand-subtitle {
    color: var(--primary);
    opacity: 1;
    transform: translateX(5px);
}

/* Version compacte pour mobile */
@media (max-width: 768px) {
    .navbar-brand-modern {
        gap: 0.5rem;
        padding: 0.3rem 0.5rem;
        border-radius: 10px;
    }

    .navbar-brand-modern img {
        width: 28px;
        height: 28px;
    }

    .brand-text {
        font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    }

    .brand-subtitle {
        display: none;
        /* Cache le sous-titre sur mobile */
    }
}

/* Version ultra compacte pour très petits écrans */
@media (max-width: 480px) {
    .navbar-brand-modern {
        gap: 0.3rem;
        padding: 0.2rem 0.3rem;
    }

    .navbar-brand-modern img {
        width: 24px;
        height: 24px;
    }

    .brand-text {
        font-size: 0.9rem;
    }
}

/* Animation d'entrée */
@keyframes brandSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.navbar-brand-modern {
    animation: brandSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effet de focus pour accessibilité */
.navbar-brand-modern:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 8px;
}

/* État actif */
.navbar-brand-modern.active {
    background: var(--gradient-primary);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.navbar-brand-modern.active .brand-text {
    -webkit-text-fill-color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar-brand-modern.active img {
    border-color: white;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Style pour le mode sombre */
[data-theme="dark"] .navbar-brand-modern {
    background: linear-gradient(135deg, var(--primary-50), transparent 70%);
}

[data-theme="dark"] .navbar-brand-modern:hover {
    background: linear-gradient(135deg, var(--primary-100), transparent 50%);
}

[data-theme="dark"] .brand-subtitle {
    color: var(--gray-400);
}

/* Enhanced Theme Toggle */
.theme-toggle {
    background: var(--gradient-light);
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem !important;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0.5rem !important;
    position: relative;
    overflow: hidden;
    font-size: 1rem !important;
    width: 35px !important;
    height: 35px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.4s ease;
    z-index: -1;
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    color: white;
    border-color: var(--primary);
}

.theme-toggle:hover::before {
    left: 0;
}

.theme-toggle i {
    font-size: 1rem !important;
    transition: transform 0.4s ease;
}

/* Enhanced User Dropdown */
.user-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px !important;
    padding: 0.3rem !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    height: 35px !important;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    transition: left 0.4s ease;
    pointer-events: none;
}

.user-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-lg);
    border-color: var(--primary);
}

.user-dropdown:hover::before {
    left: 0;
}

.user-avatar {
    border-radius: 50%;
    border: 2px solid var(--primary);
    transition: all 0.4s ease;
    box-shadow: 0 3px 12px var(--shadow);
    width: 28px !important;
    height: 28px !important;
}

.user-dropdown:hover .user-avatar {
    transform: scale(1.1);
    border-color: var(--primary-light);
}

.dropdown-menu-modern {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 15px 40px var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: dropdownSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem !important;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item-modern {
    color: var(--dark);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
    font-size: 0.8rem;
}

.dropdown-item-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-item-modern:hover {
    background: var(--primary);
    color: white;
    transform: translateX(6px);
}

.dropdown-item-modern:hover::before {
    transform: scaleY(1);
}

/* CORRECTION SIDEBAR - Position sous la navbar */
.sidebar-modern {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    min-height: 100vh !important;
    /* Ajusté pour occuper tout l'écran car le navbar est supprimé */
    box-shadow: 4px 0 25px var(--shadow);
    position: fixed;
    top: 0 !important;
    /* Commence en haut de l'écran */
    left: 0;
    width: min(260px, 90vw);
    z-index: 1100 !important;
    /* Z-index inférieur à la navbar */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-modern.collapsed {
    transform: translateX(-100%);
    opacity: 0;
}

.sidebar-header {
    padding: 1rem 0.75rem 0.75rem;
    /* Padding réduit */
    border-bottom: none;
    /* Bordure enlevée */
    text-align: center;
    background: var(--gradient-light);
    margin: 0.5rem;
    /* Marge réduite */
    border-radius: 10px;
    /* Border radius réduit */
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.sidebar-title {
    color: var(--dark);
    font-weight: 700;
    font-size: 0.9rem;
    /* Taille réduite */
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Sidebar Navigation */
.sidebar-nav-modern {
    padding: 0.5rem 0;
    /* Padding réduit */
}

.nav-item-modern {
    margin: 0.15rem 0.5rem;
    /* Marge réduite */
}

.nav-link-modern {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.6rem 0.75rem;
    /* Padding réduit */
    border-radius: 6px;
    /* Border radius réduit */
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: none;
    /* Bordure enlevée */
    font-size: 0.75rem;
    /* Taille réduite */
    background: transparent;
    line-height: 1.1;
    /* Interligne réduit */
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.nav-link-modern:hover {
    background: var(--sidebar-hover);
    transform: translateX(4px);
    color: var(--primary);
}

.nav-link-modern:hover::before {
    transform: scaleY(1);
}

.nav-link-modern.active {
    background: var(--sidebar-hover);
    transform: translateX(4px);
    color: var(--primary);
    border: none;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.nav-link-modern.active::before {
    transform: scaleY(1);
    background: white;
    opacity: 0.4;
}

.nav-icon {
    width: 16px;
    /* Taille réduite */
    height: 16px;
    /* Taille réduite */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: inherit;
    font-size: 0.8rem;
    /* Taille réduite */
}

.nav-link-modern:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link-modern.active .nav-icon {
    transform: scale(1.05);
}

.nav-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: inherit;
    font-size: 0.7rem;
    /* Taille réduite */
}

.nav-link-modern[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

/* Styles pour les sous-menus - BORDURES ENLEVÉES */
.nav-collapse-modern {
    border: none;
    /* Bordure enlevée */
    background: transparent;
}

.nav-submenu-modern {
    border: none;
    /* Bordure enlevée */
    padding-left: 1rem;
    /* Padding réduit */
}

.nav-submenu-modern .nav-link-modern {
    padding: 0.5rem 0.75rem;
    /* Padding réduit */
    font-size: 0.7rem;
    /* Taille réduite */
    border-radius: 5px;
    /* Border radius réduit */
    line-height: 1.1;
    /* Interligne réduit */
}

.nav-submenu-modern .nav-link-modern:hover {
    background: var(--sidebar-hover);
    transform: translateX(2px);
}

.nav-submenu-modern .nav-link-modern.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(2px);
}

/* Enhanced Submenu - BORDURES ENLEVÉES */
.nav-submenu {
    background: var(--sidebar-hover);
    border-radius: 8px;
    /* Border radius réduit */
    margin: 0.3rem 0.5rem;
    /* Marge réduite */
    padding: 0.3rem 0;
    /* Padding réduit */
    border: none;
    /* BORDURE ENLEVÉE */
    animation: submenuSlide 0.3s ease-out;
}

@keyframes submenuSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu-item {
    padding: 0.4rem 1rem 0.4rem 2rem;
    /* Padding réduit */
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 5px;
    /* Border radius réduit */
    transition: all 0.3s ease;
    font-size: 0.7rem;
    /* Taille réduite */
    position: relative;
    margin: 0.1rem 0.3rem;
    /* Marge réduite */
    line-height: 1.1;
    /* Interligne réduit */
}

.submenu-item::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    /* Taille réduite */
    height: 4px;
    /* Taille réduite */
    background: var(--primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.submenu-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

.submenu-item:hover::before {
    background: white;
    transform: translateY(-50%) scale(1.3);
}

.submenu-item.active {
    background: var(--primary);
    color: white;
    transform: translateX(2px);
}

/* Enhanced Nav Headings */
.nav-heading-modern {
    color: var(--gray-500);
    font-size: 0.65rem;
    /* Taille réduite */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Espacement réduit */
    padding: 0.75rem 1rem 0.4rem;
    /* Padding réduit */
    margin: 0;
    position: relative;
    line-height: 1.1;
    /* Interligne réduit */
}

.nav-heading-modern::after {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: var(--border);
}

/* CORRECTION MAIN CONTENT — largeur calée sur la sidebar admin (240px / 76px réduit) */
@media (min-width: 992px) {
    body.admin-sidebar-expanded .main-content-modern {
        margin-left: 240px;
        width: calc(100% - 240px);
        max-width: calc(100vw - 240px);
        padding: clamp(1rem, 3vw, 2rem);
    }

    body.admin-sidebar-collapsed .main-content-modern {
        margin-left: 76px;
        width: calc(100% - 76px);
        max-width: calc(100vw - 76px);
        padding: clamp(1rem, 3vw, 2rem);
    }
}

.main-content-modern {
    background: var(--main-bg);
    min-height: 100vh !important;
    margin-top: 0 !important;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: auto;
}

.main-content-modern::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.main-content-modern.expanded {
    margin-left: 0;
}

/* RÉDUCTION DES CARTES ET WIDGETS */
.card {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.card-body {
    padding: 0.75rem !important;
}

.card-title {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
}

.card-text {
    font-size: 0.8rem !important;
}

/* RÉDUCTION DES STATISTIQUES */
.stats-number {
    font-size: 1.5rem !important;
}

.stats-label {
    font-size: 0.75rem !important;
}

/* RÉDUCTION DES BOUTONS */
.btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8rem !important;
}

/* RÉDUCTION DES TABLEAUX */
.table {
    font-size: 0.8rem !important;
}

.table th,
.table td {
    padding: 0.5rem 0.75rem !important;
}

/* RÉDUCTION DES BADGES */
.badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* RÉDUCTION DES FORMULAIRES */
.form-control {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8rem !important;
    height: calc(1.5em + 0.75rem) !important;
}

.form-label {
    font-size: 0.8rem !important;
    margin-bottom: 0.25rem !important;
}

/* RÉDUCTION DES ESPACEMENTS */
.container-fluid {
    padding: 0.75rem !important;
}

.row {
    margin-bottom: 0.5rem !important;
}

.col,
.col-auto {
    padding: 0.375rem !important;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 991.98px) {
    .sidebar-modern {
        transform: translateX(-100%);
        width: min(280px, 88vw);
        box-shadow: 6px 0 35px var(--shadow-lg);
    }

    .sidebar-modern.mobile-open {
        transform: translateX(0);
    }

    .main-content-modern {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0.75rem;
        padding-top: 4.25rem;
        overflow-x: auto;
    }

    .navbar-brand-modern {
        font-size: 1rem;
    }

    .nav-link-modern {
        padding: 0.6rem 0.75rem;
    }

    body {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .navbar-modern {
        padding: 0.3rem 0.5rem !important;
        min-height: 45px !important;
        height: 45px !important;
    }

    .sidebar-modern {
        width: 100vw;
        top: 0 !important;
        /* Ajusté car le navbar est supprimé */
        min-height: 100vh !important;
    }

    .main-content-modern {
        min-height: 100vh !important;
        margin-top: 0 !important;
        padding: 0.5rem !important;
    }

    .nav-link-modern {
        padding: 0.6rem 0.75rem;
    }

    h1 {
        font-size: 1.25rem !important;
    }

    h2 {
        font-size: 1.1rem !important;
    }
}

/* Enhanced Scrollbar */
.sidebar-modern::-webkit-scrollbar {
    width: 6px;
}

.sidebar-modern::-webkit-scrollbar-track {
    background: var(--sidebar-hover);
    border-radius: 3px;
}

.sidebar-modern::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 3px;
    border: 1px solid var(--sidebar-hover);
}

.sidebar-modern::-webkit-scrollbar-thumb:hover {
    background: var(white);
}

/* Enhanced Animation Classes */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-25px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(25px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced Notification Badge */
.notification-badge {
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 6px;
    right: 6px;
    box-shadow: 0 1px 6px var(--shadow);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Enhanced Toggle Sidebar Button */
.sidebar-toggle {
    background: var(--gradient-light);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.4s ease;
    z-index: -1;
}

.sidebar-toggle:hover {
    background: var(--gradient-primary);
    color: white;
    transform: rotate(90deg) scale(1.05);
    border-color: var(--primary);
}

.sidebar-toggle:hover::before {
    left: 0;
}

/* Loading Animation */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Focus States for Accessibility */
.nav-link-modern:focus,
.dropdown-item-modern:focus,
.theme-toggle:focus,
.sidebar-toggle:focus {
    /* outline: 2px solid var(--primary);
    outline-offset: 1px; */
}

/* RÉDUCTION DE LA TAILLE DES SLOTS À 80% */
.slot-container {
    transform: scale(0.8);
    transform-origin: top left;
    width: 125%;
    height: 125%;
}

/* Conteneur principal : défilement horizontal si tableau large */
.main-content-modern .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Pour les écrans mobiles - ajustement responsive */
@media (max-width: 768px) {
    .slot-container {
        transform: scale(0.9);
        transform-origin: top left;
        width: 111.11%;
        height: 111.11%;
    }
}

@media (max-width: 480px) {
    .slot-container {
        transform: scale(1);
        width: 100%;
        height: 100%;
    }
}

/* Style ultra-compact pour administration */
.compact-mode .card {
    margin-bottom: 0.5rem !important;
}

.compact-mode .table-sm td,
.compact-mode .table-sm th {
    padding: 0.25rem 0.5rem !important;
}

/* Mode compact pour le dashboard */
.dashboard-compact {
    font-size: 0.875rem;
}

.dashboard-compact .card {
    transform: scale(0.95);
    transform-origin: top left;
}

.dashboard-compact h1 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.dashboard-compact .stats-widget {
    padding: 0.5rem;
}

.dashboard-compact .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}