:root {
  --sidebar-w: 240px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #2563eb;
}

body { background: #f1f5f9; font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Auth ─────────────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
}
.login-card {
  width: 400px;
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { font-size: 2.5rem; }

#consent-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  padding: 24px 12px;
}
.consent-card {
  width: 520px;
  max-width: 100%;
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.consent-text {
  max-height: 260px;
  overflow-y: auto;
  font-size: .88rem;
  color: #334155;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
}
.consent-text p:last-child { margin-bottom: 0; }

/* ── Layout ───────────────────────────────────────────────────── */
#app-shell { display: none; min-height: 100vh; }
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.25rem 1rem;
  font-weight: 700; font-size: 1.1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center;
}
.sidebar-logo-img { width: 36px; height: 36px; object-fit: contain; }
.navbar-logo-img { width: 24px; height: 24px; object-fit: contain; }
.login-logo-img { width: 88px; height: 88px; object-fit: contain; }
.sidebar-nav { flex: 1; padding: .5rem 0; }
.nav-item a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none; font-size: .92rem;
  border-radius: 6px; margin: .1rem .5rem;
  transition: background .15s, color .15s;
}
.nav-item a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item a i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-badge {
  background: rgba(255,255,255,.08);
  border-radius: 8px; padding: .5rem .75rem;
  color: var(--sidebar-text); font-size: .82rem;
}

#main-content {
  margin-left: var(--sidebar-w);
  padding: 1.5rem;
  min-height: 100vh;
}
.page-header { margin-bottom: 1.5rem; }
.page-header h4 { font-weight: 700; color: #1e293b; margin: 0; }

/* ── Cards ────────────────────────────────────────────────────── */
.stat-card {
  border: none; border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  background: #fff;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: .8rem; color: #64748b; }

/* ── Tables ───────────────────────────────────────────────────── */
.content-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}
.content-card-header {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.content-card-header h6 { margin: 0; font-weight: 700; color: #1e293b; }
.aide-video-link { border: 1px solid #e2e8f0; transition: background .15s; }
.aide-video-link:hover { background: #f8fafc; }
.table { margin: 0; }
.table th { font-size: .78rem; font-weight: 600; color: #64748b;
             text-transform: uppercase; letter-spacing: .04em;
             border-bottom: 1px solid #f1f5f9; }
.table td { font-size: .88rem; vertical-align: middle; border-color: #f8fafc; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge-statut { font-size: .72rem; padding: .25em .6em; border-radius: 20px; font-weight: 600; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alerte-item {
  border-left: 3px solid #e2e8f0;
  padding: .75rem 1rem; margin-bottom: .5rem;
  border-radius: 0 8px 8px 0; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.alerte-item.HAUTE { border-color: #ef4444; }
.alerte-item.MOYENNE { border-color: #f59e0b; }
.alerte-item.BASSE { border-color: #22c55e; }
.alerte-item.lue { opacity: .55; }

/* ── Utils ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: #94a3b8; }
.empty-state i { font-size: 3rem; display: block; margin-bottom: .75rem; }
.spinner-wrap { display: flex; justify-content: center; padding: 2rem; }
.toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 9999; }
