/* Sidebar styles */
.sidebar {
  width: 260px;
  background-color: var(--white);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1004;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-decoration: none;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding: 0 1.5rem;
  letter-spacing: 0.05em;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: var(--neutral-lighter);
  color: var(--primary-blue);
}

.nav-link.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  border-left-color: var(--primary-blue);
  font-weight: 600;
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.nav-link .text {
  font-weight: 500;
}

/* User section at bottom of sidebar */
.sidebar-user {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--neutral-light);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}



/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--primary-blue);
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--primary-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0.75rem;
  font-size: 0.875rem;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.sign-out-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
}

.sign-out-btn:hover {
  background-color: var(--error);
  color: var(--white);
  border-color: var(--error);
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1.25rem;
  left: 1rem;
  z-index: 1005;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.375rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  width: 2.5rem;
  height: 2.5rem;
}

.mobile-menu-toggle:hover {
  background: var(--neutral-lighter);
}

.mobile-menu-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--text-primary);
}

.hamburger {
  display: flex;
  flex-direction: column;
  width: 1.5rem;
  height: 1.5rem;
  justify-content: space-between;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
}

/* Overlay for mobile when sidebar is open */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1003;
}

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

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

  .mobile-menu-toggle {
    display: block;
    top: 0.75rem;
    /* Center in 4rem header: (4rem - 1.5rem button height) / 2 = 1.25rem */
  }

  /* Move hamburger to top right of sidebar when open */
  .sidebar-open .mobile-menu-toggle {
    left: calc(260px - 3.5rem);
    /* Position from right edge of sidebar (260px width - 1.5rem padding - 1.5rem button width) */
    transition: left 0.3s ease;
  }

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