/* ============================================================
   ASCEW — Design System V9
   ------------------------------------------------------------
   Feuille de style centralisée (LOT VISUEL 1 : identité + chrome
   des pages authentifiées + navigation + responsive).
   Les styles métier spécifiques d'une page restent dans son
   <style> inline ; ce fichier porte les fondations communes.
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  /* Brand ASCEW : vert émeraude + bleu marine */
  --ascew-primary:      #0e9f6e;
  --ascew-primary-hover:#0b7d57;
  --ascew-primary-soft: #ebf7f2;
  --ascew-navy:         #0f172a;
  --ascew-navy-soft:    #1e293b;
  --ascew-accent-soft:  rgba(14,159,110,.16);

  /* Couleurs sémantiques */
  --color-success:        #0e9f6e;
  --color-success-soft:   #ebf7f2;
  --color-success-dark:   #0b7d57;
  --color-info:           #2563eb;
  --color-info-soft:      #eff6ff;
  --color-info-dark:      #1d4ed8;
  --color-warning:        #d97706;
  --color-warning-soft:   #fffbeb;
  --color-warning-dark:   #b45309;
  --color-danger:         #dc2626;
  --color-danger-soft:    #fef2f2;
  --color-danger-dark:    #b91c1c;
  --color-purple:         #7c3aed;
  --color-purple-soft:    #f5f3ff;

  /* Neutres */
  --bg:           #f4f7fb;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-muted:#f1f5f9;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --text-soft:    #334155;
  --text-muted:   #64748b;
  --text-faint:   #94a3b8;

  /* Typographie */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Poppins', 'Inter', var(--font-sans);

  /* Rayons */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Ombres */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.14);

  /* Espacements */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Dimensions chrome */
  --topbar-h: 64px;
  --sidebar-w: 180px;
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }
a { color: var(--color-info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); line-height: 1.2; }

/* Accessibilité : focus clavier visible */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid rgba(37,99,235,.45);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Respect des préférences de mouvement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Barres de défilement discrètes */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ------------------------------------------------------------
   3. CHROME D'APPLICATION (pages authentifiées)
   ------------------------------------------------------------ */
body.ascew-app {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* ----- TOP BAR ----- */
#top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  min-height: var(--topbar-h);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 40;
}

#top-bar .logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
#top-bar .logo img { height: 34px; object-fit: contain; }
#top-bar .logo span { color: var(--ascew-primary); }

#top-bar .user-info {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
}
#top-bar .user-info strong { color: var(--text); font-weight: 700; }

/* Contrôleurs en haut (sélecteurs classe/élève/prof, actions) */
.gestion-eleve-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gestion-eleve-container select,
#top-bar select {
  max-width: 220px;
  min-height: 36px;
  padding: 6px 10px 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
}
.gestion-eleve-container select:hover,
#top-bar select:hover { border-color: var(--text-faint); }
.gestion-eleve-container select:focus,
#top-bar select:focus { border-color: var(--ascew-primary); box-shadow: 0 0 0 3px var(--ascew-accent-soft); }

#top-bar select option { color: var(--text); background: var(--surface); }

.badge-classe {
  background: var(--ascew-navy);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Boutons icônes de la top bar */
.btn-icon {
  border: 1px solid transparent;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn-icon:hover { background: var(--border); color: var(--text); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-xs); }

.btn-icon.green  { background: var(--color-success-soft);  color: var(--color-success-dark); }
.btn-icon.green:hover  { background: var(--color-success);  color: #fff; }
.btn-icon.red    { background: var(--color-danger-soft);   color: var(--color-danger-dark); }
.btn-icon.red:hover    { background: var(--color-danger);   color: #fff; }
.btn-icon.orange { background: var(--color-warning-soft);  color: var(--color-warning-dark); }
.btn-icon.orange:hover { background: var(--color-warning);  color: #fff; }
.btn-icon.purple { background: var(--color-purple-soft);   color: var(--color-purple); }
.btn-icon.purple:hover { background: var(--color-purple);   color: #fff; }
.btn-icon.blue   { background: var(--color-info-soft);     color: var(--color-info-dark); }
.btn-icon.blue:hover   { background: var(--color-info);     color: #fff; }

/* Bouton déconnexion / actions de la top bar */
.btn-logout {
  background: var(--surface-muted);
  color: var(--text-soft);
  border: 1px solid transparent;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: background .2s, color .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.btn-logout:hover { background: var(--border); color: var(--text); text-decoration: none; }

/* Bouton hamburger (drawer mobile) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-toggle:hover { background: var(--surface-muted); color: var(--text); }

/* ----- CONTENEUR PRINCIPAL ----- */
#app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ----- SIDEBAR (base sombre) ----- */
#sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--ascew-navy) 0%, #111a2e 100%);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin: 2px 0 4px;
  align-self: flex-start;
  padding-left: 4px;
}
.sidebar-sep {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255,255,255,.09);
  margin: 6px 0;
}

/* Navigation .app-nav (liens) */
#sidebar.app-nav { align-items: stretch; }
#sidebar.app-nav .sidebar-label { align-self: flex-start; }

.btn-side {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: rgba(255,255,255,.74);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.btn-side i { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }
.btn-side:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.btn-side.active {
  background: var(--ascew-accent-soft);
  color: #4ade80;
}

/* Palette drag & drop .app-palette */
#sidebar.app-palette { position: relative; }

.source-bulle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  cursor: grab;
  background: linear-gradient(160deg, #38bdf8 0%, #2563eb 100%);
  box-shadow: 0 6px 14px rgba(37,99,235,.28);
  transition: transform .18s, box-shadow .18s;
  user-select: none;
  border: 2px solid rgba(255,255,255,.28);
}
.source-bulle:hover { transform: scale(1.06); box-shadow: 0 10px 20px rgba(37,99,235,.35); }

.source-etape {
  width: 112px;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  border: 2px dashed rgba(255,255,255,.35);
  transition: transform .18s, background .18s;
  user-select: none;
  text-align: center;
}
.source-etape:hover { transform: scale(1.04); background: rgba(255,255,255,.12); }

#drop-zone-small {
  width: 100%;
  min-height: 56px;
  background: rgba(255,255,255,.06);
  border: 2px dashed rgba(255,255,255,.28);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  padding: 6px;
  color: #b6c3d2;
  transition: all .25s;
}
#drop-zone-small.hover { border-color: var(--color-success); background: rgba(14,159,110,.18); color: #fff; }

#trash-zone {
  width: 100%;
  min-height: 46px;
  background: rgba(220,38,38,.85);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
  transition: all .25s;
  margin-top: 4px;
  gap: 2px;
}
#trash-zone.active { background: var(--color-danger); transform: scale(1.04); box-shadow: 0 0 14px rgba(220,38,38,.55); animation: ascew-pulse-trash 1s infinite; }
@keyframes ascew-pulse-trash { 0%,100% { box-shadow: 0 0 12px rgba(220,38,38,.5); } 50% { box-shadow: 0 0 22px rgba(220,38,38,.9); } }
#trash-zone.hover { background: #b91c1c; transform: scale(1.06); }

.btn-config-side {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  padding: 8px 8px;
  font-size: 10.5px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
}
.btn-config-side:hover { background: rgba(255,255,255,.16); }

/* ----- ZONE PRINCIPALE ----- */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 22px 26px 40px;
  position: relative;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(14,159,110,.05), transparent 60%),
    var(--bg);
}

/* ----- PANEL DROIT (dashboard condensé) ----- */
#dashboard-right {
  width: 192px;
  background: var(--surface);
  padding: 16px 12px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   4. COMPOSANTS GÉNÉRIQUES
   ------------------------------------------------------------ */

/* ----- Boutons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--ascew-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--ascew-primary-hover); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--text-soft); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-muted); color: var(--text); }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-dark); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }

.btn-sm { min-height: 30px; padding: 4px 12px; font-size: 12px; border-radius: var(--radius-pill); font-weight: 600; }

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success-dark); }
.badge-info    { background: var(--color-info-soft); color: var(--color-info-dark); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning-dark); }
.badge-danger  { background: var(--color-danger-soft); color: var(--color-danger-dark); }
.badge-neutral { background: var(--surface-muted); color: var(--text-muted); }

/* ----- Cartes ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ----- Tableaux ----- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th,
.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.empty-row:hover { background: transparent; }
.cell-mono { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12.5px; }
.cell-dim { color: var(--text-muted); }
.empty-row td { padding: 0 !important; }

/* ----- Titres de panneau ----- */
.panel-title { font-family: var(--font-display); font-size: 17px; color: var(--text); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.panel-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

/* ----- Barre de filtres (back-office) ----- */
.connexions-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.connexions-filters label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.connexions-filters select,
.connexions-filters input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
}
.connexions-filters select:focus,
.connexions-filters input[type="date"]:focus { border-color: var(--ascew-primary); box-shadow: 0 0 0 3px var(--ascew-accent-soft); outline: none; }
.connexions-filters .btn-filter {
  padding: 8px 18px;
  background: var(--ascew-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.connexions-filters .btn-filter:hover { background: var(--ascew-primary-hover); }
.connexions-filters .btn-reset {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, border-color .2s;
}
.connexions-filters .btn-reset:hover { background: var(--surface-muted); }
.connexions-count { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

/* ----- Cartes statistiques (back-office) ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.stat-icon.i-primary { background: linear-gradient(135deg, var(--ascew-primary), var(--ascew-primary-hover)); }
.stat-icon.i-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-icon.i-success { background: linear-gradient(135deg, #22c55e, var(--ascew-primary-hover)); }
.stat-icon.i-info    { background: linear-gradient(135deg, var(--color-info), #1d4ed8); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ----- Modales (base design system) ----- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-contenu {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-contenu h3 { margin: 0 0 16px; font-family: var(--font-display); color: var(--text); }

/* ----- Formulaires ----- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 5px;
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ascew-primary);
  box-shadow: 0 0 0 3px var(--ascew-accent-soft);
}

/* ----- Notifications (toasts) ----- */
.ascew-toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.ascew-toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ascew-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: ascew-toast-in .25s ease;
}
.ascew-toast i { margin-top: 1px; }
.ascew-toast.success { background: var(--color-success); }
.ascew-toast.info    { background: var(--color-info); }
.ascew-toast.warning { background: var(--color-warning); }
.ascew-toast.danger  { background: var(--color-danger); }
@keyframes ascew-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ----- État vide ----- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 15px;
  width: 100%;
}
.empty-state i { display: block; font-size: 34px; margin-bottom: 12px; opacity: .6; }

/* ----- Titres de page (back-office) ----- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

/* ------------------------------------------------------------
   5. RESPONSIVE
   ------------------------------------------------------------ */

/* --- Écrans moyens : on compacte le chrome --- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 150px; }
  #dashboard-right { display: none; }
  #main-content { padding: 18px 18px 32px; }
  .source-bulle { width: 82px; height: 82px; font-size: 10px; }
  .source-etape { width: 100px; font-size: 10px; }
}

/* --- Tablette / mobile : top bar + drawer navigation --- */
@media (max-width: 768px) {
  #top-bar { padding: 10px 14px; gap: 8px; }
  #top-bar .logo { font-size: 16px; }
  #top-bar .logo img { height: 30px; }

  /* Le menu de navigation .app-nav devient un tiroir */
  #sidebar.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 252px;
    z-index: 110;
    padding: 20px 14px;
    transform: translateX(-104%);
    transition: transform .26s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open #sidebar.app-nav { transform: translateX(0); }

  .nav-toggle { display: inline-flex; }

  /* Voile derrière le tiroir */
  #sidebar.app-nav::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  body.nav-open #sidebar.app-nav::before { opacity: 1; pointer-events: auto; }

  /* La palette drag&drop reste visible et compacte */
  #sidebar.app-palette { width: 96px; }

  .gestion-eleve-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .gestion-eleve-container select,
  #top-bar select { max-width: 170px; }
}

/* --- Très petit écran --- */
@media (max-width: 480px) {
  #top-bar { justify-content: flex-start; }
  #top-bar .user-info { display: none; }
  .badge-classe { font-size: 11px; padding: 4px 10px; }
  #main-content { padding: 14px 12px 28px; }
  #sidebar.app-palette { width: 84px; padding: 12px 6px; }
  .source-bulle { width: 68px; height: 68px; font-size: 9px; }
  .source-etape { width: 74px; font-size: 9px; padding: 5px; }
  #drop-zone-small { font-size: 8px; min-height: 40px; }
  #trash-zone { font-size: 9px; min-height: 40px; }
}