:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --texte: #1c2733;
  --discret: #5b6878;
  --bord: #d5dce5;
  --marque: #1f4e79;
  --marque-fonce: #163a5c;
  --accent: #1b8a6b;
  --alerte: #b3261e;
  --attention: #9a6700;
  --focus: #2b7de9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #1a212a;
    --texte: #e6ebf1;
    --discret: #9aa7b6;
    --bord: #334050;
    --marque: #6fa8dc;
    --marque-fonce: #8bbbe8;
    --accent: #4cc3a0;
    --alerte: #ff8a80;
    --attention: #e3b341;
    --focus: #79b3ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--marque); }
.conteneur { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.entete { background: var(--marque); color: #fff; }
.entete .conteneur { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.marque { font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .02em; }
.marque small { font-weight: 400; opacity: .85; display: block; font-size: 12px; letter-spacing: 0; }
.entete .espace { flex: 1; }
.entete .utilisateur { font-size: 14px; opacity: .95; }
.entete a, .entete button.lien { color: #fff; font-size: 14px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font-family: inherit; }
.entete form { display: inline; margin: 0; }
main { padding: 20px 0 48px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3.groupe { font-size: 16px; margin: 26px 0 10px; color: var(--marque-fonce); padding-bottom: 4px; border-bottom: 2px solid var(--bord); }
.sous-titre { color: var(--discret); margin: 0 0 16px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.barre { height: 10px; background: var(--bord); border-radius: 999px; overflow: hidden; }
.barre > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.bandeau { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.bandeau .grand { font-size: 28px; font-weight: 700; }
.bandeau .barre { flex: 1; min-width: 160px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.bouton, button.bouton {
  display: inline-block; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  background: var(--marque); color: #fff; border: 1px solid var(--marque); border-radius: 8px; padding: 9px 16px; min-height: 44px;
}
.bouton:hover { background: var(--marque-fonce); }
.bouton.secondaire { background: transparent; color: var(--marque); }
.bouton.secondaire:hover { background: rgba(31,78,121,.08); }
.bouton.valider { background: var(--accent); border-color: var(--accent); }
.bouton.petit { padding: 4px 10px; min-height: 32px; font-size: 13px; font-weight: 500; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.liste-sections { list-style: none; margin: 0; padding: 0; }
.ligne-section { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px 14px; align-items: center; }
.ligne-section .code { font-size: 22px; font-weight: 700; color: var(--marque); text-align: center; }
.ligne-section .titre { font-weight: 600; }
.ligne-section .meta { color: var(--discret); font-size: 14px; }
.ligne-section .barre { margin-top: 6px; }
.etat { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--bord); color: var(--discret); }
.etat.termine { color: var(--accent); border-color: var(--accent); }
.etat.encours { color: var(--attention); border-color: var(--attention); }
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface); margin-bottom: 6px; }
.messages li.error { border-color: var(--alerte); color: var(--alerte); }
.avis { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--attention); background: var(--surface); margin-bottom: 14px; }
.question { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.question.remplie { border-left: 5px solid var(--accent); }
.question .enonce { display: flex; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.question .num { color: var(--marque); min-width: 42px; }
label.etiquette { display: block; font-size: 13px; color: var(--discret); margin: 8px 0 3px; }
textarea {
  width: 100%; font: inherit; color: var(--texte); background: var(--bg); border: 1px solid var(--bord);
  border-radius: 8px; padding: 9px 11px; resize: vertical; min-height: 46px; line-height: 1.4;
}
textarea:disabled { opacity: .75; cursor: not-allowed; }
textarea.remarque { min-height: 38px; }
.rapides { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pieces { list-style: none; margin: 8px 0 0; padding: 0; }
.pieces li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--bord); font-size: 14px; flex-wrap: wrap; }
.pieces .nom { flex: 1; min-width: 140px; word-break: break-all; }
.pieces .taille { color: var(--discret); }
.pieces button.suppr { background: none; border: 0; color: var(--alerte); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; padding: 4px; }
.ligne-fichier { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ligne-fichier input[type=file] { font-size: 14px; max-width: 100%; }
.coche { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; }
.coche input { width: 22px; height: 22px; accent-color: var(--accent); }
.etat-sauvegarde { font-size: 13px; color: var(--discret); margin-top: 6px; min-height: 18px; }
.etat-sauvegarde.ok { color: var(--accent); }
.etat-sauvegarde.erreur { color: var(--alerte); font-weight: 600; }
.barre-fixe { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; border-bottom: 1px solid var(--bord); margin-bottom: 14px; }
.barre-fixe .bandeau .grand { font-size: 18px; }
.navigation { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.fin-section { text-align: center; padding: 22px 16px; }
.formulaire { max-width: 420px; margin: 40px auto; }
.formulaire label { display: block; font-weight: 600; margin: 14px 0 4px; }
.formulaire input[type=text], .formulaire input[type=password], .formulaire input[type=email] {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; background: var(--bg); color: var(--texte); min-height: 44px;
}
.erreurs { color: var(--alerte); margin: 8px 0; font-size: 14px; }
.aide { color: var(--discret); font-size: 13px; }
table.historique { width: 100%; border-collapse: collapse; font-size: 14px; }
table.historique th, table.historique td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
table.historique td.long { max-width: 280px; white-space: pre-wrap; word-break: break-word; }
.pagination { display: flex; gap: 12px; margin-top: 14px; align-items: center; }
.pied { color: var(--discret); font-size: 13px; text-align: center; padding: 18px 16px 30px; }
.defilement { overflow-x: auto; }
@media (max-width: 560px) {
  h1 { font-size: 21px; }
  .barre-fixe .bandeau { gap: 4px 10px; }
  .barre-fixe .bandeau .barre { flex: 1 1 100%; min-width: 0; }
  .barre-fixe #prog-global { display: none; }
  .ligne-section { grid-template-columns: 34px 1fr; }
  .ligne-section .action { grid-column: 1 / -1; }
  .ligne-section .action .bouton { width: 100%; text-align: center; }
  .navigation .bouton { flex: 1; text-align: center; }
}

/* Présentation et mode d'emploi */
.presentation summary { cursor: pointer; font-weight: 700; font-size: 16px; }
.presentation h2 { font-size: 17px; margin: 18px 0 6px; }
.presentation p { margin: 0 0 10px; line-height: 1.55; }
.presentation .pas { margin: 0 0 12px; padding-left: 22px; line-height: 1.55; }
.presentation .pas li { margin-bottom: 6px; }
