/* Site Fiches formation. Couleurs et volet de lecture repris de KM Visconti. */
:root {
  --entete: 56px;
  --fond: #f7f6f2;
  --surface: #ffffff;
  --texte: #1f2328;
  --discret: #5d6470;
  --bord: #e2e0d8;
  --accent: #1d4e89;
  --accent-doux: #e6eef8;
  --alerte: #8a4b00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16181c;
    --surface: #1e2126;
    --texte: #e6e6e3;
    --discret: #9aa1ab;
    --bord: #33373e;
    --accent: #8db8ea;
    --accent-doux: #22324a;
    --alerte: #f0b35c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.discret { color: var(--discret); }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* En-tête */
.entete {
  position: sticky; top: 0; z-index: 5; height: var(--entete); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--accent); }
.marque span { color: var(--texte); }
.compte { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.compte form { margin: 0; }
.lien-bouton { background: none; border: 1px solid var(--bord); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.lien-bouton:hover { background: var(--accent-doux); }

/* Liste et volet de lecture côte à côte */
.cadre { display: grid; grid-template-columns: minmax(0, 1fr); }
.cadre.avec-lecteur { grid-template-columns: minmax(420px, 44%) minmax(0, 1fr); }
.contenu { padding: 16px 18px 40px; min-width: 0; }
.outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
#recherche {
  flex: 1 1 260px; min-width: 0; padding: 8px 12px; font: inherit; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bord); border-radius: 8px;
}
.bouton-principal {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer;
  color: #fff; background: var(--accent); border: 0; border-radius: 8px; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .bouton-principal { color: #10151c; } }
.bouton-principal:disabled { opacity: .45; cursor: default; }

table.jeux { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.jeux th { text-align: left; font-size: 12px; font-weight: 600; color: var(--discret); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--bord); }
.jeux td { padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.jeux tbody tr:last-child td { border-bottom: 0; }
.jeux tbody tr[data-id] { cursor: pointer; }
.jeux tbody tr[data-id]:hover { background: var(--accent-doux); }
.jeux tbody tr.ouvert { background: var(--accent-doux); box-shadow: inset 3px 0 0 var(--accent); }
.col-case { width: 36px; text-align: center; }
.col-case input { width: 17px; height: 17px; cursor: pointer; }
.col-photo { width: 190px; }
.col-date { width: 110px; white-space: nowrap; color: var(--discret); font-size: 14px; }
.col-pdf { width: 56px; text-align: center; }
.photos { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.photos img, .pastille {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface);
  background: var(--accent-doux); flex: none;
}
.photos > * + * { margin-left: -12px; }
.pastille { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--accent); }
.pastille.plus { font-size: 12px; }
.noms { display: inline-block; vertical-align: middle; max-width: 120px; font-size: 13px; color: var(--discret); line-height: 1.25; }
.cadre.avec-lecteur .noms, .cadre.avec-lecteur .col-date { display: none; }
.cadre.avec-lecteur .col-photo { width: 76px; }
.date-sous-titre { display: none; font-size: 12.5px; color: var(--discret); }
.cadre.avec-lecteur .date-sous-titre { display: block; }
.cadre.avec-lecteur .contenu { overflow: hidden; }
table.jeux { table-layout: auto; }
.col-titre { overflow-wrap: anywhere; }
.ouvrir { display: block; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; font-weight: 600; color: var(--texte); }
.ouvrir:hover, .ouvrir:focus-visible { color: var(--accent); text-decoration: underline; }
.detail { display: block; font-size: 13px; color: var(--discret); }
a.icone { display: inline-block; padding: 3px 7px; font-size: 12px; font-weight: 700; text-decoration: none; border: 1px solid var(--bord); border-radius: 6px; }
a.icone:hover { background: var(--accent-doux); }
.confidentiel { margin: 18px 2px 0; font-size: 12.5px; color: var(--discret); }

/* Type de formation, demande de Robin du 2026-12-02 */
.types { display: inline-flex; flex: none; border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; background: var(--surface); }
.types button { padding: 7px 11px; font-size: 13px; background: none; border: 0; cursor: pointer; }
.types button + button { border-left: 1px solid var(--bord); }
.types button[aria-pressed="true"] { background: var(--accent-doux); font-weight: 600; }
.type { display: inline-block; margin-bottom: 2px; padding: 0 7px; font-size: 11px; font-weight: 600; letter-spacing: .02em; border-radius: 999px; }
.type-initiale { color: #1d4e89; background: #e6eef8; }
.type-continue { color: #3b6e4f; background: #e5f2ea; }
.type-hors-calendrier { color: #7a2e8c; background: #f6e9f9; }
@media (prefers-color-scheme: dark) {
  .type-initiale { color: #8db8ea; background: #22324a; }
  .type-continue { color: #8fd0a6; background: #1f3328; }
  .type-hors-calendrier { color: #e0a8ef; background: #3a2342; }
}

/* Volet de lecture, comme sur KM Visconti */
.lecteur[hidden] { display: none; }
.lecteur {
  position: sticky; top: var(--entete); height: calc(100vh - var(--entete)); min-width: 0;
  display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-left: 1px solid var(--bord);
}
.lecteur:fullscreen { width: 100vw; height: 100vh; border: 0; }
.lecteur-barre {
  display: flex; gap: 8px; align-items: center; padding: 6px 8px 6px 14px;
  background: var(--surface); border-bottom: 1px solid var(--bord); font-size: 13px;
}
.lecteur-titre { flex: 1; min-width: 0; color: var(--discret); }
.lecteur-titre > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formats { display: inline-flex; border: 1px solid var(--bord); border-radius: 6px; overflow: hidden; flex: none; }
.formats button { padding: 3px 10px; background: var(--surface); border: 0; cursor: pointer; }
.formats button + button { border-left: 1px solid var(--bord); }
.formats button[aria-pressed="true"] { background: var(--accent-doux); font-weight: 600; }
.formats button:disabled { opacity: .45; cursor: default; }
.nouvel-onglet { flex: none; text-decoration: none; border: 1px solid var(--bord); border-radius: 6px; padding: 3px 10px; white-space: nowrap; }
.nouvel-onglet:hover { background: var(--accent-doux); }
.loupe { display: inline-flex; flex: none; border: 1px solid var(--bord); border-radius: 6px; overflow: hidden; }
.loupe button { padding: 2px 8px; background: var(--surface); border: 0; cursor: pointer; }
.loupe .loupe-niveau { min-width: 56px; border-left: 1px solid var(--bord); border-right: 1px solid var(--bord); font-size: 12px; }
.loupe button:hover { background: var(--accent-doux); }
.icone-volet {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; color: var(--texte);
}
.icone-volet:hover { background: var(--accent-doux); border-color: var(--bord); }
.fermer { flex: none; width: 30px; height: 30px; font-size: 22px; line-height: 1; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.fermer:hover { background: var(--accent-doux); }
.lecteur-cadre { position: relative; flex: 1; min-height: 0; }
.lecteur-attente { position: absolute; inset: 40% 0 auto; margin: 0; text-align: center; color: var(--discret); font-size: 14px; }
.lecteur-doc { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity .15s; }
.lecteur-doc.charge { opacity: 1; }

/* Téléphone : la liste seule, les documents s'ouvrent dans un onglet. */
@media (max-width: 800px) {
  .cadre.avec-lecteur { grid-template-columns: minmax(0, 1fr); }
  .lecteur { display: none !important; }
  .contenu { padding: 12px 10px 30px; }
  .noms, .compte .discret { display: none; }
  .col-photo { width: 56px; }
  .col-date { width: 84px; font-size: 13px; }
  .marque span { font-size: 15px; }
}

/* Page de connexion */
.page-connexion main { max-width: 460px; margin: 8vh auto; padding: 0 18px; }
.page-connexion h1 { font-size: 22px; line-height: 1.3; margin: 0 0 18px; }
.carte-connexion { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; }
.carte-connexion p { margin: 0; }
.carte-connexion label { font-weight: 600; font-size: 14px; }
.carte-connexion input {
  padding: 10px 12px; font: inherit; font-size: 16px; color: var(--texte);
  background: var(--fond); border: 1px solid var(--bord); border-radius: 8px;
}
.carte-connexion input#code { font-size: 24px; letter-spacing: 6px; font-family: ui-monospace, Consolas, monospace; }
.carte-connexion button { padding: 10px; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .carte-connexion button { color: #10151c; } }
.erreur { color: var(--alerte); font-weight: 600; }
