/* ─── Sidebar ─── */

.sidebar {
  width: 250px;
  height: 100%;
  background: linear-gradient(180deg, #6C5CE7 0%, #8E44AD 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  border-radius: 0 16px 16px 0;
  padding: 20px 16px;
  overflow-y: auto;
  position: relative;
  box-shadow: 4px 0 20px rgba(108,92,231,0.25);
}

/* Soft noise/shimmer overlay — adds premium texture */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.07) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.sidebar.loading {
  opacity: 0.5;
  pointer-events: none;
}

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

.sidebar-header {
  padding: 0 0 16px;
  position: relative;
  z-index: 2;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity var(--transition-base);
}

.sidebar-logo:hover {
  opacity: 0.85;
}

.logo-icon {
  width: 30px;
  height: 30px;
  color: white;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.sidebar-logo-image {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 2;
}

.sidebar .nav-item,
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

.nav-item--left {
  justify-content: flex-start;
}

.sidebar .nav-item:hover,
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.nav-item:hover .nav-icon {
  transform: scale(1.05);
}

.sidebar .nav-item.active,
.nav-item.active {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-text {
  flex: 1;
}

.sidebar-footer {
  padding: 16px 0 0;
  position: relative;
  z-index: 2;
}

/* Profile card — glassy, breathable */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease;
}

.sidebar-profile-card {
  cursor: pointer;
  position: relative;
}

.user-profile-card:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #6D5DF6;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.6);
}

.profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-profile-info {
  flex: 1;
}

.profile-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.sidebar-email {
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sidebar-chevron {
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.sidebar-profile-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 2000;
}

.sidebar-profile-dropdown.active {
  display: block;
}

.sidebar-profile-head {
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F6;
}

.sidebar-profile-label {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-bottom: 2px;
}

.sidebar-profile-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1F2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #1F2937;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.sidebar-profile-action:hover {
  background: #F9FAFB;
}

.sidebar-profile-action.logout {
  color: #EF4444;
}

.sidebar-profile-action.logout:hover {
  background: #FEF2F2;
}

.sidebar-profile-divider {
  border-top: 1px solid #F3F4F6;
}

/* Responsive mobile sidebar - Overlay Drawer */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 2000;
  }

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

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