/* Portail formation — styles communs (mobile d'abord). */
:root {
  --fond: #f6f5f2;
  --carte: #ffffff;
  --texte: #1d1d1f;
  --doux: #5f6368;
  --bord: #e2e0da;
  --accent: #e8590c;
  --accent-fonce: #c2410c;
  --accent-clair: #fff1e8;
  --ok: #1a7f37;
  --ok-clair: #e8f5ec;
  --erreur: #b42318;
  --erreur-clair: #fdecea;
  --rayon: 12px;
  --ombre: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #141416;
    --carte: #1e1e21;
    --texte: #ececed;
    --doux: #a0a0a8;
    --bord: #33333a;
    --accent: #ff7a2e;
    --accent-fonce: #ff9152;
    --accent-clair: #2d1d12;
    --ok: #4ac26b;
    --ok-clair: #13261a;
    --erreur: #ff6b5e;
    --erreur-clair: #2e1513;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-fonce); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

/* Mise en page */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--carte); border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 10;
}
.entete .marque { font-weight: 700; color: var(--texte); text-decoration: none; }
.entete .marque span { color: var(--accent); }
.entete .qui { font-size: .9rem; color: var(--doux); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.centre { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 20px; margin-bottom: 16px;
}
.carte.etroite { width: 100%; max-width: 400px; }
.grille { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille.deux { grid-template-columns: 1fr 1fr; } }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--fond);
  border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
.aide { font-size: .85rem; color: var(--doux); margin-top: 4px; }

/* Boutons */
button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; border-radius: 8px; padding: 10px 16px;
  background: var(--accent); color: #fff; min-height: 44px;
}
button:hover, .bouton:hover { background: var(--accent-fonce); }
button:disabled { opacity: .6; cursor: wait; }
.secondaire { background: transparent; color: var(--texte); border-color: var(--bord); }
.secondaire:hover { background: var(--fond); }
.danger { background: var(--erreur); }
.danger:hover { background: var(--erreur); filter: brightness(.9); }
.petit { min-height: 34px; padding: 6px 10px; font-size: .88rem; }
.lien-bouton { background: none; border: none; color: var(--accent-fonce); padding: 0; min-height: 0; text-decoration: underline; font-weight: 500; }
.lien-bouton:hover { background: none; }
.plein { width: 100%; margin-top: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Messages */
.message { border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: .95rem; }
.message.ok { background: var(--ok-clair); color: var(--ok); }
.message.erreur { background: var(--erreur-clair); color: var(--erreur); }
.message.info { background: var(--accent-clair); color: var(--accent-fonce); }
.vide { color: var(--doux); font-style: italic; }

/* Listes de ressources */
.ressources { list-style: none; margin: 0; padding: 0; }
.ressources li { border-top: 1px solid var(--bord); }
.ressources li:first-child { border-top: none; }
.ressources a, .ressources button.ligne {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px;
  text-decoration: none; color: var(--texte); background: none; border: none;
  font-weight: 500; text-align: left; min-height: 52px; border-radius: 0;
}
.ressources a:hover, .ressources button.ligne:hover { background: var(--fond); }
.pastille {
  flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-clair); color: var(--accent-fonce); font-size: 1.1rem;
}
.groupe-titre { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 16px 0 4px; }
.meta { font-size: .85rem; color: var(--doux); }

/* Onglets (tableau de bord) */
.onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--bord); margin-bottom: 16px; }
.onglets button {
  background: none; color: var(--doux); border: none; border-bottom: 3px solid transparent;
  border-radius: 0; padding: 10px 12px; white-space: nowrap;
}
.onglets button[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--accent); }
.onglets button:hover { background: none; color: var(--texte); }

/* Tableaux */
.tableau-conteneur { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.etiquette { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--fond); border: 1px solid var(--bord); }
.etiquette.ok { background: var(--ok-clair); color: var(--ok); border-color: transparent; }
.etiquette.off { background: var(--erreur-clair); color: var(--erreur); border-color: transparent; }

[hidden] { display: none !important; }
