/* ============================================
   Sidebar — collapsible left navigation
   --------------------------------------------
   Default state: expanded (icons + labels)
   .sidebar-collapsed: minimized (icons only)
   ============================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background-color: #23242a;
  z-index: 80;
  transition: width 0.25s ease, left 0.25s ease;
  overflow: hidden;
  padding-top: 60px;
}

.sidebar-collapsed {
  width: 60px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  left: 220px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 79;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .sidebar {
    left: -220px;
    width: 220px !important;
  }

  .sidebar.sidebar-mobile-open {
    left: 0;
  }

  .sidebar-collapsed {
    width: 220px;
  }

  .sidebar-toggle {
    display: none;
  }
}


/* ---------- Toggle button ---------- */
.sidebar-toggle {
  position: absolute;
  top: 12px;
  left: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Nav links ---------- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1px;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

/* ---------- Label visibility ---------- */
.sidebar-label {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.sidebar-collapsed .sidebar-label {
  opacity: 0;
  pointer-events: none;
}

html.sidebar-collapsed-init .sidebar {
  width: 60px;
}

html.sidebar-collapsed-init .sidebar-label {
  opacity: 0;
  pointer-events: none;
}

/* .sidebar:hover {
  z-index: 50;
} */

@media (max-width: 768px) {
  .sidebar.sidebar-mobile-open .sidebar-label {
    opacity: 1;
    pointer-events: auto;
  }
}
