/* =====================================================
   SIDEBAR - MODERN COMPACT DESIGN
   ===================================================== */

/* Sidebar Wrapper */
.sidebar-wrapper {
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  border-right: none;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

/* Sidebar Header */
.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-header .logo-icon a {
  display: block;
}

.sidebar-header .logo-img {
  width: 100%;
  max-width: 120px;
  transition: opacity 0.3s ease;
  filter: brightness(1.1);
}

.sidebar-wrapper.closed .sidebar-header .logo-img.open-logo {
  display: none;
}

.sidebar-wrapper.closed .sidebar-header .logo-img.collapsed-logo {
  display: block;
  width: 36px !important;
  margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar-nav {
  padding: 0.75rem 0;
  position: relative;
  min-height: calc(100vh - 80px);
}

/* Menu Label */
.sidebar-nav .menu-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  padding: 1rem 1rem 0.5rem;
  margin-top: 0.5rem;
}

/* MetisMenu Styling */
.metismenu {
  padding: 0 0.5rem;
}

.metismenu > li {
  margin-bottom: 2px;
}

.metismenu > li > a {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.metismenu > li > a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-decoration: none;
}

.metismenu > li.mm-active > a,
.metismenu > li > a.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* Parent Icon */
.metismenu .parent-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  margin-right: 0.75rem;
  transition: all 0.2s ease;
}

.metismenu > li > a:hover .parent-icon {
  background: rgba(255, 255, 255, 0.15);
}

.metismenu > li.mm-active > a .parent-icon,
.metismenu > li > a.active .parent-icon {
  background: linear-gradient(135deg, var(--vyne-primary, #6366f1) 0%, var(--vyne-primary-dark, #4f46e5) 100%);
}

.metismenu .parent-icon i,
.metismenu .parent-icon i.material-icons-outlined {
  font-size: 18px !important;
  color: #7d60f4;
  opacity: 0.9;
}

.metismenu > li.mm-active > a .parent-icon i,
.metismenu > li > a.active .parent-icon i {
  color: white;
}

/* Menu Title */
.metismenu .menu-title {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow for Submenu */
.metismenu .has-arrow::after {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.sidebar-wrapper .sidebar-nav .metismenu a {
  padding: 6px 5px;
}

.sidebar-wrapper .sidebar-nav .metismenu a .menu-title {
    margin-left: -5px;
    margin-top: 3px;
}

/* Submenu */
.metismenu ul {
  padding: 0.25rem 0 0.25rem 2.75rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin: 0.25rem 0;
}

.metismenu ul li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.metismenu ul li a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.metismenu ul li a.active {
  color: var(--vyne-primary-light, #818cf8);
  background: rgba(99, 102, 241, 0.15);
}

.metismenu ul li a i {
  font-size: 14px;
  margin-right: 0.5rem;
  opacity: 0.6;
}

/* Version Text */
.sidebar-nav > p,
.sidebar-nav p[style] {
  position: absolute !important;
  bottom: 1rem !important;
  left: 1rem !important;
  font-size: 0.7rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

/* System Check Alert Nav */
.system-check-nav {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%) !important;
  border-radius: 10px;
  margin: 0.5rem;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.system-check-nav a {
  color: white !important;
  font-weight: 600 !important;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.system-check-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Scrollbar Styling */
.sidebar-wrapper[data-simplebar] .simplebar-scrollbar::before {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar-wrapper[data-simplebar] .simplebar-track.simplebar-vertical {
  width: 6px;
}

/* Collapsed State */
.sidebar-wrapper.closed {
  width: 70px;
}

.sidebar-wrapper.closed .menu-title,
.sidebar-wrapper.closed .has-arrow::after,
.sidebar-wrapper.closed .menu-label,
.sidebar-wrapper.closed .sidebar-nav > p {
  display: none;
}

.sidebar-wrapper.closed .metismenu > li > a {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar-wrapper.closed .metismenu .parent-icon {
  margin-right: 0;
}

.sidebar-wrapper.closed .metismenu ul {
  display: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar-wrapper {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
  }

  .sidebar-wrapper.show {
    left: 0;
  }
}
