/* Socle CPS multi-clients — feuille de style (charte CPS Consult) */
:root {
  --nav: #49535C;
  --accent: #899FA5;
  --sable: #CCC4A6;
  --brun: #989585;
  --fond: #f3f3f2;
  --carte: #ffffff;
  --bord: #dfe2e4;
  --texte: #23292e;
  --doux: #5f6b74;
  --ok: #2e7d4f;
  --ok-fond: #e6f3eb;
  --alerte: #a15c00;
  --alerte-fond: #fff4e0;
  --erreur: #b3261e;
  --erreur-fond: #fdecea;
  --test: #b26a00;
  --test-fond: #fff1d6;
  --rayon: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px; color: var(--texte); background: var(--fond); line-height: 1.45;
}
a { color: #2f5f73; }
h1 { font-size: 26px; font-weight: 500; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.droite { text-align: right; }
.nowrap { white-space: nowrap; }
.cache { display: none !important; }

/* ---- Structure -------------------------------------------------------- */
.cadre { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--nav) 228px, transparent 228px); }
.menu {
  width: 228px; flex: 0 0 228px; background: var(--nav); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu .marque { padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.menu .marque a { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.menu .marque small { display: block; color: rgba(255,255,255,.65); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.menu .section {
  margin: 22px 14px 8px; font-size: 13px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sable);
}
.menu a.lien {
  display: block; color: rgba(255,255,255,.92); text-decoration: none; padding: 8px 17px; font-size: 15px;
}
.menu a.lien:hover { background: rgba(255,255,255,.08); }
.menu a.lien.actif { background: rgba(255,255,255,.14); font-weight: 600; }
.menu .pied { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.12); font-size: 11px; color: rgba(255,255,255,.6); }
.menu .pied img { max-width: 92px; max-height: 44px; display: block; margin-bottom: 8px; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barre {
  background: #fff; border-bottom: 1px solid var(--bord); padding: 8px 22px; min-height: 48px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.barre .titre { font-size: 17px; font-weight: 500; margin-right: auto; }
.barre .utilisateur { font-size: 13px; }
.barre .utilisateur small { color: var(--doux); margin-left: 6px; }
.barre form { margin: 0; }
.langues { display: inline-flex; border: 1px solid var(--bord); border-radius: 4px; overflow: hidden; }
.langues a { padding: 4px 9px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--nav); }
.langues a.actif { background: var(--nav); color: #fff; }
.contenu { padding: 22px; max-width: 1480px; width: 100%; }

.bandeau-test {
  background: var(--test-fond); color: var(--test); border-bottom: 1px solid #f0d49a;
  padding: 7px 22px; font-size: 13px; font-weight: 600;
}

/* ---- Composants --------------------------------------------------------- */
.entete { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.entete > div:first-child { margin-right: auto; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); margin-bottom: 18px; }
.carte > .corps { padding: 16px 18px; }
.carte > .titre-carte { padding: 14px 18px; border-bottom: 1px solid var(--bord); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.carte > .titre-carte .actions { margin-left: auto; display: flex; gap: 8px; }
.grille { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.chiffre { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; }
.chiffre b { display: block; font-size: 26px; font-weight: 600; }
.chiffre span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); }

table.liste { width: 100%; border-collapse: collapse; }
table.liste th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #4a555e; padding: 10px 12px; border-bottom: 1px solid var(--bord); background: #fafafa; white-space: nowrap;
}
table.liste td { padding: 11px 12px; border-bottom: 1px solid #eceeef; vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tr.inactif td { color: #9aa3a9; }
.table-defile { overflow-x: auto; }

.btn {
  display: inline-block; border: 1px solid var(--bord); background: #fff; color: var(--texte);
  padding: 7px 14px; border-radius: 4px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit; line-height: 1.3;
}
.btn:hover { border-color: #b9c0c5; }
.btn.primaire { background: var(--nav); color: #fff; border-color: var(--nav); }
.btn.primaire:hover { filter: brightness(1.1); }
.btn.danger { color: var(--erreur); border-color: #e7b7b3; }
.btn.petit { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.en-ligne { display: inline; margin: 0; }

.pastille { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 2px 7px; border-radius: 10px; border: 1px solid var(--bord); color: var(--doux); background: #f6f7f8; vertical-align: middle; }
.pastille.sigle { border-radius: 3px; margin-left: 4px; }
.pastille.prod { background: var(--ok-fond); color: var(--ok); border-color: #b9dcc6; }
.pastille.test { background: var(--test-fond); color: var(--test); border-color: #f0d49a; }
.pastille.ok { background: var(--ok-fond); color: var(--ok); border-color: #b9dcc6; }
.pastille.alerte { background: var(--alerte-fond); color: var(--alerte); border-color: #f0d49a; }
.pastille.erreur { background: var(--erreur-fond); color: var(--erreur); border-color: #efbdb8; }
.pastille.cps { background: var(--nav); color: #fff; border-color: var(--nav); }

.message { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; border: 1px solid; }
.message.ok { background: var(--ok-fond); color: var(--ok); border-color: #b9dcc6; }
.message.erreur { background: var(--erreur-fond); color: var(--erreur); border-color: #efbdb8; }
.message.info { background: #eef4f6; color: #2f5f73; border-color: #c9dde4; }
.message.mdp { background: #fffbe8; color: #5c4a00; border-color: #eadb95; font-weight: 600; }

/* ---- Formulaires ------------------------------------------------------- */
.champs { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-size: 13px; font-weight: 600; color: #3b454d; }
.champ .aide { font-size: 12px; color: var(--doux); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid #c9cfd3; border-radius: 4px; background: #fff; width: 100%;
}
input[type=color] { width: 56px; height: 34px; padding: 2px; border: 1px solid #c9cfd3; border-radius: 4px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.boutons { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.cases { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cases label { font-weight: 400; font-size: 14px; }
.barre select { width: auto; min-width: 280px; }

/* ---- Pages simples (connexion) ---------------------------------------- */
.page-simple { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--nav); }
.boite { background: #fff; border-radius: 8px; padding: 28px 30px; width: 100%; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.boite.large { max-width: 560px; }
.boite .logo { max-height: 46px; margin-bottom: 14px; }
.boite h1 { font-size: 22px; }
.boite .champ { margin-top: 12px; }
.boite .btn.primaire { width: 100%; margin-top: 18px; padding: 10px; }
.boite .langues { float: right; }

/* ---- Contenu rédactionnel ----------------------------------------------- */
.texte { max-width: 860px; }
.texte p, .texte li { margin: 0 0 8px; }
.texte ol, .texte ul { padding-left: 22px; }
.kpi { font-size: 13px; color: var(--doux); }
.kpi b { color: var(--texte); font-weight: 600; }

/* ---- Écrans étroits ---------------------------------------------------- */
@media (max-width: 860px) {
  .cadre { flex-direction: column; background: none; }
  .menu { width: 100%; flex: none; height: auto; position: static; }
  .menu .pied { display: none; }
  .contenu { padding: 16px; }
  .barre select { min-width: 0; width: 100%; }
}

/* ---- Impression -------------------------------------------------------- */
@media print {
  .menu, .barre, .boutons, .btn, .bandeau-test form { display: none !important; }
  body, .contenu { background: #fff; padding: 0; }
  .carte { border: 0; }
}
.etroit { max-width: 640px; }
.moyen { max-width: 960px; }
.aide.bloc { display: block; margin-top: 8px; }
.ligne-form { display: grid; grid-template-columns: minmax(140px, 1.6fr) minmax(160px, 1.6fr) minmax(130px, 1fr) minmax(100px, .8fr) auto; gap: 8px; align-items: center; }
@media (max-width: 860px) { .ligne-form { grid-template-columns: 1fr; } }
hr.separateur { border: 0; border-top: 1px solid var(--bord); margin: 16px 0; }

/* 1.3.0 — double authentification de la console */
.qr-2fa { display: flex; justify-content: center; margin: 12px 0; }
.qr-2fa svg { width: 200px; height: auto; background: #fff; padding: 6px; border-radius: 6px; }
.secret-2fa { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; user-select: all; }
.etapes-2fa { padding-left: 1.2em; margin: 8px 0; }
