/* Design tokens (extraits pour le composant sidebar) */
:root {
  --primary: #002FA7;
  --primary-dark: #001A66;
  --accent: #FF4500;
  --text-main: #111827;
  --text-muted: #6B7280;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --r-md: 12px;
  --r-full: 9999px;
  --grad-accent: linear-gradient(135deg, #FF4500 0%, #FF8C00 100%);
  --sidebar-width: 280px;
  --sidebar-bg: linear-gradient(180deg, #002FA7 0%, #00154D 100%);
  --duration-fast: 200ms;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: white;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 47, 167, 0.15);
  transition: transform 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  width: 48px;
  height: 48px;
  background: white;
  color: var(--primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  opacity: 0.7;
}

.user-profile {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-md);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  backdrop-filter: blur(10px);
}

.avatar {
  width: 40px;
  height: 40px;
  background: var(--grad-accent);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-info .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-radius: var(--r-full);
  text-transform: uppercase;
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--r-md);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.nav-item i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.nav-item.active,
.nav-item[aria-current="page"] {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-item.active i,
.nav-item[aria-current="page"] i {
  color: var(--primary);
}

.sidebar-footer {
  margin-top: var(--space-xl);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(220, 38, 38, 0.1);
  color: #FCA5A5;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.2);
  color: white;
}

.sidebar-close {
  display: none;
  align-self: flex-end;
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(var(--sidebar-width), 88vw);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .sidebar-close {
    display: inline-flex;
  }
}
