/* ═══════════════════════════════════════════════════════════════
   Campus BambaTech — feuille de style unique (étudiants + enseignant)
   Thème sombre par défaut, thème clair via data-theme="clair".
   ═══════════════════════════════════════════════════════════════ */

:root, [data-theme="sombre"] {
  --fond: #07090e;
  --fond-2: #0b0f17;
  --surface: #0f141d;
  --surface-haut: #161d29;
  --surface-survol: #1a2230;
  --bord: #1f2735;
  --bord-fort: #2b3546;
  --texte: #e8edf6;
  --doux: #93a0b5;
  --faible: #5f6b80;
  --accent: #4cc2ff;
  --accent-2: #7c8cff;
  --accent-fond: rgba(76, 194, 255, 0.11);
  --accent-bord: rgba(76, 194, 255, 0.34);
  --sur-accent: #03131f;
  --vert: #3ddc97;
  --vert-fond: rgba(61, 220, 151, 0.11);
  --rouge: #ff7a7a;
  --rouge-fond: rgba(255, 122, 122, 0.11);
  --orange: #ffb454;
  --orange-fond: rgba(255, 180, 84, 0.12);
  --violet: #b18cff;
  --violet-fond: rgba(177, 140, 255, 0.12);
  --voile: rgba(7, 9, 14, 0.8);
  --ombre: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.7);
  --lueur: radial-gradient(1200px 420px at 10% -10%, rgba(76,194,255,.10), transparent 60%),
           radial-gradient(900px 380px at 100% 0%, rgba(124,140,255,.08), transparent 60%);
  color-scheme: dark;
}
[data-theme="clair"] {
  --fond: #f4f6fa;
  --fond-2: #eef1f6;
  --surface: #ffffff;
  --surface-haut: #f0f3f8;
  --surface-survol: #e9eef6;
  --bord: #e1e6ee;
  --bord-fort: #cbd3df;
  --texte: #0d1320;
  --doux: #556075;
  --faible: #8a94a6;
  --accent: #0a7cc2;
  --accent-2: #4f5bd5;
  --accent-fond: rgba(10, 124, 194, 0.08);
  --accent-bord: rgba(10, 124, 194, 0.3);
  --sur-accent: #ffffff;
  --vert: #0d9a60;
  --vert-fond: rgba(13, 154, 96, 0.09);
  --rouge: #d13f3f;
  --rouge-fond: rgba(209, 63, 63, 0.08);
  --orange: #b4700a;
  --orange-fond: rgba(180, 112, 10, 0.1);
  --violet: #6b46d9;
  --violet-fond: rgba(107, 70, 217, 0.08);
  --voile: rgba(244, 246, 250, 0.85);
  --ombre: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -16px rgba(16,24,40,.18);
  --lueur: radial-gradient(1200px 420px at 10% -10%, rgba(10,124,194,.07), transparent 60%);
  color-scheme: light;
}
:root {
  --police: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --rayon: 16px;
  --cote: 256px;
  --haut-bas: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; font-family: var(--police); font-size: 15px;
  background: var(--fond); background-image: var(--lueur); background-attachment: fixed;
  color: var(--texte); line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent); }
img { max-width: 100%; }
::selection { background: var(--accent-fond); }
.ic { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.p { width: 16px; height: 16px; }
.ic.g { width: 24px; height: 24px; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.masque main { filter: blur(22px); }

/* ─────────── Barre latérale (ordinateur) ─────────── */
.cote {
  position: fixed; inset: 0 auto 0 0; width: var(--cote); z-index: 40;
  background: var(--fond-2); border-right: 1px solid var(--bord);
  display: none; flex-direction: column; padding: 18px 14px;
}
.cote-marque { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; text-decoration: none; color: inherit; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03131f; font-weight: 800; font-size: 14px; letter-spacing: -.02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -6px var(--accent-bord);
}
.cote-marque b { display: block; font-size: 15px; letter-spacing: -.01em; }
.cote-marque small { display: block; font-family: var(--mono); font-size: 10px; color: var(--faible); letter-spacing: .08em; text-transform: uppercase; }
.cote nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.cote nav a, .tiroir nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--doux); text-decoration: none; font-weight: 550; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.cote nav a:hover, .tiroir nav a:hover { background: var(--surface-haut); color: var(--texte); }
.cote nav a.actif, .tiroir nav a.actif { background: var(--accent-fond); color: var(--accent); }
.cote nav a .nb, .tiroir nav a .nb { margin-left: auto; }
.cote-pied { border-top: 1px solid var(--bord); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.carte-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-decoration: none; color: inherit; border-radius: 11px; }
.carte-user:hover { background: var(--surface-haut); }
.carte-user b { display: block; font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-user small { display: block; font-size: 11.5px; color: var(--faible); }
.signature { font-size: 10.5px; color: var(--faible); line-height: 1.45; padding: 0 8px; }

.nb {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px;
  background: var(--rouge); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono);
}

/* ─────────── En-tête ─────────── */
.zone { min-width: 0; }
.entete { position: sticky; top: 0; z-index: 30; background: var(--voile); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--bord); }
.entete-corps { max-width: 1080px; margin: 0 auto; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.marque { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pastille {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: var(--accent-fond); border: 1px solid var(--accent-bord);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700; font-size: 14px;
}
.entete h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sous { font-family: var(--mono); font-size: 11px; color: var(--faible); margin: 1px 0 0; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outils { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bouton-icone, .bascule {
  position: relative; width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--bord); color: var(--doux); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s; font-size: 15px;
}
.bouton-icone:hover, .bascule:hover { background: var(--surface-haut); color: var(--texte); border-color: var(--bord-fort); }
.bouton-icone .nb { position: absolute; top: -6px; right: -6px; border: 2px solid var(--fond); }
.page { max-width: 1080px; margin: 0 auto; padding: 26px 22px 120px; }
.etroit { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ─────────── Barre du bas (téléphone) ─────────── */
.bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--voile); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid var(--bord);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bas a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px 5px; border-radius: 12px; color: var(--faible); text-decoration: none;
  font-size: 10.5px; font-weight: 650; letter-spacing: .01em;
}
.bas a.actif { color: var(--accent); }
.bas a.actif .ic { stroke-width: 2.2; }
.bas a.actif::before { content: ""; position: absolute; top: -7px; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bas a .nb { position: absolute; top: 2px; left: 50%; margin-left: 5px; min-width: 17px; height: 17px; font-size: 10px; }

/* Tiroir (menu complet sur téléphone) */
.tiroir-fond { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tiroir {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--bord); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility .28s;
}
.tiroir::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--bord-fort); margin: 0 auto 14px; }
body.tiroir-ouvert .tiroir { transform: none; visibility: visible; }
body.tiroir-ouvert .tiroir-fond { opacity: 1; pointer-events: auto; }
.tiroir nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 0 14px; }
.tiroir nav a { background: var(--surface-haut); }

@media (min-width: 960px) {
  body.avec-nav .cote { display: flex; }
  body.avec-nav .zone { margin-left: var(--cote); }
  body.avec-nav .bas, body.avec-nav .seul-mobile, .tiroir, .tiroir-fond { display: none !important; }
  .page { padding-bottom: 60px; }
}
@media (max-width: 959px) {
  .seul-ordi { display: none !important; }
  body.avec-nav .page { padding-bottom: calc(var(--haut-bas) + 46px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .page { padding: 16px 14px 120px; }
  .entete-corps { padding: 10px 14px; }
  .entete h1 { font-size: 16px; }
}

/* ─────────── Cartes & sections ─────────── */
.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 20px; margin-bottom: 14px; box-shadow: var(--ombre);
  animation: apparait .34s cubic-bezier(.2,.7,.3,1) backwards;
}
.carte.serre { padding: 6px 18px; }
.carte.nu { padding: 0; overflow: hidden; }
a.carte, .carte.cliquable { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
a.carte:hover, .carte.cliquable:hover { border-color: var(--bord-fort); transform: translateY(-1px); }
.carte.accent { border-color: var(--accent-bord); background: linear-gradient(180deg, var(--accent-fond), transparent 70%), var(--surface); }
.carte.alerte { border-color: rgba(255,180,84,.35); background: linear-gradient(180deg, var(--orange-fond), transparent 70%), var(--surface); }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.carte h2, .titre-carte { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.carte h3 { font-size: 15px; font-weight: 700; margin: 0; }
.meta { font-size: 13.5px; color: var(--doux); margin: 0; }
.tech { font-family: var(--mono); font-size: 11px; color: var(--faible); letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.texte-long { white-space: pre-wrap; overflow-wrap: anywhere; }

.section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section:first-child { margin-top: 0; }
.section h2 { font-size: 15px; font-weight: 750; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.section a { font-size: 13px; font-weight: 600; text-decoration: none; }

.grille { display: grid; gap: 14px; }
.grille.d2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grille.d3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grille > .carte { margin-bottom: 0; }
.colonnes { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .colonnes { grid-template-columns: minmax(0, 1fr); } }

/* Bandeau d'accueil */
.bonjour { margin: 2px 0 22px; }
.bonjour h2 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 4px; line-height: 1.2; }
.bonjour p { margin: 0; color: var(--doux); }
@media (max-width: 600px) { .bonjour h2 { font-size: 22px; } }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi {
  background: var(--surface); border: 1px solid var(--bord); border-radius: 15px; padding: 15px 16px;
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; box-shadow: var(--ombre);
  transition: border-color .15s;
}
a.kpi:hover { border-color: var(--bord-fort); }
.kpi .v { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--faible); font-weight: 600; margin-top: 2px; }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 13px; } .kpi .v { font-size: 20px; } }

.puce {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-fond); color: var(--accent);
}
.puce.vert { background: var(--vert-fond); color: var(--vert); }
.puce.rouge { background: var(--rouge-fond); color: var(--rouge); }
.puce.orange { background: var(--orange-fond); color: var(--orange); }
.puce.violet { background: var(--violet-fond); color: var(--violet); }
.puce.gris { background: var(--surface-haut); color: var(--faible); }
.puce.petite { width: 32px; height: 32px; border-radius: 10px; }

/* Listes */
.liste { list-style: none; margin: 0; padding: 0; }
.ligne {
  display: flex; align-items: center; gap: 13px; padding: 13px 0;
  border-top: 1px solid var(--bord); text-decoration: none; color: inherit; min-width: 0;
}
.liste > .ligne:first-child, .liste > li:first-child > .ligne { border-top: none; }
a.ligne:hover .ligne-titre { color: var(--accent); }
.ligne-corps { flex: 1; min-width: 0; }
.ligne-titre { font-weight: 650; font-size: 14.5px; transition: color .15s; overflow-wrap: anywhere; }
.ligne-sous { font-size: 12.5px; color: var(--faible); margin-top: 1px; overflow-wrap: anywhere; }
.ligne-fin { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* Bande de couleur d'un cours */
.cours-carte { position: relative; overflow: hidden; padding-left: 24px; }
.cours-carte::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--teinte, var(--accent)); }
.teinte-texte { color: var(--teinte, var(--accent)); }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--teinte, var(--accent)); flex-shrink: 0; display: inline-block; }

/* ─────────── Boutons ─────────── */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--sur-accent); border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: filter .15s, transform .08s, background .15s; white-space: nowrap; line-height: 1.2;
}
.bouton:hover { filter: brightness(1.08); }
.bouton:active { transform: scale(.98); }
.bouton.creux, .bouton.gris { background: transparent; color: var(--texte); border-color: var(--bord-fort); }
.bouton.creux:hover, .bouton.gris:hover { background: var(--surface-haut); filter: none; }
.bouton.vert { background: var(--vert); color: #04150d; }
.bouton.danger { background: transparent; color: var(--rouge); border-color: rgba(255,122,122,.35); }
.bouton.danger:hover { background: var(--rouge-fond); filter: none; }
.bouton.petit { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.bouton.large { display: flex; width: 100%; }
.bouton[disabled] { opacity: .5; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lien-nu { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--faible); transition: color .15s; text-decoration: none; }
.lien-nu:hover { color: var(--texte); }
form.enligne { display: inline; margin: 0; }

/* Étiquettes */
.etiquette {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; white-space: nowrap;
  background: var(--surface-haut); color: var(--faible);
}
.etiquette.vert { background: var(--vert-fond); color: var(--vert); }
.etiquette.bleu { background: var(--accent-fond); color: var(--accent); }
.etiquette.rouge { background: var(--rouge-fond); color: var(--rouge); }
.etiquette.orange { background: var(--orange-fond); color: var(--orange); }
.etiquette.violet { background: var(--violet-fond); color: var(--violet); }
.etiquette.gris { background: var(--surface-haut); color: var(--faible); }

/* Note mise en avant */
.note { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.note small { font-weight: 600; color: var(--faible); font-family: var(--mono); font-size: .62em; letter-spacing: 0; }
.note.bonne { color: var(--vert); } .note.moyenne { color: var(--orange); } .note.faible { color: var(--rouge); }

/* Jauge */
.jauge-fond { height: 6px; border-radius: 6px; background: var(--surface-haut); overflow: hidden; }
.jauge-fond > span { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .5s cubic-bezier(.2,.7,.3,1); }
.jauge-fond.vert > span { background: var(--vert); }

/* Onglets */
.onglets { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; padding: 4px; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a, .onglets button {
  flex: 1 0 auto; text-align: center; padding: 9px 14px; border-radius: 10px; color: var(--doux); text-decoration: none;
  font-weight: 650; font-size: 13.5px; white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.onglets a:hover, .onglets button:hover { color: var(--texte); }
.onglets a.actif, .onglets button.actif { background: var(--surface-haut); color: var(--texte); box-shadow: 0 1px 0 var(--bord-fort) inset; }
.onglets .compte { font-family: var(--mono); font-size: 11px; color: var(--faible); }

/* Messages flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 13px; margin-bottom: 14px; font-size: 14px; font-weight: 550; border: 1px solid; animation: apparait .3s backwards; overflow-wrap: anywhere; }
.flash.succes { background: var(--vert-fond); color: var(--vert); border-color: rgba(61,220,151,.28); }
.flash.erreur { background: var(--rouge-fond); color: var(--rouge); border-color: rgba(255,122,122,.3); }
.flash.info, .flash.alerte { background: var(--accent-fond); color: var(--accent); border-color: var(--accent-bord); }

/* État vide */
.vide { text-align: center; padding: 40px 20px; }
.vide .puce { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 14px; }
.vide p { margin: 0; }
.vide b { display: block; font-size: 15.5px; margin-bottom: 4px; }

/* ─────────── Formulaires ─────────── */
.formulaire .champ-bloc { margin-bottom: 16px; }
.formulaire label, .etiq { display: block; font-size: 13px; font-weight: 650; color: var(--doux); margin-bottom: 7px; }
.aide, .formulaire .aide { font-size: 12px; color: var(--faible); margin-top: 5px; }
.formulaire .erreurs, .errorlist { color: var(--rouge); font-size: 12.5px; margin: 6px 0 0; padding: 0; list-style: none; font-weight: 600; }
.formulaire input[type=text], .formulaire input[type=email], .formulaire input[type=password], .formulaire input[type=number],
.formulaire input[type=url], .formulaire input[type=datetime-local], .formulaire input[type=time], .formulaire input[type=date],
.formulaire select, .formulaire textarea, .champ, .champ-c {
  width: 100%; padding: 12px 14px; border: 1px solid var(--bord-fort); border-radius: 12px;
  font-size: 16px; font-family: inherit; background: var(--fond); color: var(--texte);
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.formulaire select { background-image: linear-gradient(45deg, transparent 50%, var(--faible) 50%), linear-gradient(135deg, var(--faible) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.formulaire textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus, .champ:focus, .champ-c:focus { outline: none; border-color: var(--accent-bord); box-shadow: 0 0 0 3px var(--accent-fond); }
.formulaire input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); vertical-align: middle; margin: 0 8px 0 0; }
.case { display: flex !important; align-items: center; gap: 2px; cursor: pointer; color: var(--texte) !important; font-weight: 600 !important; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .deux { grid-template-columns: 1fr; } }
.code-champ { font-family: var(--mono) !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-size: 22px !important; font-weight: 700; }

/* Zone de dépôt de fichier */
.depot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1.5px dashed var(--bord-fort); border-radius: 16px; padding: 26px 16px; cursor: pointer; background: var(--fond);
  transition: border-color .15s, background .15s; color: var(--doux);
}
.depot:hover, .depot.survol { border-color: var(--accent); background: var(--accent-fond); color: var(--texte); }
.depot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.depot b { color: var(--texte); font-size: 14.5px; }
.depot .choisi { font-family: var(--mono); font-size: 12.5px; color: var(--accent); overflow-wrap: anywhere; }

/* Fichier téléchargeable */
.fichier {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 13px;
  text-decoration: none; color: inherit; background: var(--fond); transition: border-color .15s; min-width: 0;
}
.fichier:hover { border-color: var(--accent-bord); }
.fichier .ext { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; background: var(--accent-fond); color: var(--accent); flex-shrink: 0; }
.fichier .ext.pdf { background: var(--rouge-fond); color: var(--rouge); }
.fichier .ext.doc, .fichier .ext.docx { background: rgba(80,140,255,.13); color: #6d9fff; }
.fichier .ext.ppt, .fichier .ext.pptx { background: var(--orange-fond); color: var(--orange); }
.fichier .ext.xls, .fichier .ext.xlsx, .fichier .ext.csv { background: var(--vert-fond); color: var(--vert); }
.fichier .ext.zip, .fichier .ext.rar, .fichier .ext.pkt { background: var(--violet-fond); color: var(--violet); }

/* ─────────── Messagerie ─────────── */
.fil { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; }
.bulle { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.bulle.lui { align-self: flex-start; background: var(--surface-haut); border: 1px solid var(--bord); border-bottom-left-radius: 6px; }
.bulle.moi { align-self: flex-end; background: var(--accent); color: var(--sur-accent); border-bottom-right-radius: 6px; }
.bulle .heure { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; font-family: var(--mono); }
.bulle a.pj { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.14); color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; white-space: normal; }
.jour-sep { align-self: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faible); margin: 8px 0 2px; }
.composeur {
  position: sticky; bottom: calc(var(--haut-bas) + 10px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 8px; align-items: flex-end; padding: 8px; background: var(--surface); border: 1px solid var(--bord-fort);
  border-radius: 18px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5);
}
@media (min-width: 960px) { .composeur { bottom: 16px; } }
.composeur textarea { flex: 1; border: 0; background: transparent; color: var(--texte); font: inherit; font-size: 15.5px; resize: none; padding: 9px 6px; max-height: 160px; min-height: 40px; }
.composeur textarea:focus { outline: none; }
.composeur .pj-btn { position: relative; overflow: hidden; }
.composeur .pj-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composeur .pj-nom { font-size: 12px; color: var(--accent); font-family: var(--mono); padding: 0 10px 6px; overflow-wrap: anywhere; }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; background: var(--teinte, var(--accent-2)); letter-spacing: -.02em;
}
.avatar.petit { width: 30px; height: 30px; font-size: 11.5px; }
button.avatar { border: 0; cursor: pointer; font-family: inherit; }

/* Tableaux */
.tableau-zone { overflow-x: auto; border: 1px solid var(--bord); border-radius: 14px; background: var(--surface); }
table.tableau { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tableau th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--faible); padding: 11px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; background: var(--fond-2); position: sticky; top: 0; }
.tableau td { padding: 10px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr:hover td { background: var(--surface-haut); }
.tableau .col-fixe { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tableau th.col-fixe { background: var(--fond-2); z-index: 2; }
.tableau .num { text-align: center; }

/* Code d'inscription */
.code-classe { font-family: var(--mono); font-weight: 800; font-size: 22px; letter-spacing: .22em; color: var(--accent); }

/* Chronologie / à faire */
.echeance { font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.echeance.urgent { color: var(--rouge); }
.echeance.proche { color: var(--orange); }
.echeance.loin { color: var(--faible); }

/* Discussion */
.post { padding: 14px 0; border-top: 1px solid var(--bord); }
.post:first-child { border-top: 0; }
.post-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post-tete b { font-size: 13.5px; }
.post-tete span { font-size: 11.5px; color: var(--faible); }
.reponses { margin: 10px 0 0 18px; padding-left: 14px; border-left: 2px solid var(--bord); }
.reponses .post { padding: 10px 0; }
.prof-badge { color: var(--accent); }

/* Emploi du temps */
.edt { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.edt-jour { background: var(--surface); border: 1px solid var(--bord); border-radius: 15px; padding: 14px; }
.edt-jour.ajd { border-color: var(--accent-bord); box-shadow: 0 0 0 3px var(--accent-fond); }
.edt-jour h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); display: flex; justify-content: space-between; }
.creneau { border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; background: color-mix(in srgb, var(--teinte) 13%, transparent); border-left: 3px solid var(--teinte); }
.creneau b { display: block; font-size: 13.5px; line-height: 1.3; }
.creneau span { font-family: var(--mono); font-size: 11.5px; color: var(--doux); }

/* Pied de page */
.pied { max-width: 1080px; margin: 0 auto; padding: 0 22px 30px; font-size: 11.5px; color: var(--faible); text-align: center; }
body.avec-nav .pied { display: none; }

/* Divers */
.separe { height: 1px; background: var(--bord); margin: 16px 0; border: 0; }
.mono { font-family: var(--mono); }
.centre { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.entre { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mt { margin-top: 14px; } .mt-s { margin-top: 6px; } .mb { margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--haut-bas) + 30px); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 90; background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 12px; font-weight: 650; font-size: 13.5px; transition: all .25s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ─────────── Impression (relevé de notes, carnet) ─────────── */
@media print {
  @page { margin: 14mm; }
  :root, [data-theme] { --fond: #fff; --surface: #fff; --surface-haut: #f3f5f8; --fond-2: #f3f5f8; --texte: #000; --doux: #333; --faible: #666; --bord: #d5dae2; --bord-fort: #b9c0cc; --accent: #0a5a8f; --ombre: none; }
  body { background: #fff !important; }
  .cote, .bas, .entete, .tiroir, .tiroir-fond, .pas-imprimer, .flash, .pied { display: none !important; }
  .zone { margin: 0 !important; }
  .page { padding: 0 !important; max-width: none; }
  .carte { box-shadow: none; animation: none; break-inside: avoid; }
}

/* La zone de dépôt est un <label> : on neutralise le style des étiquettes de formulaire */
.formulaire label.depot { display: flex; flex-direction: column; color: var(--doux); font-size: 14px; font-weight: 500; margin-bottom: 0; }
.formulaire label.depot:hover { color: var(--texte); }
a.carte.fichier { display: flex; }
/* Pages « plein écran » (épreuve en cours…) : pas de navigation */
body:not(.avec-nav) .cote, body:not(.avec-nav) .bas, body:not(.avec-nav) .tiroir, body:not(.avec-nav) .tiroir-fond, body:not(.avec-nav) [data-tiroir] { display: none !important; }
