/* Rempart — charte DigitalCraftery. Lime en aplat, olive au trait. */
:root {
  --fond:#f1f3e6; --surface:#fbfcf5; --creux:#e5e8d4; --trait:#d7dbc3;
  --encre:#171911; --travail:#5a6a0c; --signature:#B0CB1F; --olive-gris:#5B5A50;
  --ambre:#e8a317;
  --crit:#8b1a1a; --high:#c0392b; --med:#e8a317; --low:#5a6a0c; --info:#5B5A50;
  --ombre:0 1px 3px rgba(23,25,17,.08), 0 4px 16px rgba(23,25,17,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond:#14150f; --surface:#23261c; --creux:#1b1d15; --trait:#3a3f2f;
    --encre:#f7f9f4; --travail:#c6e22b; --signature:#c6e22b; --olive-gris:#9a9c88;
    --ambre:#f0b84a;
  }
}
* { box-sizing:border-box; }
body { margin:0; font-family:'Inter',system-ui,sans-serif; color:var(--encre);
  background:var(--fond); line-height:1.5; }
h1,h2,h3 { font-family:'Poppins','Inter',sans-serif; color:var(--travail); margin:.2em 0 .5em; }
.muted { color:var(--olive-gris); }
.fineprint { font-size:12px; color:var(--olive-gris); margin-top:8px; }
.mono { font-family:ui-monospace,'Cascadia Code',monospace; font-size:12px;
  background:var(--creux); padding:10px; border-radius:8px; overflow:auto; }

.topbar { display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; background:var(--surface); border-bottom:4px solid var(--signature); }
.brand .mark { font-family:'Poppins',sans-serif; font-weight:700; background:var(--signature);
  color:#171911; padding:3px 10px; border-radius:6px; }
.brand .tag { color:var(--olive-gris); font-size:13px; margin-left:10px; }
.right { display:flex; gap:10px; align-items:center; }
.pill { background:var(--signature); color:#171911; font-size:12px; font-weight:600;
  padding:3px 10px; border-radius:12px; }

button { font:inherit; cursor:pointer; border-radius:8px; border:1px solid var(--trait);
  padding:9px 16px; background:var(--surface); color:var(--travail); font-weight:600; }
button:hover { border-color:var(--travail); }
.primary { background:var(--signature); color:#171911; border-color:var(--signature); }
.primary:hover { filter:brightness(.96); }
.ghost { background:transparent; }
.danger { color:var(--high); border-color:var(--high); }

input { font:inherit; padding:9px 12px; border:1px solid var(--trait); border-radius:8px;
  background:var(--surface); color:var(--encre); }
input::placeholder { color:var(--olive-gris); }
.grow { flex:1; width:100%; }
.row { display:flex; gap:10px; margin:8px 0; flex-wrap:wrap; }
.row.between { justify-content:space-between; align-items:center; }

.gate { display:flex; justify-content:center; padding:8vh 16px; }
.gate-card { max-width:420px; width:100%; text-align:center; }
.gate-card input { width:100%; margin:12px 0; }
.gate-card .primary { width:100%; }

main { max-width:960px; margin:0 auto; padding:20px 16px 60px; }
.tabs { display:flex; gap:8px; margin-bottom:16px; }
.tabs button { background:transparent; border:none; border-bottom:3px solid transparent;
  border-radius:0; padding:8px 14px; color:var(--olive-gris); }
.tabs button.active { color:var(--travail); border-bottom-color:var(--signature); }

.card { background:var(--surface); border:1px solid var(--trait); border-radius:12px;
  padding:18px 20px; margin-bottom:16px; box-shadow:var(--ombre); }
.card h2 { margin-top:0; }

.item { display:flex; justify-content:space-between; gap:12px; align-items:flex-start;
  padding:14px 0; border-bottom:1px solid var(--trait); }
.item:last-child { border-bottom:none; }
.item .title { font-weight:600; }
.item .sub { font-size:13px; color:var(--olive-gris); }
.actions { display:flex; gap:8px; flex-wrap:wrap; }

.state { font-size:12px; font-weight:700; padding:2px 10px; border-radius:12px; }
.state.en_attente { background:var(--creux); color:var(--olive-gris); }
.state.autorisee { background:var(--signature); color:#171911; }
.state.suspendue { background:#e0d5c0; color:#7a5a20; }
.state.en_cours { background:var(--ambre); color:#171911; }
.state.termine { background:var(--signature); color:#171911; }
.state.echoue { background:var(--high); color:#fff; }

.kpis { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
.kpi { flex:1; min-width:90px; text-align:center; background:var(--fond);
  border:1px solid var(--trait); border-radius:10px; padding:10px; }
.kpi .n { font-size:26px; font-weight:700; font-family:'Poppins',sans-serif; }
.kpi .l { font-size:11px; text-transform:uppercase; letter-spacing:.03em; }

.badge { color:#fff; font-size:11px; font-weight:700; padding:2px 8px; border-radius:10px; }
.badge.critical{background:var(--crit)} .badge.high{background:var(--high)}
.badge.medium{background:var(--med);color:#171911} .badge.low{background:var(--low)}
.badge.info{background:var(--info)}

.finding { border:1px solid var(--trait); border-left-width:5px; border-radius:8px;
  padding:12px 14px; margin:10px 0; }
.finding .meta { font-size:12px; color:var(--olive-gris); margin:4px 0; }
.finding .rem { background:var(--fond); border-radius:6px; padding:10px; margin-top:8px;
  white-space:pre-wrap; font-size:13px; }
.finding code { background:var(--creux); padding:1px 4px; border-radius:3px; font-size:12px; }

.progress { height:8px; background:var(--creux); border-radius:6px; overflow:hidden; margin:8px 0; }
.progress > span { display:block; height:100%; background:var(--signature); transition:width .4s; }

.msg { min-height:18px; font-size:13px; }
.msg.err { color:var(--high); } .msg.ok { color:var(--travail); }
.instr { background:var(--fond); border:1px dashed var(--trait); border-radius:8px;
  padding:10px 12px; margin:10px 0; font-size:13px; }
.instr code { display:block; margin-top:6px; word-break:break-all; }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%);
  background:var(--encre); color:var(--fond); padding:10px 18px; border-radius:10px;
  box-shadow:var(--ombre); z-index:50; font-size:14px; }
[hidden] { display:none !important; }
