/**
 * SIDEBAR - NOUVEAU DESIGN
 */

/* ==========================================
   POLICE INTER
   ========================================== */
body,
.vertical-menu,
#sidebar-menu,
#sidebar-menu ul li a,
.sidebar-footer {
  font-family: "Inter", sans-serif;
}

/* ==========================================
   BACKGROUND BODY
   ========================================== */
body {
  background-color: #f7f9ff;
}

/* ==========================================
   SIDEBAR CONTAINER (.sidebar → .vertical-menu)
   ========================================== */

.vertical-menu {
  width: 280px;
  height: 100vh;
  top: 0;
  background-color: #040622;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #747d9e;
  position: fixed;
  left: 0;
  z-index: 1001;
  box-shadow: none;
  border-right: none;
}

/* Supprimer l'overlay/pseudo-element de Borex */
.vertical-menu::before {
  display: none;
}

/* ==========================================
   LOGO
   ========================================== */

.vertical-menu .navbar-brand-box {
  text-align: left;
  margin-bottom: 40px;
  background: transparent;
  padding: 0;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border: none;
}

.vertical-menu .navbar-brand-box .logo {
  display: block;
}

.vertical-menu .navbar-brand-box .logo img {
  height: auto;
  max-height: 32px;
  width: auto;
}

/* Afficher le logo light (blanc) pour le fond sombre */
.vertical-menu .navbar-brand-box .logo-dark {
  display: none;
}

.vertical-menu .navbar-brand-box .logo-light {
  display: block;
}

/* Cacher le bouton hamburger dans le sidebar */
.vertical-menu .vertical-menu-btn {
  display: none;
}

/* ==========================================
   SCROLLBAR CONTAINER
   ========================================== */

.sidebar-menu-scroll {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

/* Scrollbar personnalisée */
.sidebar-menu-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb {
  background: #1d2c45;
  border-radius: 2px;
}

/* ==========================================
   MENU CONTAINER (.menu → #sidebar-menu .metismenu)
   ========================================== */

#sidebar-menu {
  width: 100%;
}

#sidebar-menu .metismenu {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ==========================================
   SECTION TITLES (.section-title → .menu-title)
   ========================================== */

#sidebar-menu .menu-title {
  border-top: 1px solid #1d2c45;
  padding-top: 14px;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #bec6d3;
  margin: 16px 0 8px;
  text-transform: uppercase;
  background: transparent;
}

/* Premier section title sans bordure */
#sidebar-menu .menu-title:first-child {
  border-top: none;
  padding-top: 0;
}

/* Supprimer le ::after de Borex */
#sidebar-menu .metismenu .menu-title::after {
  display: none;
}

/* ==========================================
   MENU ITEMS (.menu-item → #sidebar-menu ul li a)
   ========================================== */

#sidebar-menu ul li {
  margin-bottom: 2px;
  list-style: none;
}

#sidebar-menu ul li a {
  padding: 7px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: #747d9e;
  text-decoration: none;
  background: transparent;
  border: none;
}

/* Supprimer les pseudo-éléments de Borex */
#sidebar-menu ul li a::before,
#sidebar-menu ul li a::after {
  display: none;
}

/* ==========================================
   HOVER STATE
   ========================================== */

#sidebar-menu ul li a:hover {
  background-color: rgba(160, 165, 205, 0.16);
  color: #747d9e;
}

/* ==========================================
   ICÔNES
   ========================================== */

#sidebar-menu ul li a .nav-icon,
#sidebar-menu ul li a i {
  font-size: 18px;
  color: #747d9e;
  width: 18px;
  height: 18px;
  fill: #747d9e;
  flex-shrink: 0;
}

#sidebar-menu ul li a:hover .nav-icon,
#sidebar-menu ul li a:hover i {
  color: #747d9e;
  fill: #747d9e;
}

/* ==========================================
   ACTIVE STATE (.menu-item.active → li.mm-active > a)
   ========================================== */

#sidebar-menu ul li.mm-active > a,
body[data-sidebar=dark] #sidebar-menu ul li.mm-active > a {
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 400;
}

#sidebar-menu ul li.mm-active > a .nav-icon,
#sidebar-menu ul li.mm-active > a i {
  color: #ffffff;
  fill: #ffffff;
}

#sidebar-menu ul li.mm-active > a .menu-item {
  color: #ffffff;
}

/* ==========================================
   SUB-MENU
   ========================================== */

#sidebar-menu ul li ul.sub-menu {
  padding-left: 28px;
  background: transparent;
  margin-top: 4px;
  margin-bottom: 4px;
}

#sidebar-menu ul li ul.sub-menu li a {
  padding: 6px 12px;
  font-size: 12px;
  color: #747d9e;
}

#sidebar-menu ul li ul.sub-menu li a:hover {
  background-color: rgba(160, 165, 205, 0.16);
  color: #747d9e;
}

#sidebar-menu ul li ul.sub-menu li a:before {
  display: none;
}

/* Flèche des sous-menus */
#sidebar-menu .has-arrow:after {
  color: #747d9e;
  border-color: #747d9e;
}

#sidebar-menu .mm-active > .has-arrow:after {
  color: #ffffff;
  border-color: #ffffff;
}

/* ==========================================
   FOOTER (footer → .sidebar-footer)
   ========================================== */

.sidebar-footer {
  border-top: 1px solid #1d2c45;
  margin-top: 30px;
  padding: 16px 0 0 0;
  font-size: 12px;
  color: #a0a6b8;
  line-height: 1.4;
  background: transparent;
}

.sidebar-footer p {
  margin-bottom: 4px;
  color: #a0a6b8;
  font-size: 12px;
}

.sidebar-footer p:last-child,
.sidebar-footer .subtext {
  font-size: 11px;
  color: #747d9e;
}

/* ==========================================
   AJUSTEMENT HEADER ET MAIN CONTENT
   ========================================== */

/* Layout wrapper */
#layout-wrapper {
  position: relative;
  min-height: 100vh;
}

/* Cacher le horizontal header (on utilise uniquement le vertical) */
.ishorizontal-topbar {
  display: none !important;
}

/* Header décalé à droite du sidebar */
#page-topbar,
.isvertical-topbar {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  width: calc(100% - 280px);
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Cacher le logo du header car il est déjà dans le sidebar */
#page-topbar .navbar-brand-box {
  display: none !important;
}

/* Cacher le bouton hamburger du header */
#page-topbar .vertical-menu-btn {
  display: none !important;
}

/* Titre de page dans le header */
#page-topbar .page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e2a38;
}

/* Navbar header - alignement des éléments */
#page-topbar .navbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 24px;
  height: 70px;
}

/* Les deux groupes d'éléments dans le header */
#page-topbar .navbar-header > .d-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Groupe de droite (icônes) - espacement réduit */
#page-topbar .navbar-header > .d-flex:last-child {
  gap: 4px;
}

/* Icônes du header (notifications, profil, etc.) */
#page-topbar .navbar-header .header-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main content décalé à droite du sidebar */
.main-content {
  margin-left: 280px;
  padding-top: 70px; /* Hauteur du header */
  min-height: 100vh;
  transition: all 0.3s ease;
}

.page-content {
  padding: 24px;
}

/* ==========================================
   DARK SIDEBAR (Borex body[data-sidebar=dark])
   ========================================== */

body[data-sidebar=dark] .vertical-menu {
  background-color: #040622;
}

body[data-sidebar=dark] #sidebar-menu ul li a {
  color: #747d9e;
}

body[data-sidebar=dark] #sidebar-menu .menu-title {
  color: #bec6d3;
}

/* ==========================================
   RESPONSIVE (Logique identique à Borex)
   ========================================== */

/* Mode mobile : en dessous de 992px */
@media (max-width: 991.98px) {
  /* Sidebar cachée par défaut */
  .vertical-menu {
    display: none;
    top: 70px; /* Positionné sous le header */
    height: calc(100vh - 70px);
    z-index: 1002; /* Au-dessus du header en overlay */
  }

  /* Quand le hamburger menu est cliqué, Borex ajoute la classe sidebar-enable au body */
  body.sidebar-enable .vertical-menu {
    display: block;
  }

  /* Cacher le logo et le bouton dans le sidebar mobile */
  .vertical-menu .navbar-brand-box,
  .vertical-menu .vertical-menu-btn {
    display: none !important;
  }

  /* Header prend toute la largeur */
  #page-topbar,
  .isvertical-topbar {
    left: 0;
    width: 100%;
  }

  /* Afficher le bouton hamburger dans le header */
  #page-topbar .vertical-menu-btn,
  .ishorizontal-topbar .navbar-header .vertical-menu-btn,
  .isvertical-topbar .navbar-header .vertical-menu-btn {
    display: inline-block !important;
  }

  /* Logo du header visible en mobile */
  #page-topbar .navbar-brand-box {
    display: block !important;
    width: auto;
  }

  /* Main content sans margin */
  .main-content {
    margin-left: 0 !important;
  }
}
