/* Back office PROMETUDE — marine #0f2747, orange #f7931e (mêmes valeurs que le site). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/montserrat-latin-variable.woff2") format("woff2");
}

:root {
  --marine: #0f2747;
  --marine-fonce: #081a33;
  --marine-clair: #24497a;
  --orange: #f7931e;
  --orange-texte: #b25000;
  --orange-pale: #fff3e6;
  --texte: #2c3a52;
  --discret: #53627a;
  --fond: #f4f6fa;
  --blanc: #fff;
  --bordure: #dde3ec;
  --champ: #6b7a93;
  --erreur: #b3261e;
  --erreur-pale: #fdecea;
  --succes: #1e7a46;
  --succes-pale: #e6f4ec;
  --info-pale: #e8eef7;
  --rayon: 0.75rem;
  --ombre: 0 1px 2px rgb(15 39 71 / 0.06), 0 8px 24px rgb(15 39 71 / 0.07);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--texte);
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--fond); font-size: 0.95rem; }
h1, h2, h3, legend { color: var(--marine); line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
a { color: var(--marine-clair); }
a:hover { color: var(--orange-texte); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
code { font-size: 0.85em; background: var(--fond); padding: 0.1em 0.35em; border-radius: 0.3em; word-break: break-all; }
small { font-weight: 400; }

.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--blanc); padding: 0.5rem 1rem; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Cadre ─────────────────────────────────────────────────────────────── */
.bo-cadre { display: grid; grid-template-columns: 15.5rem 1fr; min-height: 100vh; background: linear-gradient(to right, var(--marine) 15.5rem, var(--fond) 15.5rem); }
.bo-menu { background: var(--marine); color: #fff; padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.bo-logo { display: block; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: 0.02em; margin-bottom: 1.5rem; }
.bo-logo:hover { color: #fff; }
.bo-logo small { display: block; font-size: 0.7rem; font-weight: 500; color: #c9d3e3; letter-spacing: 0.08em; text-transform: uppercase; }
.bo-logo__accent { color: var(--orange); }
.bo-logo--grand { color: var(--marine); text-align: center; font-size: 2rem; }
.bo-logo--grand small { color: var(--discret); }
.bo-menu__bascule { display: none; }
.bo-menu__liens { display: flex; flex-direction: column; gap: 0.15rem; }
.bo-menu__liens a, .bo-menu__deconnexion button {
  color: #e6ecf5; text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font: inherit; text-align: left;
}
.bo-menu__liens a:hover, .bo-menu__deconnexion button:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.bo-menu__liens a[aria-current="page"] { background: rgb(247 147 30 / 0.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.bo-menu__groupe { margin: 1.1rem 0 0.25rem; padding: 0 0.75rem; font-size: 0.7rem; font-weight: 700; color: #9fb0c9; text-transform: uppercase; letter-spacing: 0.08em; }
.bo-menu__deconnexion button { background: none; border: 0; cursor: pointer; width: 100%; }
.bo-contenu { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 72rem; width: 100%; min-width: 0; }
.bo-contenu:focus { outline: none; }

/* ── Éléments ──────────────────────────────────────────────────────────── */
.entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.entete__compte { font-size: 1rem; font-weight: 600; color: var(--discret); background: var(--blanc); border-radius: 999px; padding: 0.1rem 0.6rem; vertical-align: middle; }
.fil { margin: 0 0 0.25rem; font-size: 0.85rem; }
.carte { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.25rem 1.5rem; margin: 0 0 1.25rem; border: 0; }
.carte--danger { border-left: 4px solid var(--erreur); }
.vide { text-align: center; padding: 2.5rem; }
fieldset.carte { min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0; float: left; width: 100%; margin-bottom: 1rem; }
legend + * { clear: both; }
legend small { color: var(--discret); font-size: 0.8rem; margin-left: 0.5rem; }

.alerte { border-radius: 0.6rem; padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
.alerte p { margin: 0.25rem 0; }
.alerte ul { margin: 0; padding-left: 1.2rem; }
.alerte--succes { background: var(--succes-pale); color: var(--succes); border-left: 4px solid var(--succes); }
.alerte--erreur { background: var(--erreur-pale); color: var(--erreur); border-left: 4px solid var(--erreur); }
.alerte--info { background: var(--orange-pale); color: #7a3e00; border-left: 4px solid var(--orange); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 700; border-radius: 999px; padding: 0.6rem 1.2rem;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.bouton--principal { background: var(--orange); color: var(--marine-fonce); }
.bouton--principal:hover { background: #ffa94a; color: var(--marine-fonce); }
.bouton--secondaire { background: var(--blanc); color: var(--marine); border-color: var(--marine); }
.bouton--secondaire:hover { background: var(--marine); color: #fff; }
.bouton--danger { background: var(--erreur); color: #fff; }
.bouton--danger:hover { background: #8c1d17; color: #fff; }
.bouton--large { width: 100%; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--marine-clair); text-decoration: underline; cursor: pointer; }
.lien-bouton:hover { color: var(--orange-texte); }
.lien-danger, .lien-danger.lien-bouton { color: var(--erreur); }
.lien-discret { color: var(--discret); }
.icone-bouton { border: 1px solid var(--bordure); background: var(--blanc); border-radius: 0.4rem; width: 2rem; height: 2rem; cursor: pointer; color: var(--marine); }
.icone-bouton:disabled { opacity: 0.35; cursor: default; }

.pastille { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pastille--publiee { background: var(--succes-pale); color: var(--succes); }
.pastille--brouillon { background: #eceff4; color: var(--discret); }
.pastille--depubliee { background: var(--orange-pale); color: var(--orange-texte); }

/* ── Formulaires ───────────────────────────────────────────────────────── */
.formulaire--etroit { max-width: 28rem; }
.champ { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.champ label { font-weight: 600; color: var(--marine); }
.requis, .facultatif { font-weight: 500; font-size: 0.75rem; color: var(--discret); margin-left: 0.25rem; }
.requis { color: var(--orange-texte); }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  font: inherit; color: var(--texte); background: var(--blanc);
  border: 1.5px solid var(--champ); border-radius: 0.5rem; padding: 0.55rem 0.7rem; width: 100%;
}
textarea { resize: vertical; }
input[type="file"] { font: inherit; }
.champ--erreur input, .champ--erreur select, .champ--erreur textarea { border-color: var(--erreur); }
.aide { color: var(--discret); font-size: 0.85rem; margin: 0; }
.carte > .aide, .bo-contenu > .aide { margin-bottom: 1rem; }
.erreur { color: var(--erreur); font-weight: 600; font-size: 0.85rem; margin: 0; }
.compteur { font-size: 0.8rem; color: var(--discret); align-self: flex-end; margin-top: -0.2rem; }
.compteur--ideal { color: var(--succes); }
.compteur--hors { color: var(--orange-texte); }
.case { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.depot__actuel { background: var(--fond); border-radius: 0.5rem; padding: 0.6rem 0.8rem; margin: 0; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.25rem; }
.grille-ajout { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 0 1rem; align-items: end; }
.grille-ajout .bouton { margin-bottom: 1rem; }
.barre-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--fond); padding: 1rem 0; box-shadow: 0 -8px 16px -12px rgb(15 39 71 / 0.35); }
.barre-actions .lien-danger { margin-left: auto; }

.filtres { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); gap: 0 0.75rem; align-items: end; background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1rem 1.25rem 0.25rem; margin-bottom: 1.25rem; }
.filtres__actions { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: center; margin-bottom: 0.75rem; }

/* ── Tableaux ──────────────────────────────────────────────────────────── */
.tableau-conteneur { overflow-x: auto; background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--discret); padding: 0.75rem 1rem; border-bottom: 2px solid var(--bordure); vertical-align: bottom; }
.tableau td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }
.tableau__titre { font-weight: 700; text-decoration: none; color: var(--marine); }
.tableau td:first-child { min-width: 14rem; }
.tableau td:nth-child(2) { min-width: 9rem; }
.tableau__secondaire { color: var(--discret); font-size: 0.85rem; }
.actions { white-space: nowrap; font-size: 0.85rem; }
.actions > * { display: block; margin-bottom: 0.2rem; }
.actions form { display: block; }
.pagination { display: flex; gap: 1.5rem; justify-content: center; align-items: center; margin-top: 1.25rem; }

/* ── Tableau de bord ───────────────────────────────────────────────────── */
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.chiffres div { background: var(--fond); border-radius: 0.6rem; padding: 0.9rem 1rem; }
.chiffres dt { font-size: 0.8rem; color: var(--discret); }
.chiffres dd { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--marine); }
.top { padding-left: 1.2rem; }
.top li { margin-bottom: 0.3rem; }

/* ── Chapitres ─────────────────────────────────────────────────────────── */
.groupe summary { cursor: pointer; padding: 0.25rem 0; }
.chapitres { padding-left: 1.5rem; margin: 0.75rem 0 0; }
.chapitres li { margin-bottom: 0.4rem; }
.chapitre { display: flex; gap: 0.6rem; align-items: center; }
.chapitre input { max-width: 26rem; padding: 0.35rem 0.6rem !important; }
.chapitre__compte { min-width: 4.5rem; }

/* ── Compte / 2FA ──────────────────────────────────────────────────────── */
.qr { width: 12rem; margin: 0.5rem 0 1rem; }
.qr svg { width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 0.3rem 2rem; list-style: none; padding: 0; }
.codes code { font-size: 1rem; }
.etapes { padding-left: 1.2rem; }

/* ── Connexion ─────────────────────────────────────────────────────────── */
.bo--connexion { background: linear-gradient(160deg, var(--marine) 0 40%, var(--fond) 40%); min-height: 100vh; }
.connexion { max-width: 25rem; margin: 0 auto; padding: 4rem 1rem; }
.connexion .bo-logo--grand { color: #fff; }
.connexion .bo-logo--grand small { color: #c9d3e3; }
.connexion__carte { padding: 2rem; }
.connexion__carte h1 { margin-bottom: 1.25rem; }
.connexion__pied { text-align: center; color: var(--discret); font-size: 0.8rem; }

/* ── Petits écrans (publier depuis un téléphone) ───────────────────────── */
@media (max-width: 60rem) {
  .bo-cadre { grid-template-columns: 1fr; background: var(--fond); }
  .bo-menu { position: static; height: auto; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .bo-logo { margin: 0; font-size: 1.1rem; }
  .bo-menu__bascule { display: block; font: inherit; color: #fff; background: none; border: 1.5px solid #9fb0c9; border-radius: 0.5rem; padding: 0.35rem 0.8rem; }
  .bo-menu__liens { display: none; width: 100%; padding-top: 0.75rem; }
  .bo-menu__liens.ouvert { display: flex; }
  .filtres, .grille-2, .grille-3, .grille-ajout { grid-template-columns: 1fr; }
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapitre { flex-wrap: wrap; }
}

/* ── Statistiques ─────────────────────────────────────────────────────── */
.entete__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.widget__pied { margin-top: 1rem; border-top: 1px solid var(--bordure); padding-top: 0.75rem; }
.widget__pied .aide { margin: 0; }
.periodes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.periodes a { padding: 0.4rem 0.9rem; border-radius: 999px; background: var(--blanc); color: var(--marine); text-decoration: none; font-weight: 600; border: 1px solid var(--bordure); }
.periodes a[aria-current] { background: var(--marine); color: #fff; border-color: var(--marine); }
.legende { display: flex; gap: 1.25rem; margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.85rem; color: var(--texte); }
.legende li { display: flex; align-items: center; gap: 0.4rem; }
.legende__trait { display: inline-block; width: 1.25rem; height: 0.25rem; border-radius: 2px; }
.legende__trait--vues { background: #1f5fa8; }
.legende__trait--telechargements { background: #d97706; }
.graphique { position: relative; }
.graphique svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphique__axe { font-size: 11px; fill: var(--discret); font-variant-numeric: tabular-nums; }
.graphique__etiquette { font-size: 12px; font-weight: 600; fill: var(--texte); }
.graphique [data-point] { cursor: crosshair; }
.graphique__infobulle { position: absolute; top: 0; pointer-events: none; background: var(--blanc); border: 1px solid var(--bordure); border-radius: 0.5rem; box-shadow: var(--ombre); padding: 0.5rem 0.75rem; font-size: 0.85rem; white-space: nowrap; transform: translateX(-50%); }
.graphique__infobulle strong { display: block; color: var(--marine); }
.graphique__infobulle span { display: flex; align-items: center; gap: 0.4rem; }
.graphique__tableau { margin-top: 1rem; }
.graphique__tableau summary { cursor: pointer; color: var(--marine-clair); font-weight: 600; margin-bottom: 0.75rem; }
