:root {
  --primary-color: #4e73df;
  --primary-gradient: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  --secondary-color: #1cc88a;
  --warning-color: #f6c23e;
  --danger-color: #e74a3b;
  --light-color: #f8f9fc;
  --dark-color: #5a5c69;
  --sidebar-bg: #121540;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --sidebar-active: #ffffff;
  --sidebar-text: rgba(255, 255, 255, 0.8);
  --sidebar-active-text: #121540;
  --sidebar-icon: rgba(255, 255, 255, 0.6);
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 70px;
  --sidebar-transition: all 0.3s ease;
  --primary: #4e73df;
  --warning: #f6c23e;
  --success: #1cc88a;
  --danger: #e74a3b;
  --info: #36b9cc;
  
  /* Gradients */
  --sidebar-gradient: linear-gradient(180deg, #121540 0%, #1c1f59 100%);
  --sidebar-active-gradient: linear-gradient(90deg, #ffffff 0%, #f8f9fc 100%);
  --category-gradient: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
}

ul.collapsible li.toggle > a::after {
    content: "▶";
    position: absolute;
    right: 20px;
  }

  ul.collapsible li.toggle > a.active::after {
    content: "▼";
  }

  ul.collapsible li.toggle {
    position: relative;
   
  }
  ul.collapsible  li.toggle ul {
    display: none;
   
  }
  .left-sidebar {
    background: var(--sidebar-gradient);
    height: 100%;
    top: 0;
    left: 0;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: var(--sidebar-transition);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
  }
  .left-sidebar h3{
    font-weight: bold;
    font-size: 25px;
    text-align: center;
    border-bottom: 1px solid lightgray;
    padding: 20px 0px;
    color: white;
  }
  .sidebar-col{
    padding-right: 0px;
  }
  .dashboard-col{
    padding-left: 0px;
  }
  .toggle-list{
      position: relative;
      left: 22px;
  }
  .left-sidebar .nav-link{
      color: white;
     
  }
  .close-menu {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: var(--transition);
display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .close-menu:hover {
    background: var(--sidebar-hover);
    color: white;
  }
  
  ul li.nav-item:hover, ul li.nav-item:focus {
    background-color: #a0a0a0; 
   }

   ul li.active {
    background-color: white; 
   }

   ul li.active a {
    color: black !important; 
   }

  @media only screen and (max-width: 600px) {
 
    .left-sidebar {
        z-index: 99;
        display: none;
  }
  
  @media (max-width: 767.98px) {
    .close-menu {
      display: flex !important; /* Show on mobile with !important */
    }
  }
}

/* Navigation Menu */
.nav {
  padding: 0;
}

.nav-item {
  margin: 3px 10px;
  border-radius: 0.35rem;
}

.nav-item.active {
  background: var(--sidebar-active);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-link {
  color: var(--sidebar-text);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  transition: var(--sidebar-transition);
  font-size: 0.95rem;
  white-space: nowrap;
  position: relative;
}

.nav-item:not(.active) .nav-link:hover {
  color: white;
  background-color: var(--sidebar-hover);
  border-radius: 0.35rem;
}

.nav-item.active .nav-link {
  color: var(--sidebar-active-text);
}

.nav-link i {
  width: 1.5rem;
  font-size: 1rem;
  margin-right: 0.75rem;
  text-align: center;
}

/* Section Dividers */
hr {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1rem 1.25rem;
}

/* New badges and indicators */
.badge-new {
  position: relative;
  display: inline-flex;
  margin-left: 8px;
}

.badge-new img {
  width: 24px !important;
  height: 24px !important;
}

/* Section headers */
.sidebar-section {
  padding: 1rem 1.5rem 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  font-weight: 700;
}

/* Submenu */
.toggle-list {
  margin-left: 2.25rem;
  display: none;
}

.toggle-list.show {
  display: block;
}

.nav-item.toggle .nav-link:after {
  content: "\f107";
  font-family: "FontAwesome";
  position: absolute;
  right: 1rem;
  transition: var(--sidebar-transition);
}

.nav-item.toggle.active .nav-link:after {
  transform: rotate(180deg);
}

/* Profile section */
.user-profile {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  margin-top: auto;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.user-info {
  flex-grow: 1;
}

.user-name {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.user-role {
  color: var(--sidebar-text);
  font-size: 0.8rem;
  margin: 0;
}

/* Responsive styles */
@media (max-width: 992px) {
  .left-sidebar {
    position: fixed;

    box-shadow: none;
  }
  
  .left-sidebar.show {
    transform: translateX(0);
    box-shadow: var(--card-shadow);
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1020;
    display: none;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 576px) {
  
  .nav-link {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }
}

/* Scrollbar Styling */
.left-sidebar::-webkit-scrollbar {
  width: 5px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
}

.sidebar-title a {
  color: white !important;
  text-decoration: none;
  transition: var(--sidebar-transition);
}

.sidebar-title a:hover {
  opacity: 0.9;
}

.sidebar-title i {
  margin-right: 0.75rem;
  font-size: 1.35rem;
}

/* Close button - only visible on mobile */
.close-menu {
  display: none;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--sidebar-transition);
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.close-menu:hover {
  background: var(--sidebar-hover);
  color: white;
}

/* Category Divider */
.category-divider {
  margin: 1.25rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  letter-spacing: 1px;
  padding: 0.5rem 0.75rem;
  background: var(--category-gradient);
  border-radius: 0.35rem;
}

/* Navigation */
.nav {
  padding: 0 0.75rem;
}

.nav-item {
  margin: 0.25rem 0;
  border-radius: 0.5rem;
  transition: var(--sidebar-transition);
}

.nav-item:hover {
  background: var(--sidebar-hover);
}

.nav-item.active {
  background: var(--sidebar-active);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.nav-item.active .nav-link,
.nav-item.active .nav-link i {
  color: var(--sidebar-active-text) !important;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  color: var(--sidebar-text) !important;
  padding: 0.75rem 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--sidebar-transition);
  position: relative;
}

.nav-link i {
  margin-right: 0.85rem;
  min-width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  color: var(--sidebar-icon);
  transition: var(--sidebar-transition);
}

.nav-link:hover {
  color: white !important;
}

.nav-link:hover i {
  color: white;
}

/* New badge */
.new-badge {
  position: absolute;
  right: 10px;
  height: 20px;
  width: auto;
  max-width: 36px;
}

/* Separator */
.sidebar-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.75rem 1rem;
}

/* Nested Navigation */
.toggle-list {
  padding-left: 2rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.toggle-list.show {
  max-height: 500px;
}

.toggle .nav-link::after {
  content: "\f107";
  font-family: "FontAwesome";
  position: absolute;
  right: 1rem;
  transition: transform 0.3s ease;
}

.toggle.expanded .nav-link::after {
  transform: rotate(180deg);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem 1.5rem;
  color: var(--sidebar-text);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 1rem;
}

.sidebar-footer a {
  color: white;
  text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .left-sidebar {
    z-index: 1030;
    display: none;
    width: 100%;
    height: 100%;
    margin-top: 1rem;
  }

  .left-sidebar.show {
    transform: translateX(0);
    display: block;
  }

  .close-menu {
    display: flex !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .left-sidebar {
    width: 240px;
  }

  .nav-link {
    padding: 0.6rem 0.75rem;
  }
}

/* Animation for menu items */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-item {
  animation: fadeIn 0.3s ease;
  animation-fill-mode: both;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
.nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-item:nth-child(10) { animation-delay: 0.5s; }