/* ============================================================
   EDUCPRO — Feuille de style principale
   Playfair Display + DM Sans · Palette crème/terracotta/sauge
   ============================================================ */
:root {
  --cream: #FAF6F0; --white: #FFFFFF; --surface: #FFF9F4; --surface2: #FDF3EA;
  --border: #EDE5DA; --border2: #DDD0C0;
  --terra: #C4714A; --terra-l: #E8A882; --terra-d: #a85d39; --terra-dim: rgba(196,113,74,.10);
  --sage: #6B8C6E; --sage-l: #A8C4A2; --sage-dim: rgba(107,140,110,.10);
  --gold: #C9A84C; --gold-dim: rgba(201,168,76,.10);
  --lavender: #7A7EC4; --lav-dim: rgba(122,126,196,.10);
  --sky: #5189A8; --sky-dim: rgba(81,137,168,.10);
  --rose: #B45C78; --rose-dim: rgba(180,92,120,.10);
  --charcoal: #2C2C2C; --charcoal2: #3d3330;
  --text: #2C2C2C; --text2: #7A7068; --text3: #A89E94;
  --sidebar-w: 240px; --radius: 12px; --radius-sm: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text); min-height: 100vh; display: flex; overflow-x: hidden; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: var(--charcoal); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; overflow: hidden; }
.sidebar-logo { padding: 1.3rem 1.1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-text { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; color: var(--terra-l); }
.logo-sub { font-size: .65rem; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .1em; margin-top: .18rem; }
.sidebar-xp { padding: .75rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.xp-label { display: flex; justify-content: space-between; font-size: .69rem; color: rgba(255,255,255,.4); margin-bottom: .3rem; }
.xp-label span:last-child { color: var(--gold); font-weight: 600; }
.xp-bar { background: rgba(255,255,255,.1); border-radius: 3px; height: 4px; overflow: hidden; }
.xp-fill { background: linear-gradient(90deg, var(--gold), var(--terra-l)); height: 100%; border-radius: 3px; transition: width .5s ease; }
.xp-streak { font-size: .71rem; color: var(--terra-l); margin-top: .45rem; font-weight: 500; }
.sidebar-nav { flex: 1; padding: .65rem .6rem; overflow-y: auto; }
.nav-group-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.28); padding: .4rem .5rem .22rem; margin-top: .3rem; }
.nav-item { display: flex; align-items: center; gap: .6rem; padding: .52rem .72rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .84rem; color: rgba(255,255,255,.6); font-weight: 400; position: relative; margin-bottom: .07rem; user-select: none; transition: all .18s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(196,113,74,.2); color: var(--terra-l); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; background: var(--terra-l); border-radius: 0 3px 3px 0; }
.nav-icon { width: 17px; text-align: center; font-size: .88rem; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--terra); color: #fff; font-size: .59rem; font-weight: 700; padding: .08rem .35rem; border-radius: 8px; }
.sidebar-bottom { padding: .7rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .55rem; margin-bottom: .7rem; padding-bottom: .6rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.user-av { width: 30px; height: 30px; border-radius: 50%; background: var(--terra); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-promo { font-size: .62rem; color: rgba(255,255,255,.38); }
.logout-btn { color: rgba(255,255,255,.35); text-decoration: none; font-size: .88rem; flex-shrink: 0; transition: color .18s; padding: .2rem; }
.logout-btn:hover { color: var(--terra-l); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .32rem; }
.mini-stat { text-align: center; background: rgba(255,255,255,.05); border-radius: 5px; padding: .32rem .15rem; }
.mini-stat-val { font-size: .88rem; font-weight: 700; color: var(--gold); font-family: 'Playfair Display', serif; }
.mini-stat-lbl { font-size: .54rem; color: rgba(255,255,255,.33); text-transform: uppercase; letter-spacing: .04em; }

/* ── TOPBAR ── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 52px; background: rgba(250,246,240,.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 1.5rem; gap: .85rem; position: sticky; top: 0; z-index: 100; }
.topbar-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; flex: 1; }
.global-search { display: flex; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: 7px; padding: .32rem .72rem; gap: .42rem; width: 195px; transition: all .2s; }
.global-search:focus-within { border-color: rgba(196,113,74,.4); width: 235px; }
.global-search input { background: none; border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: .79rem; color: var(--text); width: 100%; }
.global-search input::placeholder { color: var(--text3); }
.topbar-pomo { display: flex; align-items: center; gap: .32rem; background: var(--white); border: 1px solid var(--border); border-radius: 7px; padding: .28rem .68rem; font-size: .79rem; font-weight: 700; color: var(--text2); cursor: pointer; transition: all .2s; }
.topbar-pomo:hover, .topbar-pomo.running { border-color: var(--terra); color: var(--terra); }
.topbar-save { display: flex; align-items: center; gap: .32rem; background: var(--sage-dim); border: 1px solid rgba(107,140,110,.3); border-radius: 7px; padding: .28rem .68rem; font-size: .74rem; font-weight: 600; color: var(--sage); cursor: pointer; transition: all .2s; }
.topbar-save:hover { background: rgba(107,140,110,.18); }
.save-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); transition: background .3s; }
.save-indicator.unsaved { background: var(--terra); animation: pulse-save 1.5s infinite; }
@keyframes pulse-save { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── PAGES ── */
.page { display: none; padding: 1.7rem 1.5rem; animation: fadeIn .22s ease; }
.page.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; color: var(--charcoal); }
.page-header p { color: var(--text2); font-size: .86rem; margin-top: .32rem; }

/* ── HERO DASHBOARD ── */
.hero { background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal2) 60%, #2a3328 100%); border-radius: 18px; padding: 1.7rem 2rem; margin-bottom: 1.3rem; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -25%; right: -5%; width: 280px; height: 280px; background: radial-gradient(circle, rgba(196,113,74,.15) 0%, transparent 70%); pointer-events: none; }
.hero-greet { font-size: .74rem; color: var(--terra-l); text-transform: uppercase; letter-spacing: .12em; margin-bottom: .38rem; font-weight: 600; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: 1.85rem; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: .38rem; }
.hero h1 em { color: var(--terra-l); font-style: italic; }
.hero p { color: rgba(255,255,255,.58); font-size: .86rem; max-width: 420px; line-height: 1.7; }
.hero-cta { display: inline-flex; align-items: center; gap: .38rem; background: var(--terra); color: #fff; border: none; padding: .58rem 1.25rem; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 700; cursor: pointer; margin-top: 1rem; transition: all .2s; }
.hero-cta:hover { background: var(--terra-d); transform: translateY(-1px); }

/* ── STAT CARDS ── */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .88rem; margin-bottom: 1.3rem; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--c, var(--terra)); }
.stat-icon { font-size: 1.25rem; margin-bottom: .55rem; }
.stat-val { font-family: 'Playfair Display', serif; font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--charcoal); }
.stat-lbl { font-size: .72rem; color: var(--text2); margin-top: .22rem; }
.stat-trend { font-size: .67rem; color: var(--sage); margin-top: .38rem; }

/* ── DASHBOARD BOTTOM ── */
.dash-bottom { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.1rem; }
.sec-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; margin-bottom: .85rem; }
.mod-list { display: flex; flex-direction: column; gap: .55rem; }
.mod-row { display: flex; align-items: center; gap: .78rem; padding: .72rem .88rem; background: var(--white); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .18s; }
.mod-row:hover { border-color: var(--border2); background: var(--surface); }
.mod-ico { font-size: .95rem; width: 24px; text-align: center; flex-shrink: 0; }
.mod-info { flex: 1; min-width: 0; }
.mod-name { font-size: .79rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-bar-w { height: 3px; background: rgba(0,0,0,.06); border-radius: 2px; margin-top: .25rem; overflow: hidden; }
.mod-bar { height: 100%; border-radius: 2px; transition: width .5s ease; }
.mod-pct { font-size: .69rem; font-weight: 600; flex-shrink: 0; }

/* ── POMODORO ── */
.pomo-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.pomo-phase { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); text-align: center; margin-bottom: .45rem; }
.pomo-ring-w { position: relative; width: 108px; height: 108px; margin: 0 auto .65rem; }
.pomo-ring-w svg { transform: rotate(-90deg); }
.pomo-ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.pomo-ring-f { fill: none; stroke: var(--terra); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 307; stroke-dashoffset: 307; transition: stroke-dashoffset 1s linear; }
.pomo-ring-f.brk { stroke: var(--sage); }
.pomo-t-w { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pomo-t { font-family: 'Playfair Display', serif; font-size: 1.75rem; font-weight: 700; line-height: 1; }
.pomo-dots { display: flex; gap: .32rem; justify-content: center; margin: .55rem 0; }
.pomo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border2); }
.pomo-dot.done { background: var(--terra); }
.pomo-ctrls { display: flex; gap: .48rem; justify-content: center; }
.pomo-btn { padding: .42rem .95rem; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text2); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: .79rem; font-weight: 500; transition: all .18s; }
.pomo-btn.pr { background: var(--terra-dim); border-color: rgba(196,113,74,.3); color: var(--terra); }
.pomo-btn.pr:hover { background: rgba(196,113,74,.18); }
.pomo-btn:hover:not(.pr) { color: var(--text); }

/* ── COURS ── */
.cours-cats { display: flex; flex-wrap: wrap; gap: .48rem; margin-bottom: 1.3rem; }
.cat-btn { padding: .32rem .82rem; border: 1px solid var(--border); border-radius: 20px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .77rem; font-weight: 500; cursor: pointer; transition: all .18s; }
.cat-btn:hover { border-color: var(--border2); color: var(--text); }
.cat-btn.active { background: var(--terra-dim); border-color: rgba(196,113,74,.35); color: var(--terra); font-weight: 600; }
.cours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: .95rem; }
.cours-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; transition: all .2s; position: relative; }
.cours-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 7px 22px rgba(0,0,0,.08); }
.cours-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .75rem; }
.cours-card-ico { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.cours-dur { font-size: .68rem; background: var(--terra-dim); color: var(--terra); border-radius: 11px; padding: .13rem .52rem; font-weight: 600; border: 1px solid rgba(196,113,74,.2); }
.cours-card h3 { font-family: 'Playfair Display', serif; font-size: .93rem; font-weight: 600; line-height: 1.35; margin-bottom: .28rem; }
.cours-card p { font-size: .75rem; color: var(--text2); line-height: 1.6; margin-bottom: .88rem; }
.cours-prog-bar { height: 3px; background: rgba(0,0,0,.05); border-radius: 2px; overflow: hidden; margin-bottom: .22rem; }
.cours-prog-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.cours-status { font-size: .67rem; color: var(--text3); }
.cours-check { position: absolute; top: .75rem; right: .75rem; width: 19px; height: 19px; border-radius: 50%; background: var(--sage); color: #fff; font-size: .62rem; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.cours-card.done .cours-check { opacity: 1; }
/* Fiche detail */
.cours-detail-panel { display: none; }
.cours-detail-panel.open { display: block; }
.back-pill { display: inline-flex; align-items: center; gap: .38rem; padding: .35rem .82rem; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: .77rem; color: var(--text2); background: var(--white); transition: all .18s; font-family: 'DM Sans', sans-serif; }
.back-pill:hover { color: var(--text); border-color: var(--border2); }
.detail-hdr { display: flex; align-items: center; gap: .88rem; margin-bottom: 1.3rem; padding-bottom: .95rem; border-bottom: 1px solid var(--border); }
.fiche-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .65rem; overflow: hidden; transition: border-color .2s; }
.fiche-item:hover { border-color: rgba(196,113,74,.25); }
.fiche-item-header { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.05rem; cursor: pointer; user-select: none; }
.fiche-num { width: 23px; height: 23px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .67rem; font-weight: 700; flex-shrink: 0; }
.fiche-item-title { font-size: .87rem; font-weight: 500; flex: 1; }
.fiche-item-chevron { color: var(--text3); font-size: .73rem; transition: transform .25s; flex-shrink: 0; }
.fiche-item.open .fiche-item-chevron { transform: rotate(180deg); }
.fiche-body { display: none; padding: 0 1.05rem 1.05rem; border-top: 1px solid var(--border); background: #fefcfa; }
.fiche-item.open .fiche-body { display: block; }
.fiche-body p { font-size: .84rem; line-height: 1.85; color: #555; margin: .72rem 0 .32rem; }
.fiche-body strong { color: var(--text); font-weight: 600; }
.fiche-body ul { padding-left: 1.12rem; margin: .38rem 0; }
.fiche-body li { font-size: .82rem; color: #666; line-height: 1.9; }
.callout { border-left: 3px solid var(--terra); background: var(--terra-dim); border-radius: 0 7px 7px 0; padding: .68rem .88rem; margin: .68rem 0; font-size: .8rem; color: #555; line-height: 1.7; }
.tag { display: inline-block; background: var(--surface2); border: 1px solid var(--border); color: var(--text3); font-size: .64rem; font-weight: 600; padding: .11rem .48rem; border-radius: 7px; margin: .22rem .17rem 0 0; text-transform: uppercase; letter-spacing: .06em; }

/* ── FLASHCARDS ── */
.fc-bar { display: flex; align-items: center; gap: .48rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.fc-btn { padding: .28rem .78rem; border: 1px solid var(--border); border-radius: 18px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .18s; }
.fc-btn:hover { border-color: var(--border2); color: var(--text); }
.fc-btn.active { background: var(--terra-dim); border-color: rgba(196,113,74,.35); color: var(--terra); }
.fc-main { display: grid; grid-template-columns: 1fr 235px; gap: 1.25rem; align-items: start; }
.flashcard-scene { height: 315px; cursor: pointer; perspective: 1200px; }
.flashcard-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.23,1,.32,1); }
.flashcard-inner.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.fc-front { background: linear-gradient(145deg, var(--charcoal), var(--charcoal2)); border: 1px solid rgba(255,255,255,.07); box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.fc-back { background: var(--white); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,.08); transform: rotateY(180deg); }
.fc-category-badge { position: absolute; top: .95rem; left: 50%; transform: translateX(-50%); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; padding: .17rem .62rem; border-radius: 9px; white-space: nowrap; }
.fc-front .fc-category-badge { background: rgba(196,113,74,.25); color: var(--terra-l); border: 1px solid rgba(196,113,74,.2); }
.fc-back .fc-category-badge { background: var(--sage-dim); color: var(--sage); border: 1px solid rgba(107,140,110,.2); }
.fc-q { font-family: 'Playfair Display', serif; font-size: 1.18rem; font-weight: 600; color: #fff; line-height: 1.5; }
.fc-a { font-size: .87rem; color: #555; line-height: 1.8; }
.fc-hint-text { position: absolute; bottom: .95rem; font-size: .66rem; color: rgba(255,255,255,.3); }
.fc-back .fc-hint-text { color: var(--text3); }
.fc-nav-row { display: flex; align-items: center; justify-content: center; gap: .88rem; margin-top: .88rem; }
.fc-arrow { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--text2); cursor: pointer; font-size: .88rem; display: flex; align-items: center; justify-content: center; transition: all .18s; }
.fc-arrow:hover { background: var(--surface); color: var(--text); }
.fc-nav-info { text-align: center; min-width: 78px; }
.fc-nav-num { font-family: 'Playfair Display', serif; font-size: 1.02rem; font-weight: 700; }
.fc-nav-total { font-size: .66rem; color: var(--text3); }
.fc-rating-row { display: flex; gap: .48rem; margin-top: .88rem; opacity: 0; pointer-events: none; transition: opacity .25s; }
.fc-rate { flex: 1; padding: .48rem; border: 1px solid var(--border); border-radius: 9px; background: transparent; font-family: 'DM Sans', sans-serif; font-size: .75rem; font-weight: 600; cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: .28rem; }
.fc-rate-hard { color: var(--rose); }
.fc-rate-hard:hover { background: var(--rose-dim); border-color: rgba(180,92,120,.3); }
.fc-rate-ok { color: var(--gold); }
.fc-rate-ok:hover { background: var(--gold-dim); border-color: rgba(201,168,76,.3); }
.fc-rate-easy { color: var(--sage); }
.fc-rate-easy:hover { background: var(--sage-dim); border-color: rgba(107,140,110,.3); }
.fc-sidebar-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem; position: sticky; top: 65px; }
.fc-sidebar-title { font-size: .74rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .85rem; }
.fc-donut { position: relative; width: 88px; height: 88px; margin: 0 auto .65rem; }
.fc-donut svg { transform: rotate(-90deg); }
.fc-donut-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fc-donut-pct { font-family: 'Playfair Display', serif; font-size: 1.18rem; font-weight: 700; color: var(--sage); }
.fc-donut-lbl { font-size: .59rem; color: var(--text3); }
.fc-stat-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .38rem; }
.fc-stat-label { font-size: .75rem; color: var(--text3); display: flex; align-items: center; gap: .32rem; }
.fc-stat-val { font-size: .79rem; font-weight: 600; }
.fc-action-btn { width: 100%; padding: .46rem; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .77rem; cursor: pointer; transition: all .18s; margin-top: .48rem; }
.fc-action-btn:hover { background: var(--surface); color: var(--text); }

/* ── QUIZ ── */
.quiz-topbar { display: flex; align-items: center; gap: .88rem; margin-bottom: 1.35rem; }
.quiz-prog-w { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quiz-prog-fill { height: 100%; background: linear-gradient(90deg, var(--terra), var(--gold)); border-radius: 3px; transition: width .35s ease; }
.quiz-counter { font-size: .79rem; color: var(--text2); font-weight: 600; white-space: nowrap; }
.quiz-timer-pill { background: var(--white); border: 1px solid var(--border); border-radius: 7px; padding: .27rem .62rem; font-size: .79rem; font-weight: 700; color: var(--terra); white-space: nowrap; }
.quiz-category-label { font-size: .69rem; text-transform: uppercase; letter-spacing: .1em; color: var(--terra); margin-bottom: .48rem; font-weight: 600; }
.quiz-question-text { font-family: 'Playfair Display', serif; font-size: 1.38rem; font-weight: 600; line-height: 1.5; margin-bottom: 1.55rem; color: var(--charcoal); }
.quiz-options { display: flex; flex-direction: column; gap: .58rem; max-width: 650px; }
.quiz-option { display: flex; align-items: center; gap: .88rem; padding: .82rem 1.05rem; border: 1.5px solid var(--border); border-radius: 11px; background: var(--white); cursor: pointer; font-size: .85rem; color: var(--text2); transition: all .18s; }
.quiz-option:hover:not([disabled]) { border-color: rgba(196,113,74,.3); color: var(--text); background: var(--surface); }
.quiz-option.correct { border-color: rgba(107,140,110,.5); background: var(--sage-dim); color: var(--sage); }
.quiz-option.wrong { border-color: rgba(180,92,120,.4); background: var(--rose-dim); color: var(--rose); }
.quiz-opt-letter { width: 27px; height: 27px; border-radius: 50%; background: var(--cream); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .69rem; font-weight: 700; flex-shrink: 0; transition: all .18s; }
.quiz-option.correct .quiz-opt-letter { background: var(--sage); border-color: var(--sage); color: #fff; }
.quiz-option.wrong .quiz-opt-letter { background: var(--rose); border-color: var(--rose); color: #fff; }
.quiz-explanation { max-width: 650px; margin-top: .88rem; padding: .82rem .98rem; background: var(--sage-dim); border: 1px solid rgba(107,140,110,.2); border-radius: 9px; font-size: .81rem; color: #555; line-height: 1.7; display: none; animation: fadeIn .25s ease; }
.quiz-explanation.show { display: block; }
.quiz-explanation strong { color: var(--sage); }
.quiz-next-btn { margin-top: 1.25rem; background: var(--terra); color: #fff; border: none; padding: .62rem 1.75rem; border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 700; cursor: pointer; transition: all .2s; }
.quiz-next-btn:hover { background: var(--terra-d); transform: translateY(-1px); }
.quiz-next-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.quiz-start-area { max-width: 640px; }
.quiz-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .68rem; margin-bottom: 1.15rem; }
.quiz-cat-card { padding: .88rem 1.05rem; background: var(--white); border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; display: flex; align-items: center; gap: .72rem; transition: all .18s; }
.quiz-cat-card:hover { border-color: var(--border2); background: var(--surface); }
.quiz-cat-card.selected { border-color: rgba(196,113,74,.35); background: var(--terra-dim); }
.quiz-start-row { display: flex; align-items: center; gap: .88rem; }
.quiz-count-opts { display: flex; gap: .42rem; }
.quiz-count-opt { padding: .28rem .72rem; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .77rem; cursor: pointer; transition: all .18s; }
.quiz-count-opt.active { background: var(--terra-dim); border-color: rgba(196,113,74,.35); color: var(--terra); }
.quiz-start-btn { background: var(--terra); color: #fff; border: none; padding: .6rem 1.55rem; border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 700; cursor: pointer; transition: all .2s; margin-left: auto; }
.quiz-start-btn:hover { background: var(--terra-d); }
.quiz-result { text-align: center; padding: 1.5rem 1rem; max-width: 540px; margin: 0 auto; }
.result-score-ring { position: relative; width: 138px; height: 138px; margin: 0 auto 1.25rem; }
.result-ring-svg { transform: rotate(-90deg); }
.result-ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.result-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 376; }
.result-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.result-score-big { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; line-height: 1; }
.result-score-sub { font-size: .71rem; color: var(--text3); }
.quiz-result h2 { font-family: 'Playfair Display', serif; font-size: 1.55rem; margin-bottom: .38rem; }
.quiz-result .result-msg { color: var(--text2); font-size: .86rem; margin-bottom: 1.25rem; line-height: 1.6; }
.result-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: .68rem; margin: 1.15rem 0; }
.result-bd-item { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: .72rem; }
.result-bd-val { font-family: 'Playfair Display', serif; font-size: 1.38rem; font-weight: 700; }
.result-bd-lbl { font-size: .67rem; color: var(--text3); margin-top: .17rem; }
.quiz-restart-btn { background: var(--white); border: 1px solid var(--border); color: var(--text); padding: .58rem 1.55rem; border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .18s; margin: .28rem; }
.quiz-restart-btn:hover { background: var(--surface); }
.quiz-restart-btn.primary { background: var(--terra); color: #fff; border-color: var(--terra); }
.quiz-restart-btn.primary:hover { background: var(--terra-d); }

/* ── GLOSSAIRE ── */
.glossaire-search-bar { display: flex; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: 9px; padding: .62rem .88rem; margin-bottom: .88rem; gap: .58rem; transition: border-color .2s; }
.glossaire-search-bar:focus-within { border-color: rgba(196,113,74,.35); }
.glossaire-search-bar input { background: none; border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: .85rem; color: var(--text); width: 100%; }
.alpha-filter { display: flex; flex-wrap: wrap; gap: .24rem; margin-bottom: 1.25rem; }
.alpha-btn { width: 25px; height: 25px; border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--text3); font-size: .71rem; font-weight: 600; cursor: pointer; transition: all .15s; font-family: 'DM Sans', sans-serif; }
.alpha-btn:hover, .alpha-btn.active { background: var(--terra-dim); border-color: rgba(196,113,74,.3); color: var(--terra); }
.glossaire-cols { columns: 2; gap: .88rem; }
.gloss-group { break-inside: avoid; margin-bottom: 1.25rem; }
.gloss-letter { font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 700; color: var(--terra); opacity: .5; margin-bottom: .48rem; }
.gloss-term { background: var(--white); border: 1px solid var(--border); border-radius: 9px; padding: .82rem .98rem; margin-bottom: .42rem; break-inside: avoid; transition: border-color .15s; }
.gloss-term:hover { border-color: rgba(196,113,74,.25); }
.gloss-term dt { font-weight: 600; font-size: .85rem; display: flex; align-items: center; gap: .42rem; margin-bottom: .18rem; }
.domain-badge { font-size: .59rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .09rem .38rem; border-radius: 6px; white-space: nowrap; }
.gloss-term dd { font-size: .77rem; color: var(--text2); line-height: 1.65; }

/* ── NOTES ── */
.notes-toolbar { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.note-add-btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--terra); color: #fff; border: none; padding: .52rem 1.1rem; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: .8rem; font-weight: 700; cursor: pointer; transition: all .18s; }
.note-add-btn:hover { background: var(--terra-d); }
.note-cat-btn { padding: .28rem .7rem; border: 1px solid var(--border); border-radius: 16px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .74rem; cursor: pointer; transition: all .18s; }
.note-cat-btn.active { background: var(--terra-dim); border-color: rgba(196,113,74,.3); color: var(--terra); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.note-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; animation: fadeIn .22s ease; }
.note-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .6rem; }
.nc-cat { font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: .18rem .5rem; border-radius: 7px; }
.note-delete-btn { background: none; border: none; color: var(--text3); cursor: pointer; font-size: .82rem; padding: .2rem; border-radius: 4px; transition: color .15s; font-family: 'DM Sans', sans-serif; }
.note-delete-btn:hover { color: var(--rose); }
.note-title { font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.note-content { font-size: .79rem; color: var(--text2); line-height: 1.7; white-space: pre-wrap; }
.note-date { font-size: .65rem; color: var(--text3); margin-top: .7rem; }

/* ── ÉDITEUR ── */
.editor-layout { display: grid; grid-template-columns: 215px 1fr; gap: 1.05rem; min-height: calc(100vh - 130px); }
.doc-sidebar-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: .95rem; position: sticky; top: 64px; max-height: calc(100vh - 95px); overflow-y: auto; }
.doc-sidebar-title { font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: .72rem; display: flex; align-items: center; justify-content: space-between; }
.doc-new-btn { background: var(--terra); color: #fff; border: none; padding: .28rem .68rem; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: .71rem; font-weight: 700; cursor: pointer; transition: all .18s; }
.doc-new-btn:hover { background: var(--terra-d); }
.doc-list-item { padding: .52rem .62rem; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: .48rem; margin-bottom: .22rem; transition: all .18s; font-size: .79rem; color: var(--text2); }
.doc-list-item:hover { background: var(--surface); color: var(--text); }
.doc-list-item.active { background: var(--terra-dim); color: var(--terra); font-weight: 600; }
.doc-del-btn { margin-left: auto; opacity: 0; font-size: .73rem; color: var(--text3); background: none; border: none; cursor: pointer; padding: .09rem .28rem; border-radius: 4px; transition: all .15s; font-family: 'DM Sans', sans-serif; }
.doc-list-item:hover .doc-del-btn { opacity: 1; }
.doc-del-btn:hover { color: var(--rose); background: var(--rose-dim); }
.gdocs-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.gdocs-section h4 { font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: .65rem; }
.gdoc-link-row { display: flex; align-items: center; gap: .4rem; padding: .42rem .5rem; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); margin-bottom: .35rem; }
.gdoc-link-row a { font-size: .77rem; color: var(--terra); text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdoc-link-row a:hover { text-decoration: underline; }
.gdoc-del-btn { background: none; border: none; color: var(--text3); cursor: pointer; font-size: .78rem; font-family: 'DM Sans', sans-serif; padding: .08rem .25rem; border-radius: 4px; transition: color .15s; }
.gdoc-del-btn:hover { color: var(--rose); }
.gdoc-add-form { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.gdoc-input { padding: .42rem .6rem; border: 1px solid var(--border); border-radius: 7px; font-family: 'DM Sans', sans-serif; font-size: .78rem; color: var(--text); background: var(--white); outline: none; transition: border-color .2s; width: 100%; }
.gdoc-input:focus { border-color: rgba(196,113,74,.4); }
.gdoc-add-btn { background: var(--sky-dim); border: 1px solid rgba(81,137,168,.3); color: var(--sky); padding: .38rem; border-radius: 7px; font-family: 'DM Sans', sans-serif; font-size: .76rem; font-weight: 600; cursor: pointer; transition: all .18s; }
.gdoc-add-btn:hover { background: rgba(81,137,168,.2); }
.doc-editor-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 600px; }
.doc-editor-topbar { padding: .72rem 1.15rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .58rem; }
.doc-title-input { font-family: 'Playfair Display', serif; font-size: 1.08rem; font-weight: 700; border: none; outline: none; background: transparent; color: var(--text); flex: 1; }
.doc-title-input::placeholder { color: var(--text3); }
.autosave-indicator { font-size: .7rem; display: flex; align-items: center; gap: .3rem; white-space: nowrap; color: var(--sage); }
.autosave-indicator::before { content: '●'; }
.autosave-indicator.unsaved { color: var(--terra); }
.ed-toolbar { padding: .52rem 1.15rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .28rem; flex-wrap: wrap; background: var(--cream); }
.ed-btn { width: 27px; height: 27px; border: 1px solid var(--border); border-radius: 5px; background: var(--white); color: var(--text2); font-size: .78rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .18s; font-family: 'DM Sans', sans-serif; }
.ed-btn:hover { background: var(--terra-dim); border-color: rgba(196,113,74,.3); color: var(--terra); }
.ed-sep { width: 1px; height: 17px; background: var(--border); margin: 0 .2rem; }
.ed-color-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; transition: transform .15s; }
.ed-color-dot:hover { transform: scale(1.22); }
.editor-area { padding: 1.3rem 1.7rem; flex: 1; outline: none; min-height: 480px; font-family: 'DM Sans', sans-serif; font-size: .9rem; line-height: 1.9; color: var(--text); }
.editor-area h1 { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; margin-bottom: .5rem; }
.editor-area h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; margin: 1rem 0 .4rem; color: var(--terra); }
.editor-area h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; margin: .8rem 0 .3rem; }
.editor-area ul, .editor-area ol { padding-left: 1.5rem; margin: .3rem 0; }
.editor-area blockquote { border-left: 3px solid var(--terra); padding: .5rem 1rem; background: var(--terra-dim); border-radius: 0 7px 7px 0; margin: .7rem 0; font-style: italic; color: #555; }
.editor-footer { padding: .5rem 1.2rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: .7rem; color: var(--text3); }

/* ── ASSISTANT IA ── */
.ia-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; align-items: start; }
.ia-input-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.ia-action-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0; }
.ia-action-btn { padding: .35rem .85rem; border: 1.5px solid var(--border); border-radius: 20px; background: transparent; color: var(--text2); font-family: 'DM Sans', sans-serif; font-size: .77rem; cursor: pointer; transition: all .18s; }
.ia-action-btn:hover { border-color: var(--border2); color: var(--text); }
.ia-action-btn.active { background: var(--terra-dim); border-color: rgba(196,113,74,.35); color: var(--terra); font-weight: 600; }
.ia-textarea { width: 100%; padding: .8rem .95rem; border: 1px solid var(--border); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: .85rem; color: var(--text); background: var(--cream); outline: none; resize: vertical; min-height: 210px; line-height: 1.8; transition: border-color .2s; }
.ia-textarea:focus { border-color: rgba(196,113,74,.4); }
.ia-gdocs-links { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.ia-gdocs-links h4 { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: .5rem; }
.ia-gdoc-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; background: var(--sky-dim); border: 1px solid rgba(81,137,168,.25); border-radius: 16px; font-size: .76rem; color: var(--sky); cursor: pointer; margin: .2rem; transition: all .18s; text-decoration: none; }
.ia-gdoc-chip:hover { background: rgba(81,137,168,.18); }
.ia-send-btn { width: 100%; margin-top: .9rem; background: var(--terra); color: #fff; border: none; padding: .7rem; border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 700; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.ia-send-btn:hover:not(:disabled) { background: var(--terra-d); transform: translateY(-1px); }
.ia-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ia-result-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; min-height: 420px; }
.ia-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: 200px; }
.ia-spinner { width: 38px; height: 38px; border: 3px solid var(--border); border-top-color: var(--terra); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ia-empty { text-align: center; color: var(--text3); padding: 2.5rem 1rem; }
.ia-empty-icon { font-size: 2.5rem; margin-bottom: .8rem; }
.ia-result-body { font-size: .86rem; line-height: 1.85; color: var(--text); }
.ia-result-body h2, .ia-result-body h3 { font-family: 'Playfair Display', serif; color: var(--terra); margin: .9rem 0 .3rem; font-weight: 600; }
.ia-result-body p { font-size: .86rem; color: #555; line-height: 1.8; margin-bottom: .4rem; }
.ia-result-body ul, .ia-result-body ol { padding-left: 1.4rem; margin: .4rem 0; }
.ia-result-body li { font-size: .84rem; color: #555; line-height: 1.85; margin-bottom: .2rem; }
.ia-result-body strong { color: var(--text); font-weight: 600; }
.ia-result-body hr { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }
.ia-result-actions { display: flex; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ia-copy-btn, .ia-save-doc-btn { flex: 1; padding: .5rem; border: 1px solid var(--border); border-radius: 8px; background: transparent; font-family: 'DM Sans', sans-serif; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--text2); transition: all .18s; }
.ia-copy-btn:hover { background: var(--surface); color: var(--text); }
.ia-save-doc-btn { background: var(--sage-dim); border-color: rgba(107,140,110,.3); color: var(--sage); }
.ia-save-doc-btn:hover { background: rgba(107,140,110,.18); }

/* ── MODAL ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn .18s ease; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--white); border: 1px solid var(--border2); border-radius: 16px; padding: 1.8rem; width: 100%; max-width: 460px; box-shadow: 0 30px 60px rgba(0,0,0,.2); }
.modal h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 1.1rem; }
.form-group { margin-bottom: .9rem; }
.form-group label { font-size: .76rem; color: var(--text2); font-weight: 500; margin-bottom: .35rem; display: block; }
.form-input { width: 100%; background: var(--cream); border: 1px solid var(--border); border-radius: 7px; padding: .6rem .85rem; font-family: 'DM Sans', sans-serif; font-size: .83rem; color: var(--text); outline: none; resize: vertical; transition: border-color .2s; }
.form-input:focus { border-color: rgba(196,113,74,.35); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23A89E94' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; cursor: pointer; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.3rem; }
.modal-btn { padding: .52rem 1.1rem; border-radius: 7px; font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .18s; border: 1px solid var(--border); background: transparent; color: var(--text2); }
.modal-btn:hover { color: var(--text); }
.modal-btn.primary { background: var(--terra); color: #fff; border-color: var(--terra); }
.modal-btn.primary:hover { background: var(--terra-d); }

/* ── TOAST & CONFETTI ── */
.toast-container { position: fixed; bottom: 1.3rem; right: 1.3rem; z-index: 2000; display: flex; flex-direction: column; gap: .45rem; }
.toast { background: var(--charcoal); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: .65rem 1rem; font-size: .8rem; color: #fff; display: flex; align-items: center; gap: .5rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: slideIn .25s ease; max-width: 260px; }
@keyframes slideIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }
.toast-success::before { content: '✓'; color: var(--sage-l); font-weight: 700; }
.toast-xp::before { content: '⚡'; color: var(--gold); }
.toast-error::before { content: '✕'; color: var(--rose); }
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
@media(max-width:1024px) { .dash-grid{grid-template-columns:repeat(2,1fr)} .fc-main{grid-template-columns:1fr} .glossaire-cols{columns:1} .ia-layout{grid-template-columns:1fr} .editor-layout{grid-template-columns:1fr} }
@media(max-width:768px) { :root{--sidebar-w:0} .sidebar{transform:translateX(-240px);width:240px} .sidebar.open{transform:translateX(0)} .main{margin-left:0} .dash-bottom{grid-template-columns:1fr} }
