:root {
  --bg: #161719; --panel: #1f2023; --panel2: #26282c; --line: #34363b; --text: #e8e8e8;
  --muted: #9a9ca3; --accent: #e8a33d; --accent-ink: #1a1408; --ok: #4cc777; --bad: #e5534b;
  --warn: #e8c33d; --info: #5aa9e6; --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- layout ---------- */
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .08em; font-size: 18px; }
.brand span { color: var(--accent); }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; }
nav.tabs button.on { background: var(--panel2); color: var(--text); }
nav.tabs button:hover { color: var(--text); }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
.who b { color: var(--text); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, "SF Mono", monospace; }
.nowrap { white-space: nowrap; }
.modal h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
header.top .who, header.top #logout { flex-shrink: 0; }

/* ---------- status pill ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.led { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(229,83,75,.18); }
.pill.on .led { background: var(--ok); box-shadow: 0 0 0 3px rgba(76,199,119,.2), 0 0 10px rgba(76,199,119,.6); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(76,199,119,.08), 0 0 14px rgba(76,199,119,.8); } }

/* ---------- forms ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.c { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.btn:hover { border-color: #55585e; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.big { padding: 12px 22px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 12vh auto 0; padding: 0 16px; }
.login .card { padding: 28px; }
.login .brand { font-size: 28px; margin-bottom: 4px; }
.login input { width: 100%; font-family: Consolas, monospace; letter-spacing: .06em; font-size: 15px; padding: 12px; margin: 14px 0; }
.err { color: var(--bad); min-height: 20px; }

/* ---------- dropzone ---------- */
.drop { border: 2px dashed #4a4c52; border-radius: 12px; padding: 34px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(232,163,61,.05); }
.drop .big { font-size: 17px; }
.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- tables ---------- */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
tr.sel td { background: rgba(232,163,61,.1); }
tr.dim td { color: var(--muted); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- badges / steps ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(76,199,119,.4); }
.badge.bad { color: var(--bad); border-color: rgba(229,83,75,.4); }
.badge.run { color: var(--accent); border-color: rgba(232,163,61,.45); }
.badge.info { color: var(--info); border-color: rgba(90,169,230,.4); }
.steps { display: flex; gap: 0; margin: 6px 0 4px; flex-wrap: wrap; }
.steps div { flex: 1; min-width: 90px; text-align: center; font-size: 12px; color: var(--muted); padding-top: 14px; position: relative; }
.steps div::before { content: ""; position: absolute; top: 3px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps div::after { content: ""; position: absolute; top: 0; left: calc(50% - 5px); width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.steps div.done { color: var(--text); }
.steps div.done::before, .steps div.done::after { background: var(--accent); }
.steps div.cur::after { box-shadow: 0 0 0 4px rgba(232,163,61,.3); }
.sim { font-weight: 700; }
.sim.ok { color: var(--ok); }
.versions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.versions label { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.versions label:has(input:checked) { border-color: var(--accent); background: rgba(232,163,61,.1); }
.note { background: rgba(232,195,61,.08); border: 1px solid rgba(232,195,61,.3); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.note.bad { background: rgba(229,83,75,.08); border-color: rgba(229,83,75,.35); }
pre.report { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; margin: 10px 0 0; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(620px, 100%); max-height: 92vh; overflow: auto; }
.modal h2 { margin-top: 0; }
.keybox { font-family: Consolas, monospace; font-size: 20px; letter-spacing: .08em; background: var(--bg); border: 1px dashed var(--accent);
  border-radius: 8px; padding: 14px; text-align: center; user-select: all; margin: 12px 0; word-break: break-all; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 8px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.bad { border-color: var(--bad); }

@media (max-width: 640px) {
  header.top { padding: 10px 16px; gap: 10px; }
  .who { display: none; }
  main { padding: 16px 16px 40px; }
  .card { padding: 14px; }
}

/* utilitaires (pas de style en ligne : CSP stricte) */
.m0 { margin: 0 !important; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; }
.mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mt18 { margin-top: 18px; } .mb8 { margin-bottom: 8px; } .w100 { width: 100%; }

/* comptes (connexion identifiant / mot de passe, Mon compte) */
.grid1 { display: grid; gap: 12px; }
.grid1 input { width: 100%; }
.login .grid1 input { font-family: inherit; letter-spacing: normal; margin: 0; padding: 10px 12px; font-size: 14px; }
.login-foot { text-align: center; margin-top: 14px; }
.narrowcard { max-width: 620px; }
a.navlink { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 8px; }
a.navlink:hover { color: var(--text); }

/* mode automatique */
.note.ok { background: rgba(76,199,119,.08); border-color: rgba(76,199,119,.35); }
.autobox { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.autobox.off { opacity: .45; }
.autogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; }
