 /*  assets/css/sidebar_responsive_fix.css  */
 /* ====== CORRECTIONS SIDEBAR RESPONSIVE TDRCONSULTING ====== */

 /* Variables pour consistency */
 :root {
     --sidebar-width: 280px;
     --header-height: 70px;
     --transition-speed: 0.3s;
     --transition-easing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
 }

 /* ====== CORRECTIONS LAYOUT PRINCIPAL ====== */

 /* Container principal */
 #page-container {
     position: relative;
     min-height: 100vh;
     transition: all var(--transition-speed) var(--transition-easing);
 }

 /* État fermé par défaut sur mobile */
 @media (max-width: 991.98px) {
     #page-container {
         padding-left: 0 !important;
     }
 }

 /* État ouvert sur desktop */
 @media (min-width: 992px) {
     #page-container.sidebar-o {
         padding-left: 0;
         /* On utilise margin sur main-content à la place */
     }
 }

 /* ====== CORRECTIONS SIDEBAR ====== */

 .modern-sidebar {
     position: fixed;
     top: 0;
     left: 0;
     width: var(--sidebar-width);
     height: 100vh;
     transform: translateX(-100%);
     transition: transform var(--transition-speed) var(--transition-easing);
     z-index: 1040;
     /* Bootstrap compatible */
 }

 /* Sidebar visible sur desktop par défaut */
 @media (min-width: 992px) {
     .modern-sidebar {
         transform: translateX(0);
         transition: transform var(--transition-speed) var(--transition-easing);

     }
 }

 /* Nouvelle classe pour l'état fermé sur desktop */
 .sidebar-closed .modern-sidebar {
     transform: translateX(-100%);
 }

 /* Sidebar toggle states */
 .sidebar-o .modern-sidebar,
 .modern-sidebar.show {
     transform: translateX(0) !important;
 }

 /* Mobile specific */
 @media (max-width: 991.98px) {
     .modern-sidebar {
         transform: translateX(-100%);
         z-index: 1040;
         /* Au dessus du header sur mobile */
     }

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

 /* ====== CORRECTIONS HEADER ====== */

 .modern-header {
     position: fixed;
     top: 0;
     left: 0;
     /* Start at 0, will be adjusted by JS */
     right: 0;
     height: var(--header-height);
     z-index: 1040;
     transition: left var(--transition-speed) ease;
 }

 /* Desktop: header adjusts with sidebar */
 @media (min-width: 992px) {
     .modern-header {
         left: var(--sidebar-width);
         /* Default with sidebar open */
     }

     /* When sidebar is closed on desktop */
     .sidebar-closed .modern-header {
         left: 0;
     }
 }

 /* Mobile: header always full width */
 @media (max-width: 991.98px) {
     .modern-header {
         left: 0 !important;
     }
 }

 /* ====== CORRECTIONS MAIN CONTENT ====== */

 .main-content {
     margin-top: var(--header-height);
     margin-left: 0;
     /* Will be adjusted by JS */
     transition: margin-left var(--transition-speed) ease;
     min-height: calc(100vh - var(--header-height));
 }

 /* Desktop: adjust with sidebar */
 @media (min-width: 992px) {
     .main-content {
         margin-left: var(--sidebar-width);
         /* Default with sidebar open */
     }

     .sidebar-closed .main-content {
         margin-left: 0;
     }
 }

 /* Mobile: always full width */
 @media (max-width: 991.98px) {
     .main-content {
         margin-left: 0 !important;
     }
 }

 /* ====== CORRECTIONS BOUTON TOGGLE ====== */

 .sidebar-toggle {
     position: relative;
     background: none;
     border: none;
     color: #6c757d;
     font-size: 20px;
     cursor: pointer;
     padding: 10px;
     border-radius: 8px;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     width: 44px;
     height: 44px;
 }

 .sidebar-toggle:hover {
     background: rgba(0, 0, 0, 0.05);
     color: #495057;
 }

 .sidebar-toggle:focus {
     outline: 2px solid #4facfe;
     outline-offset: 2px;
 }

 .sidebar-toggle.active {
     background: rgba(79, 172, 254, 0.1);
     color: #4facfe;
 }

 /* Icon rotation animation */
 .sidebar-toggle i {
     transition: transform 0.3s ease;
 }

 .sidebar-toggle.active i {
     transform: rotate(90deg);
 }

 /* ====== OVERLAY MOBILE ====== */

 .sidebar-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.5);
     z-index: 1039;
     opacity: 0;
     visibility: hidden;
     transition: all 0.3s ease;
     pointer-events: none;
 }

 .sidebar-overlay.show {
     opacity: 1;
     visibility: visible;
     pointer-events: auto;
 }

 /* ====== CORRECTIONS RESPONSIVE BREAKPOINTS ====== */

 /* Tablettes portrait */
 @media (max-width: 1199.98px) and (min-width: 768px) {
     .modern-header .breadcrumb-nav h6 {
         font-size: 1rem;
     }

     .user-name {
         display: none !important;
     }
 }

 /* Mobiles landscape */
 @media (max-width: 767.98px) and (orientation: landscape) {
     .modern-sidebar {
         width: 260px;
         /* Slightly smaller on mobile landscape */
     }
 }

 /* Très petits écrans */
 @media (max-width: 575.98px) {
     .modern-header {
         padding: 0 10px;
     }

     .header-right {
         gap: 5px;
     }

     .language-selector {
         transform: scale(0.85);
     }

     .user-toggle {
         padding: 6px 10px;
     }

     .user-avatar {
         width: 32px;
         height: 32px;
         font-size: 12px;
     }
 }

 /* ====== CORRECTIONS ANIMATIONS ====== */

 /* Smooth transitions pour tous les éléments */
 /* .modern-sidebar,
 .modern-header,
 .main-content,
 .sidebar-toggle,
 .sidebar-overlay {
     will-change: transform, margin, left, opacity;
 } */


 /* Disable animations on reduced motion */
 @media (prefers-reduced-motion: reduce) {

     .modern-sidebar,
     .modern-header,
     .main-content,
     .sidebar-toggle,
     .sidebar-overlay {
         transition: none !important;
         animation: none !important;
     }
 }

 /* ====== CORRECTIONS Z-INDEX ====== */

 /* Hierarchy z-index pour éviter les conflits */
 .sidebar-overlay {
     z-index: 1039;
 }

 .modern-sidebar {
     z-index: 1040;
 }

 .modern-header {
     z-index: 1040;
 }

 /* Dropdown menu above everything */
 .dropdown-menu {
     z-index: 1060;
 }

 /* ====== CORRECTIONS SCROLLING ====== */

 /* Prevent body scroll when sidebar is open on mobile */
 .sidebar-mobile-open {
     overflow: hidden;
 }

 @media (min-width: 992px) {
     .sidebar-mobile-open {
         overflow: auto;
         /* Allow scroll on desktop */
     }
 }

 /* Improve sidebar scrolling */
 .sidebar-content {
     overflow-x: hidden;
     overflow-y: auto;
     -webkit-overflow-scrolling: touch;
     /* iOS smooth scrolling */
 }

 /* ====== CORRECTIONS ACCESSIBILITY ====== */

 /* Screen reader only text */
 .sr-only {
     position: absolute;
     width: 1px;
     height: 1px;
     padding: 0;
     margin: -1px;
     overflow: hidden;
     clip: rect(0, 0, 0, 0);
     white-space: nowrap;
     border: 0;
 }

 /* Focus visible */
 .nav-link:focus-visible,
 .sidebar-toggle:focus-visible {
     outline: 2px solid #0a2f4f;
     outline-offset: 2px;
     border-radius: 4px;
 }

 /* High contrast mode */
 @media (prefers-contrast: high) {
     .modern-sidebar {
         border-right: 2px solid;
     }

     .nav-link:hover,
     .nav-link.active {
         border: 2px solid;
     }
 }

 /* ====== CORRECTIONS POUR LARAVEL BLADE ====== */

 /* Fix pour les classes Laravel/Bootstrap conflictuelles */
 body.sidebar-o {
     /* Override Laravel sidebar classes */
 }

 .page-header-fixed .modern-header {
     position: fixed !important;
 }

 .main-content-narrow .main-content {
     max-width: none !important;
 }

 /* Compatibility avec les anciennes classes */
 .sidebar-custom,
 .sidebar-container {
     /* Redirection vers modern-sidebar */
 }

 /* ====== DEBUG HELPERS (à supprimer en production) ====== */

 .debug-outline * {
     outline: 1px solid red;
 }

 .debug-sidebar {
     background: rgba(255, 0, 0, 0.1) !important;
 }

 .debug-header {
     background: rgba(0, 255, 0, 0.1) !important;
 }

 .debug-content {
     background: rgba(0, 0, 255, 0.1) !important;
 }

 /* ====== PRINT STYLES ====== */

 @media print {

     .modern-sidebar,
     .modern-header,
     .sidebar-toggle,
     .sidebar-overlay {
         display: none !important;
     }

     .main-content {
         margin: 0 !important;
         margin-top: 0 !important;
         margin-left: 0 !important;
     }
 }