/* ============================================================
   DASHBOARD-ELEVE.CSS — v3
   Fichier unique : variables + burger + dashboard
   ============================================================ */

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --ocean-deep:  #0b2e4f;
  --ocean:       #14508a;
  --ocean-light: #2e7fc2;
  --foam:        #d8ecf7;
  --sand:        #e8d5a3;
  --sand-dark:   #c9b076;
  --coral:       #ff7f66;
  --gold:        #f5c542;
  --palm:        #2e8b57;
  --ink:         #10222f;
  --paper:       #fdfaf2;
  --line:        #eee3c8;
  --m-poor:      #d32f2f;
  --m-weak:      #f57c00;
  --m-avg:       #fbc02d;
  --m-good:      #7cb342;
  --m-exc:       #388e3c;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(180deg,
    var(--ocean-deep) 0%, var(--ocean) 55%, var(--ocean-light) 100%);
  min-height: 100vh;
  color: var(--ink);
}

/* ============================================================
   BURGER MENU (.bm-* injecté par burger-menu.js)
   Inclus ici au cas où burger-menu.js ne charge pas son propre CSS.
   Sans effet si les styles sont déjà dans main.css.
   ============================================================ */
.bm-wrap {
  position: fixed; top: 0; left: 0; z-index: 400;
}
.bm-btn {
  background: rgba(11,46,79,.92); border: none;
  color: var(--foam); cursor: pointer;
  padding: 12px 14px; font-size: 1.2em;
  border-bottom-right-radius: 10px;
  transition: background .15s;
}
.bm-btn:hover { background: var(--ocean); }

.bm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 401; display: none;
}
.bm-overlay.open { display: block; }

.bm-nav {
  position: fixed; top: 0; left: -280px;
  width: 270px; height: 100vh;
  background: var(--paper); z-index: 402;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.3);
  transition: left .25s ease-out;
  overflow-y: auto;
}
.bm-nav.open { left: 0; }

.bm-user {
  background: var(--ocean-deep); color: var(--foam);
  padding: 20px 18px 16px; flex-shrink: 0;
}
.bm-user-name  { font-size: 1.05em; font-weight: 700; }
.bm-user-class { font-size: .82em; opacity: .8; margin-top: 3px; }

.bm-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; color: var(--ink);
  text-decoration: none; font-size: .93em;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.bm-link:hover  { background: #f4efe0; }
.bm-link.active { font-weight: 700; color: var(--ocean); }
.bm-link .bm-ico { font-size: 1.15em; width: 22px; text-align: center; flex-shrink: 0; }

.bm-sep { height: 1px; background: var(--sand-dark); margin: 6px 0; opacity: .4; }

/* ============================================================
   FRAME PRINCIPAL
   ============================================================ */
.db-frame {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 18px 80px;
}

/* ============================================================
   LOADING
   ============================================================ */
#loading { text-align: center; padding: 60px 20px; color: var(--foam); }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  margin: 0 auto 16px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px; align-items: center;
  background: rgba(255,255,255,.09);
  border-radius: 18px; padding: 20px 24px;
  color: var(--foam); margin-bottom: 14px;
}

.hero-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--sand); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 2em; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.hero-avatar:hover { transform: scale(1.07); box-shadow: 0 6px 20px rgba(0,0,0,.4); }

.hero-name { font-size: 1.3em; font-weight: 700; }
.hero-lvl  { font-size: .88em; opacity: .8; margin-top: 3px; }

.hero-xp { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .8em; }
.hero-xp .bar {
  width: 160px; max-width: 38vw; height: 8px;
  background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden;
}
.hero-xp .bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--gold));
}

.hero-right { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.hero-logout {
  background: none; border: 1px solid rgba(255,255,255,.25);
  color: var(--foam); border-radius: 20px;
  padding: 6px 14px; cursor: pointer;
  font-size: .82em; font-family: inherit;
  text-decoration: none; display: flex; align-items: center; gap: 5px;
  transition: background .15s;
}
.hero-logout:hover { background: rgba(255,255,255,.12); }

/* Boussole */
.compass { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.compass svg { transform: rotate(-90deg); }
.compass-val {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--foam); pointer-events: none;
}
.compass-val b    { font-size: 1.65em; line-height: 1; }
.compass-val span { font-size: .6em; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

/* ============================================================
   KPIs (cliquables)
   ============================================================ */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 13px;
}
.kpi {
  background: rgba(255,255,255,.09);
  border-radius: 12px; padding: 14px 16px; color: var(--foam);
  text-decoration: none; display: block;
  transition: background .15s;
  cursor: pointer;
}
.kpi:hover { background: rgba(255,255,255,.15); }
.kpi .n { font-size: 1.35em; font-weight: 700; }
.kpi .l { font-size: .74em; opacity: .78; margin-top: 3px; }

/* ============================================================
   BANDEAUX
   ============================================================ */
.band {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-radius: 14px; padding: 13px 18px; margin-bottom: 13px;
  color: var(--foam);
}
.band.clickable { cursor: pointer; transition: filter .15s; }
.band.clickable:hover { filter: brightness(1.08); }

.band .ico  { font-size: 1.5em; flex-shrink: 0; }
.band .txt  { flex: 1; min-width: 160px; }
.band .txt b     { display: block; font-size: 1em; margin-bottom: 2px; }
.band .txt small { font-size: .78em; opacity: .75; }

.band-time {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
}
.time-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.tslot {
  background: rgba(255,255,255,.1); border-radius: 10px;
  padding: 8px 14px; text-align: center; min-width: 88px;
}
.tslot .tv { font-size: 1.15em; font-weight: 700; color: var(--gold); }
.tslot .tl { font-size: .72em; opacity: .8; margin-top: 2px; }

.band-auto {
  background: linear-gradient(90deg, rgba(245,197,66,.16), rgba(255,127,102,.08));
  border: 1px solid rgba(245,197,66,.45);
}
.auto-prog { min-width: 140px; }
.auto-prog .bar {
  height: 8px; background: rgba(255,255,255,.15);
  border-radius: 4px; overflow: hidden;
}
.auto-prog .bar i { display: block; height: 100%; background: var(--gold); }
.auto-prog .lbl   { font-size: .75em; text-align: right; opacity: .85; margin-top: 3px; }

.band-defis {
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.25); opacity: .85;
}
.badge-soon {
  background: rgba(255,127,102,.2); border: 1px solid rgba(255,127,102,.4);
  color: var(--coral); border-radius: 20px;
  padding: 4px 12px; font-size: .78em; font-weight: 700; white-space: nowrap;
}

/* ============================================================
   BARRE OUTILS
   ============================================================ */
.tools-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; align-items: center;
}
.tool-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--foam); border-radius: 22px;
  padding: 8px 16px; font-size: .85em; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.tool-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
.tool-btn.primary { background: var(--ocean); border-color: var(--ocean-light); font-weight: 600; }
.tool-btn.primary:hover { background: var(--ocean-light); }
.tool-btn .t-ico { font-size: 1.1em; }

.tools-popup-wrap { position: relative; }
.tools-popup {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--paper); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 8px; min-width: 230px; z-index: 300; display: none;
}
.tools-popup.open { display: block; }
.tp-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink); font-size: .88em;
  transition: background .12s;
}
.tp-link:hover { background: #f4efe0; }
.tp-link .tp-ico { font-size: 1.2em; width: 24px; text-align: center; }
.tp-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ============================================================
   THÈMES / ÎLES
   ============================================================ */
.section-h { color: var(--foam); margin: 4px 4px 12px; font-size: 1em; letter-spacing: .03em; }

/* Barre titre + filtres pour les thèmes */
.themes-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  margin: 4px 0 14px; color: var(--foam);
}
.themes-title { font-size: 1.05em; font-weight: 700; letter-spacing: .03em; }
.themes-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.themes { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }

.island { background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.island-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; color: #fff; font-weight: 700; font-size: .97em;
}
.island-head .pct { margin-left: auto; font-weight: 600; }
.island-body { padding: 4px 0 8px; }

/* Chapitre — deux zones cliquables : + pour déplier, titre pour popup */
.chap {
  border-bottom: 1px solid var(--line);
}
.chap:last-child { border-bottom: none; }

.chap-row {
  padding: 11px 14px;
  display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center;
}

/* Bouton + / − pour déplier les items */
.chap-toggle {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ocean); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1em; font-weight: 700; flex-shrink: 0;
  line-height: 1; user-select: none;
  cursor: pointer; border: none;
  transition: background .15s, transform .15s;
}
.chap-toggle:hover { background: var(--ocean-light); transform: scale(1.1); }

/* Titre cliquable → ouvre le popup exercices/jeux */
.chap-title {
  cursor: pointer; transition: color .12s;
}
.chap-title:hover { color: var(--ocean); }

.chap-title { font-weight: 700; font-size: .93em; }
.chap-title small { display: block; font-weight: 400; color: #8a8064; font-size: .78em; }
.chap-right { display: flex; align-items: center; gap: 8px; }

.m-bar { width: 64px; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.m-bar i { display: block; height: 100%; }
.m-pct { font-size: .82em; font-weight: 700; min-width: 32px; text-align: right; }

.st-pill { font-size: .68em; padding: 2px 8px; border-radius: 10px; white-space: nowrap; font-weight: 700; }
.st-none { background: #f0eede; color: #8a8064; }
.st-prog { background: #fff3e0; color: #e65100; }
.st-good { background: #fff8e1; color: #c79100; }
.st-mast { background: #e8f5e9; color: #2e7d32; }

/* Items (sous chaque chapitre, dépliables via le bouton +) */
.items-wrap {
  padding: 0 10px 10px;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}
.items-wrap.open {
  max-height: 2000px;
  padding: 4px 10px 10px;
}

.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
  padding: 9px 4px; border-top: 1px solid var(--line);
  align-items: start; cursor: pointer; transition: background .12s;
}
.item:hover { background: #f8f3e8; border-radius: 6px; }

.item-name  { font-size: .86em; display: flex; align-items: center; gap: 7px; }
.item-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.item-last  { grid-column: 1 / -1; font-size: .72em; color: #9a8f74; padding-left: 0; }

/* Icône jeu/noplay sur l'item */
.icon-play   { font-size: .88em; color: var(--ocean); flex-shrink: 0; }
.icon-noplay { font-size: .88em; color: #8a9aaa;    flex-shrink: 0; cursor: help; }

/* Chips */
.chip {
  font-size: .71em; padding: 2px 7px; border-radius: 8px;
  background: #f4efe0; color: #6a6045; white-space: nowrap;
}
.chip b { color: var(--ink); }
.chip.ok  { background: #e8f5e9; color: #2e7d32; } .chip.ok  b { color: #1b5e20; }
.chip.mid { background: #fff3e0; color: #e65100; } .chip.mid b { color: #bf360c; }
.chip.off { opacity: .5; }

/* ============================================================
   POPUP UNIVERSEL (chapitre ET item) — 2 étapes
   ============================================================ */
#play-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(11,46,79,.72); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
#play-overlay.open { display: flex; }

.play-popup {
  background: var(--paper); border-radius: 18px;
  width: 380px; max-width: 94vw;
  box-shadow: 0 16px 48px rgba(0,0,0,.45); overflow: hidden;
}
.pp-head {
  background: var(--ocean); color: #fff;
  padding: 16px 20px 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.pp-head h3   { font-size: 1em; margin-bottom: 3px; }
.pp-head small { font-size: .78em; opacity: .8; }
.pp-close {
  background: none; border: none; color: #fff; font-size: 1.2em;
  cursor: pointer; opacity: .7; padding: 0 0 0 10px; line-height: 1;
}
.pp-close:hover { opacity: 1; }

.pp-steps {
  display: flex; padding: 9px 20px;
  font-size: .75em; color: #9a8f74; align-items: center;
}
.pp-steps .stp { padding: 3px 0; }
.pp-steps .stp.active { color: var(--ocean); font-weight: 700; }
.pp-steps .sep { margin: 0 8px; opacity: .4; }

.pp-body { padding: 12px 20px 20px; }
.pp-subtitle {
  font-size: .79em; color: #8a8064; margin-bottom: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}

.pp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-btn {
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  padding: 14px 10px; cursor: pointer; text-align: center;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.pp-btn:hover:not(:disabled) { border-color: var(--ocean-light); background: #f0f8ff; }
.pp-btn:disabled { opacity: .42; cursor: not-allowed; }
.pp-btn .pp-ico { font-size: 1.7em; margin-bottom: 5px; }
.pp-btn .pp-lbl { font-weight: 700; font-size: .88em; }
.pp-btn .pp-sub { font-size: .73em; color: #8a8064; margin-top: 2px; }

.pp-mode-list { display: flex; flex-direction: column; gap: 8px; }
.pp-mode {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  padding: 12px 14px; text-decoration: none; cursor: pointer;
  font-family: inherit; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.pp-mode:hover:not(.disabled) { border-color: var(--ocean-light); background: #f0f8ff; }
.pp-mode.disabled { opacity: .42; cursor: not-allowed; pointer-events: none; }
.pp-mode .pm-ico { font-size: 1.4em; width: 34px; text-align: center; flex-shrink: 0; }
.pp-mode .pm-txt b     { display: block; font-size: .88em; }
.pp-mode .pm-txt small { font-size: .74em; color: #8a8064; }
.pp-mode .pm-tag { margin-left: auto; font-size: .7em; padding: 2px 8px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.tag-ok  { background: #e8f5e9; color: #2e7d32; }
.tag-off { background: #f5f5f5; color: #9e9e9e; }

.pp-back {
  background: none; border: none; color: var(--ocean); cursor: pointer;
  font-family: inherit; font-size: .82em; margin-top: 11px; padding: 0;
  text-decoration: underline; display: block;
}

/* ============================================================
   MODALE PROFIL
   ============================================================ */
.modal {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.6); align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-content {
  background: #fff; border-radius: 16px;
  width: 520px; max-width: 96vw; max-height: 90vh; overflow-y: auto;
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid #f0f0f0;
}
.modal-header h2 { font-size: 1.2em; }
.modal-close { background: none; border: none; font-size: 1.4em; cursor: pointer; color: #666; }
.modal-close:hover { color: #333; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .88em; margin-bottom: 6px; color: #444; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: .95em; font-family: inherit;
}
.form-group input:focus, .form-group select:focus { border-color: var(--ocean-light); outline: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-primary {
  background: var(--ocean); color: #fff; border: none; border-radius: 10px;
  padding: 11px 22px; font-size: .95em; font-family: inherit; cursor: pointer; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: var(--ocean-light); }
.btn-secondary {
  background: #f5f5f5; color: #333; border: 1px solid #ddd;
  border-radius: 10px; padding: 10px 20px; font-size: .95em; font-family: inherit; cursor: pointer;
}
.btn-secondary:hover { background: #eee; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 700;
  background: var(--ink); color: var(--foam); border-radius: 12px;
  padding: 13px 20px; font-size: .88em;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  transform: translateY(80px); opacity: 0;
  transition: transform .25s, opacity .25s; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============================================================
   RESPONSIVE (automatique, sans classe JS)
   ============================================================ */
@media (max-width: 900px) {
  .kpis   { grid-template-columns: repeat(2, 1fr); }
  .themes { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .db-frame  { padding: 12px 12px 60px; }
  .hero      { grid-template-columns: auto 1fr; }
  .hero-right { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
  .kpis      { grid-template-columns: repeat(2, 1fr); }
  .themes    { grid-template-columns: 1fr; }
  .item      { grid-template-columns: 1fr; }
  .item-chips { justify-content: flex-start; }
  .tool-btn  { padding: 7px 12px; font-size: .8em; }
  .tslot     { min-width: 75px; }
  .chap-right .st-pill { display: none; } /* trop compact sur mobile */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   STATS RAPIDES (4 cartes Auto/Flash/Eval/Badges)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.stat-card-new {
  background: var(--paper);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.stat-card-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.scn-icon  { font-size: 1.8em; line-height: 1; margin-bottom: 2px; }
.scn-main  { font-size: clamp(1.2em, 3vw, 1.9em); font-weight: 800; color: var(--ocean); line-height: 1.1; }
.scn-sub   { font-size: .74em; color: #666; min-height: 1.2em; }
.scn-label { font-size: .67em; font-weight: 700; color: #94a3b8; letter-spacing: .4px; margin-top: 4px; }

/* ============================================================
   PROGRESSION DÉTAILLÉE
   ============================================================ */
.progress-section {
  background: var(--paper);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.progress-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.progress-title { font-size: 1em; font-weight: 700; color: var(--ink); }
.progress-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  background: #f0eede; border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 13px;
  font-size: .8em; cursor: pointer; font-family: inherit;
  color: var(--ink); transition: background .15s, border-color .15s;
}
.filter-btn:hover  { background: var(--sand); border-color: var(--sand-dark); }
.filter-btn.active { background: var(--ocean); color: #fff; border-color: var(--ocean); }

/* Accordéon chapitre */
.chapter-accordion { margin-bottom: 6px; border-radius: 10px; overflow: hidden; }
.chapter-summary {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  border-radius: 10px; list-style: none;
  transition: filter .12s;
}
.chapter-summary::-webkit-details-marker { display: none; }
.chapter-summary:hover { filter: brightness(.96); }
details[open] > .chapter-summary { border-radius: 10px 10px 0 0; }

.chapter-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.chapter-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.color-gray   { background: #9e9e9e; }
.color-red    { background: #e53935; }
.color-orange { background: #fb8c00; }
.color-yellow { background: #fdd835; }
.color-green  { background: #43a047; }

.chapter-stats-inline {
  display: flex; gap: 5px; flex-wrap: wrap; align-items: center; flex-shrink: 0;
}
.cs-badge {
  padding: 2px 7px; border-radius: 10px;
  font-size: .73em; font-weight: 600; white-space: nowrap;
}
.cs-acquis { background: #e8f5e9; color: #2e7d32; }
.cs-auto   { background: #e3f2fd; color: #1565c0; }
.cs-flash  { background: #f3e5f5; color: #6a1b9a; }
.cs-eval   { background: #fff3e0; color: #e65100; }
.cs-time   { background: #e8eaf6; color: #283593; }

.cs-status { font-size: .73em; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.cs-status-none     { background: #f5f5f5; color: #999; }
.cs-status-progress { background: #fff9c4; color: #f57f17; }
.cs-status-good     { background: #ffe0b2; color: #e65100; }
.cs-status-mastered { background: #e8f5e9; color: #2e7d32; }

/* Tableau items */
.items-list { background: #fff; border-radius: 0 0 10px 10px; }
.items-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  padding: 6px 14px;
  background: #f5f5f5;
  font-size: .74em; color: #888; font-weight: 600; gap: 8px;
}
.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  padding: 9px 14px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center; gap: 8px; font-size: .84em;
  cursor: pointer; transition: background .12s;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: #fdf8ee; }
.item-name-cell { font-weight: 500; color: #333; }

/* Badges statut item */
.badge-status      { padding: 2px 7px; border-radius: 10px; font-size: .73em; font-weight: 600; }
.mastery-none      { background: #f5f5f5; color: #999; }
.mastery-progress  { background: #fff9c4; color: #f57f17; }
.mastery-good      { background: #e8f5e9; color: #2e7d32; }
.mastery-excellent { background: #e3f2fd; color: #1565c0; }

/* Pills stats */
.stat-pill  { border-radius: 8px; padding: 3px 6px; font-size: .78em; line-height: 1.4; text-align: center; }
.pill-ok    { background: #e8f5e9; color: #2e7d32; }
.pill-mid   { background: #fff9c4; color: #f57f17; }
.pill-none  { background: #f5f5f5; color: #bbb; }

/* Responsive stats */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .items-table-header,
  .item-row { grid-template-columns: 1fr 1fr 1fr; }
  .items-table-header span:nth-child(n+4),
  .item-row span:nth-child(n+4) { display: none; }
}