/* EVM – École Virtuelle de Mauritanie · Feuille de style principale (mobile d'abord, FR/AR RTL) */

@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 800; font-display: swap; src: url("../fonts/figtree-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); }

:root {
  --ink: #13203A;
  --ink-2: #1F2E4D;
  --muted: #556079;
  --line: #E3E7EF;
  --line-strong: #C9D1DF;
  --ground: #F4F6FA;
  --surface: #FFFFFF;
  --blue: #0A5CA8;
  --blue-dark: #08427A;
  --blue-soft: #E6F0FA;
  --green: #2E7D1F;
  --green-ink: #2E5A1F;
  --green-soft: #E8F5E1;
  --orange: #B4530A;
  --orange-ink: #8A3E06;
  --orange-soft: #FDEEDF;
  --red: #A61C31;
  --red-ink: #5A1220;
  --red-soft: #FBE4E7;
  --yellow: #F5B400;
  --brand-red: #C8233B;
  --brand-green: #4FA82A;
  --brand-orange: #F07D1A;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 32, 58, .06), 0 4px 16px rgba(19, 32, 58, .06);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Figtree", system-ui, sans-serif;
  --topbar-h: 64px;
  --bottomnav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1, .h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.h2 { font-size: 20px; font-weight: 800; }
.h3 { font-size: 17px; font-weight: 800; }
p { margin: 0; }
code { font-size: .9em; background: var(--ground); padding: 1px 6px; border-radius: 6px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.icon { flex: none; }

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Bandeau de marque ---------- */
.brand-stripe { display: flex; height: 6px; }
.brand-stripe span { flex: 1; }
.brand-stripe span:nth-child(1) { background: var(--brand-red); }
.brand-stripe span:nth-child(2) { background: var(--blue); }
.brand-stripe span:nth-child(3) { background: var(--brand-green); }
.brand-stripe span:nth-child(4) { background: var(--brand-orange); }
.brand-stripe span:nth-child(5) { background: var(--yellow); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled, .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-ink); color: #fff; }
.btn-accent { background: var(--yellow); color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn-dark { background: transparent; border-color: transparent; color: #fff; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
select.input { padding-inline-end: 8px; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 14px; font-weight: 600; }
.input-group { position: relative; }
.input-group .input { padding-inline-end: 52px; }
.input-addon {
  position: absolute; inset-inline-end: 2px; top: 2px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }

/* ---------- Cartes, grilles, listes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.badge {
  display: inline-flex; align-items: center; border-radius: 6px; padding: 3px 8px;
  font-size: 12px; font-weight: 700;
}
.badge-blue { color: var(--blue); background: var(--blue-soft); }
.badge-green { color: var(--green-ink); background: var(--green-soft); }
.badge-orange { color: var(--orange-ink); background: var(--orange-soft); }
.badge-red { color: var(--red-ink); background: var(--red-soft); }
.dl { margin: 0; display: flex; flex-direction: column; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; font-weight: 600; text-align: end; }
html[dir="rtl"] .dl dd[dir="ltr"] { text-align: left; }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-main { display: flex; flex-direction: column; min-width: 0; }

.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 15px; text-decoration: none;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .badge { margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
}
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-orange .stat-icon { background: var(--orange-soft); color: var(--orange); }
.stat-red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-ink .stat-icon { background: var(--ink); color: #fff; }

/* ---------- Alertes ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 12px; font-size: 15px; font-weight: 600;
}
.alert .icon { margin-top: 1px; }
.alert-text { flex: 1; }
.alert-success { background: var(--green-soft); color: var(--green-ink); }
.alert-error { background: var(--red-soft); color: var(--red-ink); }
.alert-warning { background: var(--orange-soft); color: var(--orange-ink); }
.alert-info { background: var(--blue-soft); color: var(--blue-dark); }
.alert-close {
  width: 32px; height: 32px; margin: -6px; margin-inline-start: 0; border: 0; background: transparent;
  color: inherit; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px;
}
.content > .alert, .login > .alert { margin-bottom: 14px; }

/* ---------- Pages visiteurs (connexion, installation, erreurs) ---------- */
.guest { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.guest-top { display: flex; justify-content: flex-end; padding: 14px 20px 0; }
.guest-main { width: 100%; max-width: 460px; margin: 0 auto; padding: 8px 20px calc(110px + var(--safe-bottom)); flex: 1; }
.install-main { max-width: 720px; display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-bottom: 20px; }
.login-brand img { width: 150px; }
.login-brand h1 { font-size: 22px; }
.login-card { display: flex; flex-direction: column; gap: 16px; }
.error-page { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-top: 24px; }
.error-code { font-size: 56px; font-weight: 800; color: var(--blue); line-height: 1; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.checklist .ok .icon { color: var(--green); }
.checklist .ko { color: var(--red); font-weight: 700; }

/* ---------- Sélecteur de langue ---------- */
.lang-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-btn {
  min-width: 44px; height: 38px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink); font: 700 14px var(--font); cursor: pointer;
}
.lang-btn-ar { font-family: var(--font-ar); font-size: 17px; font-weight: 600; }
.lang-btn[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ---------- Gabarit connecté ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.topbar-brand img { width: 48px; }
.topbar-titles { display: flex; flex-direction: column; min-width: 0; }
.topbar-kicker { font-size: 12px; color: var(--muted); }
.topbar-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .lang-switch { flex: none; }
.topbar .lang-btn { min-width: 40px; height: 36px; }

.shell { display: flex; }
.sidebar { display: none; }
.content {
  flex: 1; min-width: 0; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 18px 16px calc(var(--bottomnav-h) + 24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.page-head { display: flex; flex-direction: column; gap: 4px; }
.account-logout { margin-top: 4px; }

.bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  display: flex; height: calc(var(--bottomnav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav-link {
  flex: 1; min-width: 0; text-align: center; padding: 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
}
.bottomnav-link[aria-current="page"] { color: var(--blue); font-weight: 800; }

/* ---------- Bannières PWA ---------- */
.offline-bar {
  position: fixed; top: 0; inset-inline: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; background: var(--yellow); color: var(--ink); font-size: 14px; font-weight: 700;
}
.offline-bar.is-online { background: var(--green); color: #fff; }
.pwa-banner {
  position: fixed; inset-inline: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--ink); color: #fff; border-radius: 16px; box-shadow: var(--shadow);
}
.app .pwa-banner { bottom: calc(var(--bottomnav-h) + 10px + var(--safe-bottom)); }
.pwa-banner-logo { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; }
.pwa-banner-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: var(--line-strong); }
.pwa-banner-text strong { color: #fff; font-size: 14px; }

/* ---------- Modales et notifications (remplacent alert/confirm) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(19, 32, 58, .55);
  display: flex; align-items: flex-end; justify-content: center;
  animation: evm-fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px;
  animation: evm-up .18s ease-out;
}
.modal-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); }
.modal-danger .modal-icon { background: var(--red-soft); color: var(--red); }
.modal-title { font-size: 19px; font-weight: 800; }
.modal-body { color: var(--muted); font-size: 15px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.toast-stack {
  position: fixed; inset-inline: 12px; top: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast-stack .alert { width: 100%; max-width: 480px; box-shadow: var(--shadow); pointer-events: auto; animation: evm-fade .2s ease-out; }
@keyframes evm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes evm-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-backdrop, .modal, .toast-stack .alert { animation: none; } }

/* ---------- Utilitaires ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .02em; }
.print-only { display: none; }
html[dir="rtl"] .icon-flip .icon { transform: scaleX(-1); }
.icon-flip { display: inline-flex; color: var(--muted); }

/* ---------- En-têtes de page, formulaires ---------- */
.page-head-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; align-self: flex-start; }
html[dir="rtl"] .back-link .icon { transform: scaleX(-1); }
.form-narrow { max-width: 640px; width: 100%; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.form-actions-start { justify-content: flex-start; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 28px 18px; }
.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-green { background: var(--green-soft); color: var(--green); }
.icon-btn-danger { color: var(--red); }
.icon-btn-danger:hover { background: var(--red-soft); border-color: var(--red-soft); }

/* ---------- Barre d'outils des listes ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; }
.toolbar-search { display: flex; flex-wrap: wrap; gap: 8px; }
.search-field { position: relative; flex: 1 1 220px; }
.search-field .input { padding-inline-start: 42px; }
.search-icon { position: absolute; inset-inline-start: 13px; top: 14px; color: var(--muted); display: flex; }
.field-inline { flex: 1 1 150px; }
.field-date { display: flex; flex-direction: column; gap: 2px; }
.field-date label { font-size: 12px; color: var(--muted); font-weight: 600; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar .btn { min-height: 48px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pagination-links { display: flex; gap: 8px; }

/* ---------- Tableaux (cartes sur mobile) ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1.5px solid var(--line-strong); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.th-sort:hover { color: var(--ink); }
.who { display: flex; align-items: center; gap: 10px; }
.cell-detail { font-size: 13px; color: var(--muted); max-width: 360px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

@media screen and (max-width: 759px) {
  .table-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; margin-bottom: 10px; }
  table.data td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: end; }
  table.data td::before { content: attr(data-label); font-size: 13px; font-weight: 600; color: var(--muted); text-align: start; flex: none; }
  table.data td.cell-main { justify-content: flex-start; text-align: start; padding-top: 10px; }
  .who { width: 100%; }
  table.data td.cell-main::before, table.data td.cell-actions::before { display: none; }
  table.data td.cell-actions { border-bottom: 0; }
  table.data td.mono::before { font-family: var(--font); letter-spacing: 0; }
  html[lang="ar"] table.data td.mono::before { font-family: var(--font-ar); }
  .row-actions { width: 100%; justify-content: flex-start; }
  .cell-detail { max-width: none; }
}

/* ---------- Années scolaires ---------- */
.terms-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.term { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.term legend { font-weight: 800; padding: 0 6px; }

/* ---------- Tableaux de bord ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 8px; border-bottom: 1px solid var(--line-strong); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 100%; max-width: 44px; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar.is-today { background: var(--ink); }
.bar-value { font-size: 12px; color: var(--muted); font-weight: 600; }
.bar-value.is-today, .bar-label.is-today { color: var(--ink); font-weight: 800; }
.bar-label { font-size: 12px; color: var(--muted); margin-bottom: -26px; height: 20px; }
.bars { margin-bottom: 26px; }
.bar-h-0 { height: 3px; } .bar-h-1 { height: 7px; } .bar-h-2 { height: 14px; } .bar-h-3 { height: 21px; } .bar-h-4 { height: 28px; }
.bar-h-5 { height: 35px; } .bar-h-6 { height: 42px; } .bar-h-7 { height: 49px; } .bar-h-8 { height: 56px; } .bar-h-9 { height: 63px; }
.bar-h-10 { height: 70px; } .bar-h-11 { height: 77px; } .bar-h-12 { height: 84px; } .bar-h-13 { height: 91px; } .bar-h-14 { height: 98px; }
.bar-h-15 { height: 105px; } .bar-h-16 { height: 112px; } .bar-h-17 { height: 119px; } .bar-h-18 { height: 126px; } .bar-h-19 { height: 133px; } .bar-h-20 { height: 140px; }

/* ---------- Menu « Plus » ---------- */
.more-list { padding: 4px 0; display: flex; flex-direction: column; }
.more-link { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 18px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.more-link:last-child { border-bottom: 0; }
.more-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.more-label { flex: 1; }

/* ---------- Fiche d'identifiants ---------- */
.credentials-sheet { max-width: 560px; width: 100%; }
.credentials-head { display: flex; align-items: center; gap: 12px; }
.credentials-head > div { display: flex; flex-direction: column; }
.credentials-pass { font-size: 20px; color: var(--blue-dark); }

/* ---------- Lot 3 : enseignant ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-orange { background: var(--orange-soft); color: var(--orange-ink); }
.avatar-red { background: var(--red-soft); color: var(--red); }
.fieldset-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset-plain legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.check-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 8px; }
.check-item { padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 52px; }
.check-item:last-child { border-bottom: 0; }
.input-file { padding: 10px 12px; min-height: 52px; }
.header-preview { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.header-preview img { width: 90px; height: auto; max-height: 70px; object-fit: contain; }
.header-preview-text { display: flex; flex-direction: column; gap: 2px; }
.header-preview-text strong { font-size: 18px; }
.header-preview-text span { color: var(--muted); font-size: 14px; }
.credentials-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.credentials-head img { width: 72px; height: auto; max-height: 56px; object-fit: contain; }
@media (min-width: 960px) { .credentials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link .stat { height: 100%; transition: border-color .15s; }
.stat-link:hover .stat { border-color: var(--blue); }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; min-height: 44px; }
.quick-icon { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.quick:hover, .more-link:hover, .stat-link:hover, .topbar-brand:hover { color: var(--ink); }
.quick:hover .quick-icon { filter: brightness(.95); }
.qi-blue { background: var(--blue-soft); color: var(--blue); }
.qi-orange { background: var(--orange-soft); color: var(--orange); }
.qi-green { background: var(--green-soft); color: var(--green); }
.qi-red { background: var(--red-soft); color: var(--red); }
.qi-ink { background: var(--ink); color: #fff; }
@media (min-width: 640px) { .quick-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- Lot 4 : cours et fiches ---------- */
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input-lg { font-size: 18px; font-weight: 700; }
.label { font-size: 14px; font-weight: 600; }
.btn-text-danger { color: var(--red); }
.btn-text-danger:hover { color: var(--red-ink); border-color: var(--red); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .input { flex: 1 1 220px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--line); border-radius: 12px; padding: 4px; }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(19, 32, 58, .12); }
.segment input:focus-visible + span { outline: 3px solid var(--yellow); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0 14px 0 10px; background: var(--surface); }
.check-chip:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }

.course-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.course-card { display: flex; flex-direction: column; gap: 6px; }
.course-card .icon { vertical-align: -3px; }
.course-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.course-link { color: var(--ink); text-decoration: none; }
.course-link::after { content: ""; position: absolute; inset: 0; }
.course-card { position: relative; }
.course-card:has(.course-link:hover), .course-card-link:hover { border-color: var(--blue); }
.course-card-link { text-decoration: none; color: var(--ink); }
.course-card-link:hover { color: var(--ink); }

.chapter-head { display: flex; align-items: center; gap: 12px; }
.chapter-num { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.chapter-title { flex: 1; min-width: 0; }
details > summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details[open] > summary { margin-bottom: 8px; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lesson-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.lesson-main { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 600; }
.lesson-main:hover { color: var(--blue); }
.lesson-main .icon { color: var(--blue); }
.lesson-title { flex: 1; min-width: 0; }
.row-actions .icon-btn:disabled { opacity: .35; cursor: default; }

.editor-wrap { border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.editor-wrap .ql-toolbar.ql-snow { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.editor-wrap .ql-container.ql-snow { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar-h); z-index: 5; background: var(--surface); padding: 6px; }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 17px; min-height: 340px; }
.editor-wrap .ql-editor { min-height: 340px; line-height: 1.65; }
.editor-wrap .ql-editor:focus, .editor-wrap .ql-editor:focus-visible { outline: none; }
.editor-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.editor-wrap .ql-toolbar button { width: 36px; height: 36px; padding: 6px; }
.editor-wrap .ql-snow .ql-picker { height: 36px; }
.editor-actions { align-items: center; }
.editor-actions [data-editor-status] { margin-inline-end: auto; }
html[lang="fr"] .ql-snow .ql-tooltip::before { content: "Ouvrir le lien :"; }
html[lang="fr"] .ql-snow .ql-tooltip[data-mode=link]::before { content: "Adresse du lien :"; }
html[lang="fr"] .ql-snow .ql-tooltip[data-mode=formula]::before { content: "Formule (LaTeX) :"; }
html[lang="fr"] .ql-snow .ql-tooltip a.ql-action::after { content: "Modifier"; }
html[lang="fr"] .ql-snow .ql-tooltip a.ql-remove::before { content: "Retirer"; }
html[lang="fr"] .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Valider"; }
html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-label::before, html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Texte"; }
html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Titre"; }
html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, html[lang="fr"] .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Sous-titre"; }
html[lang="ar"] .ql-snow .ql-tooltip::before { content: "فتح الرابط:"; }
html[lang="ar"] .ql-snow .ql-tooltip[data-mode=link]::before { content: "عنوان الرابط:"; }
html[lang="ar"] .ql-snow .ql-tooltip[data-mode=formula]::before { content: "الصيغة (LaTeX):"; }
html[lang="ar"] .ql-snow .ql-tooltip a.ql-action::after { content: "تعديل"; }
html[lang="ar"] .ql-snow .ql-tooltip a.ql-remove::before { content: "إزالة"; }
html[lang="ar"] .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "تأكيد"; }
html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-label::before, html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "نص"; }
html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "عنوان"; }
html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, html[lang="ar"] .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "عنوان فرعي"; }
html[dir="rtl"] .editor-wrap .ql-toolbar { direction: ltr; }

.lesson-kicker { margin: 0; }
.lesson-card { padding: 22px 20px; }
.lesson-content.ql-editor { padding: 0; font-size: 17px; line-height: 1.7; color: var(--ink); overflow: visible; height: auto; font-family: inherit; }
.lesson-content h1, .lesson-content h2 { font-size: 22px; margin: 18px 0 8px; }
.lesson-content h3 { font-size: 19px; margin: 14px 0 6px; }
.lesson-content p { margin: 0 0 10px; }
.lesson-content img, .editor-wrap .ql-editor img { display: block; max-width: 100%; height: auto; margin: 10px auto; border-radius: 8px; }
.lesson-content blockquote { border-inline-start: 4px solid var(--blue); background: var(--blue-soft); margin: 12px 0; padding: 10px 14px; border-radius: 0 8px 8px 0; }
.lesson-content .ql-formula { font-size: 1.05em; }
.lesson-content a { word-break: break-word; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; }
.lesson-nav-link { flex: 1 1 0; max-width: 48%; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.lesson-nav-link:hover { border-color: var(--blue); color: var(--ink); }
.lesson-nav-next { text-align: end; }
.file-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.file-pdf { background: var(--red-soft); color: var(--red); }
.file-img { background: var(--green-soft); color: var(--green); }
progress.quota { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress.quota::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress.quota::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
progress.quota::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.toc ol { margin: 6px 0 0; padding-inline-start: 22px; }
.toc li { margin: 2px 0; }
.print-chapter { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.print-lesson { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) { .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Tablette et ordinateur ---------- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .terms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
  .toolbar-search { flex: 1 1 480px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding-bottom: 22px; }
  .pwa-banner { inset-inline: auto 20px; max-width: 420px; }
  html[dir="rtl"] .pwa-banner { inset-inline: 20px auto; }
}
@media (min-width: 960px) {
  :root { --topbar-h: 68px; }
  h1, .h1 { font-size: 28px; }
  .topbar { padding: 0 24px; }
  .sidebar {
    display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
    width: 248px; flex: none; padding: 18px 14px;
    position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
    background: var(--ink);
  }
  .sidenav { display: flex; flex-direction: column; gap: 4px; }
  .sidenav-link {
    display: flex; align-items: center; gap: 12px; min-height: 44px; width: 100%; padding: 0 12px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--line); font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  }
  .sidenav-link:hover { background: var(--ink-2); color: #fff; }
  .sidenav-link[aria-current="page"] { background: var(--blue); color: #fff; font-weight: 700; }
  .content { padding: 28px 32px 40px; }
  .bottomnav { display: none; }
  .app .pwa-banner { bottom: 20px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- Lot 5 : banque de questions & évaluations ---------------- */
.form-wide { max-width: 880px; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.type-card { position: relative; display: block; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.type-card-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); line-height: 1.3; }
.type-card-body strong { font-size: 14px; }
.type-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ground); color: var(--muted); }
.type-card input:checked + .type-card-body { border-color: var(--blue); background: var(--blue-soft); }
.type-card input:checked + .type-card-body .type-card-icon { background: var(--blue); color: #fff; }
.type-card input:focus-visible + .type-card-body { outline: 3px solid var(--yellow); outline-offset: 2px; }

.editor-compact .ql-container.ql-snow, .editor-compact .ql-editor { min-height: 160px; }
.editor-small .ql-container.ql-snow, .editor-small .ql-editor { min-height: 96px; }

.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; }
.option-row .option-correct { grid-column: 2; min-height: 36px; font-size: 14px; color: var(--muted); }
@media (min-width: 640px) {
  .option-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .option-row .option-correct { grid-column: auto; }
}
.option-letter { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ground); font-weight: 700; color: var(--ink-2); }
.option-row:has([data-correct]:checked) .option-letter { background: var(--green); color: #fff; }
.option-row:has([data-correct]:checked) .option-correct { color: var(--green-ink); font-weight: 600; }

.setting-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; }
.setting-row > .check { flex: 1 1 260px; }
.field-inline-sm { flex: 0 0 160px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.instructions { margin: 12px 0 0; padding: 10px 14px; border-inline-start: 4px solid var(--blue); background: var(--blue-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: normal; }
html[dir="rtl"] .instructions { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.total-points { font-size: 15px; color: var(--blue-dark); white-space: nowrap; }
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q-item { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.q-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.q-num { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; }
.q-points { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.input-points { width: 72px; min-height: 38px; padding: 4px 8px; text-align: center; }
.q-statement { padding: 8px 0 0 !important; font-size: 15px; }
.q-statement p { margin: 0 0 4px; }
.q-item .row-actions { justify-content: flex-end; }

.cell-statement { min-width: 260px; }
.stmt { display: flex; flex-direction: column; min-width: 0; }
.stmt a { overflow-wrap: anywhere; }
.check-list-tall { max-height: 460px; }

/* Sujet / corrigé imprimable */
.print-exam { max-width: 880px; }
.exam-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.exam-title { flex: 1 1 280px; min-width: 0; }
.exam-title h1 { margin: 2px 0 4px; }
.exam-kind { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.exam-identity { flex: 0 1 300px; margin: 0; display: grid; gap: 6px; }
.exam-identity div { display: grid; grid-template-columns: 110px 1fr; align-items: end; gap: 8px; }
.exam-identity dt { font-size: 13px; color: var(--muted); }
.exam-identity dd { margin: 0; min-height: 22px; border-bottom: 1px dotted var(--ink); }
.exam-identity .exam-mark { text-align: end; font-weight: 700; border-bottom: 0; }
.exam-questions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.exam-q { break-inside: avoid; }
.exam-q-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.exam-q-pts { font-weight: 600; color: var(--muted); white-space: nowrap; }
.exam-stmt { padding: 8px 0 4px !important; }
.exam-hint { margin: 0 0 4px; font-style: italic; }
.exam-options { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.exam-options li { display: flex; align-items: baseline; gap: 8px; }
.exam-options-inline { flex-direction: row; gap: 32px; }
.exam-options .box { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 3px; font-weight: 700; line-height: 1; transform: translateY(3px); }
.exam-options .option-letter { width: auto; height: auto; background: none; border-radius: 0; }
.exam-options .is-correct { color: var(--green-ink); font-weight: 600; }
.exam-options .is-correct .box { background: var(--green); border-color: var(--green); color: #fff; }
.answer-lines { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.answer-lines span { display: block; height: 30px; border-bottom: 1px dotted var(--line-strong); }
.exam-answer { margin-top: 8px; padding: 8px 12px; border-inline-start: 4px solid var(--green); background: var(--green-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
html[dir="rtl"] .exam-answer { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.exam-answer p { margin: 0 0 4px; }
.exam-explanation .lesson-content { padding: 4px 0 0 !important; }
.q-statement img { max-height: 160px; width: auto; margin: 6px 0; }
.stack > .toolbar-search { flex: 0 0 auto; align-items: center; }

/* ---------------- Lot 6 : espace élève – évaluations ---------------- */
.badge-gray { color: var(--muted); background: var(--ground); }
.grow { flex: 1 1 auto; }
.test-section { margin-bottom: 20px; }
.test-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.test-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.test-card:hover { border-color: var(--blue); }
.test-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.test-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.test-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.test-when { color: var(--ink-2); font-weight: 600; }
.test-score { font-size: 22px; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.test-score small, .result-score small { font-size: .5em; color: var(--muted); font-weight: 600; }
.test-score-sm { font-weight: 800; color: var(--blue-dark); white-space: nowrap; }

.take-bar { position: sticky; top: var(--topbar-h); z-index: 6; display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.take-bar-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.take-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.take-timer { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.take-timer-soft { font-size: 13px; font-weight: 600; background: var(--ground); color: var(--ink-2); }
.take-timer.is-urgent { background: var(--red); color: #fff; animation: evm-pulse 1s ease-in-out infinite; }
@keyframes evm-pulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .take-timer.is-urgent { animation: none; } }
.save-ok { color: var(--green-ink); }
.save-warn { color: var(--orange-ink); font-weight: 600; }
.save-error { color: var(--red); font-weight: 600; }

.take-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.take-q { border-inline-start: 4px solid var(--line-strong); }
.take-q.is-answered { border-inline-start-color: var(--blue); }
.take-q.is-right { border-inline-start-color: var(--green); }
.take-q.is-partial, .take-q.is-pending { border-inline-start-color: var(--orange); }
.take-q.is-wrong { border-inline-start-color: var(--red); }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.choices-inline { flex-direction: row; flex-wrap: wrap; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 16px; }
.choices-inline .choice { flex: 1 1 140px; justify-content: center; font-weight: 600; }
.choice input { flex: none; width: 22px; height: 22px; accent-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.input-numeric { max-width: 220px; }
.file-answer { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.file-answer[aria-busy="true"] { opacity: .6; pointer-events: none; }
.file-current { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ground); max-width: 100%; }
.file-current a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick { cursor: pointer; }
.file-pick:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }
.take-end { margin-top: 4px; }

.result-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.result-score { font-size: 48px; font-weight: 800; color: var(--blue-dark); line-height: 1.1; }
.result-wait { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--orange-ink); }
.your-answer { margin: 6px 0 0; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.exam-options .is-chosen { font-weight: 700; }
.option-tag { font-size: 12px; font-weight: 700; color: var(--green-ink); background: var(--green-soft); border-radius: 999px; padding: 1px 8px; }
.mark { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; font-weight: 700; font-size: 14px; }
.mark-right { color: var(--green-ink); }
.mark-partial, .mark-pending { color: var(--orange-ink); }
.mark-wrong { color: var(--red); }
.teacher-comment { margin: 8px 0 0; padding: 8px 12px; background: var(--ground); border-radius: var(--radius-sm); }
.result-list .exam-options .is-correct .box { background: none; border-color: var(--ink); color: var(--ink); }
.result-list .exam-options .is-correct { color: var(--green-ink); }
.take-q .exam-stmt img { max-height: 280px; width: auto; }

/* ---------------- Lot 7 : copies, carnet de notes, bulletins ---------------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: 14px; }
.tab[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab-count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--ground); color: var(--ink-2); font-size: 12px; }
.tab[aria-current="page"] .tab-count { background: rgba(255, 255, 255, .2); color: #fff; }
a.badge { text-decoration: none; }

.copy-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.copy-score strong { font-size: 32px; line-height: 1; color: var(--blue-dark); }
.copy-score small { font-size: .5em; color: var(--muted); }
.copy-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.grade-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
@media (min-width: 640px) { .grade-row { grid-template-columns: 200px 1fr; } }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.answer-text { margin: 4px 0 0; padding: 10px 12px; background: var(--ground); border-radius: var(--radius-sm); font-weight: 500; }
.answer-image { display: block; max-width: 100%; max-height: 420px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

.book-filters { align-items: flex-end; margin-bottom: 12px; }
.book-filters label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.book-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .book-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-mini { display: flex; flex-direction: column; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stat-mini strong { font-size: 20px; }
.book-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.book-wrap:focus-visible { outline: 3px solid var(--yellow); }
.book { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.book th, .book td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.book thead th { background: var(--ground); vertical-align: bottom; font-weight: 700; }
.book .book-name { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); text-align: start; min-width: 150px; max-width: 220px; white-space: normal; border-inline-end: 1px solid var(--line); }
.book thead .book-name { background: var(--ground); z-index: 2; }
.book-col a { color: var(--ink); text-decoration: none; }
.book-col a:hover { color: var(--blue); }
.book-cell sup { font-size: 10px; color: var(--orange-ink); margin-inline-start: 2px; }
.book .is-low { color: var(--red); }
.book-state { color: var(--muted); font-size: 12px; font-weight: 700; }
.cell-pending .book-state, .cell-unpublished .book-state { color: var(--orange-ink); }
.cell-missing .book-state { color: var(--red); }
.book-avg { background: var(--blue-soft); font-weight: 700; }
.book tfoot th, .book tfoot td { background: var(--ground); font-size: 13px; color: var(--ink-2); }
.book-legend { margin: 8px 0 16px; }
.segment-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.segment-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(19, 32, 58, .12); }

.report-stack { display: flex; flex-direction: column; gap: 16px; }
.report-sheet { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.report-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.report-head img { width: 56px; height: auto; }
.report-school { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.report-kind { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.report-kind strong { font-size: 18px; text-transform: uppercase; letter-spacing: .03em; }
.report-id { margin: 0; display: grid; grid-template-columns: 1fr; gap: 4px 20px; }
@media (min-width: 640px) { .report-id { grid-template-columns: 1fr 1fr; } }
.report-id div { display: flex; gap: 8px; border-bottom: 1px dotted var(--line-strong); padding: 4px 0; }
.report-id dt { color: var(--muted); min-width: 110px; font-size: 14px; }
.report-id dd { margin: 0; font-weight: 600; }
.report-table, .report-terms { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td, .report-terms th, .report-terms td { border: 1px solid var(--line-strong); padding: 6px 8px; text-align: start; }
.report-table thead th, .report-terms thead th { background: var(--ground); }
.report-table .num, .report-terms td, .report-terms th { text-align: center; }
.report-summary { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 12px; background: var(--blue-soft); border-radius: var(--radius-sm); }
.report-avg { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.report-avg strong { font-size: 32px; line-height: 1; color: var(--blue-dark); }
.report-avg small { font-size: .5em; color: var(--muted); }
.report-facts { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.report-facts div { display: flex; justify-content: space-between; gap: 12px; }
.report-facts dt { color: var(--muted); font-size: 14px; }
.report-facts dd { margin: 0; font-weight: 700; }
.report-comment h2 { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.report-comment p { margin: 0; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.report-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.report-sign div { min-height: 64px; border-bottom: 1px solid var(--ink); display: flex; align-items: flex-start; }
.report-date { margin: 0; text-align: end; }
.book .book-col { white-space: normal; min-width: 88px; max-width: 130px; font-size: 13px; line-height: 1.3; }
@media (max-width: 639px) {
  .book .book-name { min-width: 118px; font-size: 13px; }
  .book th, .book td { padding: 7px 8px; }
  .book-filters [type="submit"] { display: none; }
}

/* ---------------- Lot 8 : notifications, espaces élève et parent ---------------- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 999px; color: var(--ink-2); text-decoration: none; margin-inline-start: auto; }
.bell:hover, .bell[aria-current="page"] { background: var(--ground); color: var(--blue); }
.bell:focus-visible { outline: 3px solid var(--yellow); }
.bell-count { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
.topbar .bell + .lang-switch { margin-inline-start: 0; }
.notif-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; min-height: 56px; }
.notif a:hover { background: var(--ground); }
.notif-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ground); color: var(--muted); }
.notif.is-unread .notif-icon { background: var(--blue-soft); color: var(--blue); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif.is-unread .notif-text { font-weight: 700; }
.notif-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }

.child-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
@media (min-width: 900px) { .child-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.child-card { display: flex; flex-direction: column; gap: 12px; color: var(--ink); text-decoration: none; }
.child-card:hover { border-color: var(--blue); }
.child-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.child-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.child-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.child-stats > span { padding: 8px 10px; background: var(--ground); border-radius: var(--radius-sm); }
.child-stats strong { font-size: 20px; }
.child-stats small { font-size: .6em; color: var(--muted); }
.child-stats .is-alert, .stat-alert { background: var(--red-soft); }
.child-stats .is-alert strong, .stat-alert strong { color: var(--red); }
.test-card-static { box-shadow: none; }
.test-card-static:hover { border-color: var(--line); }
.term-tabs { margin-top: 10px; }
.bell-count { top: 5px; inset-inline-end: 3px; min-width: 14px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; border-width: 1.5px; }
.report-table-wrap { overflow-x: auto; }
@media (max-width: 639px) {
  .report-head { flex-wrap: wrap; }
  .report-school { flex: 1 1 calc(100% - 70px); }
  .report-kind { flex: 1 1 100%; align-items: flex-start; text-align: start; }
  .report-table, .report-terms { font-size: 13px; }
  .report-table th, .report-table td, .report-terms th, .report-terms td { padding: 5px 6px; }
  .report-table td .small { display: block; }
}

/* ---------------- v2.1 : audit ---------------- */
.stat-warn { background: var(--orange-soft); }
.stat-warn strong, .late-note { color: var(--orange-ink); font-weight: 700; }
.preview-answer { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--green); border-radius: var(--radius-sm); background: var(--green-soft); }
.preview-answer summary { cursor: pointer; font-weight: 700; color: var(--green-ink); min-height: 32px; display: flex; align-items: center; }
.preview-answer p { margin: 8px 0 0; }
