/* ===== Design tokens ===== */
:root{
  --bg: #FAF6FC;
  --surface: #ffffff;
  --surface-alt: #F3ECFA;
  --text: #3D3452;
  --text-muted: #786C8C;
  --border: #E8DFF5;
  --primary: #6E5AA3;
  --primary-dark: #4A3B78;
  --primary-light: #EDE6F9;
  --success: #4F9E72;
  --success-light: #E3F5EA;
  --danger: #B84F63;
  --danger-light: #FBE9ED;
  --warning: #C99A3E;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(110,90,163,.08), 0 1px 2px rgba(110,90,163,.10);
  --shadow-lg: 0 12px 32px rgba(110,90,163,.16);
  --maxw: 980px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.55;
}
a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%}
h1,h2,h3,h4{line-height:1.25; margin-top:0}
button{font-family:inherit}

/* ===== Header ===== */
.site-header{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:50;
}
.header-inner{
  max-width:1100px; margin:0 auto; padding:12px 20px;
  display:flex; align-items:center; gap:20px;
}
.brand{display:flex; align-items:center; gap:10px; color:var(--text); flex:1}
.brand:hover{text-decoration:none}
.brand-icon{font-size:28px}
.brand-text{display:flex; flex-direction:column; line-height:1.2}
.brand-text strong{font-size:16px}
.brand-text small{color:var(--text-muted); font-size:12px}
.main-nav{display:flex; gap:6px}
.main-nav a{
  padding:8px 14px; border-radius:8px; color:var(--text); font-weight:600; font-size:14px;
}
.main-nav a:hover{background:var(--surface-alt); text-decoration:none}
.main-nav a.nav-cta{background:var(--primary); color:#fff}
.main-nav a.nav-cta:hover{background:var(--primary-dark)}
.nav-avatar{
  width:34px; height:34px; padding:0; border-radius:50%; overflow:hidden; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:18px; background:var(--surface-alt);
  order:99;
}
.nav-avatar img{width:100%; height:100%; object-fit:cover}
.nav-toggle{
  display:none; background:none; border:none; font-size:22px; cursor:pointer; color:var(--text);
}

/* ===== Sélecteur de niveau ===== */
.niveau-select{
  display:flex; align-items:center; gap:8px;
  background:var(--surface-alt); border:1px solid var(--border);
  border-radius:999px; padding:4px 6px 4px 14px;
}
.niveau-label{
  font-size:11.5px; font-weight:800; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.05em;
}
.niveau-select select{
  border:none; background:var(--surface); color:var(--primary-dark); font-family:inherit;
  font-weight:700; font-size:14px; padding:6px 10px; border-radius:999px; cursor:pointer; outline:none;
}
.niveau-select select:focus{box-shadow:0 0 0 2px var(--primary-light);}
@media (max-width: 680px){
  .niveau-label{display:none;}
  .niveau-select{padding:3px 5px; margin-left:auto;}
}

@media (max-width: 680px){
  .main-nav{
    display:none; position:absolute; top:100%; left:0; right:0;
    background:var(--surface); flex-direction:column; padding:10px; border-bottom:1px solid var(--border);
    box-shadow:var(--shadow);
  }
  .main-nav.open{display:flex}
  .nav-toggle{display:block}
}

/* ===== Layout ===== */
.app-main{max-width:var(--maxw); margin:0 auto; padding:28px 20px 80px}
.site-footer{
  text-align:center; color:var(--text-muted); font-size:13px; padding:26px 20px 40px;
}
.site-footer .footer-links{margin-top:8px}
.site-footer .footer-links a{color:var(--text-muted); font-weight:600}
.site-footer .footer-links a:hover{color:var(--primary)}

/* ===== Breadcrumb ===== */
.breadcrumb{
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  font-size:13px; color:var(--text-muted); margin-bottom:18px;
}
.breadcrumb a{color:var(--text-muted); font-weight:600}
.breadcrumb a:hover{color:var(--primary)}
.breadcrumb .sep{opacity:.5}
.breadcrumb .current{color:var(--text); font-weight:700}

/* ===== Hero ===== */
.hero{
  background:linear-gradient(135deg, var(--primary) 0%, #C88FC7 100%);
  color:#fff; border-radius:20px; padding:40px 32px; margin-bottom:32px;
  box-shadow:var(--shadow-lg);
}
.hero h1{font-size:clamp(24px,4vw,34px); margin-bottom:10px}
.hero p{opacity:.95; max-width:640px; font-size:15.5px}
.hero .pill{
  display:inline-block; background:rgba(255,255,255,.18); padding:5px 12px;
  border-radius:999px; font-size:12.5px; font-weight:700; margin-bottom:14px; letter-spacing:.3px;
}

/* ===== Accueil marketing ===== */
.home-hero{text-align:left}
.cta-buttons{display:flex; gap:12px; flex-wrap:wrap; margin-top:22px}
.cta-buttons .cta-primary{background:#fff; color:var(--primary-dark); font-size:15px; padding:12px 20px}
.cta-buttons .cta-primary:hover{background:#fff; opacity:.92; color:var(--primary-dark)}
.cta-buttons .cta-secondary{background:rgba(255,255,255,.16); color:#fff; font-size:15px; padding:12px 20px}
.cta-buttons .cta-secondary:hover{background:rgba(255,255,255,.28)}

.home-features .card{text-align:center; align-items:center}
.home-features .card-icon{font-size:30px}

.niveaux-grid{grid-template-columns:repeat(auto-fill, minmax(160px,1fr))}
.niveau-card{
  font-family:inherit; text-align:center; align-items:center; cursor:pointer;
}
.niveau-card:disabled{opacity:.7; cursor:default}

.temoignages-grid{grid-template-columns:repeat(auto-fill, minmax(270px,1fr))}
.temoignage-card{gap:12px}
.temoignage-head{display:flex; align-items:center; gap:12px}
.temoignage-avatar{
  width:42px; height:42px; border-radius:50%; background:var(--surface-alt);
  display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0;
}
.temoignage-role{color:var(--text-muted); font-size:12.5px}
.temoignage-texte{font-size:14px; font-style:italic; color:var(--text); margin:0}

.programme-badge{
  display:flex; gap:24px; align-items:center;
  background:linear-gradient(135deg, var(--primary) 0%, #C88FC7 100%);
  border-radius:20px; padding:30px 32px; margin:32px 0; box-shadow:var(--shadow-lg);
  color:#fff;
}
.programme-icon{flex-shrink:0}
.programme-texte h2{font-size:21px; margin:6px 0 10px; color:#fff}
.programme-texte p{font-size:14.5px; margin:0; color:rgba(255,255,255,.92)}
.programme-tag{background:rgba(255,255,255,.2); color:#fff}

@media (max-width:640px){
  .programme-badge{flex-direction:column; align-items:center; text-align:center; padding:26px 20px}
}

.fondatrice-section{
  display:flex; gap:28px; align-items:flex-start; background:var(--surface);
  border:1px solid var(--border); border-radius:20px; padding:32px; margin:40px 0;
  box-shadow:var(--shadow);
}
.fondatrice-avatar{flex-shrink:0}
.fondatrice-texte h2{font-size:22px; margin:6px 0 14px}
.fondatrice-texte p{font-size:15px}
.fondatrice-signature{color:var(--text-muted); font-weight:700; font-style:italic}

.cta-band{
  text-align:center; background:var(--surface-alt); border-radius:20px; padding:40px 24px; margin:40px 0 8px;
}
.cta-band h2{font-size:24px}
.cta-band p{color:var(--text-muted); max-width:520px; margin:8px auto 20px}

@media (max-width:640px){
  .fondatrice-section{flex-direction:column; align-items:center; text-align:center; padding:26px 20px}
}

/* ===== Cards / grid ===== */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(230px,1fr)); gap:16px;
}
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow); transition:transform .15s ease, box-shadow .15s ease;
  display:flex; flex-direction:column; gap:8px;
}
.card:hover{transform:translateY(-3px); box-shadow:var(--shadow-lg); text-decoration:none}
.card .card-icon{
  font-size:26px; width:52px; height:52px; display:flex; align-items:center; justify-content:center;
  border-radius:14px; background:var(--surface-alt);
}
.card .card-icon svg{width:26px; height:26px; stroke:var(--text); flex-shrink:0}
.card h3{font-size:17px; margin:0; color:var(--text)}
.card p{font-size:13px; color:var(--text-muted); margin:0}
.card .card-meta{font-size:12px; color:var(--primary); font-weight:700; margin-top:auto}

.section-title{
  display:flex; align-items:baseline; justify-content:space-between; margin:36px 0 16px;
}
.section-title h2{font-size:20px}
.section-title .count{color:var(--text-muted); font-size:13px}

/* ===== Chapter page ===== */
.chapter-header{margin-bottom:24px}
.chapter-header .tag{
  display:inline-flex; align-items:center; gap:5px; background:var(--primary-light); color:var(--primary-dark);
  font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; margin-bottom:10px;
}
.chapter-header .tag svg{width:14px; height:14px; stroke:currentColor; flex-shrink:0}
.chapter-header h1{font-size:26px}

.tabs{display:flex; gap:6px; border-bottom:2px solid var(--border); margin-bottom:24px; flex-wrap:wrap}
.tab-btn{
  background:none; border:none; padding:11px 16px; font-size:14px; font-weight:700;
  color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px;
}
.tab-btn:hover{color:var(--primary)}
.tab-btn.active{color:var(--primary); border-color:var(--primary)}

.cours-block{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:26px 28px; box-shadow:var(--shadow);
}
.cours-block .intro{font-size:15.5px; color:var(--text-muted); margin-bottom:20px; font-style:italic}
.cours-block h3{font-size:17px; margin-top:26px; color:var(--primary-dark); border-left:4px solid var(--primary); padding-left:10px}
.cours-block h3:first-of-type{margin-top:6px}
.cours-block p{font-size:15px}
.cours-block ul, .cours-block ol{padding-left:22px; font-size:15px}
.vocab-box{
  background:var(--surface-alt); border-radius:10px; padding:14px 18px; margin:14px 0; font-size:14px;
}
.vocab-box strong{color:var(--primary-dark)}
.key-points{
  background:var(--success-light); border:1px solid #C9EAD6; border-radius:12px; padding:18px 20px; margin-top:28px;
}
.key-points h4{color:#2F7A52; margin:0 0 10px; font-size:15px}
.key-points ul{margin:0; padding-left:20px; font-size:14.5px}

/* ===== Carte mentale ===== */
.mindmap-wrap{
  position:relative; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:12px;
}
.mindmap-wrap svg, .mindmap-overlay-scroll svg{display:block; margin:0 auto}
.mindmap-wrap text, .mindmap-overlay-scroll text{font-family:inherit; user-select:none}

/* Aperçu : la carte est réduite pour tenir entièrement dans un cadre carré
   (au lieu de déborder avec un défilement horizontal) — on clique dessus
   (ou sur la loupe) pour l'ouvrir en plein écran à taille réelle. */
.mindmap-preview{
  width:100%; aspect-ratio:1/1; max-height:480px;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  cursor:zoom-in; border-radius:calc(var(--radius) - 6px);
}
.mindmap-preview:hover{background:var(--surface-alt)}
.mindmap-preview svg{width:100%; height:100%; max-width:100%; max-height:100%; margin:0}

.mindmap-zoom-btn{
  position:absolute; top:22px; right:22px; z-index:2;
  width:38px; height:38px; border-radius:50%; border:1px solid var(--border);
  background:var(--surface); box-shadow:var(--shadow); cursor:pointer; font-size:15px;
  display:flex; align-items:center; justify-content:center; padding:0;
}
.mindmap-zoom-btn:hover{background:var(--primary-light)}

/* Plein écran : la même carte, à taille réelle, avec défilement si elle
   déborde de l'écran (cf. centrerCarteMentale() qui centre le scroll). */
.mindmap-overlay{
  position:fixed; inset:0; z-index:1000; background:#241a3d;
  display:flex; flex-direction:column;
}
.mindmap-overlay-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 20px; flex-shrink:0;
}
.mindmap-overlay-title{color:#fff; font-weight:700; font-size:16px}
.mindmap-overlay-close{
  width:38px; height:38px; border-radius:50%; border:none; flex-shrink:0;
  background:rgba(255,255,255,.15); color:#fff; font-size:18px; cursor:pointer;
}
.mindmap-overlay-close:hover{background:rgba(255,255,255,.28)}
.mindmap-overlay-scroll{flex:1; overflow:auto; padding:12px 24px 32px}

/* ===== Aperçu cours (visiteur non connecté) ===== */
.cours-preview-wrap{position:relative; max-height:300px; overflow:hidden; margin-top:20px; border-radius:0 0 var(--radius) var(--radius)}
.cours-preview-masque{filter:blur(5px); user-select:none; pointer-events:none}
.cours-preview-cta{
  position:absolute; inset:0; display:flex; align-items:flex-end; justify-content:center;
  background:linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--surface) 62%); padding-bottom:22px;
}
.cours-preview-cta-inner{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-lg); padding:22px 26px; max-width:400px; text-align:center;
}
.cours-preview-cta-inner h4{font-size:16px; margin:8px 0 6px}
.cours-preview-cta-inner p{font-size:13.5px; color:var(--text-muted); margin:0 0 14px}

/* ===== Flashcards ===== */
.flashcard-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:18px;
}
.flashcard{
  background:none; border:none; padding:0; margin:0; cursor:pointer; text-align:left;
  height:180px; perspective:1200px; font-family:inherit;
}
.flashcard-inner{
  position:relative; width:100%; height:100%; display:block;
  transform-style:preserve-3d; transition:transform .5s cubic-bezier(.4,.2,.2,1);
}
.flashcard.flipped .flashcard-inner{transform:rotateY(180deg)}
.flashcard-face{
  position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; text-align:center;
}
.flashcard-front{background:var(--surface); border:1px solid var(--border)}
.flashcard-back{background:var(--primary); color:#fff; transform:rotateY(180deg)}
.flashcard-tag{
  font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px;
  color:var(--primary); opacity:.8;
}
.flashcard-back .flashcard-tag{color:#fff; opacity:.75}
.flashcard-text{font-size:15px; font-weight:600; line-height:1.4}
.flashcard:hover .flashcard-front{border-color:var(--primary)}
.flashcard:focus-visible .flashcard-inner{outline:2px solid var(--primary); outline-offset:3px}

/* ===== Evaluations list ===== */
.eval-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(260px,1fr)); gap:16px}
.eval-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow);
}
.eval-type{
  display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:800;
  text-transform:uppercase; letter-spacing:.4px; padding:4px 10px; border-radius:999px; margin-bottom:10px;
}
.eval-type.qcm{background:#E8E3FA; color:#5B4FA0}
.eval-type.vf{background:#FBEBD2; color:#8C5A20}
.eval-type.exo{background:#E3F5EA; color:#2F7A52}
.eval-type.ds{background:#F7E8CB; color:#8C6A1E}
.eval-card h3{font-size:16px; margin:0 0 6px}
.eval-card p{font-size:13px; color:var(--text-muted); margin:0 0 14px}
.btn{
  display:inline-flex; align-items:center; gap:6px; background:var(--primary); color:#fff;
  border:none; padding:10px 16px; border-radius:9px; font-weight:700; font-size:14px; cursor:pointer;
}
.btn:hover{background:var(--primary-dark); text-decoration:none; color:#fff}
.btn.secondary{background:var(--surface-alt); color:var(--text)}
.btn.secondary:hover{background:var(--border)}
.btn.block{width:100%; justify-content:center}

/* ===== Quiz ===== */
.quiz-header{margin-bottom:20px}
.quiz-progress{
  height:8px; background:var(--surface-alt); border-radius:999px; overflow:hidden; margin-top:10px;
}
.quiz-progress-bar{height:100%; background:var(--primary); width:0%; transition:width .2s ease}
.question-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:22px 24px; margin-bottom:16px; box-shadow:var(--shadow);
}
.question-card .qnum{font-size:12px; font-weight:800; color:var(--primary); text-transform:uppercase; letter-spacing:.4px}
.question-card .qtext{font-size:16px; font-weight:600; margin:8px 0 16px}
.choice-list{display:flex; flex-direction:column; gap:8px}
.choice{
  display:flex; align-items:center; gap:10px; padding:11px 14px; border:1.5px solid var(--border);
  border-radius:10px; cursor:pointer; font-size:14.5px; transition:all .12s ease;
}
.choice:hover{border-color:var(--primary); background:var(--primary-light)}
.choice input{accent-color:var(--primary); width:16px; height:16px; flex-shrink:0}
.choice.correct{border-color:var(--success); background:var(--success-light)}
.choice.incorrect{border-color:var(--danger); background:var(--danger-light)}
.choice.disabled{cursor:default}
.choice.disabled:hover{background:none}
.choice.correct:hover, .choice.incorrect:hover{background:inherit}

.vf-row{display:flex; gap:10px}
.vf-btn{
  flex:1; padding:11px; border:1.5px solid var(--border); border-radius:10px; background:var(--surface);
  cursor:pointer; font-weight:700; font-size:14px;
}
.vf-btn:hover{border-color:var(--primary)}
.vf-btn.selected{background:var(--primary-light); border-color:var(--primary)}
.vf-btn.correct{background:var(--success-light); border-color:var(--success); color:#2F7A52}
.vf-btn.incorrect{background:var(--danger-light); border-color:var(--danger); color:#8C3A48}

.explication{
  margin-top:12px; padding:12px 14px; background:var(--surface-alt); border-radius:10px; font-size:13.5px;
  border-left:3px solid var(--primary);
}

textarea.answer-box{
  width:100%; min-height:110px; border:1.5px solid var(--border); border-radius:10px; padding:12px;
  font-family:inherit; font-size:14.5px; resize:vertical;
}
.correction-box{
  margin-top:14px; padding:16px 18px; background:var(--success-light); border:1px solid #C9EAD6;
  border-radius:10px; font-size:14.5px; display:none;
}
.correction-box.show{display:block}
.correction-box h4{margin:0 0 8px; color:#2F7A52; font-size:14px}

.quiz-result{
  text-align:center; padding:36px 20px; background:var(--surface); border-radius:var(--radius);
  box-shadow:var(--shadow); margin-bottom:20px;
}
.quiz-result .score{font-size:44px; font-weight:800; color:var(--primary)}
.quiz-result .score-label{color:var(--text-muted); font-size:14px; margin-top:4px}
.quiz-result .appreciation{margin-top:10px; font-weight:700; font-size:16px}

.actions-row{display:flex; gap:10px; margin-top:20px; flex-wrap:wrap}

.ds-meta{display:flex; gap:16px; flex-wrap:wrap; font-size:13px; color:var(--text-muted); margin:6px 0 4px}
.ds-meta strong{color:var(--text)}
.ds-consigne{font-size:14.5px; color:var(--text-muted); margin:-8px 0 14px}
.ds-figure{
  background:var(--surface-alt); border:1px solid var(--border); border-radius:12px;
  padding:18px; margin:6px 0 18px; display:flex; flex-direction:column; align-items:center; gap:8px;
}
.ds-figure svg{max-width:100%; height:auto}
.ds-figure img{max-width:100%; max-height:420px; height:auto; object-fit:contain; border-radius:8px; display:block}
.doc-map{position:relative; display:inline-block; max-width:100%}
.doc-map img{max-width:100%; height:auto; border-radius:8px; display:block}
.doc-label{
  position:absolute; transform:translate(-50%,-50%); background:rgba(255,255,255,.9);
  color:#2E6E8E; font-size:12px; font-weight:700; padding:2px 7px; border-radius:6px;
  white-space:nowrap; border:1px solid rgba(46,110,142,.35);
}
.doc-credit{font-size:11.5px; color:var(--text-muted); text-align:center}
.ds-champs{display:flex; flex-direction:column; gap:10px; margin:14px 0}
.ds-champ{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.ds-champ-label{font-weight:600; font-size:14.5px}
.ds-input{
  border:none; border-bottom:2px dotted var(--text-muted); background:transparent;
  font-family:inherit; font-size:14.5px; padding:4px 6px; min-width:110px; outline:none;
}
.ds-input:focus{border-bottom-color:var(--primary)}

/* ===== Prof / admin ===== */
.login-box{
  max-width:380px; margin:60px auto; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:30px; box-shadow:var(--shadow); text-align:center;
}
.login-box input{
  width:100%; padding:11px 14px; border:1.5px solid var(--border); border-radius:9px; font-size:15px;
  margin:14px 0; text-align:center;
}
.login-box .error{color:var(--danger); font-size:13px; min-height:18px}
.login-box .pass-field{position:relative; margin:14px 0}
.login-box .pass-field input{margin:0; padding-right:42px}
.login-box .pass-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:16px; padding:6px; line-height:1;
}
.stacked-form{display:flex; flex-direction:column; gap:12px; max-width:340px; margin-top:14px}
.stacked-form .pass-field{position:relative}
.stacked-form input, .stacked-form select, .stacked-form textarea{
  width:100%; padding:11px 14px; border:1.5px solid var(--border); border-radius:9px; font-size:15px; font-family:inherit;
}
.stacked-form textarea{resize:vertical; min-height:110px}
.stacked-form .pass-field input{padding-right:42px}
.stacked-form .pass-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:16px; padding:6px; line-height:1;
}
.stacked-form .error{color:var(--danger); font-size:13px; min-height:18px}
.stacked-form .success{color:var(--success); font-size:13px}

/* ===== Plan du site ===== */
.sitemap-list{list-style:none; padding:0; margin:0 0 28px; display:flex; flex-direction:column; gap:8px}
.sitemap-list li a{font-size:15px; font-weight:600}
.sitemap-niveaux .card{align-items:flex-start}
.sitemap-niveau-link{
  background:none; border:none; padding:0; font-family:inherit; font-size:13px; font-weight:700;
  color:var(--primary); cursor:pointer;
}
.table-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch}
.admin-table{width:100%; border-collapse:collapse; margin-top:10px}
.admin-table th, .admin-table td{
  text-align:left; padding:10px 12px; border-bottom:1px solid var(--border); font-size:14px;
}
.admin-table th{color:var(--text-muted); font-size:12px; text-transform:uppercase}
.admin-table .td-icon{display:inline-flex; vertical-align:middle}
.admin-table .td-icon svg{width:16px; height:16px; stroke:var(--text); vertical-align:middle}
.info-box{
  background:var(--primary-light); border-radius:12px; padding:18px 20px; font-size:14px; margin:18px 0;
  border-left:4px solid var(--primary);
}
.badge{
  display:inline-block; background:var(--surface-alt); padding:2px 9px; border-radius:999px;
  font-size:11.5px; font-weight:700; color:var(--text-muted);
}
.badge.points{background:#F7E8CB; color:#8C6A1E; font-weight:800; margin-left:8px}

.empty-state{text-align:center; padding:60px 20px; color:var(--text-muted)}
.back-link{display:inline-block; margin-bottom:16px; font-weight:700; font-size:14px}

/* ===== Import de cours ===== */
.import-form-row{display:flex; gap:10px; flex-wrap:wrap}
.import-form-row select, .import-form-row input[type="text"]{
  flex:1; min-width:200px; padding:10px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:14.5px; font-family:inherit;
}
#impFile{
  display:block; margin-top:8px; font-size:14px;
}


/* ============================================================
   ASSISTANT DE RÉVISION (chatbot de recherche)
   ============================================================ */
.cbot-wrap{position:fixed; right:20px; bottom:20px; z-index:1000; font-family:inherit;}
.cbot-toggle{
  width:60px; height:60px; border-radius:50%; border:none; cursor:pointer;
  background:linear-gradient(135deg, var(--primary) 0%, #C88FC7 100%); color:#fff;
  box-shadow:var(--shadow-lg); display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease, box-shadow .15s ease;
}
.cbot-toggle:hover{transform:translateY(-2px) scale(1.04);}
.cbot-toggle svg{width:28px; height:28px;}
.cbot-toggle.hidden{display:none;}

.cbot-panel{
  position:absolute; right:0; bottom:0; width:min(380px, calc(100vw - 32px));
  height:min(560px, calc(100vh - 90px));
  background:var(--surface); border:1px solid var(--border); border-radius:20px;
  box-shadow:var(--shadow-lg); display:none; flex-direction:column; overflow:hidden;
}
.cbot-panel.open{display:flex; animation:cbotPop .18s ease;}
@keyframes cbotPop{from{opacity:0; transform:translateY(12px) scale(.98);} to{opacity:1; transform:none;}}

.cbot-header{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; background:linear-gradient(135deg, var(--primary) 0%, #C88FC7 100%); color:#fff;
}
.cbot-header-title{display:flex; align-items:center; gap:10px;}
.cbot-avatar{
  width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,.22);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.cbot-avatar svg{width:22px; height:22px;}
.cbot-header-title strong{display:block; font-size:15px; line-height:1.2;}
.cbot-header-title small{font-size:12px; opacity:.9;}
.cbot-close{
  background:rgba(255,255,255,.18); border:none; color:#fff; width:30px; height:30px;
  border-radius:50%; cursor:pointer; font-size:14px; line-height:1; flex-shrink:0;
}
.cbot-close:hover{background:rgba(255,255,255,.32);}

.cbot-messages{flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; background:var(--bg);}
.cbot-msg{display:flex; max-width:100%;}
.cbot-msg.cbot-user{justify-content:flex-end;}
.cbot-bubble{
  padding:11px 14px; border-radius:16px; font-size:14px; line-height:1.5; max-width:88%;
  box-shadow:var(--shadow);
}
.cbot-bot .cbot-bubble{background:var(--surface); color:var(--text); border-bottom-left-radius:5px;}
.cbot-user .cbot-bubble{background:var(--primary); color:#fff; border-bottom-right-radius:5px;}
.cbot-bubble p{margin:0 0 8px;}
.cbot-bubble p:last-child{margin-bottom:0;}
.cbot-hint{display:block; margin-top:6px; font-size:12.5px; color:var(--text-muted); font-style:italic;}

.cbot-result{
  background:var(--surface-alt); border:1px solid var(--border); border-radius:12px;
  padding:11px 12px; margin-top:10px;
}
.cbot-result-head{display:flex; align-items:center; gap:8px; margin-bottom:6px; flex-wrap:wrap;}
.cbot-badge{
  display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:700;
  color:var(--primary-dark); padding:3px 9px; border-radius:999px;
}
.cbot-badge svg{width:13px; height:13px; stroke:currentColor;}
.cbot-type{font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em;}
.cbot-result-title{font-weight:700; font-size:13.5px; color:var(--text); margin-bottom:4px;}
.cbot-result-text{font-size:13.5px; color:var(--text); line-height:1.5;}
.cbot-result-text em{color:var(--primary-dark);}
.cbot-result-link{display:inline-block; margin-top:8px; font-size:12.5px; font-weight:700; color:var(--primary);}

.cbot-form{display:flex; gap:8px; padding:12px; border-top:1px solid var(--border); background:var(--surface);}
.cbot-form input{
  flex:1; padding:10px 14px; border:1.5px solid var(--border); border-radius:999px;
  font-size:14px; font-family:inherit; outline:none;
}
.cbot-form input:focus{border-color:var(--primary);}
.cbot-form button{
  width:42px; height:42px; border-radius:50%; border:none; cursor:pointer; flex-shrink:0;
  background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center;
}
.cbot-form button:hover{background:var(--primary-dark);}
.cbot-form button svg{width:19px; height:19px;}

.cbot-thinking{display:flex; gap:4px; align-items:center;}
.cbot-thinking span{
  width:7px; height:7px; border-radius:50%; background:var(--text-muted); opacity:.5;
  animation:cbotBlink 1s infinite;
}
.cbot-thinking span:nth-child(2){animation-delay:.2s;}
.cbot-thinking span:nth-child(3){animation-delay:.4s;}
@keyframes cbotBlink{0%,80%,100%{opacity:.3; transform:translateY(0);} 40%{opacity:1; transform:translateY(-3px);}}

@media (max-width:520px){
  .cbot-wrap{right:14px; bottom:14px;}
  .cbot-panel{height:min(70vh, calc(100vh - 80px));}
}
