:root {
  --navy: #082142; --navy-2: #12335F; --blue: #00699E; --blue-bright: #0079B8; --cyan: #00CFE0;
  --bg: #F5F6F8; --card: #FFFFFF; --fg: #13202F; --muted: #5A6576; --line: #E1E5EA;
  --red: #B42318; --red-bg: #FDECEA; --amber: #A15C07; --amber-bg: #FEF3E2; --green: #067647; --green-bg: #E7F6EC;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0D1420; --card: #141D2B; --fg: #E6EAF0; --muted: #98A3B3; --line: #26324A;
          --red: #F97066; --red-bg: #3A1614; --amber: #FDB022; --amber-bg: #3A2A0C; --green: #47CD89; --green-bg: #0F2E1E; --blue: #4EC3E8; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 28px 0 10px; } h3 { font-size: 15px; margin: 18px 0 8px; }
a { color: var(--blue); }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--red); min-height: 1.4em; }

/* connexion */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 70% 20%, #0E4A7A 0%, var(--navy) 60%); padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--card); color: var(--fg); border-radius: 14px; padding: 28px; display: grid; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-logo { width: 220px; margin: 0 0 6px; }

/* gabarit */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #DCE6F5; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.side-logo { width: 170px; margin: 4px 6px 12px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button { all: unset; cursor: pointer; padding: 9px 12px; border-radius: 8px; color: #C9D6EA; }
nav button:hover { background: var(--navy-2); color: #fff; }
nav button[aria-current="page"] { background: var(--blue-bright); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
nav button:focus-visible { outline: 2px solid var(--cyan); }
.who { margin-top: auto; font-size: 12px; color: #9FB0C8; border-top: 1px solid #1E3A66; padding-top: 10px; overflow-wrap: anywhere; }
main { padding: 28px 32px 60px; max-width: 1200px; width: 100%; outline: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-logo { width: 110px; margin: 0; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin-top: 0; border: 0; }
  main { padding: 18px 16px 40px; }
}

/* composants */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi b { display: block; font-size: 26px; line-height: 1.1; }
.kpi.accent { border-left: 5px solid var(--cyan); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .fit { flex: 0 0 auto; }
label { display: block; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--fg); font-size: 14px; }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
textarea { min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
button.primary { background: var(--blue-bright); border-color: var(--blue-bright); color: #fff; }
button.danger { color: var(--red); border-color: var(--red); background: transparent; }
button.ghost { background: transparent; color: #C9D6EA; border-color: #2B4A78; }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 16px 0 8px; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: 8px 12px; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--blue-bright); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; }
.pill.red, .sev-high { color: var(--red); background: var(--red-bg); }
.pill.amber, .sev-medium { color: var(--amber); background: var(--amber-bg); }
.pill.green, .sev-low, .sev-info { color: var(--green); background: var(--green-bg); }
.pill.grey { color: var(--muted); background: var(--bg); }
ul.findings { margin: 0; padding-left: 18px; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.dns { background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px; }
.empty { color: var(--muted); padding: 12px 0; }
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(460px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 10px;
         background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #7A1712; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.notice { border-left: 4px solid var(--amber); background: var(--amber-bg); padding: 10px 12px; border-radius: 6px; font-size: 14px; }

/* connexion en plusieurs parcours */
.login-card .tabs { margin: 4px 0 6px; }
.login-form { display: grid; gap: 10px; }
.login-card ol.steps { margin: 0; padding-left: 20px; font-size: 14px; }
img.qr { width: 200px; height: 200px; justify-self: center; display: block; margin: 4px auto; border-radius: 8px; background: #fff; padding: 4px; }
input.otp { font-size: 22px; letter-spacing: 6px; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }
/* comptes et accès */
.card.secret { border: 2px solid var(--cyan); }
code.big { display: block; font-size: 15px; padding: 10px 12px; background: var(--bg); border-radius: 8px; margin: 8px 0; user-select: all; }
pre.msg { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: var(--muted); background: var(--bg); padding: 10px 12px; border-radius: 8px; margin: 10px 0 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.login-card .tabs { flex-wrap: nowrap; }
.login-card .tabs button { padding: 8px 9px; font-size: 14px; white-space: nowrap; }
.pill { white-space: nowrap; }
