/* ===== SIDEBAR LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .25s ease;
  box-shadow: 1px 0 0 var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: var(--color-brand-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
  letter-spacing: -.5px;
}
.sidebar-logo-text { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.sidebar-nav { flex: 1; padding: .75rem .5rem; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; border-radius: var(--radius);
  color: var(--text-muted); font-size: .875rem; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--color-brand-mist);
  color: var(--color-brand-primary);
  text-decoration: none;
}
/* État actif — violet (identité de marque, règle design system) */
.nav-item.active {
  background: var(--color-brand-mist);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 17px; flex-shrink: 0; }

.sidebar-footer {
  padding: .75rem .5rem;
  border-top: 1px solid var(--border);
}
.user-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem; border-radius: var(--radius);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-email {
  font-size: .78rem; color: var(--text-muted);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logout-btn {
  padding: .4rem; border-radius: var(--radius);
  background: transparent; border: none;
  color: var(--text-hint);
  display: flex; align-items: center;
  transition: color .12s, background .12s; flex-shrink: 0;
}
.logout-btn:hover { background: var(--bg-hover); color: var(--danger); }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.page-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.page-body { padding: 1.5rem 1.75rem; flex: 1; }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.hamburger { background: transparent; border: none; color: var(--text); font-size: 20px; display: flex; align-items: center; }
.mobile-logo { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ===== MOBILE OVERLAY ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 39; }
.sidebar-overlay.open { display: block; }

/* ===== AUTH LAYOUT ===== */
.auth-layout {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
}
.auth-logo { display: flex; align-items: center; gap: .65rem; justify-content: center; margin-bottom: 1.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .main-content { margin-left: 0; }
  .mobile-header { display: flex; }
  .page-header, .page-body { padding: 1rem; }
}
