/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: var(--white);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-sub {
  font-size: 12px;
  color: var(--grey-400);
  padding-left: 42px;
}

.sidebar-user {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  margin: 0 12px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-id {
  font-size: 11px;
  color: var(--grey-400);
}

.sidebar-progress {
  padding: 12px 16px;
  margin: 0 12px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.sidebar-progress-label {
  font-size: 11px;
  color: var(--grey-400);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.sidebar-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.sidebar-progress-text {
  font-size: 10px;
  color: var(--grey-400);
  margin-top: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 12px;
  overflow-y: auto;
}

.sidebar-nav-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--grey-500);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 13px;
  color: var(--grey-400);
  margin-bottom: 1px;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item .nav-check {
  color: var(--success);
  font-size: 13px;
}

.nav-item .nav-lock {
  font-size: 11px;
  opacity: 0.4;
}

.nav-item.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-item.locked:hover {
  background: transparent;
  color: var(--grey-400);
}

.nav-item .nav-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--grey-400);
}

.nav-item .nav-badge.active-badge {
  background: var(--warning);
  color: var(--grey-700);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0 12px;
}

.sidebar-footer .logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--grey-400);
  transition: var(--transition-fast);
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.sidebar-footer .logout-btn:hover {
  background: rgba(234, 67, 53, 0.1);
  color: var(--error);
}

/* Mobile toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 200;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }

  .sidebar-toggle {
    display: block;
  }
}
