/* Plateforme LMD — feuille de style unique, légère, responsive, sans dépendance. */
:root {
  --fond: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --texte: #1c2430;
  --texte-doux: #5a6676;
  --bordure: #dde2e9;
  --primaire: #1f4e8c;
  --primaire-fonce: #173b6b;
  --primaire-clair: #e6eef9;
  --accent: #b7791f;
  --succes: #1e7a46;
  --succes-fond: #e5f4ec;
  --alerte: #a15c00;
  --alerte-fond: #fdf1df;
  --danger: #b42318;
  --danger-fond: #fdecea;
  --rayon: 10px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --largeur: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11161d;
    --surface: #18202a;
    --surface-2: #212b37;
    --texte: #e6ebf1;
    --texte-doux: #9ba8b8;
    --bordure: #2c3846;
    --primaire: #6ea2e6;
    --primaire-fonce: #8fb8ee;
    --primaire-clair: #1d2c40;
    --accent: #e0a64a;
    --succes: #5cc28a;
    --succes-fond: #15301f;
    --alerte: #e9a548;
    --alerte-fond: #33260f;
    --danger: #f07468;
    --danger-fond: #3a1714;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--primaire); text-underline-offset: 2px; }
a:hover { color: var(--primaire-fonce); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 24px 0 48px; }
.doux { color: var(--texte-doux); }
.petit { font-size: .875rem; }
.pre { white-space: pre-line; }

/* En-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); position: sticky; top: 0; z-index: 10; }
.entete .conteneur { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--texte); text-decoration: none; display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; flex: 1 1 auto; }
.logo > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-marque { flex: none; }
.logo-marque { width: 32px; height: 32px; border-radius: 8px; background: var(--primaire); color: #fff; display: grid; place-items: center; font-size: .8rem; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.lien { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--texte); font-size: .95rem; }
.nav a:hover, .nav a.actif { background: var(--primaire-clair); color: var(--primaire); }
.pastille { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; text-align: center; line-height: 20px; margin-left: 4px; }
.menu-bascule { display: none; }
.menu-btn { display: none; cursor: pointer; padding: 8px 10px; border: 1px solid var(--bordure); border-radius: 8px; }
@media (max-width: 860px) {
  .menu-btn { display: block; flex: none; }
  .logo { flex-basis: 0; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .menu-bascule:checked ~ .nav { display: flex; }
  .nav a, .nav form { width: 100%; }
}

/* Pied de page */
.pied { border-top: 1px solid var(--bordure); background: var(--surface); padding: 20px 0; font-size: .9rem; color: var(--texte-doux); }

/* Boutons */
.btn, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--primaire);
  background: var(--primaire); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 42px;
}
.btn:hover, button:hover { background: var(--primaire-fonce); color: #fff; }
@media (prefers-color-scheme: dark) { .btn, button, input[type=submit] { color: #0d1520; } .btn:hover, button:hover { color: #0d1520; } }
.btn-secondaire { background: transparent; color: var(--primaire); }
.btn-secondaire:hover { background: var(--primaire-clair); color: var(--primaire); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-succes { background: var(--succes); border-color: var(--succes); }
.btn-petit { padding: 6px 10px; min-height: 34px; font-size: .875rem; }
button.lien { background: none; border: 0; color: var(--primaire); padding: 0; min-height: 0; font-weight: 400; text-decoration: underline; }
button.lien:hover { background: none; color: var(--primaire-fonce); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cartes et grilles */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); }
.carte + .carte { margin-top: 16px; }
.grille > .carte, .grille-2 > .carte { margin-top: 0; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grille-2 { display: grid; gap: 20px; grid-template-columns: 2fr 1fr; }
@media (max-width: 860px) { .grille-2 { grid-template-columns: 1fr; } }
.carte-lien { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
.carte-lien:hover { border-color: var(--primaire); color: inherit; }
.etiquette { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--texte-doux); }
.etiquette.attente { background: var(--alerte-fond); color: var(--alerte); }
.etiquette.publie, .etiquette.valide { background: var(--succes-fond); color: var(--succes); }
.etiquette.refuse, .etiquette.masque { background: var(--danger-fond); color: var(--danger); }
.etiquette.primaire { background: var(--primaire-clair); color: var(--primaire); }

/* Héros */
.heros { background: linear-gradient(135deg, var(--primaire) 0%, var(--primaire-fonce) 100%); color: #fff; border-radius: var(--rayon); padding: clamp(24px, 5vw, 48px); margin-bottom: 28px; }
.heros h1 { color: #fff; }
.heros p { max-width: 640px; opacity: .92; }
.heros .btn { background: #fff; color: var(--primaire-fonce); border-color: #fff; }
.heros .btn-secondaire { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
@media (prefers-color-scheme: dark) { .heros { background: linear-gradient(135deg, #1d3a63, #142a49); } .heros .btn { color: #142a49; } }

/* Statistiques */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 14px 16px; }
.stat .valeur { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .libelle { color: var(--texte-doux); font-size: .875rem; }
a.stat { text-decoration: none; color: inherit; }
a.stat.a-faire { border-left: 4px solid var(--accent); }

/* Formulaires */
.formulaire { max-width: 560px; }
.champ { margin-bottom: 14px; }
.champ label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.champ .aide { font-size: .82rem; color: var(--texte-doux); margin-top: 4px; }
.champ .erreur, .erreurs-form { color: var(--danger); font-size: .88rem; margin-top: 4px; }
.erreurs-form { background: var(--danger-fond); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.erreurs-form ul, .champ .erreur ul { margin: 0; padding-left: 18px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: 8px; font: inherit; color: var(--texte); background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaire); outline-offset: 1px; border-color: var(--primaire); }
input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; }
.champ-case label { display: inline; font-weight: 500; margin-left: 6px; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filtres input, .filtres select { width: auto; flex: 1 1 180px; }

/* Messages flash */
.flash { list-style: none; padding: 0; margin: 0 0 16px; }
.flash li { padding: 12px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--primaire-clair); color: var(--texte); border-left: 4px solid var(--primaire); }
.flash li.success { background: var(--succes-fond); border-color: var(--succes); }
.flash li.warning { background: var(--alerte-fond); border-color: var(--alerte); }
.flash li.error { background: var(--danger-fond); border-color: var(--danger); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.ligne-ue td { background: var(--primaire-clair); font-weight: 600; }
tfoot td { font-weight: 700; background: var(--surface-2); }

/* Onglets */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bordure); margin-bottom: 16px; overflow-x: auto; }
.onglets a { padding: 10px 14px; text-decoration: none; color: var(--texte-doux); border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets a.actif { color: var(--primaire); border-color: var(--primaire); font-weight: 600; }

/* Mise en page admin */
.admin-mise { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.admin-menu { display: flex; flex-direction: column; gap: 2px; }
.admin-menu a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--texte); display: flex; justify-content: space-between; }
.admin-menu a:hover, .admin-menu a.actif { background: var(--primaire-clair); color: var(--primaire); }
@media (max-width: 860px) {
  .admin-mise { grid-template-columns: 1fr; }
  .admin-menu { flex-direction: row; overflow-x: auto; }
  .admin-menu a { white-space: nowrap; }
}

/* Messagerie */
.conv-liste { list-style: none; padding: 0; margin: 0; }
.conv-liste li a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--bordure); text-decoration: none; color: inherit; }
.conv-liste li a:hover { background: var(--surface-2); }
.fil { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 16px; background: var(--surface-2); border-radius: var(--rayon); }
.bulle { max-width: min(80%, 560px); padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--bordure); align-self: flex-start; }
.bulle.moi { align-self: flex-end; background: var(--primaire-clair); border-color: transparent; }
.bulle.masque { font-style: italic; color: var(--texte-doux); }
.bulle .meta { font-size: .75rem; color: var(--texte-doux); display: flex; gap: 8px; justify-content: space-between; margin-bottom: 2px; }
.bulle .corps { white-space: pre-wrap; word-wrap: break-word; }
.bulle details summary { cursor: pointer; font-size: .75rem; color: var(--texte-doux); }
.saisie { display: grid; gap: 8px; margin-top: 12px; }

.vide { text-align: center; padding: 32px 16px; color: var(--texte-doux); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; align-items: center; }
.fil-ariane { font-size: .88rem; color: var(--texte-doux); margin-bottom: 12px; }
.fil-ariane a { color: var(--texte-doux); }
.prix { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.apercu-img { border-radius: 8px; border: 1px solid var(--bordure); }
dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.infos dt { color: var(--texte-doux); }
dl.infos dd { margin: 0; }
.grille > .carte, .grille-2 > .carte { margin-top: 0; }
.numero-mm { font-size: 1.15rem; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.code-suivi { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; word-break: break-all; display: block; }
.etapes { counter-reset: e; list-style: none; padding: 0; }
.etapes li { counter-increment: e; padding-left: 38px; position: relative; margin-bottom: 12px; }
.etapes li::before { content: counter(e); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primaire); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 700; }
.inline { display: inline; }
details.carte summary { cursor: pointer; font-weight: 600; }
.niveaux-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.niveaux-onglets a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--bordure); text-decoration: none; color: var(--texte); background: var(--surface); }
.niveaux-onglets a.actif { background: var(--primaire); border-color: var(--primaire); color: #fff; }
@media (prefers-color-scheme: dark) { .niveaux-onglets a.actif { color: #0d1520; } }

/* =====================================================================
   Thème « université » v2 : barre de contact, en-tête, menu déroulant,
   bannières, sections d'accueil, pied de page en colonnes.
   ===================================================================== */
:root {
  --primaire: #0f3460;
  --primaire-fonce: #0a2342;
  --primaire-clair: #e7eef8;
  --accent: #e8a317;
  --accent-fonce: #b97f0c;
  --sombre: #0a1f3a;
}
@media (prefers-color-scheme: dark) {
  :root { --primaire: #7fa8e0; --primaire-fonce: #a6c2ea; --primaire-clair: #18263a; --accent: #f0b84a; --sombre: #060f1d; }
}
h1, h2, h3 { letter-spacing: -.01em; }

/* Barre de contact */
.barre-haut { background: var(--sombre); color: #c9d4e3; font-size: .85rem; }
.barre-haut .conteneur { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; flex-wrap: wrap; }
.barre-haut a, .barre-haut .lien-barre { color: #e6edf6; text-decoration: none; }
.barre-haut a:hover, .barre-haut .lien-barre:hover { color: var(--accent); background: none; }
.barre-haut-infos, .barre-haut-liens { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.barre-haut .lien-barre { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 400; cursor: pointer; }
@media (max-width: 860px) { .barre-haut-infos { display: none; } .barre-haut .conteneur { justify-content: center; } }

/* En-tête */
.entete { box-shadow: 0 2px 10px rgba(10, 35, 66, .08); border-bottom: 0; }
.entete .conteneur { min-height: 76px; }
.logo { gap: 12px; }
.logo-embleme { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--primaire); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; letter-spacing: .5px; box-shadow: inset 0 0 0 3px var(--accent); }
.logo-texte { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-texte strong { font-size: 1.02rem; color: var(--primaire); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-texte small { color: var(--texte-doux); font-size: .85rem; }
@media (prefers-color-scheme: dark) { .logo-embleme { color: #0a1f3a; } }
.nav { gap: 2px; }
.nav-lien { padding: 10px 14px !important; font-weight: 600; color: var(--texte) !important; border-radius: 8px; position: relative; }
.nav-lien.actif, .nav-lien:hover { color: var(--primaire) !important; background: var(--primaire-clair); }
.nav-cta { margin-left: 8px; background: var(--accent); border-color: var(--accent); color: #1b1300 !important; }
.nav-cta:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); color: #fff !important; }
.nav-deroulant { position: relative; }
.sous-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 300px; background: var(--surface); border: 1px solid var(--bordure); border-top: 3px solid var(--accent); border-radius: 0 0 10px 10px; box-shadow: 0 12px 30px rgba(10, 35, 66, .15); padding: 10px; z-index: 30; }
.nav-deroulant:hover .sous-menu, .nav-deroulant:focus-within .sous-menu { display: block; }
.sous-menu a { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--texte); font-size: .93rem; }
.sous-menu a:hover { background: var(--primaire-clair); color: var(--primaire); }
.sous-menu .sous-menu-titre { font-weight: 700; color: var(--primaire); }
.sous-menu-groupe + .sous-menu-groupe { border-top: 1px solid var(--bordure); margin-top: 6px; padding-top: 6px; }
.menu-btn { font-size: 1.3rem; line-height: 1; }
@media (max-width: 860px) {
  .sous-menu { display: block; position: static; box-shadow: none; border: 0; border-left: 3px solid var(--accent); border-radius: 0; padding: 0 0 0 10px; min-width: 0; }
  .nav-cta { margin: 8px 0 0; }
}

/* Bannière des pages intérieures */
.banniere { background: linear-gradient(120deg, var(--primaire-fonce), var(--primaire) 60%, #1d5c9c); color: #fff; padding: 34px 0 30px; position: relative; overflow: hidden; }
.banniere::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; border: 40px solid rgba(232, 163, 23, .18); }
.banniere-titre { color: #fff; margin: 4px 0 0; font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
.banniere p { opacity: .9; margin: 8px 0 0; max-width: 720px; }
.banniere-ariane { font-size: .85rem; opacity: .85; }
.banniere-ariane a { color: #fff; }
@media (prefers-color-scheme: dark) { .banniere { background: linear-gradient(120deg, #0a1a30, #12355f); } }

/* Accueil */
.accueil-heros { background: linear-gradient(110deg, rgba(10, 35, 66, .84), rgba(15, 52, 96, .62)), var(--image-heros, linear-gradient(120deg, #0f3460, #1d5c9c)); background-size: cover; background-position: center; color: #fff; padding: clamp(48px, 9vw, 110px) 0; position: relative; overflow: hidden; }
.accueil-heros::before { content: ""; position: absolute; right: -120px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%; border: 60px solid rgba(232, 163, 23, .16); }
.accueil-heros .surtitre { display: inline-block; background: var(--accent); color: #1b1300; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; }
.accueil-heros h1 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); margin: 14px 0 12px; max-width: 760px; }
.accueil-heros p { max-width: 640px; font-size: 1.08rem; opacity: .92; }
.accueil-heros .btn { background: var(--accent); border-color: var(--accent); color: #1b1300; }
.accueil-heros .btn-secondaire { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
main.main-accueil { padding-top: 0; }
.chiffres { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.chiffres .conteneur { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffre { padding: 22px 12px; text-align: center; border-right: 1px solid var(--bordure); }
.chiffre:last-child { border-right: 0; }
.chiffre strong { display: block; font-size: 2rem; color: var(--primaire); line-height: 1.1; }
.chiffre span { color: var(--texte-doux); font-size: .9rem; }
.section { padding: 48px 0 8px; }
.section-titre { text-align: center; margin-bottom: 28px; }
.section-titre .surtitre { color: var(--accent-fonce); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.section-titre h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin: 6px 0 8px; }
.section-titre h2::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--accent); margin: 12px auto 0; }
.section-titre p { color: var(--texte-doux); max-width: 640px; margin: 0 auto; }
.carte-mention { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.carte-mention-entete { background: linear-gradient(120deg, #0a2342, #1d4f8c); color: #fff; padding: 22px 22px 18px; }
.carte-mention-entete h3 { color: #fff; font-size: 1.3rem; margin: 6px 0 0; }
.carte-mention-entete .etiquette { background: var(--accent); color: #1b1300; }
.carte-mention-corps { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.carte-mention-corps ul { margin: 0; padding-left: 18px; }
.niveaux-puces { display: flex; gap: 6px; flex-wrap: wrap; }
.niveaux-puces span { padding: 3px 10px; border-radius: 999px; background: var(--primaire-clair); color: var(--primaire); font-weight: 700; font-size: .8rem; }
.cycles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cycle { border-left: 5px solid var(--accent); }
.carte-pub { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.carte-pub .vignette { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--primaire), #1d5c9c); display: grid; place-items: center; color: rgba(255, 255, 255, .85); font-size: 2.2rem; }
.carte-pub .vignette img { width: 100%; height: 100%; object-fit: cover; }
.carte-pub .corps { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.carte-pub .lire { margin-top: auto; color: var(--primaire); font-weight: 600; font-size: .9rem; }
.bandeau-cta { background: linear-gradient(110deg, var(--accent), #f3c35c); color: #1b1300; border-radius: var(--rayon); padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 40px 0 8px; }
.bandeau-cta h2 { margin: 0 0 4px; color: #1b1300; }
.bandeau-cta p { margin: 0; }
.bandeau-cta .btn { background: #0a2342; border-color: #0a2342; color: #fff; }

/* Pied de page */
.pied { background: var(--sombre); color: #b9c6d8; padding: 0; border-top: 4px solid var(--accent); }
.pied a { color: #e6edf6; text-decoration: none; }
.pied a:hover { color: var(--accent); }
.pied-colonnes { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-top: 40px; padding-bottom: 28px; }
.pied h3 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.pied ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; }
.logo-pied .logo-texte strong { color: #fff; }
.pied-bas { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 0; font-size: .85rem; text-align: center; }
@media (max-width: 860px) { .pied-colonnes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pied-colonnes { grid-template-columns: 1fr; } }

/* Visionneuse PDF intégrée */
.visionneuse { border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; background: #525659; user-select: none; -webkit-user-select: none; }
.vis-barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: #323639; color: #f1f1f1; font-size: .88rem; }
.vis-outils { display: flex; align-items: center; gap: 6px; }
.vis-btn { min-height: 30px; padding: 2px 12px; background: #4a4f53; border: 0; color: #fff; font-size: 1.05rem; }
.vis-btn:hover { background: #63696e; color: #fff; }
.vis-zoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.vis-pages { max-height: 80vh; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* flex: none : chaque page garde sa hauteur réelle (sinon, avec beaucoup de pages, elles étaient comprimées et se recouvraient) ;
   margin auto : centrée, mais entièrement accessible par défilement horizontal quand elle est agrandie */
.vis-page { flex: none; margin: 0 auto; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); min-height: 120px; min-width: 120px; max-width: none; overflow: hidden; }
.vis-fin { flex: none; margin: 0 auto; }
.vis-page canvas { display: block; }
.vis-attente { padding: 60px 30px; color: #777; }
.vis-fin { color: #fff; background: rgba(0, 0, 0, .35); padding: 14px 18px; border-radius: 8px; text-align: center; max-width: 520px; }
.collant { position: sticky; top: 16px; }

/* Fenêtre de dialogue */
.dialogue { border: 0; border-radius: 14px; padding: 24px; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--texte); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dialogue::backdrop { background: rgba(10, 31, 58, .6); }
.dialogue-fermer { float: right; margin: -8px -8px 0 0; }

/* Tableaux de bord par mention / niveau */
.matrice td, .matrice th { text-align: center; }
.matrice td:first-child, .matrice th:first-child { text-align: left; }
.matrice a.cellule { display: block; padding: 6px; border-radius: 8px; text-decoration: none; color: var(--texte); }
.matrice a.cellule:hover { background: var(--primaire-clair); }
.matrice .cellule strong { display: block; font-size: 1.15rem; color: var(--primaire); }
.barre-progression { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barre-progression span { display: block; height: 100%; background: var(--succes); }

/* Photo d'identité */
.photo-identite { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 2px solid var(--bordure); background: var(--surface-2); display: block; }
.photo-champ { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.vignette-photo { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; display: block; }

/* Recherche globale de l'administration */
.recherche-globale { display: flex; gap: 8px; margin-bottom: 18px; }
.recherche-globale input { flex: 1; min-height: 46px; font-size: 1rem; border-width: 2px; }
.resultats-recherche li a { align-items: center; }

/* Résultats */
tr.ma-ligne td { background: var(--alerte-fond) !important; font-weight: 700; }
.decision-admis { color: var(--succes); font-weight: 700; }
.decision-ajourne { color: var(--danger); font-weight: 700; }
.grille-notes input[type=text] { width: 90px; text-align: right; padding: 6px 8px; }
.grille-notes input.invalide { border-color: var(--danger); background: var(--danger-fond); }
.publications-resultats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.publications-resultats .case { border: 1px solid var(--bordure); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media print {
  .barre-haut, .entete, .pied, .admin-menu, .no-print, .recherche-globale, .flash { display: none !important; }
  .admin-mise { display: block; }
  .bloc-resultat { break-inside: avoid; box-shadow: none; border: 0; }
  main { padding: 0; }
}
.bloc-resultat td:nth-child(2) { white-space: nowrap; }

/* Feuilles de résultats officielles (A4 portrait) — mêmes règles dans le logiciel ENS Notes */
.feuilles { overflow-x: auto; padding-bottom: 6px; }
.feuille { width: 210mm; min-height: 297mm; box-sizing: border-box; margin: 0 auto 18px; padding: 12mm 12mm 10mm; background: #fff; color: #000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15); font-family: "Times New Roman", Times, serif; font-size: 11pt; display: flex; flex-direction: column; }
.feuille p { margin: 0; }
.f-entete { display: grid; grid-template-columns: 34mm 1fr 34mm; align-items: center; gap: 4mm; text-align: center; }
.f-logo img { max-width: 30mm; max-height: 28mm; object-fit: contain; }
.f-logo-texte { display: inline-flex; align-items: center; justify-content: center; width: 26mm; height: 26mm; border: 1.5px solid #0f3460; border-radius: 50%;
  font-size: 8pt; font-weight: 700; color: #0f3460; line-height: 1.15; padding: 2mm; box-sizing: border-box; }
.f-centre { font-size: 12pt; line-height: 1.45; }
.f-devise { font-size: 10.5pt; }
.f-infos { display: flex; justify-content: space-between; gap: 8mm; margin: 9mm 2mm 7mm; font-size: 11.5pt; line-height: 2; }
.f-titre { text-align: center; font-size: 12pt; font-weight: 700; margin: 0 0 4mm; font-family: inherit; color: #000; }
.f-table { width: 100%; border-collapse: collapse; font-size: 10pt; margin: 0 auto; }
.f-table th, .f-table td { border: 1px solid #555; padding: 1.4mm 1.6mm; color: #000; background: #fff; vertical-align: middle; }
.f-table th { font-weight: 700; text-align: center; font-size: 9.5pt; }
.f-table td.c { text-align: center; white-space: nowrap; }
.f-table th.f-vide { border: 0; background: transparent; }
.f-table .f-valid { background: #e8f0de; }
.f-table .f-petit { font-weight: 400; font-size: 7.5pt; }
.f-table tr.ma-ligne td { background: #fff3c4; font-weight: 700; }
.f-nb { margin-top: 6mm !important; font-size: 11pt; line-height: 1.6; text-indent: 8mm; }
.f-signature { margin: 8mm 4mm 0 auto; text-align: center; min-width: 75mm; }
.f-titre-sign { margin-top: 2mm !important; font-weight: 700; }
.f-nom-sign { margin-top: 18mm !important; font-weight: 700; }
@media print {
  @page feuille { size: A4 portrait; margin: 0; }
  .feuilles { overflow: visible; }
  .feuille { page: feuille; }
  .feuilles { padding: 0; }
  .feuille { box-shadow: none; margin: 0; break-after: page; page-break-after: always; min-height: 0; }
  .feuille:last-child { break-after: auto; page-break-after: auto; }
}
.lieu-carte { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.lieu-carte:hover span { text-decoration: underline; }
.lieu-carte .epingle { flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.admin-mise > * { min-width: 0; }
.feuilles { max-width: 100%; }

/* Logo de l'Université de Toamasina dans l'en-tête */
.logo-universite { flex: none; height: 56px; width: auto; border-radius: 8px; background: #fff; padding: 2px; object-fit: contain; }
@media (max-width: 420px) { .logo-universite { height: 40px; } }

/* Compensation semestrielle (Notes et résultats) */
form.compensation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 8px; margin: 8px 0 14px; }
.compensation-active { background: var(--succes-fond, #e5f4ec); border-left: 4px solid #1a7f37; }
.compensation-inactive { background: var(--alerte-fond, #fdf1df); border-left: 4px solid var(--alerte, #a15c00); }

/* Inscription / réinscription */
.actions-droite { justify-content: flex-end; }
.carte-candidats { border: 1px solid var(--bordure); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: var(--surface-2, #f6f7f9); }
.carte-candidats h3 { margin: 0 0 4px; font-size: 1rem; }
.choix-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-choix { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface, #fff); color: var(--texte); text-decoration: none; }
.btn-choix:hover { border-color: var(--primaire); }

/* Choix de la langue (drapeaux) */
.choix-langue { display: inline-flex; gap: 4px; margin-right: 6px; }
.choix-langue .drapeau { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; min-height: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 5px;
  background: transparent; color: #fff; font-size: .74rem; font-weight: 700; cursor: pointer; line-height: 1.4; }
.choix-langue .drapeau.actif { background: rgba(255,255,255,.18); border-color: #fff; }
.choix-langue .drapeau svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

/* Champs saisis en majuscules */
input[data-majuscules] { text-transform: uppercase; }

/* En-tête officiel (comme le logiciel) : logo ENS + nom du site à gauche, langue + logo de l'Université à droite */
.entete-officielle { background: #fff; border-bottom: 3px solid var(--accent); color: #0f3460; }
.entete-officielle .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.eo-gauche { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.eo-gauche:hover { color: inherit; background: none; }
.eo-logo { width: 56px; height: 56px; object-fit: contain; flex: none; }
.eo-nom { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.12rem; line-height: 1.25; }
.eo-nom > span:first-child { display: block; }
.eo-nom > span:last-child { display: block; font-size: .92rem; font-weight: 600; color: #3d4f66; }
.eo-droite { display: flex; align-items: center; gap: 14px; flex: none; }
.entete-officielle .logo-universite { height: 56px; padding: 0; border-radius: 0; }
.entete-officielle .choix-langue .drapeau { color: #0f3460; border-color: #c9d2de; background: #fff; }
.entete-officielle .choix-langue .drapeau.actif { border-color: #0f3460; box-shadow: inset 0 0 0 1px #0f3460; background: #f1f4f9; }
.logo-compact .logo-texte strong { font-size: 1rem; }
@media (max-width: 700px) {
  .entete-officielle .conteneur { flex-wrap: wrap; gap: 8px; }
  .eo-logo { width: 42px; height: 42px; }
  .eo-nom { font-size: .92rem; }
  .eo-nom > span:last-child { font-size: .8rem; }
  .eo-droite { width: 100%; justify-content: space-between; }
  .entete-officielle .logo-universite { height: 40px; }
}

/* Fond personnalisé des cartes de mention (Paramètres) */
.carte-mention-entete.avec-fond { background: linear-gradient(180deg, rgba(10,35,66,.35), rgba(10,35,66,.82)), var(--fond) center / cover no-repeat; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.carte-mention-entete.avec-fond h3 { text-shadow: 0 1px 3px rgba(0,0,0,.5); }
/* Pied de page : logo de l'ENS */
.logo-pied-img { flex: none; width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
/* Cachet sur les feuilles de résultats, au-dessus du nom du chef de mention */
.f-cachet { height: 27mm; position: relative; margin-top: 1mm; }
.f-cachet img { position: absolute; width: auto; mix-blend-mode: multiply; pointer-events: none; }
.f-cachet .f-img-cachet { left: 50%; top: -1mm; transform: translateX(-70%); height: 30mm; opacity: .95; }
/* Signature posée en travers du cachet, comme sur papier */
.f-cachet .f-img-sign { left: 50%; top: 3mm; transform: translateX(-28%); height: 25mm; }
.f-nom-sign.apres-cachet { position: relative; margin-top: 0 !important; }
input[data-nom] { text-transform: uppercase; }
input[data-parent] { text-transform: none; }

/* Photo d'accueil un peu plus visible : le texte garde une ombre pour rester lisible */
.accueil-heros h1, .accueil-heros p { text-shadow: 0 2px 10px rgba(5, 18, 36, .55); }
/* Recherche dans une liste déroulante */
.recherche-liste { margin-bottom: 6px; }
/* Lecture d'un document de cours dans le site */
.lecture-cours { margin-top: 18px; }
.lecture-cours .visionneuse { min-height: 70vh; }
.image-cours { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; -webkit-user-select: none; user-select: none; }
