:root {
    --bg-main: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --rev-primary: #d97706;
    --rev-dark: #b45309;
    --rev-light: #fef3c7;
    --rev-border: #fde68a;
    --success: #10b981;
    --danger: #ef4444;
    --line: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    padding-bottom: 60px;
}

a { color: var(--rev-primary); }

.container {
    max-width: 1080px;
    margin: 40px auto;
    padding: 0 20px;
}
.container.narrow { max-width: 960px; }

/* ---- HEADER (style "header-outil") ---- */
header.app-header {
    background: linear-gradient(135deg, var(--rev-primary) 0%, #f59e0b 100%);
    color: #fff;
    padding: 36px 20px;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

header.app-header h1 { font-size: 2rem; font-weight: 800; margin: 0; }

header.app-header > div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

header.app-header a {
    color: #fff;
    text-decoration: none;
    background: rgba(0,0,0,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background 0.2s;
}
header.app-header a:hover { background: rgba(0,0,0,0.32); }
header.app-header a.active { background: rgba(255,255,255,0.92); color: var(--rev-dark); }

/* ---- TEACHER TOPBAR ---- */
header.teacher-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.teacher-topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.teacher-brand {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.teacher-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.teacher-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.teacher-nav a:hover { background: var(--bg-main); color: var(--text-dark); }
.teacher-nav a.active { background: var(--rev-light); color: var(--rev-dark); }
.teacher-nav a.logout { margin-left: 6px; color: var(--text-muted); font-weight: 600; }
.teacher-nav a.logout:hover { color: var(--danger); background: transparent; }

/* ---- TABS (sous-navigation admin) ---- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}
.tab {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text-dark); }
.tab.active { color: var(--rev-primary); border-bottom-color: var(--rev-primary); }

/* ---- TOGGLE / CHIPS ---- */
.toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--line);
    cursor: pointer;
    background: #fff;
    color: var(--text-muted);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.toggle-chip:hover { border-color: #cbd5e1; }
.toggle-chip.on { background: var(--rev-light); color: var(--rev-dark); border-color: var(--rev-border); }

/* ---- MODALS ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.modal-header h2 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
}
.modal-close:hover { color: var(--text-dark); }
.modal.wide { max-width: 640px; }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--rev-primary);
    font-weight: 700;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}
.link-btn:hover { color: var(--rev-dark); text-decoration: underline; }

/* ---- CARDS ---- */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

h2 { margin-top: 0; font-weight: 800; color: var(--text-dark); font-size: 1.15rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
tbody tr:hover { background: var(--bg-main); }
tbody tr:last-child td { border-bottom: none; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-block;
    background: var(--rev-primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s, border-color 0.15s;
    line-height: 1.3;
    border: 1px solid transparent;
}
.btn:hover { background: var(--rev-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--text-dark); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg-main); border-color: #cbd5e1; }
.btn.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 0.78rem; border-radius: 7px; }

/* Bouton icône discret (suppression, etc.) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.icon-btn:hover { background: #fee2e2; color: var(--danger); }
.icon-btn.edit:hover { background: var(--rev-light); color: var(--rev-dark); }

/* Champ texte "inline" (édition directe sans ouvrir de formulaire) */
input.inline-edit {
    border: 1.5px solid transparent;
    background: transparent;
    padding: 6px 8px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 0.95rem;
    width: auto;
    min-width: 140px;
    transition: border-color 0.15s, background 0.15s;
}
input.inline-edit:hover { background: #f1f5f9; }
input.inline-edit:focus { border-color: var(--rev-primary); background: #fff; }

/* ---- FORMS ---- */
label { display: block; margin: 12px 0 4px; font-weight: 700; font-size: 0.85rem; color: var(--text-dark); }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-dark);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--rev-primary);
    box-shadow: 0 0 0 3px var(--rev-light);
}
textarea { min-height: 160px; font-family: monospace; }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 600;
    border: 1px solid transparent;
}
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* ---- PROGRESS ---- */
.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.progress-bar > div {
    height: 100%;
    background: var(--rev-primary);
    border-radius: 6px;
    transition: width 0.3s ease;
}
.progress-cell { min-width: 150px; }
.progress-label { display:block; margin-top:4px; font-size:0.82rem; color: var(--text-dark); }
.progress-pct { color: var(--text-muted); }

/* ---- FILTER BAR ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    padding: 14px;
    margin: 14px 0 18px;
    background: var(--bg-main);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-field select { margin: 0; }
.filter-field-checkbox { justify-content: center; }
.filter-field-checkbox label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--text-dark);
    cursor: pointer;
}
.filter-field-checkbox input { width: auto; margin: 0; }

/* ---- PROGRESS TABLE ---- */
.progress-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.progress-table { margin: 0; }
.progress-table th, .progress-table td { white-space: nowrap; }
.progress-table .progress-cell { white-space: normal; }
.progress-table thead th { background: var(--bg-main); }
.sticky-col { position: sticky; left: 0; background: var(--white); z-index: 1; }
.progress-table thead th.sticky-col { background: var(--bg-main); }

.student-cell {
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; padding: 4px 0; cursor: pointer; text-align: left; font-family: inherit;
}

/* ---- CHAPTER PROGRESS (fiche élève) ---- */
.chapter-progress { margin-bottom: 14px; }
.chapter-progress-toggle {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    width: 100%; background: none; border: none; padding: 0 0 4px; cursor: pointer; font-family: inherit; text-align: left;
}
.chapter-progress-toggle:hover .chapter-progress-name { color: var(--rev-primary); }
.chapter-progress-name { font-weight: 700; }
.chapter-progress-name .chevron { display: inline-block; width: 14px; font-size: 0.7rem; color: var(--text-muted); }
.chapter-detail {
    margin: 10px 0 0 22px;
    padding: 10px 12px;
    background: var(--bg-main);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.detail-table { margin: 0; }
.detail-table th, .detail-table td { padding: 6px 10px; font-size: 0.85rem; }
.detail-table thead th { font-size: 0.68rem; }

/* ---- FLASHCARD ---- */
.flashcard {
    text-align: center;
    padding: 40px 20px;
}
.flashcard .word {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--rev-primary);
}
.flashcard input[type=text] {
    text-align: center;
    font-size: 1.2rem;
    max-width: 320px;
    margin: 0 auto 16px;
}
.feedback {
    font-weight: 700;
    margin-top: 12px;
    min-height: 1.4em;
}
.feedback.correct { color: var(--success); }
.feedback.wrong { color: var(--danger); }

/* ---- STATS ---- */
.stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.stat-box {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.stat-box .num { font-size: 1.6rem; font-weight: 800; color: var(--rev-primary); }
.stat-box .label { font-size: 0.8rem; color: var(--text-muted); }

.stat-box.big {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 22px 14px;
}
.stat-box.big .num { font-size: 2.2rem; }
.stat-box.big .icon { font-size: 1.6rem; }
.stat-box.orange { background: var(--rev-light); border: 1px solid var(--rev-border); }
.stat-box.orange .num { color: var(--rev-dark); }
.stat-box.blue { background: #e0f2fe; border: 1px solid #bae6fd; }
.stat-box.blue .num { color: #0369a1; }
.stat-box.green { background: #d1fae5; border: 1px solid #a7f3d0; }
.stat-box.green .num { color: #047857; }
.stat-box.purple { background: #ede9fe; border: 1px solid #ddd6fe; }
.stat-box.purple .num { color: #6d28d9; }
.stat-box.pink { background: #fce7f3; border: 1px solid #fbcfe8; }
.stat-box.pink .num { color: #be185d; }

/* ---- STUDENT PHOTOS ---- */
.student-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--rev-border);
    vertical-align: middle;
}
.student-photo.large {
    width: 110px;
    height: 110px;
    border-radius: 16px;
}

/* ---- COURSE BADGE ---- */
.badge {
    display: inline-block;
    background: var(--rev-light);
    color: var(--rev-dark);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.admin-link {
    position: fixed;
    bottom: 10px;
    right: 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
    text-decoration: none;
}
.admin-link:hover { opacity: 1; }

/* =====================================================================
   THÈMES PAR LANGUE — <body data-lang="nl|en|all">
   nl = orange (défaut), en = bleu, all = gris neutre (pages sans langue)
   ===================================================================== */
body[data-lang="en"]  { --rev-primary:#2563eb; --rev-dark:#1d4ed8; --rev-light:#dbeafe; --rev-border:#bfdbfe; }
body[data-lang="all"] { --rev-primary:#475569; --rev-dark:#334155; --rev-light:#f1f5f9; --rev-border:#cbd5e1; }

/* ---- Sélecteur de langue (admin) ---- */
.lang-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.lang-bar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lang-bar .lang-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-right: 4px; }
.lang-tab {
    --c: #d97706; --cl: #fef3c7;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 18px; border-radius: 12px; text-decoration: none;
    border: 2px solid var(--line); background: #fff; color: var(--text-muted);
    font-weight: 800; font-size: 0.95rem; transition: all 0.15s;
}
.lang-tab[data-l="en"] { --c: #2563eb; --cl: #dbeafe; }
.lang-tab:hover { border-color: var(--c); color: var(--c); }
.lang-tab .lt-flag { font-size: 1.4rem; line-height: 1; }
.lang-tab .lt-count { font-weight: 600; font-size: 0.75rem; opacity: 0.85; display: block; }
.lang-tab.active { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Bandeau de contexte */
.ctx-banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
    background: var(--rev-light); border: 1px solid var(--rev-border); border-left: 6px solid var(--rev-primary);
    border-radius: 12px; padding: 14px 18px; margin-bottom: 20px;
}
.ctx-banner h1 { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--rev-dark); }
.ctx-banner p { margin: 2px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.ctx-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.ctx-stats div { text-align: center; }
.ctx-stats b { display: block; font-size: 1.35rem; color: var(--rev-dark); line-height: 1.1; }
.ctx-stats span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }

/* Pastille de langue (listes, chapitres, suivi) */
.lang-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 800; background: #fef3c7; color: #b45309;
}
.lang-pill.en { background: #dbeafe; color: #1d4ed8; }

/* ---- Barre d'outils de page ---- */
.page-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.page-tools .grow { flex: 1; min-width: 200px; }
.search-input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.92rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }

/* ---- Sections de chapitre ---- */
.ch-section { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.ch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--rev-light); border-bottom: 1px solid var(--rev-border); }
.ch-head h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--rev-dark); flex: 1; min-width: 160px; }
.ch-head.plain { background: var(--bg-main); border-bottom-color: var(--line); }
.ch-head.plain h3 { color: var(--text-muted); }
.ch-section table { margin: 0; }
.ch-section th { background: #fff; }
.ch-section td.title-cell strong { font-weight: 700; }
.ch-section td .sub { color: var(--text-muted); font-size: 0.78rem; display: block; }
.ch-section .col-check { width: 34px; }
.ch-section .col-check input { width: auto; margin: 0; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.empty-note { padding: 16px; color: var(--text-muted); font-size: 0.88rem; }
tr.hidden-by-search, .ch-section.hidden-by-search { display: none; }

/* Barre d'actions groupées (apparaît quand des listes sont cochées) */
.bulk-bar {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%);
    background: #0f172a; color: #fff; border-radius: 14px; padding: 10px 16px;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3); z-index: 200; max-width: calc(100vw - 24px);
    transition: transform 0.2s;
}
.bulk-bar.show { transform: translateX(-50%) translateY(0); }
.bulk-bar .count { font-weight: 800; margin-right: 6px; font-size: 0.88rem; }
.bulk-bar .btn { background: rgba(255,255,255,0.12); color: #fff; border-color: transparent; }
.bulk-bar .btn:hover { background: rgba(255,255,255,0.22); }
.bulk-bar .btn.danger { color: #fca5a5; background: rgba(239,68,68,0.15); }
.bulk-bar select { width: auto; padding: 6px 8px; font-size: 0.8rem; border-radius: 7px; }

/* Carte « espace » du tableau de bord */
.space-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.space-card { --c: #d97706; --cl: #fef3c7; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 14px; padding: 20px; }
.space-card[data-l="en"] { --c: #2563eb; --cl: #dbeafe; }
.space-card h2 { display: flex; align-items: center; gap: 8px; color: var(--c); margin-bottom: 14px; }
.space-card .mini-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.space-card .mini-stats div { flex: 1; min-width: 70px; background: var(--cl); border-radius: 10px; padding: 8px; text-align: center; }
.space-card .mini-stats b { display: block; font-size: 1.4rem; color: var(--c); }
.space-card .mini-stats span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.space-card .btn { background: var(--c); }

@media (max-width: 720px) {
    .ch-section table thead { display: none; }
    .ch-section tr { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line); }
    .ch-section td { display: inline-block; border: none; padding: 4px 6px; }
    .ch-section td.title-cell { display: block; }
}

/* =====================================================================
   POLISH v2 — espace professeur
   ===================================================================== */
body { background: #f4f6fb; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { max-width: 1180px; margin: 28px auto; padding: 0 24px; }
.container.narrow { max-width: 900px; }
h1, h2, h3 { letter-spacing: -0.01em; }

/* ---- Barre de navigation ---- */
header.teacher-topbar { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(15,23,42,0.04); }
.teacher-topbar-inner { max-width: 1180px; padding: 10px 24px; }
.teacher-brand { text-decoration: none; color: var(--text-dark); gap: 10px; }
.teacher-brand .brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-size: 1.2rem;
    background: linear-gradient(135deg, var(--rev-primary), var(--rev-dark)); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.teacher-brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; font-size: 1rem; }
.teacher-brand small { font-weight: 600; font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.teacher-nav { gap: 2px; }
.teacher-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; font-size: 0.86rem; }
.teacher-nav a .ni { font-size: 1rem; }
.teacher-nav a.active { background: var(--rev-light); color: var(--rev-dark); box-shadow: inset 0 0 0 1px var(--rev-border); }
@media (max-width: 860px) { .teacher-nav a .ni { display: none; } .teacher-brand small { display: none; } }

/* ---- En-tête de page ---- */
.page-head { margin-bottom: 22px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--rev-primary); }
.crumbs b { color: var(--text-dark); }
.page-head-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.page-head-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.6rem; flex: none;
    background: var(--rev-light); border: 1px solid var(--rev-border); }
.page-head h1 { margin: 0; font-size: 1.55rem; font-weight: 800; }
.page-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .ctx-stats { margin-left: auto; padding: 8px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }

/* ---- Cartes, boutons, formulaires ---- */
.card { border-radius: 16px; padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.03); }
.card > h2:first-child, .card-title { font-size: 1.05rem; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 800; }
.card-title .hint { font-weight: 500; font-size: 0.82rem; color: var(--text-muted); }
.btn { border-radius: 10px; padding: 9px 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.btn.secondary, .btn.danger { box-shadow: none; }
.btn.small { padding: 6px 12px; }
.btn.ghost { background: transparent; color: var(--text-muted); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--rev-light); color: var(--rev-dark); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=file], textarea, select { border-radius: 10px; }
.alert { border-radius: 12px; }
.badge { background: var(--rev-light); color: var(--rev-dark); }
.badge.muted { background: #f1f5f9; color: var(--text-muted); }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.warn { background: #fef3c7; color: #b45309; }

/* Chips de cours (nom + langue) */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 0.74rem; font-weight: 700;
    background: #f1f5f9; color: #334155; border: 1px solid var(--line); white-space: nowrap; }
.chip.nl { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.chip.en { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }

/* Interrupteur (publication d'une liste dans un cours) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; transition: background .15s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--rev-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Cartes de cours / classes */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tile { --c: var(--rev-primary); background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; padding: 18px;
    display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(15,23,42,0.04); transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: 0 10px 26px rgba(15,23,42,0.08); transform: translateY(-1px); }
.tile[data-l="nl"] { --c: #d97706; }
.tile[data-l="en"] { --c: #2563eb; }
.tile h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.tile h3 a { color: inherit; text-decoration: none; }
.tile h3 a:hover { color: var(--c); }
.tile .meta { display: flex; gap: 14px; color: var(--text-muted); font-size: 0.85rem; flex-wrap: wrap; }
.tile .meta b { color: var(--text-dark); }
.tile .tile-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.tile .tile-actions .btn:first-child { background: var(--c); }
.lang-section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 1.05rem; font-weight: 800; }
.lang-section-title:first-child { margin-top: 0; }
.lang-section-title .line { flex: 1; height: 1px; background: var(--line); }

/* Onglets de page (fiche cours) */
.tabs { gap: 2px; margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 11px 18px; white-space: nowrap; }

/* États vides */
.empty { text-align: center; padding: 34px 18px; color: var(--text-muted); }
.empty-icon { font-size: 2.2rem; margin-bottom: 6px; }
.empty p { margin: 0 0 14px; }

/* Tableaux */
table th { padding: 10px 14px; }
table td { padding: 12px 14px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
td.num, th.num { text-align: right; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    background: var(--rev-light); color: var(--rev-dark); font-weight: 800; font-size: 0.95rem; object-fit: cover; border: 2px solid var(--rev-border); }
.person { display: flex; align-items: center; gap: 10px; }
.person .sub { display: block; font-size: 0.76rem; color: var(--text-muted); }

/* Cases d'accès (fiche élève : cours suivis) */
.check-group { display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; margin: 0; font-weight: 600; }
.check-row:hover { border-color: var(--rev-primary); background: var(--rev-light); }
.check-row input { width: auto; margin: 0; }
.check-row .grow { flex: 1; }
.check-row.disabled { opacity: 0.55; cursor: default; }
details.pick { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
details.pick > summary { padding: 12px 16px; cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
details.pick > summary::-webkit-details-marker { display: none; }
details.pick > summary::before { content: "▸"; color: var(--text-muted); transition: transform .15s; }
details.pick[open] > summary::before { transform: rotate(90deg); }
details.pick .pick-body { padding: 4px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }

@media (max-width: 720px) {
    .container { padding: 0 14px; margin-top: 18px; }
    .page-head h1 { font-size: 1.25rem; }
    .ph-icon { width: 42px; height: 42px; font-size: 1.3rem; }
}

/* Tableau de bord : cours dans chaque carte de langue */
.space-card .mini-list { display: flex; flex-direction: column; gap: 4px; }
.space-card .mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px;
    background: var(--cl); text-decoration: none; color: var(--text-dark); font-weight: 700; font-size: 0.9rem; }
.space-card .mini-row:hover { filter: brightness(0.97); }
.space-card .mini-row .meta { font-weight: 500; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.space-card .space-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.space-card .btn.secondary { background: #fff; color: var(--text-dark); }
.bulk-bar .sep { width: 1px; height: 22px; background: rgba(255,255,255,.25); margin: 0 4px; }

/* =====================================================================
   SUIVI — carte de chaleur, indicateurs, fiche élève
   ===================================================================== */
.container.wide { max-width: 1480px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.kpi .kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; color: var(--text-muted); }
.kpi b { font-size: 2rem; line-height: 1.1; color: var(--text-dark); font-weight: 800; }
.kpi b small { font-size: 1rem; color: var(--text-muted); font-weight: 700; }
.kpi .kpi-sub { font-size: 0.8rem; color: var(--text-muted); }
.kpi.ok b { color: #059669; }
.kpi.alert { background: #fff7f7; border-color: #fecaca; }
.kpi.alert b { color: #dc2626; }
.kpi .progress-bar { margin-top: 6px; }

.sv-card { padding: 18px; }
.sv-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sv-filters .filter-field { min-width: 130px; }
.sv-filters .filter-field.grow { flex: 1; min-width: 200px; }
.sv-filters .filter-field label { margin: 0; }
.sv-filters select, .sv-filters .search-input { margin: 0; }

.sv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 0.76rem; color: var(--text-muted); }
.sv-legend .lg { font-style: normal; padding: 2px 9px; border-radius: 6px; font-weight: 700; }
.sv-legend .lg-note { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; }
.hm-dot { width: 22px; height: 6px; border-radius: 4px; background: rgba(15,23,42,.18); display: inline-block; }

/* Couleurs de la carte de chaleur */
.h-na, .lg.h0 { background: #f1f5f9; color: #94a3b8; }
.h0 { background: #f8fafc; color: #94a3b8; }
.h1 { background: #fee2e2; color: #b91c1c; }
.h2 { background: #ffedd5; color: #c2410c; }
.h3 { background: #fef9c3; color: #a16207; }
.h4 { background: #dcfce7; color: #15803d; }
.h5 { background: #bbf7d0; color: #166534; }
.lg.h0 { background: #f1f5f9; }

.sv-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sv-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.86rem; }
.sv-table th, .sv-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid #f1f5f9; vertical-align: middle; white-space: nowrap; }
.sv-table thead th { position: sticky; top: 0; background: #f8fafc; z-index: 3; font-size: 0.7rem; text-align: center; vertical-align: bottom; }
.sv-table thead tr.sv-groups th { top: 0; z-index: 4; }
.sv-table thead tr:not(.sv-groups) th { top: 34px; }
.sv-table thead:not(:has(.sv-groups)) tr th { top: 0; }
.sv-table th.sv-chapter { background: var(--rev-light); color: var(--rev-dark); font-size: 0.74rem; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--rev-border); }
.sv-table th.num, .sv-table td.num { text-align: right; }
.sv-sticky { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 210px; text-align: left !important; box-shadow: 1px 0 0 var(--line); }
.sv-table thead th.sv-sticky { z-index: 6; background: #f8fafc; }
.sv-table tfoot td { position: sticky; bottom: 0; background: #f8fafc; z-index: 2; font-size: 0.82rem; border-top: 2px solid var(--line); }
.sv-table tfoot td.sv-sticky { z-index: 5; }
.sv-table tbody tr:hover td:not(.hm) { background: #f8fafc; }
.sv-table tbody tr:hover td.hm { filter: brightness(0.97); }
.sv-col { min-width: 108px; max-width: 150px; white-space: normal !important; }
.sv-col-title { display: block; font-weight: 800; color: var(--text-dark); text-transform: none; letter-spacing: 0; font-size: 0.78rem; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; }
.sv-col .chip { font-size: 0.66rem; padding: 1px 7px; }
.sv-col-n { display: block; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin-top: 3px; font-size: 0.68rem; }

.sv-student { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 2px 0; cursor: pointer; font-family: inherit; text-align: left; width: 100%; }
.sv-student b { display: block; color: var(--text-dark); font-size: 0.88rem; }
.sv-student em { display: block; font-style: normal; font-size: 0.72rem; color: var(--text-muted); }
.sv-student:hover b { color: var(--rev-primary); text-decoration: underline; }
.sv-student .avatar { width: 34px; height: 34px; font-size: 0.85rem; }

td.hm { text-align: center; min-width: 100px; position: relative; padding-bottom: 12px; }
td.hm b { display: block; font-size: 0.95rem; line-height: 1.1; }
td.hm small { display: block; font-size: 0.68rem; opacity: .75; }
.hm-bar { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 4px; border-radius: 4px; background: rgba(15,23,42,.07); overflow: hidden; }
.hm-bar .t, .hm-bar .k { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.hm-bar .t { background: rgba(15,23,42,.22); }
.hm-bar .k { background: currentColor; opacity: .85; }
td.hm-avg { text-align: center; }
.sv-global { min-width: 130px; }
.sv-global-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.sv-global-top small { color: var(--text-muted); font-size: 0.72rem; }
.sv-global .progress-bar { height: 7px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; margin-right: 3px; }
.dot.ok { background: #10b981; } .dot.warn { background: #f59e0b; } .dot.idle { background: #ef4444; } .dot.never { background: #cbd5e1; }

/* Fiche élève (fenêtre) */
.sv-profile { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 6px 0 16px; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: conic-gradient(var(--rev-primary) calc(var(--p) * 1%), #e5e7eb 0); }
.ring span { width: 74px; height: 74px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; align-content: center; }
.ring b { font-size: 1.3rem; line-height: 1; } .ring small { display: block; font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.sv-profile-info { flex: 1; min-width: 240px; }
.sv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.sv-facts div { background: var(--bg-main); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.sv-facts span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.sv-facts b { font-size: 0.9rem; }
details.sv-ch { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
details.sv-ch > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
details.sv-ch > summary::-webkit-details-marker { display: none; }
details.sv-ch > summary::before { content: "▸"; color: var(--text-muted); transition: transform .15s; }
details.sv-ch[open] > summary::before { transform: rotate(90deg); }
.sv-ch-name { font-weight: 800; flex: 1; min-width: 100px; }
.sv-ch-bar { width: 130px; } .sv-ch-pct { font-size: 0.8rem; color: var(--text-muted); min-width: 92px; text-align: right; }
.sv-ch-body { padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.sv-list-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.sv-list-title .sub { font-weight: 500; color: var(--text-muted); font-size: 0.76rem; margin-left: 6px; }
.sv-dir { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.sv-dir .chip { min-width: 74px; justify-content: center; }
.hm-bar.wide { position: relative; flex: 1; left: 0; right: 0; bottom: 0; height: 8px; color: var(--rev-primary); }
.sv-dir-n { font-size: 0.8rem; min-width: 100px; text-align: right; color: var(--text-muted); }

/* Mots de passe dans le tableau d'une classe (visibles par défaut ; le bouton les masque via l'attribut hidden) */
.pwd-cell [hidden] { display: none !important; }
.pwd-cell .pwd-val { font-family: ui-monospace, Menlo, monospace; font-size: 0.9rem; background: #f1f5f9; padding: 2px 8px; border-radius: 6px; user-select: all; }
.pwd-cell .pwd-mask { color: var(--text-muted); letter-spacing: 1px; }
.pwd-unknown { color: var(--text-muted); cursor: help; }
.sv-ch-bar .progress-bar { display: block; height: 8px; }

/* =====================================================================
   ESPACE ÉLÈVE — body.student  (thème par langue : data-lang nl / en)
   ===================================================================== */
body.student { background: radial-gradient(1100px 480px at 8% -8%, var(--rev-light), transparent 62%), radial-gradient(900px 420px at 100% 0%, var(--rev-light), transparent 60%), #f7f8fc;
    min-height: 100vh; padding-bottom: 48px; }
body.student .container { max-width: 980px; margin: 26px auto 0; padding: 0 20px; }

/* Barre du haut */
.st-topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.st-topbar-inner { max-width: 980px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.st-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.st-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff;
    background: linear-gradient(135deg, var(--rev-primary), var(--rev-dark)); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.st-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-dark); font-weight: 800; font-size: .92rem;
    padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.st-back:hover { border-color: var(--rev-primary); color: var(--rev-primary); }
.st-title { flex: 1; min-width: 0; text-align: center; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-title small { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.st-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.st-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: var(--rev-dark);
    background: var(--rev-light); border: 2px solid var(--rev-border); object-fit: cover; }
.st-user-name { font-weight: 700; font-size: .9rem; }
.st-logout { font-size: .8rem; color: var(--text-muted); text-decoration: none; font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.st-logout:hover { background: #fee2e2; color: var(--danger); }
@media (max-width: 560px) { .st-user-name, .st-back span:last-child { display: none; } .st-back { padding: 8px 12px; } }

/* En-tête d'accueil */
.st-hero { background: linear-gradient(135deg, var(--rev-primary), var(--rev-dark)); color: #fff; border-radius: 22px; padding: 26px 28px; display: flex; gap: 22px;
    align-items: center; flex-wrap: wrap; box-shadow: 0 16px 36px -14px var(--rev-primary); position: relative; overflow: hidden; }
.st-hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.st-hero h1 { margin: 0; font-size: 1.7rem; font-weight: 800; }
.st-hero p { margin: 4px 0 0; opacity: .92; }
.st-hero-text { flex: 1; min-width: 220px; position: relative; z-index: 1; }
.st-hero-stats { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.st-hero-stat { background: rgba(255,255,255,.18); border-radius: 14px; padding: 10px 16px; text-align: center; min-width: 96px; }
.st-hero-stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.st-hero-stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .9; font-weight: 700; }

/* Choix de la langue */
.st-langs { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }
.st-lang { --c: #d97706; --cl: #fef3c7; display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 14px; text-decoration: none; font-weight: 800;
    background: #fff; color: var(--text-muted); border: 2px solid var(--line); transition: all .15s; }
.st-lang[data-l="en"] { --c: #2563eb; --cl: #dbeafe; }
.st-lang .f { font-size: 1.5rem; line-height: 1; }
.st-lang:hover { border-color: var(--c); color: var(--c); }
.st-lang.active { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 8px 18px -8px var(--c); }

/* Chapitres et cartes de liste */
.st-chapter { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 1.05rem; font-weight: 800; }
.st-chapter small { color: var(--text-muted); font-weight: 700; }
.st-chapter::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.st-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 26px -14px rgba(15,23,42,.18); transition: transform .15s, box-shadow .15s; }
.st-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -14px rgba(15,23,42,.28); }
.st-card.done { background: linear-gradient(180deg, #f0fdf4, #fff 55%); border-color: #bbf7d0; }
.st-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.st-card h3 { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.25; }
.st-card .desc { margin: -4px 0 0; color: var(--text-muted); font-size: .86rem; }
.st-status { font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: #f1f5f9; color: var(--text-muted); }
.st-status.progress { background: var(--rev-light); color: var(--rev-dark); }
.st-status.done { background: #dcfce7; color: #15803d; }
.st-parcours { display: flex; flex-direction: column; gap: 10px; }
.st-parc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-card.mixed .st-parc { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbff; }
.st-parc-main { flex: 1; min-width: 150px; }
.st-parc-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; margin-bottom: 6px; }
.st-parc-label .chip { font-size: .7rem; }
.st-bar { height: 10px; background: #e8ecf3; border-radius: 999px; overflow: hidden; }
.st-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--rev-primary), var(--rev-dark)); border-radius: 999px; transition: width .4s; }
.st-card.done .st-bar > span, .st-bar.full > span { background: linear-gradient(90deg, #34d399, #10b981); }
.st-parc-n { font-size: .78rem; color: var(--text-muted); margin-top: 5px; font-weight: 600; }
.st-go { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 12px; background: var(--rev-primary); color: #fff; font-weight: 800;
    text-decoration: none; font-size: .9rem; box-shadow: 0 6px 14px -6px var(--rev-primary); white-space: nowrap; }
.st-go:hover { background: var(--rev-dark); }
.st-go.again { background: #fff; color: var(--text-dark); border: 1px solid var(--line); box-shadow: none; }
.st-go.again:hover { border-color: var(--rev-primary); color: var(--rev-primary); }
.st-empty { text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: 18px; padding: 44px 20px; color: var(--text-muted); margin-top: 22px; }
.st-empty .big { font-size: 2.6rem; margin-bottom: 6px; }

/* Connexion (élève et professeur) : panneau de marque + formulaire */
body.auth { margin: 0; padding: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; background: #f7f8fc; }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 44px 52px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(155deg, var(--rev-primary), var(--rev-dark)); }
body.auth.teacher .auth-side { background: linear-gradient(155deg, #1e293b, #334155); }
.auth-side::before, .auth-side::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.auth-side::before { width: 420px; height: 420px; right: -160px; top: -140px; }
.auth-side::after { width: 300px; height: 300px; left: -120px; bottom: -110px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; font-weight: 800; font-size: 2rem; letter-spacing: -.02em; text-align: center; }
.auth-brand small { display: block; margin-top: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.auth-mark { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 28px; font-size: 3rem; background: rgba(255,255,255,.2); box-shadow: 0 20px 40px -18px rgba(0,0,0,.5); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-form-card { width: 100%; max-width: 400px; }
.auth-sites { position: absolute; left: 24px; right: 24px; bottom: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-sites-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.auth-sites-logos { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.auth-sites a { display: block; width: 96px; height: 96px; border-radius: 24px; overflow: hidden; border: 3px solid rgba(255,255,255,.85);
    box-shadow: 0 14px 28px -12px rgba(0,0,0,.55); transition: transform .18s, box-shadow .18s; }
.auth-sites a:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 20px 34px -12px rgba(0,0,0,.6); }
.auth-sites img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* écran peu haut : les logos passent sous la marque au lieu de se superposer */
@media (min-width: 861px) and (max-height: 700px) {
    .auth-side { flex-direction: column; gap: 34px; }
    .auth-sites { position: static; }
}
.auth-form-card h2 { margin: 0 0 6px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 24px; color: var(--text-muted); }
.auth-form-card label { margin: 16px 0 6px; }
.auth-form-card input[type=text], .auth-form-card input[type=password] { padding: 14px 16px; font-size: 1rem; border-radius: 12px; border-width: 1.5px; }
.auth-pw { position: relative; }
.auth-pw input { padding-right: 52px !important; }
.auth-pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 7px 9px; border-radius: 8px; }
.auth-pw button:hover { background: var(--bg-main); }
.auth-caps { margin-top: 8px; font-size: .8rem; font-weight: 700; color: #b45309; background: #fef3c7; padding: 6px 10px; border-radius: 8px; }
.auth-caps[hidden] { display: none; }
.auth-submit { width: 100%; margin-top: 26px; padding: 15px; border: none; border-radius: 14px; cursor: pointer; font-family: inherit; font-size: 1.05rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--rev-primary), var(--rev-dark)); box-shadow: 0 14px 24px -12px var(--rev-primary); transition: transform .1s, filter .15s; }
.auth-submit:hover { filter: brightness(1.07); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: .7; cursor: default; }
.auth-alt { margin: 22px 0 0; text-align: center; font-size: .88rem; }
.auth-alt a { color: var(--text-muted); font-weight: 700; text-decoration: none; }
.auth-alt a:hover { color: var(--rev-primary); text-decoration: underline; }
.auth-form-card .alert { margin: 0 0 6px; }

@media (max-width: 860px) {
    body.auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-side { padding: 18px 20px; justify-content: flex-start; gap: 12px; }
    .auth-brand { flex-direction: row; gap: 12px; font-size: 1.15rem; text-align: left; }
    .auth-mark { width: 44px; height: 44px; border-radius: 14px; font-size: 1.4rem; box-shadow: none; }
    .auth-brand small { margin-top: 0; font-size: .7rem; }
    .auth-sites { position: static; margin-left: auto; }
    .auth-sites-label { display: none; }
    .auth-sites-logos { gap: 10px; flex-wrap: nowrap; }
    .auth-sites a { width: 46px; height: 46px; border-radius: 13px; border-width: 2px; }
    .auth-main { align-items: flex-start; padding-top: 26px; }
    .auth-form-card h2 { font-size: 1.45rem; }
}

/* Révision */
.rv-progress { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.rv-progress .rv-bar { flex: 1; min-width: 180px; }
.rv-progress .rv-count { font-weight: 800; white-space: nowrap; }
.rv-progress .rv-count small { color: var(--text-muted); font-weight: 600; }
.rv-stage { max-width: 680px; margin: 22px auto 0; }
.rv-card { background: #fff; border: 2px solid transparent; border-radius: 26px; padding: 34px 30px 28px; text-align: center; position: relative;
    box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 24px 50px -24px rgba(15,23,42,.3); transition: border-color .2s, background .2s; }
.rv-card.ok { border-color: #34d399; background: linear-gradient(180deg, #f0fdf4, #fff 60%); }
.rv-card.ko { border-color: #f87171; background: linear-gradient(180deg, #fef2f2, #fff 60%); animation: rv-shake .4s; }
@keyframes rv-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.rv-meta { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 700; font-size: .9rem; flex-wrap: wrap; }
.rv-prompt { font-size: clamp(2rem, 7vw, 3.1rem); font-weight: 800; color: var(--rev-dark); margin: 14px 0 6px; line-height: 1.15; word-break: break-word; }
.rv-pips { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 8px 0 20px; color: var(--text-muted); font-size: .8rem; font-weight: 600; flex-wrap: wrap; }
.rv-pip { width: 13px; height: 13px; border-radius: 50%; background: #e2e8f0; transition: background .2s, transform .2s; }
.rv-pip.on { background: var(--rev-primary); transform: scale(1.1); }
.rv-card.ok .rv-pip.on { background: #10b981; }
.rv-input { width: 100%; max-width: 440px; padding: 16px 18px; font-size: 1.3rem; text-align: center; border: 2px solid var(--line); border-radius: 16px; font-family: inherit; background: #fff; }
.rv-input:focus { outline: none; border-color: var(--rev-primary); box-shadow: 0 0 0 4px var(--rev-light); }
.rv-input:disabled { background: #f8fafc; color: var(--text-dark); }
.rv-actions { margin-top: 20px; }
.rv-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 200px; padding: 14px 28px; border: none; border-radius: 14px; cursor: pointer; font-family: inherit;
    font-size: 1.05rem; font-weight: 800; color: #fff; background: var(--rev-primary); box-shadow: 0 10px 20px -10px var(--rev-primary); }
.rv-submit:hover { background: var(--rev-dark); }
.rv-submit:disabled { opacity: .6; cursor: default; }
.rv-feedback { margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-weight: 700; font-size: 1rem; text-align: left; }
.rv-feedback.ok { background: #dcfce7; color: #166534; }
.rv-feedback.ko { background: #fee2e2; color: #991b1b; }
.rv-feedback .answer { display: block; margin-top: 6px; font-size: 1.35rem; color: var(--text-dark); font-weight: 800; }
.rv-feedback .yours { display: block; font-weight: 600; font-size: .85rem; opacity: .85; text-decoration: line-through; }
.rv-days { margin-top: 12px; color: var(--text-muted); font-size: .82rem; }
.rv-session { text-align: center; color: var(--text-muted); font-size: .82rem; margin-top: 14px; font-weight: 600; }
.rv-done { text-align: center; padding: 42px 26px; }
.rv-done .big { font-size: 3.4rem; }
.rv-done h2 { margin: 8px 0; font-size: 1.6rem; }
.rv-done p { color: var(--text-muted); margin: 0 0 20px; }
.rv-done .st-go { margin: 4px; }
.confetti { position: fixed; top: -20px; font-size: 1.4rem; z-index: 100; pointer-events: none; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .rv-card.ko { animation: none; } }
