body {
   margin-left: 250px;
}

* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

/* ========== SIDEBAR ========== */
.sidebar {
   position: fixed;
   top: 0;
   left: 0;
   height: 100vh;
   width: 280px;
   background: #1e1e2e;
   transition: width 0.3s ease;
   z-index: 1040;
   overflow-y: auto;
   overflow-x: hidden;
}

.sidebar.collapsed {
   width: 70px;
}

.sidebar-header {
   padding: 1.5rem 1.25rem;
   border-bottom: 1px solid rgba(255, 255, 255, 0.1);
   display: flex;
   align-items: center;
   gap: 0.75rem;
   white-space: nowrap;
   min-height: 76px;
}

.sidebar-header .icon-wrapper {
   background: #6366f1;
   color: white;
   border-radius: 8px;
   padding: 0.5rem;
   min-width: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
}

.sidebar-header h5 {
   color: #fff;
   margin: 0;
   font-weight: 600;
   transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-header h5 {
   opacity: 0;
   width: 0;
   overflow: hidden;
}

.sidebar .nav-link {
   color: #a0aec0;
   padding: 0.75rem 1.25rem;
   transition: all 0.2s;
   border-left: 3px solid transparent;
   display: flex;
   align-items: center;
   gap: 0.75rem;
   white-space: nowrap;
   position: relative;
}

.sidebar .nav-link i {
   min-width: 20px;
   flex-shrink: 0;
}

.sidebar .nav-link .link-text {
   transition: opacity 0.3s ease;
   flex: 1;
}

.sidebar.collapsed .nav-link .link-text {
   opacity: 0;
   width: 0;
   overflow: hidden;
}

.sidebar.collapsed .nav-link .bi-caret-down {
   opacity: 0;
   width: 0;
}

.sidebar .nav-link:hover {
   color: #fff;
   background: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link[aria-expanded="true"] {
   color: #fff;
   background: rgba(99, 102, 241, 0.1);
   border-left-color: #6366f1;
}

.sidebar .collapse .nav-link {
   padding-left: 3.5rem;
   font-size: 0.9rem;
}

.sidebar.collapsed .collapse {
   display: none !important;
}

.sidebar .bi-caret-down {
   transition: transform 0.2s;
   margin-left: auto;
}

.sidebar .nav-link[aria-expanded="true"] .bi-caret-down {
   transform: rotate(180deg);
}

/* Tooltip pour sidebar collapsed */
.sidebar.collapsed .nav-link {
   position: relative;
   justify-content: center;
}

.sidebar.collapsed .nav-link:hover::after {
   content: attr(data-title);
   position: absolute;
   left: 70px;
   background: #2d3748;
   color: white;
   padding: 0.5rem 1rem;
   border-radius: 4px;
   white-space: nowrap;
   z-index: 1000;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
   margin-left: 20px;
   transition: margin-left 0.3s ease;
   min-height: 100vh;
   display: flex;
   flex-direction: column;
}

.main-wrapper.expanded {
   margin-left: -190px;
}

/* ========== NAVBAR ========== */
.navbar {
   border-bottom: 1px solid #dee2e6;
   background: white !important;
   position: sticky;
   top: 0;
   z-index: 1030;
}

.navbar .container-fluid {
   margin-left: 0;
   padding: 0.75rem 1.5rem;
}

/* ========== SIDEBAR TOGGLE ========== */
.sidebar-toggle {
   background: #fff;
   border: 1px solid #dee2e6;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
   border-radius: 4px;
   padding: 0.5rem 0.75rem;
   cursor: pointer;
   transition: all 0.2s;
}

.sidebar-toggle:hover {
   background: #f8f9fa;
}

/* ========== SEARCH BAR ========== */
.search-bar .input-group {
   width: 100%;
   max-width: 600px;
}

.search-bar .form-control {
   border-top-right-radius: 0;
   border-bottom-right-radius: 0;
   border-top-left-radius: 50px;
   border-bottom-left-radius: 50px;
}

.search-bar .btn {
   border-top-left-radius: 0;
   border-bottom-left-radius: 0;
   border-top-right-radius: 50px;
   border-bottom-right-radius: 50px;
   border: 1px solid #ced4da;
   /* même bordure que l'input */
   padding: 0.5rem 1rem;
   background-color: #fff;
   /* blanc neutre */
}

/* ========== MAIN CONTENT ========== */
.main-content {
   flex: 1;
   padding: 1.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
   .search-wrapper {
      max-width: 350px;
   }
}

@media (max-width: 992px) {
   body {
      margin-left: 10px;
   }

   .sidebar {
      transform: translateX(-280px);
   }

   .sidebar.mobile-open {
      transform: translateX(0);
   }

   .sidebar.collapsed {
      transform: translateX(-280px);
   }

   .main-wrapper {
      margin-left: 0 !important;
   }

   .navbar .container-fluid {
      flex-wrap: wrap;
      gap: 1rem;
   }

   .search-wrapper {
      order: 3;
      width: 100%;
      max-width: 100%;
      margin-top: 0.5rem;
   }

   .user-info-wrapper {
      margin-left: auto;
   }

   /* Overlay pour mobile */
   .sidebar-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1039;
      display: none;
   }

   .sidebar-overlay.active {
      display: block;
   }
}

@media (max-width: 768px) {
   body {
      margin-left: 10px;
   }

   .main-content {
      padding: 1rem;
   }

   .navbar .container-fluid {
      padding: 0.5rem 1rem;
   }

   .user-info-wrapper .user-name {
      display: none;
   }
}

@media (max-width: 576px) {
   .sidebar {
      width: 250px;
   }

   .sidebar.collapsed {
      width: 250px;
      transform: translateX(-250px);
   }

   .navbar .btn-logout-text {
      display: none;
   }

   .main-content {
      padding: 0.75rem;
   }
}

/* ========== SCROLLBAR STYLING ========== */
.sidebar::-webkit-scrollbar {
   width: 6px;
}

.sidebar::-webkit-scrollbar-track {
   background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
   background: rgba(255, 255, 255, 0.2);
   border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
   background: rgba(255, 255, 255, 0.3);
}


/* ========== couleur icone ========== */
.icon-recette {
   color: #FF6B6B;
}

/* rouge clair */
.icon-depense {
   color: #4ECDC4;
}

/* turquoise */
.icon-compte {
   color: #FFD93D;
}

/* jaune */
.icon-client {
   color: #1A535C;
}

/* bleu foncé */
.icon-fournisseur {
   color: #FF6B6B;
}

/* rouge clair */
.icon-investissement {
   color: #4ECDC4;
}

/* turquoise */
.icon-production {
   color: #FFD93D;
}

/* jaune */
.icon-entreprise {
   color: #1A535C;
}

/* bleu foncé */
.icon-statistique {
   color: #FF6B6B;
}

.icon-facturation {
   color: #e10f0f;
}

.icon-devis {
   color: #05ca5a;
}

.icon-salaire {
   color: #2f0eeb;
}

.research {
   display: flex;
   align-items: center;
   justify-content: space-between;

   width: 1200px;
}

.nav-section-title {
   pointer-events: none;
   letter-spacing: 0.5px;
   color: #6a6c6e !important;
   font-weight: 600;
}

/* Masquer les titres de section quand la sidebar est fermée */
.sidebar.collapsed .nav-section-title {
   display: none;
}




/* Style pour la page Catégorie Recette */

.icon-box {
   display: inline-flex;
   align-items: center;
   justify-content: center;
}

.table tbody tr {
   transition: all 0.2s ease;
}

.table tbody tr:hover {
   background-color: rgba(255, 193, 7, 0.05);
   transform: translateX(2px);
}

.btn {
   transition: all 0.2s ease;
}

.btn:hover {
   transform: translateY(-2px);
}

.card {
   overflow: hidden;
}