/* ── VARIABLES ROOT ─────────────────────────────── */
:root {
  --icam-orange:        #FF9E1B;
  --icam-orange-dark:   #E07B00;
  --icam-gris:          #53565A;
  --icam-bleu:          #00529B;
  --icam-bleu-clair:    #4D94D6;
  --c-texte:            #282D30;
  --c-texte-attenue:    #8A8D91;
  --c-bordure:          #E4E6E8;
  --c-fond:             #F5F6F7;
  --c-surface:          #FFFFFF;
  --c-success:          #2E7D32;
  --c-success-bg:       #E8F5E9;
  --c-info:             #00529B;
  --c-info-bg:          #E3F0FB;
  --c-warning:          #E6A700;
  --c-warning-bg:       #FFF8E1;
  --c-danger:           #C62828;
  --c-danger-bg:        #FFEBEE;
  --font-titre: "Poppins", system-ui, sans-serif;
  --font-corps: "Inter", system-ui, sans-serif;
  /* ── Compat aliases (anciennes pages générées) ── */
  --color-primary:       #FF9E1B;
  --color-primary-dark:  #E07B00;
  --color-primary-light: rgba(255,158,27,.12);
  --color-secondary:     #00529B;
  --color-white:         #FFFFFF;
  --color-gray-50:       #F5F6F7;
  --color-gray-100:      #E4E6E8;
  --color-gray-900:      #282D30;
  --radius-xl:           16px;
  --radius-2xl:          24px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --text-sm: .875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem;
  --font-mono:  "JetBrains Mono", monospace;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-pill: 999px;
  --ombre-carte: 0 1px 3px rgba(40,45,48,.08), 0 4px 12px rgba(40,45,48,.05);
  --ombre-menu:  0 8px 24px rgba(40,45,48,.12);
  --e-1: 4px;  --e-2: 8px;   --e-3: 12px;
  --e-4: 16px; --e-6: 24px;  --e-8: 32px;
  --e-10: 40px; --e-12: 48px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* ── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-corps);
  color: var(--c-texte);
  background: var(--c-fond);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--icam-bleu); text-decoration: none; }
a:hover { color: var(--icam-orange); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── TYPOGRAPHIE ────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-titre);
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-texte);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
.text-muted   { color: var(--c-texte-attenue); font-size: .875rem; }
.text-orange  { color: var(--icam-orange); }
.text-bleu    { color: var(--icam-bleu); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }

/* ── BOUTONS ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--e-2);
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: var(--font-corps); font-size: .875rem;
  font-weight: 500; cursor: pointer; border: 2px solid transparent;
  transition: all .2s ease; white-space: nowrap;
}
.btn-primary   { background: var(--icam-orange); color: #fff; border-color: var(--icam-orange); }
.btn-primary:hover { background: var(--icam-orange-dark); border-color: var(--icam-orange-dark); color: #fff; }
.btn-secondary { background: var(--icam-bleu); color: #fff; border-color: var(--icam-bleu); }
.btn-secondary:hover { background: #003d75; color: #fff; }
.btn-outline   { background: transparent; color: var(--icam-orange); border-color: var(--icam-orange); }
.btn-outline:hover { background: var(--icam-orange); color: #fff; }
.btn-ghost     { background: transparent; color: var(--c-texte); border-color: var(--c-bordure); }
.btn-ghost:hover { background: var(--c-fond); }
.btn-danger    { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-sm   { padding: 6px 14px; font-size: .8rem; }
.btn-lg   { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── CARTES ─────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--ombre-carte);
  border: 1px solid var(--c-bordure);
  overflow: hidden;
}
.card-header {
  padding: var(--e-4) var(--e-6);
  border-bottom: 1px solid var(--c-bordure);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body   { padding: var(--e-6); }
.card-footer {
  padding: var(--e-4) var(--e-6);
  border-top: 1px solid var(--c-bordure);
  background: var(--c-fond);
}

/* ── KPI CARDS ──────────────────────────────────── */
.kpi-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--ombre-carte);
  padding: var(--e-6);
  display: flex; align-items: center; gap: var(--e-4);
  border-left: 4px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(40,45,48,.1); }
.kpi-card.kpi-orange  { border-left-color: var(--icam-orange); }
.kpi-card.kpi-bleu    { border-left-color: var(--icam-bleu); }
.kpi-card.kpi-success { border-left-color: var(--c-success); }
.kpi-card.kpi-warning { border-left-color: var(--c-warning); }
.kpi-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.kpi-orange  .kpi-icon { background: #FFF3E0; color: var(--icam-orange); }
.kpi-bleu    .kpi-icon { background: var(--c-info-bg); color: var(--icam-bleu); }
.kpi-success .kpi-icon { background: var(--c-success-bg); color: var(--c-success); }
.kpi-warning .kpi-icon { background: var(--c-warning-bg); color: var(--c-warning); }
.kpi-value {
  font-family: var(--font-titre);
  font-size: 1.75rem; font-weight: 700;
  color: var(--c-texte); line-height: 1;
}
.kpi-label { font-size: .8rem; color: var(--c-texte-attenue); margin-top: 4px; }

/* ── BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
}
.badge-orange  { background: #FFF3E0; color: var(--icam-orange-dark); }
.badge-bleu    { background: var(--c-info-bg); color: var(--icam-bleu); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-warning { background: var(--c-warning-bg); color: #915700; }
.badge-danger  { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-gray    { background: var(--c-fond); color: var(--c-texte-attenue); }

/* ── FORMULAIRES ────────────────────────────────── */
.form-group  { margin-bottom: var(--e-4); }
.form-label  {
  display: block; font-size: .875rem; font-weight: 500;
  color: var(--c-texte); margin-bottom: var(--e-2);
}
.form-label .required { color: var(--c-danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--c-bordure);
  border-radius: var(--radius-md);
  font-family: var(--font-corps); font-size: .875rem;
  color: var(--c-texte); background: var(--c-surface);
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.form-control:focus {
  border-color: var(--icam-orange);
  box-shadow: 0 0 0 3px rgba(255,158,27,.15);
}
.form-control::placeholder { color: var(--c-texte-attenue); }
.form-control.error { border-color: var(--c-danger); }
.form-error { font-size: .8rem; color: var(--c-danger); margin-top: 4px; }
.form-hint  { font-size: .8rem; color: var(--c-texte-attenue); margin-top: 4px; }
select.form-control   { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── TABLEAUX ────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--c-bordure); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table thead tr { background: var(--c-fond); border-bottom: 2px solid var(--c-bordure); }
.table th {
  padding: 12px 16px; text-align: left;
  font-weight: 600; font-size: .8rem;
  color: var(--c-texte-attenue); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .04em;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--c-bordure); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FFFBF5; }

/* ── BARRE DE PROGRESSION ───────────────────────── */
.progress-bar-wrap { background: var(--c-fond); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--icam-orange), var(--icam-orange-dark));
  transition: width .4s ease;
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--c-texte-attenue); margin-bottom: var(--e-1);
}

/* ── ALERTES ────────────────────────────────────── */
.alert {
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radius-md);
  font-size: .875rem; border-left: 4px solid transparent;
  margin-bottom: var(--e-4);
}
.alert-success { background: var(--c-success-bg); border-color: var(--c-success); color: var(--c-success); }
.alert-danger  { background: var(--c-danger-bg);  border-color: var(--c-danger);  color: var(--c-danger); }
.alert-warning { background: var(--c-warning-bg); border-color: var(--c-warning); color: #915700; }
.alert-info    { background: var(--c-info-bg);    border-color: var(--icam-bleu); color: var(--icam-bleu); }

/* ── LAYOUT DASHBOARD ───────────────────────────── */
/* min-width: 0 (lot MOBILE ET PHOTO, A) : 23 vues posent <body class="dashboard-layout">
   ET un <div class="dashboard-layout"> ; le div, element flexible du body, s'elargissait
   a son contenu et la page entiere debordait sur telephone. */
.dashboard-layout { display: flex; min-height: 100vh; min-width: 0; }
/* Conteneur des 21 vues a mise en page propre (aucune regle ne le definissait) :
   meme garde que .main-content, il ne s'elargit plus au contenu. */
.dashboard-main { min-width: 0; }
.topbar {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-height);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-bordure);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--e-6); z-index: 100;
  box-shadow: 0 1px 4px rgba(40,45,48,.06);
}
.topbar-left  { display: flex; align-items: center; gap: var(--e-4); }
.topbar-right { display: flex; align-items: center; gap: var(--e-3); }
.topbar-title      { font-family: var(--font-titre); font-size: 1.1rem; font-weight: 700; color: var(--icam-bleu); line-height: 1.2; }
.topbar-breadcrumb { font-size: .75rem; color: var(--c-texte-attenue); margin-top: 1px; }
.topbar-user-name  { font-size: .875rem; font-weight: 600; color: var(--c-texte); text-align: right; }
.topbar-user-role  { font-size: .7rem; color: var(--c-texte-attenue); text-align: right; }
/* hamburger mobile */
.hamburger-btn { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; cursor: pointer; padding: 8px; border: none; background: none; border-radius: var(--radius-md); flex-shrink: 0; }
.hamburger-btn:hover { background: var(--c-fond); }
.hamburger-btn span { display: block; width: 22px; height: 2px; background: var(--icam-gris); border-radius: 2px; transition: all .3s ease; }
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* sidebar overlay (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; }
.sidebar-overlay.open { display: block; }
/* responsive dashboard */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-260px); transition: transform .3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .hamburger-btn { display: flex; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 var(--e-4); }
  .topbar-breadcrumb { display: none; }
  .main-content { padding: var(--e-4); }
}
@media (max-width: 480px) {
  .topbar-title { font-size: .95rem; }
  .main-content { padding: var(--e-3); }
}
.main-content {
  /* LOT MOBILE ET PHOTO (A) : element flexible de .dashboard-layout. Sans
     min-width: 0, il s'elargit au tableau le plus large et la page entiere
     deborde ; les conteneurs a defilement des pages ne servaient jamais. */
  min-width: 0;
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: var(--e-8);
  flex: 1; min-height: calc(100vh - var(--topbar-height));
}
.page-header { margin-bottom: var(--e-8); }
.page-header h1 { font-size: 1.5rem; }
.page-header p  { color: var(--c-texte-attenue); margin-top: var(--e-1); }

/* ── SIDEBAR ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--icam-gris);
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 200;
  display: flex; flex-direction: column;
  transition: transform .3s ease;
}
.sidebar-logo {
  padding: var(--e-6) var(--e-4);
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: var(--e-3);
}
.sidebar-logo .logo-text {
  font-family: var(--font-titre); font-size: 1.5rem; font-weight: 700;
  color: #fff; letter-spacing: -.02em;
}
.sidebar-logo .logo-sub {
  font-size: .7rem; color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .08em;
}
.sidebar-logo .logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--icam-orange); flex-shrink: 0;
}
.sidebar-nav { padding: var(--e-4) var(--e-3); flex: 1; }
.nav-section-title {
  font-size: .7rem; font-weight: 600; letter-spacing: .08em;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  padding: var(--e-4) var(--e-3) var(--e-2);
}
.nav-item {
  display: flex; align-items: center; gap: var(--e-3);
  padding: 10px var(--e-3); border-radius: var(--radius-md);
  color: rgba(255,255,255,.7); font-size: .875rem;
  cursor: pointer; transition: all .2s ease;
  margin-bottom: 2px; text-decoration: none;
}
.nav-item:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--icam-orange); color: #fff; font-weight: 600; }
.nav-item .nav-icon { width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--c-danger); color: #fff;
  border-radius: var(--radius-pill); font-size: .7rem; padding: 2px 7px; font-weight: 700;
}
.sidebar-footer { padding: var(--e-4) var(--e-3); border-top: 1px solid rgba(255,255,255,.1); }
.user-info { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--icam-orange);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: .875rem; flex-shrink: 0;
}
.user-name { font-size: .875rem; font-weight: 600; color: #fff; }
.user-role { font-size: .75rem; color: rgba(255,255,255,.5); }

/* ── PAGE LOGIN ─────────────────────────────────── */
.login-page    { min-height: 100vh; display: flex; background: var(--c-fond); }
.login-left {
  flex: 1; background: var(--icam-gris);
  display: flex; flex-direction: column;
  justify-content: center; padding: var(--e-12);
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px; border-radius: 50%; background: rgba(255,158,27,.15);
}
.login-left::after {
  content: ''; position: absolute; bottom: -60px; left: -60px;
  width: 240px; height: 240px; border-radius: 50%; background: rgba(0,82,155,.2);
}
.login-brand {
  font-family: var(--font-titre); font-size: 3.5rem; font-weight: 700;
  color: var(--icam-orange); z-index: 1; position: relative;
}
.login-tagline {
  font-size: 1.25rem; color: rgba(255,255,255,.8);
  margin-top: var(--e-4); z-index: 1; position: relative;
  max-width: 380px; line-height: 1.5;
}
.login-right { width: 480px; display: flex; align-items: center; justify-content: center; padding: var(--e-8); }
.login-box { width: 100%; }
.login-box h2 { margin-bottom: var(--e-2); }
.login-box p  { color: var(--c-texte-attenue); margin-bottom: var(--e-8); }

/* ── NOTIFICATION BADGE ─────────────────────────── */
.notif-btn {
  position: relative; cursor: pointer; padding: var(--e-2);
  border-radius: var(--radius-md); color: var(--c-texte-attenue);
  transition: all .2s; border: none; background: none; font-size: 1.25rem;
}
.notif-btn:hover { background: var(--c-fond); }
.notif-count {
  position: absolute; top: 0; right: 0;
  background: var(--c-danger); color: #fff;
  border-radius: var(--radius-pill); font-size: .65rem;
  font-weight: 700; padding: 1px 5px; min-width: 18px;
  text-align: center; border: 2px solid var(--c-surface);
}

/* ── GRILLE FORMATIONS (partie publique) ─────────── */
.formations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--e-6);
}
.formation-card {
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--ombre-carte); overflow: hidden;
  border: 1px solid var(--c-bordure);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.formation-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(40,45,48,.12); }
.formation-card img { width: 100%; height: 180px; object-fit: cover; }
.formation-card-body   { padding: var(--e-4); flex: 1; }
.formation-card-footer {
  padding: var(--e-4); border-top: 1px solid var(--c-bordure);
  display: flex; justify-content: space-between; align-items: center;
}
.formation-price { font-family: var(--font-titre); font-size: 1.25rem; font-weight: 700; color: var(--icam-orange); }

/* ── NAVIGATION PUBLIQUE ────────────────────────── */
.navbar-public {
  background: var(--c-surface); border-bottom: 1px solid var(--c-bordure);
  padding: 0 var(--e-8); height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 300;
  box-shadow: 0 2px 8px rgba(40,45,48,.06);
}
.navbar-brand { font-family: var(--font-titre); font-size: 1.75rem; font-weight: 700; color: var(--icam-bleu); }
.navbar-links { display: flex; align-items: center; gap: var(--e-6); }
.navbar-links a { font-size: .9rem; font-weight: 500; color: var(--c-texte); transition: color .2s; }
.navbar-links a:hover { color: var(--icam-orange); }

/* ── HERO SECTION ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--icam-gris) 0%, #2d3035 100%);
  padding: 80px var(--e-8); text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%; background: rgba(255,158,27,.1);
}
.hero h1 { color: #fff; font-size: 3rem; line-height: 1.2; }
.hero h1 span { color: var(--icam-orange); }
.hero p { color: rgba(255,255,255,.75); font-size: 1.125rem; margin: var(--e-4) auto; max-width: 560px; }

/* ── ONGLETS ─────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--c-bordure); margin-bottom: var(--e-6); }
.tab-btn {
  padding: 12px var(--e-6); font-size: .875rem; font-weight: 500;
  color: var(--c-texte-attenue); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; font-family: var(--font-corps);
}
.tab-btn:hover { color: var(--icam-orange); }
.tab-btn.active { color: var(--icam-orange); border-bottom-color: var(--icam-orange); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── DROPDOWN ────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--c-surface); border: 1px solid var(--c-bordure);
  border-radius: var(--radius-md); box-shadow: var(--ombre-menu);
  min-width: 200px; z-index: 400; display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--e-3);
  padding: 10px var(--e-4); font-size: .875rem; color: var(--c-texte);
  transition: background .15s; cursor: pointer;
}
.dropdown-item:hover { background: var(--c-fond); color: var(--icam-orange); }
.dropdown-divider { height: 1px; background: var(--c-bordure); margin: 4px 0; }

/* ── UTILITAIRES ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--e-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--e-6); }
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.gap-2  { gap: var(--e-2); }
.gap-4  { gap: var(--e-4); }
.mt-4   { margin-top: var(--e-4); }
.mt-6   { margin-top: var(--e-6); }
.mb-4   { margin-bottom: var(--e-4); }
.mb-6   { margin-bottom: var(--e-6); }
.p-6    { padding: var(--e-6); }
.w-full { width: 100%; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--c-bordure); margin: var(--e-6) 0; }

/* ── HAMBURGER BUTTON (masqué desktop) ──────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--c-fond); }
.hamburger-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--c-texte);
  border-radius: 2px;
  transition: all .3s ease;
}
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}
.sidebar-overlay.open { display: block; }

.navbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}
.navbar-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--c-texte);
  border-radius: 2px;
}

/* ── RESPONSIVE — TABLETTE (< 1024px) ──────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0 !important; }
  .main-content { margin-left: 0 !important; }
  .hamburger-btn { display: flex !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── RESPONSIVE — MOBILE (< 768px) ─────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 16px !important; height: 56px !important; }
  .main-content { padding: var(--e-4) !important; margin-top: 56px !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr !important; }
  .formations-grid { grid-template-columns: 1fr !important; }
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .login-left { display: none !important; }
  .login-right { width: 100% !important; padding: 24px !important; }
  .hero { padding: 48px 24px !important; }
  .hero h1 { font-size: 2rem !important; }
  .navbar-links { display: none; }
  .navbar-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: var(--c-surface);
    padding: 16px;
    border-bottom: 1px solid var(--c-bordure);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 500;
  }
  .navbar-hamburger { display: flex !important; }
  .btn-group { flex-direction: column; width: 100%; }
  .btn-group .btn { width: 100%; justify-content: center; }
  .kpi-card { padding: 16px !important; }
  .kpi-value { font-size: 1.5rem !important; }
}

/* ── RESPONSIVE — MOBILE S (< 480px) ───────────── */
@media (max-width: 480px) {
  .sidebar { width: 100vw !important; }
  .main-content { padding: 12px !important; }
  .hero h1 { font-size: 1.75rem !important; }
  .hero p  { font-size: 1rem !important; }
  /* LOT MOBILE ET PHOTO (A) : plus de colonnes masquees par position ; les
     tableaux suivent assets/css/tableaux.css (cartes ou defilement). */
}

/* ── REDUCED MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .hamburger-btn span { transition: none !important; }
}
