/* Atelier Schémas — mêmes polices et couleurs que le cours « Ranger les données ». */
@font-face { font-family: "Archivo"; font-weight: 400 900; src: url("fonts/archivo-latin.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 400 900; src: url("fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Atkinson"; font-weight: 200 800; src: url("fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 200 800; src: url("fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 800; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); }

:root {
  --nuit: #1E1B3A; --texte: #1F2233; --gris: #5D6275; --gris-clair: #8A8FA3; --filet: #E3E1EE; --zebre: #F7F6FC;
  --fond: #F4F3FA; --blanc: #fff;
  --violet: #7048E8; --violet-f: #5B3BD6; --violet-t: #F1EDFE;
  --bleu: #3B82F6; --turq: #0D9488; --turq-t: #E6F7F5; --orange: #D9560B; --orange-t: #FEF0E6;
  --rose: #D02A7D; --rose-t: #FDEAF3; --rouge: #DC2626; --rouge-t: #FEECEC; --vert: #15803D; --vert-t: #E7F6EC;
  --titre: "Archivo", "Segoe UI", system-ui, sans-serif; --corps: "Atkinson", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--texte); font: 16px/1.5 var(--corps); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--violet-f); }
code { font-family: var(--mono); font-size: .9em; background: var(--violet-t); color: var(--violet-f); padding: 1px 5px; border-radius: 4px; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--filet); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
p { margin: 0 0 .7em; }
.discret { color: var(--gris); font-size: 14px; }
.chargement { padding: 40px; text-align: center; color: var(--gris); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* ---------------------------------------------------------------- boutons et champs */
.btn { font: 600 14px/1 var(--corps); display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--filet); background: var(--blanc);
  color: var(--texte); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #C9C5DD; background: var(--zebre); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primaire { background: var(--violet-f); border-color: var(--violet-f); color: #fff; }
.btn.primaire:hover { background: #4C2FC0; }
.btn.danger { color: var(--rouge); }
.btn.danger.plein, .btn.danger:hover:not(:disabled) { background: var(--rouge-t); border-color: #F5B5B5; }
.btn.danger.plein:not(:disabled) { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.btn.prof { color: var(--rouge); border-color: #F5B5B5; }
.btn.fantome { background: transparent; border-color: transparent; color: inherit; }
.btn.fantome:hover { background: rgba(255,255,255,.1); }
.btn.plein { width: 100%; }
.btn.grand { min-height: 46px; font-size: 16px; }
.btn.petit { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icone { width: 36px; padding: 0; font-size: 18px; }
.lien { border: 0; background: none; color: var(--violet-f); font: inherit; font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }
.champ { display: block; font-weight: 600; font-size: 14px; margin: 0 0 14px; border: 0; padding: 0; }
.champ input, .champ textarea, .champ select { display: block; width: 100%; margin-top: 5px; font: 400 15px/1.4 var(--corps);
  color: var(--texte); background: #fff; border: 1px solid #D5D2E4; border-radius: var(--r); padding: 9px 11px; }
.champ textarea { resize: vertical; }
.champ input:focus, .champ textarea:focus, .champ select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(112,72,232,.18); }
.champ legend { padding: 0; margin-bottom: 6px; }
.coche { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 6px 0; font-weight: 400; }
.erreur { color: var(--rouge); font-size: 14px; font-weight: 600; }
.pill { display: inline-block; font: 800 11px/1 var(--titre); letter-spacing: .3px; padding: 4px 8px; border-radius: 99px; background: var(--nuit); color: #fff; vertical-align: middle; }

/* ---------------------------------------------------------------- connexion */
.connexion { min-height: 100vh;display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 560px); gap: 56px;
  align-items: center; justify-content: center; padding: 32px 16px; }
.carte-connexion { background: #fff; border: 1px solid var(--filet); border-radius: 14px; padding: 32px; }
.logo { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.logo h1 { margin: 0; font-size: 24px; font-weight: 600; } .logo h1 b { font-weight: 900; color: var(--violet-f); }
.logo p { margin: 0; color: var(--gris); font-size: 14px; }
.apercu { margin: 0; }
.apercu svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .connexion { grid-template-columns: 1fr; gap: 24px; } .apercu { order: -1; max-width: 420px; margin: 0 auto; width: 100%; } }

/* ---------------------------------------------------------------- en-tête et pages */
.entete { background: var(--nuit); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; min-height: 56px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--titre); font-size: 17px; }
.marque b { font-weight: 900; }
.fil { flex: 1; color: #C9C6E0; font-size: 15px; }
.fil a { color: #fff; }
.qui { display: flex; gap: 4px; align-items: center; }
.qui .pill { background: var(--violet); }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 60px; }
.page section { margin-bottom: 36px; }
.titre-section { font-size: 19px; }
.titre-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.titre-ligne .titre-section { margin: 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grille.petite { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.carte { display: block; background: #fff; border: 1px solid var(--filet); border-radius: 12px; padding: 18px; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; }
a.carte:hover { border-color: var(--violet); transform: translateY(-1px); }
.carte h3 { font-size: 17px; margin: 4px 0 6px; }
.carte-haut { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.extrait { color: var(--gris); font-size: 14px; margin-bottom: 8px; }
.meta { color: var(--gris); font-size: 13px; margin: 0; }
.etat { display: inline-block; font: 800 11px/1 var(--titre); letter-spacing: .3px; text-transform: uppercase; padding: 5px 8px; border-radius: 99px; text-decoration: none; white-space: nowrap; }
.etat.neuf { background: var(--violet-t); color: var(--violet-f); }
.etat.encours { background: var(--turq-t); color: var(--turq); }
.etat.ferme { background: #ECECF1; color: var(--gris); }
.etat.prof { background: var(--rouge-t); color: var(--rouge); }
.vide-page { text-align: center; padding: 50px 20px; color: var(--gris); }
.sujet-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px !important; }
.sujet-entete h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.consigne-prof { background: #fff; border: 1px solid var(--filet); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.consigne-prof summary { cursor: pointer; font-weight: 700; }
.texte-consigne { white-space: pre-wrap; font-size: 14.5px; margin-top: 8px; }
.filtres { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.puce { display: inline-block; border: 1px solid var(--filet); background: #fff; border-radius: 99px; padding: 4px 12px; font: 600 13px var(--corps); color: var(--texte); cursor: pointer; text-decoration: none; margin: 1px 0; }
.puce.active { background: var(--nuit); color: #fff; border-color: var(--nuit); }
.grille.rendus { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 16px; }
.carte.rendu { padding: 0; overflow: hidden; }
.carte.rendu.absent { opacity: .6; }
.vignette { height: 190px; background: var(--zebre); border-bottom: 1px solid var(--filet); display: flex; align-items: center; justify-content: center; color: var(--gris-clair); padding: 8px; }
.vignette svg { width: 100%; height: 100%; }
.rendu-pied { padding: 10px 14px 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.rendu-pied .meta { flex-basis: 100%; }
.tableau-defile { overflow-x: auto; background: #fff; border: 1px solid var(--filet); border-radius: 12px; }
table.liste { border-collapse: collapse; width: 100%; font-size: 14px; }
.liste th, .liste td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--filet); vertical-align: middle; }
.liste th { font: 700 13px var(--titre); color: var(--gris); background: var(--zebre); white-space: nowrap; }
.liste tr:last-child td { border-bottom: 0; }
.actions-cellule { white-space: nowrap; text-align: right; }
.actions-cellule .btn + .btn { margin-left: 6px; }

/* ---------------------------------------------------------------- modales et toast */
.modale-fond { position: fixed; inset: 0; background: rgba(30,27,58,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modale { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(30,27,58,.25); }
.modale.large { max-width: 680px; }
.modale-pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.regles { padding-left: 22px; } .regles li { margin-bottom: 6px; } .regles li::marker { font-weight: 800; color: var(--violet-f); }
.conventions { padding-left: 18px; font-size: 15px; } .conventions li { margin-bottom: 5px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--nuit); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast.erreur, #toast.prof { background: var(--rouge); }
#toast.ok { background: var(--turq); }

/* ---------------------------------------------------------------- éditeur */
.plein-ecran { height: 100vh; height: 100dvh; }
.ed { height: 100%; display: flex; flex-direction: column; }
.ed-barre { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--filet); flex-wrap: wrap; }
.ed-gauche { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 220px; }
.ed-outils { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ed-droite { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 140px; }
.titre-ed { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.titre-ed b { font-family: var(--titre); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titre-ed span { font-size: 13px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retour { font-size: 20px; width: 36px; padding: 0; color: var(--texte); }
.retour:hover { background: var(--zebre) !important; }
.nav-eleves { display: flex; gap: 4px; }
.btn.outil b { color: var(--violet-f); font-weight: 900; }
.btn.outil.prof b { color: var(--rouge); }
.btn.zoom { min-width: 62px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.sep { width: 1px; height: 24px; background: var(--filet); margin: 0 4px; }
.bascule { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; padding: 0 8px; cursor: pointer; }
.statut { font-size: 13px; font-weight: 600; color: var(--gris); padding: 4px 10px; border-radius: 99px; background: var(--zebre); white-space: nowrap; }
.statut.ok { color: var(--turq); background: var(--turq-t); }
.statut.attente { color: var(--orange); background: var(--orange-t); }
.statut.erreur { color: var(--rouge); background: var(--rouge-t); }
.ed-corps { flex: 1; display: flex; min-height: 0; }
.ed-toile { flex: 1; position: relative; min-width: 0; background: #FBFAFE; outline: none; }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
.ed-svg.main { cursor: grabbing; }
.ed-svg .table, .ed-svg .note { cursor: pointer; }
.ed-svg .redim { cursor: nwse-resize; }
.ed-vide { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; color: var(--gris); pointer-events: none; background: rgba(255,255,255,.85); padding: 16px 22px; border-radius: 12px; }
.ed-vide p { margin: 0 0 4px; }
.ed-insp { width: 340px; flex: none; overflow-y: auto; background: #fff; border-left: 1px solid var(--filet); }
.insp-bloc { padding: 16px 18px; border-bottom: 1px solid var(--filet); }
.insp-bloc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--gris); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.insp-bloc h3 .nb { background: var(--zebre); color: var(--texte); border-radius: 99px; padding: 2px 8px; font-size: 12px; }
.insp-bloc.consigne { background: var(--violet-t); }
.insp-bloc.consigne .texte-consigne { margin: 0; font-size: 14px; max-height: 38vh; overflow-y: auto; }
.insp-bloc.actions { display: flex; flex-direction: column; gap: 8px; }
.insp-bloc .champ:last-child { margin-bottom: 0; }
.astuces { padding-left: 18px; margin: 0 0 10px; font-size: 14px; } .astuces li { margin-bottom: 6px; }
.resume { font-size: 13px; color: var(--gris); margin: 8px 0 0; }
.aide-mini { font-size: 12px; color: var(--gris-clair); margin: 6px 0 0; text-align: center; }
.pastilles { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pastille { width: 30px; height: 30px; border-radius: 50%; background: var(--p); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--filet); cursor: pointer; padding: 0; }
.pastille.carre { border-radius: 6px; border: 2px solid var(--b); box-shadow: none; }
.pastille.choisie { box-shadow: 0 0 0 2px var(--nuit); }
.pastille:disabled { cursor: default; }
.cols { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.col { border: 1px solid var(--filet); border-radius: var(--r); padding: 6px; background: #fff; }
.col.actif { border-color: var(--violet); background: var(--violet-t); }
.col-l1, .col-l2 { display: flex; gap: 4px; align-items: center; }
.col-l2 { margin-top: 5px; }
.col input { flex: 1; min-width: 0; font: 600 14px var(--mono); padding: 6px 8px; border: 1px solid #D5D2E4; border-radius: 6px; color: var(--texte); }
.col input:focus, .col select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 2px rgba(112,72,232,.2); }
.col select { flex: 1; min-width: 0; font: 13px var(--corps); padding: 4px 4px; border: 1px solid #D5D2E4; border-radius: 6px; background: #fff; color: var(--texte); }
.mini { flex: none; width: 28px; height: 28px; border: 1px solid var(--filet); border-radius: 6px; background: #fff; cursor: pointer; font: 700 14px var(--corps); color: var(--gris); padding: 0; }
.mini:hover:not(:disabled) { background: var(--zebre); color: var(--texte); }
.mini:disabled { opacity: .3; cursor: default; }
.mini.danger:hover { color: var(--rouge); background: var(--rouge-t); }
.mini.card { background: var(--nuit); color: #fff; border-color: var(--nuit); font-family: var(--titre); font-weight: 800; }
.regle-rappel { font-size: 13.5px; background: var(--zebre); border-left: 3px solid var(--violet); padding: 8px 10px; border-radius: 0 6px 6px 0; margin: -6px 0 14px; }
@media (max-width: 820px) {
  .ed-corps { flex-direction: column; }
  .ed-insp { width: auto; max-height: 42vh; border-left: 0; border-top: 1px solid var(--filet); }
  .ed-droite { flex: 0 0 auto; }
  .entete { padding: 8px 16px; } .fil { flex-basis: 100%; order: 3; }
}

/* ---------------------------------------------------------------- fiches d'identifiants (impression) */
#impression { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#impression) { display: none !important; }
  #impression { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .fiche { border: 1px dashed #999; padding: 14px 16px; break-inside: avoid; font-size: 13px; }
  .fiche-titre { font-family: var(--titre); font-size: 12px; color: #555; }
  .fiche-nom { font-family: var(--titre); font-weight: 800; font-size: 17px; margin: 4px 0 8px; }
  .fiche-ligne { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-top: 1px solid #eee; }
  .fiche-ligne code { background: none; color: #000; font-size: 15px; font-weight: 700; }
  .fiche-ligne b { font-weight: 600; word-break: break-all; text-align: right; }
}
