:root {
  --bleu: #0461a8;
  --bleu-fonce: #034a80;
  --fond: #f4f7fa;
  --encre: #1c2733;
  --gris: #64748b;
  --bord: #d8e1ea;
  --blanc: #ffffff;
  --rouge: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--encre);
  background: var(--fond) url("/static/brand/fond-clair.png") center/cover no-repeat fixed;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
header {
  background: var(--bleu-nuit, #1c2245); color: var(--blanc);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 1.2rem;
}
.marque {
  color: var(--blanc); text-decoration: none; font-size: 1.05rem; letter-spacing: .3px;
  display: flex; align-items: center; gap: .7rem;
}
.marque img { height: 34px; display: block; }
.marque span { opacity: .85; border-left: 1px solid rgb(255 255 255 / 35%); padding-left: .7rem; }

/* Page de connexion : fond sombre à motif, en-tête masqué */
body.page-connexion {
  background: #1c2245 url("/static/brand/fond-sombre.png") center/cover no-repeat fixed;
}
body.page-connexion header { display: none; }
body.page-connexion footer { color: rgb(255 255 255 / 65%); }
.logo-connexion { display: block; width: 200px; margin: 0 auto 1rem; }
.connexion h1 { text-align: center; }
header nav { display: flex; gap: 1rem; align-items: center; }
header nav a { color: var(--blanc); text-decoration: none; opacity: .92; }
header nav a:hover { text-decoration: underline; }
.qui { opacity: .75; font-size: .9rem; }
main { flex: 1; width: min(960px, 100% - 2rem); margin: 2rem auto; }
footer { text-align: center; color: var(--gris); font-size: .8rem; padding: 1rem; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.aide { color: var(--gris); }
.erreur { color: var(--rouge); background: #fdecea; border: 1px solid #f5c6c2; padding: .6rem .9rem; border-radius: 8px; }

.carte {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px;
  padding: 1.5rem; box-shadow: 0 1px 3px rgb(16 42 67 / 6%);
}
.connexion { max-width: 380px; margin: 8vh auto 0; }
label { display: block; margin: .9rem 0 .25rem; font-weight: 600; font-size: .9rem; }
input, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--bord); border-radius: 8px;
  font: inherit; background: var(--blanc);
}
input:focus, select:focus { outline: 2px solid var(--bleu); outline-offset: 1px; border-color: var(--bleu); }
button, .bouton {
  margin-top: 1.2rem; background: var(--bleu); color: var(--blanc); border: 0;
  padding: .6rem 1.3rem; border-radius: 8px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .bouton:hover { background: var(--bleu-fonce); }
.lien-retour { margin-left: 1rem; color: var(--gris); }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tuile {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px;
  padding: 1.2rem; text-decoration: none; color: inherit; position: relative;
  transition: box-shadow .15s, transform .15s;
}
a.tuile:hover { box-shadow: 0 4px 14px rgb(4 97 168 / 15%); transform: translateY(-2px); }
.tuile h2 { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--bleu); }
.tuile p { margin: 0; color: var(--gris); font-size: .9rem; }
.tuile.inactive { opacity: .65; }
.badge {
  position: absolute; top: .8rem; right: .8rem; background: var(--fond);
  border: 1px solid var(--bord); color: var(--gris);
  font-size: .72rem; padding: .1rem .5rem; border-radius: 999px;
}

.entete-page { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--bord); font-size: .92rem; }
th { background: var(--fond); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--gris); }
tr.desactive td { color: var(--gris); font-style: italic; }
.cases { display: flex; gap: 1.5rem; margin-top: 1rem; }

/* Module QUALIOPI — dossiers */
.recherche { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.recherche input { max-width: 340px; }
.recherche button { margin-top: 0; }
.pastille {
  display: inline-block; min-width: 3.2em; text-align: center; font-size: .78rem;
  padding: .12rem .45rem; border-radius: 999px; background: var(--fond);
  border: 1px solid var(--bord); color: var(--gris);
}
.pastille.ok { background: #e6f4ea; border-color: #b7dfc2; color: #1e7e34; }
.pastille.moyen { background: #fff4e0; border-color: #f5d9a8; color: #a86a00; }
.pastille.alerte { background: #fdecea; border-color: #f5c6c2; color: var(--rouge); }
.entete-dossier { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.entete-dossier h1 { margin-bottom: .3rem; }
.bloc-audit { min-width: 240px; text-align: right; }
.bloc-audit .score { margin: .4rem 0; }
.jauge { height: 10px; background: var(--fond); border: 1px solid var(--bord); border-radius: 999px; overflow: hidden; }
.jauge-barre { height: 100%; border-radius: 999px; background: var(--gris); }
.jauge-barre.ok { background: #2e9e4f; }
.jauge-barre.moyen { background: #e8a13c; }
.jauge-barre.alerte { background: var(--rouge); }
.onglets { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.onglets a {
  text-decoration: none; color: var(--encre); background: var(--blanc);
  border: 1px solid var(--bord); border-radius: 999px; padding: .35rem .85rem; font-size: .9rem;
}
.onglets a.actif { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); }
.onglets a.actif .pastille { background: rgb(255 255 255 / 20%); border-color: transparent; color: var(--blanc); }
form.ligne { display: flex; gap: .4rem; align-items: center; }
form.ligne input { max-width: 200px; padding: .3rem .5rem; }
form.ligne button { margin-top: 0; padding: .35rem .7rem; font-size: .85rem; }
button.secondaire { background: var(--blanc); color: var(--bleu); border: 1px solid var(--bleu); }
button.secondaire:hover { background: var(--fond); }
.info { background: #e8f1fb; border: 1px solid #c4dcf5; color: var(--bleu-fonce); padding: .5rem .8rem; border-radius: 8px; }
.actions-point { display: flex; gap: .4rem; align-items: center; }

/* Vue pipeline (kanban) des dossiers */
.kanban { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .8rem; align-items: flex-start; }
.colonne {
  flex: 0 0 268px; background: rgb(216 225 234 / 35%); border: 1px solid var(--bord);
  border-radius: 12px; padding: .6rem; display: flex; flex-direction: column; gap: .6rem;
}
.colonne header { display: flex; justify-content: space-between; align-items: center; padding: 0 .2rem; background: none; color: inherit; }
.colonne h2 { font-size: .82rem; margin: 0; text-transform: uppercase; letter-spacing: .4px; color: var(--gris); }
.compteur {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 999px;
  font-size: .75rem; padding: 0 .5rem; color: var(--gris);
}
.colonne .vide { text-align: center; color: var(--bord); margin: .4rem 0; }
.carte-dossier {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px;
  padding: .7rem .8rem; text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.carte-dossier:hover { box-shadow: 0 5px 14px rgb(4 97 168 / 18%); transform: translateY(-2px); border-color: var(--bleu); }
.carte-dossier h3 { margin: 0; font-size: .98rem; }
.cd-haut { display: flex; justify-content: space-between; align-items: center; }
.cd-numero {
  font-size: .78rem; font-weight: 700; letter-spacing: .5px; color: var(--bleu);
  background: #e8f1fb; border-radius: 6px; padding: .1rem .5rem;
}
.carte-dossier h2 { margin: .2rem 0 0; font-size: 1.08rem; }
.cd-titre { margin: 0; color: var(--gris); font-size: .9rem; }
.cd-formation { margin: .15rem 0 .4rem; font-size: .9rem; }
.cd-bas { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.badge-etape {
  font-size: .75rem; background: var(--fond); border: 1px solid var(--bord);
  border-radius: 999px; padding: .12rem .55rem; color: var(--encre);
}
.badge-parcours {
  font-size: .75rem; border-radius: 999px; padding: .12rem .55rem;
  background: var(--fond); border: 1px solid var(--bord); color: var(--gris);
}
.badge-parcours.complet { background: #e6f4ea; border-color: #b7dfc2; color: #1e7e34; }
.ajout-point { margin-top: 1rem; }
.ajout-point input[name="label"] { max-width: 420px; }
form.ligne select { padding: .3rem .5rem; max-width: 230px; }
.cases label, fieldset label { font-weight: 400; display: flex; gap: .45rem; align-items: center; margin: .3rem 0; }
fieldset { border: 1px solid var(--bord); border-radius: 8px; margin-top: 1.2rem; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .4rem; }
