/* Umbrella Vulnérabilités — thème du module (clair / sombre) */
:root {
  --navy: #0e1824;
  --navy-2: #16243a;
  --navy-ink: #c9d3e3;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --line: #e2e6ed;
  --line-2: #eef1f5;
  --text: #121826;
  --muted: #667085;
  --accent: #2160d8;
  --accent-ink: #ffffff;
  --accent-soft: #e7eefc;
  --red: #c4320a;      --red-soft: #fdece6;
  --crit: #9f1239;     --crit-soft: #fde7ee;
  --orange: #c2410c;   --orange-soft: #fff0e6;
  --amber: #a15c00;    --amber-soft: #fff5df;
  --green: #127a45;    --green-soft: #e3f5ea;
  --purple: #6d3fc0;   --purple-soft: #f0eafc;
  --grey: #5b6474;     --grey-soft: #eef0f3;
  --code-bg: #0f1623;
  --code-ink: #dbe3f0;
  --code-ln: #5d6b82;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #0a111b;
    --navy-2: #142033;
    --bg: #0e131b;
    --surface: #151b25;
    --surface-2: #1a212d;
    --line: #283142;
    --line-2: #1f2735;
    --text: #e6eaf1;
    --muted: #8f99aa;
    --accent: #6c9cf5;
    --accent-ink: #0b1220;
    --accent-soft: #1b2944;
    --red: #ff8a6b;      --red-soft: #3a1c14;
    --crit: #ff7096;     --crit-soft: #3d1524;
    --orange: #ffa26b;   --orange-soft: #3a2314;
    --amber: #f5bd52;    --amber-soft: #372a12;
    --green: #5fd394;    --green-soft: #13301f;
    --purple: #b799ff;   --purple-soft: #2a1f45;
    --grey: #a3acbb;     --grey-soft: #232a36;
    --code-bg: #0b1019;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; font-weight: 680; margin: 4px 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 12px; font-weight: 650; margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
h4 { font-size: 14px; margin: 12px 0 4px; }
p { margin: 0 0 8px; }
code, .mono, pre { font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace; }
.mono { font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.strong:hover, .link:hover { text-decoration: underline; }
.link { color: var(--accent); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70ch; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ok-text { color: var(--green); display: flex; align-items: center; gap: 6px; }
.err-text { color: var(--red); }
.warn-text { color: var(--amber); font-weight: 600; }
.ic { width: 18px; height: 18px; flex: none; }

/* Coquille : barre latérale + contenu */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--navy);
  color: var(--navy-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; font-weight: 680; font-size: 16px; line-height: 1.15; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--navy-ink); opacity: .75; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2b6de0, #18a0b8); display: grid; place-items: center; color: #fff; }
.brand-mark .ic { width: 20px; height: 20px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--navy-ink); font-weight: 500; }
.side-nav a:hover { background: var(--navy-2); color: #fff; }
.side-nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 #3b82f6; }
.side-nav .count { margin-left: auto; background: #2b6de0; color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.side-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.side-user .who { flex: 1; color: #fff; font-weight: 550; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { display: block; color: var(--navy-ink); font-weight: 400; font-size: 11px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; font-weight: 650; flex: none; }
.side .icon-btn { color: var(--navy-ink); }
.side .icon-btn:hover { background: var(--navy-2); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }

/* En-têtes de page */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.cves { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cve { font: 600 12px ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--accent); }
.cve:hover { border-color: var(--accent); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card.pad, .pad { padding: 18px 20px; }
.pad-h { padding-left: 20px; padding-right: 20px; }
.pad-b { padding-bottom: 18px; }
.mx { margin: 0 20px 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head.flush { padding: 0 0 6px; }
.card-head form { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 16px; }
.empty { text-align: center; padding: 48px 20px; }

/* Tuiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile-n { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-l { color: var(--muted); font-size: 12.5px; }
.tile-red { border-color: var(--red); background: var(--red-soft); } .tile-red .tile-n { color: var(--red); }
.tile-amber { border-color: var(--amber); background: var(--amber-soft); } .tile-amber .tile-n { color: var(--amber); }
.tile-blue { border-color: var(--accent); background: var(--accent-soft); } .tile-blue .tile-n { color: var(--accent); }

.res-tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.res-tile { all: unset; cursor: pointer; display: flex; flex-direction: column; min-width: 110px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.res-tile .tile-n { font-size: 20px; }
.res-tile.zero { opacity: .5; }
.res-tile.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.rt-vulnerable .tile-n { color: var(--red); }       .rt-vulnerable:not(.zero) { background: var(--red-soft); border-color: var(--red); }
.rt-unknown .tile-n { color: var(--amber); }        .rt-unknown:not(.zero) { background: var(--amber-soft); }
.rt-error .tile-n { color: var(--purple); }         .rt-error:not(.zero) { background: var(--purple-soft); }
.rt-not_vulnerable .tile-n { color: var(--green); }
.rt-not_applicable .tile-n { color: var(--grey); }
.rt-missing .tile-n { color: var(--muted); }

/* Badges */
.sev, .res, .phase, .chip, .pill, .ostag, .sbadge, .astat, .conf {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 9px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.sev-critical { background: var(--crit); color: #fff; }
.sev-high { background: var(--orange-soft); color: var(--orange); }
.sev-medium { background: var(--amber-soft); color: var(--amber); }
.sev-low { background: var(--accent-soft); color: var(--accent); }
.res-vulnerable { background: var(--red); color: #fff; }
.res-unknown { background: var(--amber-soft); color: var(--amber); }
.res-error { background: var(--purple-soft); color: var(--purple); }
.res-not_vulnerable { background: var(--green-soft); color: var(--green); }
.res-not_applicable { background: var(--grey-soft); color: var(--grey); }
.phase { background: var(--grey-soft); color: var(--grey); font-weight: 550; }
.ph-review { background: var(--amber-soft); color: var(--amber); }
.ph-running { background: var(--accent-soft); color: var(--accent); }
.ph-ready, .ph-analyze { background: var(--accent-soft); color: var(--accent); }
.ph-deploy { background: var(--green-soft); color: var(--green); }
.chip { border-radius: 6px; padding: 1px 7px; font-size: 11.5px; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.ostag { border-radius: 6px; padding: 1px 7px; font-size: 11.5px; background: var(--grey-soft); color: var(--text); }
.os-windows { background: #e3effd; color: #0b5cad; }
.os-linux { background: #fff3d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .os-windows { background: #13294a; color: #8cbcff; } .os-linux { background: #352a10; color: #f2c56b; } }
.sb-draft { background: var(--amber-soft); color: var(--amber); }
.sb-approved { background: var(--green-soft); color: var(--green); }
.sb-retired { background: var(--grey-soft); color: var(--grey); }
.as-queued, .as-running { background: var(--accent-soft); color: var(--accent); }
.as-done { background: var(--green-soft); color: var(--green); }
.as-failed { background: var(--red-soft); color: var(--red); }
.conf { padding: 0 7px; }
.conf-high { background: var(--green-soft); color: var(--green); }
.conf-medium { background: var(--amber-soft); color: var(--amber); }
.conf-low { background: var(--red-soft); color: var(--red); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 13px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.ghost.danger { color: var(--red); }
.btn.ghost.danger:hover { background: var(--red-soft); color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.icon-btn { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .ic { width: 17px; height: 17px; }

/* Formulaires
   Un seul style pour tous les champs de saisie (texte, mot de passe, recherche, nombre, liste, zone de texte) :
   même hauteur, graisse normale (jamais celle de l'étiquette), mêmes couleurs, même focus, en clair comme en sombre. */
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.form label small, .form label .muted { font-weight: 400; font-size: 12px; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; }
.form label.check input { margin-top: 2px; }
.form.narrow { max-width: 760px; }

input:where(:not([type])), input:where([type=text], [type=password], [type=search], [type=number], [type=email], [type=url], [type=date]),
select, textarea {
  font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
  min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
input:where(:not([type]), [type=text], [type=password], [type=search], [type=number], [type=email], [type=url], [type=date]), select { height: 36px; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; font-weight: 400; }
input:where(:not([type=checkbox], [type=radio])):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled, input[readonly], textarea[readonly] { background-color: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[readonly]:focus, textarea[readonly]:focus { box-shadow: none; border-color: var(--line); }
input.mono, textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* Variante compacte (filtres, champs dans les tableaux) */
.search.sm, .sm-select, .input-sm { height: 30px !important; padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.search { max-width: 260px; }
.search.sm, .sm-select { max-width: 220px; }

/* Code et texte long */
.codearea { font: 13px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; background-color: var(--code-bg); color: var(--code-ink); border-color: var(--code-bg); tab-size: 4; }
.codearea:hover { border-color: var(--code-bg); }
.codearea.prose { background-color: var(--surface-2); color: var(--text); border-color: var(--line); font-size: 13px; }
.codearea + p, textarea + p { margin-top: 6px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fields.three { grid-template-columns: 2fr 1fr 1fr; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions .spacer { margin-right: auto; }
.field-err { color: var(--red); font-weight: 500; font-size: 12.5px; }
.row-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.row-form.nowrap { flex-wrap: nowrap; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-form label { font-weight: 400; display: flex; flex-direction: column; gap: 5px; }
.inline-form input { width: 120px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; margin-bottom: 0; }
.form .seg { margin-bottom: 12px; }
.seg a { padding: 4px 12px; border-radius: 6px; color: var(--muted); font-weight: 550; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Tableaux */
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table tr.dim td { opacity: .6; }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table.compact th:first-child, .table.compact td:first-child { padding-left: 10px; }
.table .reason { max-width: 46ch; }
.row-vulnerable td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.row-current td { background: var(--green-soft); }
.kvtable th { width: 35%; background: transparent; color: var(--text); font-weight: 600; word-break: break-all; }
.kvtable td { word-break: break-word; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.big-reason { font-size: 16px; font-weight: 550; }

/* Messages */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: var(--green-soft); color: var(--green); }
.flash-err { background: var(--red-soft); color: var(--red); }
.callout { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.callout-err { background: var(--red-soft); border-color: transparent; color: var(--red); }
.callout-warn { background: var(--amber-soft); border-color: transparent; }
.callout-ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }

/* Étapes */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stepper li a { display: flex; gap: 10px; align-items: center; padding: 12px 16px; height: 100%; }
.stepper li + li { border-left: 1px solid var(--line); }
.stepper li a:hover { background: var(--surface-2); }
.stepper b { display: block; font-size: 13px; }
.stepper small { color: var(--muted); }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-soft); color: var(--muted); font-weight: 650; flex: none; }
.step-n .ic { width: 15px; height: 15px; }
.stepper li.done .step-n { background: var(--green); color: #fff; }

/* Sources */
.sources { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.sources li { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.src-ic { color: var(--muted); padding-top: 2px; }
.src-main { flex: 1; min-width: 0; }
.src-actions { display: flex; gap: 2px; }
.src-actions form { margin: 0; }
.src-err .src-ic { color: var(--red); }
.src-dup { opacity: .65; }
.src-error { color: var(--red); font-size: 12.5px; margin-top: 4px; }
.src-preview summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 4px; }
.src-preview pre { max-height: 280px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; }
.src-add { padding: 14px 20px 6px; }
.src-add .form label { margin-bottom: 8px; }
.paste summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 4px 0 12px; }

/* Analyse */
.analysis { padding: 0 20px 14px; }
.analysis-meta { margin-bottom: 4px; }
.analysis .grid2 { gap: 28px; }
.running { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--accent-soft); border-radius: 8px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent); border-right-color: transparent; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.md p, .md li { line-height: 1.55; }
.md ul, .md ol { padding-left: 20px; margin: 4px 0 8px; }
.md code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.mdcode { background: var(--code-bg); color: var(--code-ink); padding: 10px 12px; border-radius: 8px; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.history { border-top: 1px solid var(--line-2); padding: 10px 20px; }
.card.pad .history { padding: 10px 0 0; }
.history > summary { cursor: pointer; font-weight: 550; padding: 4px 0; }
.history .table { margin-top: 8px; }
.notes .md { color: var(--text); }

/* Scripts */
.script-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line-2); }
.script-col { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.script-col + .script-col { border-left: 1px solid var(--line-2); }
.script-col-head { display: flex; align-items: center; gap: 8px; }
.script-line { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); }
.script-line span { margin-left: auto; font-size: 12.5px; }
.script-line.approved { background: var(--green-soft); border-color: transparent; color: var(--green); }
.script-line.draft { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.script-line:hover { filter: brightness(.97); }

.script-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.script-side { position: sticky; top: 68px; }
.approval { border-color: var(--accent); }
.flags { list-style: none; padding: 0 !important; }
.flags li { padding: 2px 0; }
.reads { padding-left: 18px; margin: 4px 0 10px; }
.versions { list-style: none; margin: 0; padding: 0 0 8px; }
.versions a { display: flex; align-items: center; gap: 8px; padding: 7px 20px; flex-wrap: wrap; }
.versions a:hover { background: var(--surface-2); }
.versions .current a { background: var(--accent-soft); }
.versions .muted { margin-left: auto; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tabs button { all: unset; cursor: pointer; padding: 8px 14px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.code { background: var(--code-bg); color: var(--code-ink); border-radius: 0 0 var(--radius) var(--radius); overflow: auto; max-height: 75vh; margin-bottom: 16px; font: 12.8px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.code table { border-collapse: collapse; width: 100%; }
.code td { padding: 0 12px; white-space: pre; vertical-align: top; }
.code .ln { width: 1%; text-align: right; color: var(--code-ln); user-select: none; border-right: 1px solid #1f2a3b; padding-left: 14px; }
.code .ln a:hover { color: var(--code-ink); }
.code tr:target { background: #24324a; }
.code tr.flagged { background: rgba(245, 158, 11, .14); }
.code tr.flagged .ln { color: #f5b14c; box-shadow: inset 3px 0 0 #f59e0b; }
.flag-tag { margin-left: 16px; font: 600 11px system-ui, sans-serif; color: #1b1300; background: #f5b14c; border-radius: 4px; padding: 0 6px; }
.code.diff tr.dadd { background: rgba(34, 197, 94, .15); }
.code.diff tr.ddel { background: rgba(239, 68, 68, .15); }
.code.diff tr.dadd .ln { color: #4ade80; }
.code.diff tr.ddel .ln { color: #f87171; }
.card > .code.diff { border-radius: 0 0 var(--radius) var(--radius); margin: 0; }
pre.output { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
pre.output.tall { max-height: 70vh; }

/* Déploiement */
.cmd-box { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; }
.cmd-box h3 { margin-top: 0; color: var(--accent); }
.cmd { display: flex; gap: 8px; align-items: flex-start; background: var(--code-bg); border-radius: 8px; padding: 10px 10px 10px 14px; margin: 8px 0; }
.cmd pre { flex: 1; margin: 0; color: var(--code-ink); white-space: pre-wrap; word-break: break-all; font-size: 12.5px; }
.cmd-status { display: flex; align-items: center; gap: 8px; font-weight: 550; margin: 6px 0 0; }
.cmd-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.cmd-status.got .dot { background: var(--green); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }

.coverage { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 8px 0; }
.coverage ul { margin: 4px 0 0; padding-left: 18px; }

/* Paramètres */
.models { display: flex; flex-direction: column; gap: 6px; max-height: 430px; overflow: auto; margin-bottom: 14px; padding-right: 4px; }
.form .model { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 0; font-weight: 450; cursor: pointer; }
.form .model.on, .form .model:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.model-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.model-meta { text-align: right; }
.danger-zone summary { cursor: pointer; color: var(--muted); }
.danger-zone .inline-form { margin-top: 12px; }

/* Petits écrans */
@media (max-width: 1100px) {
  .script-layout { grid-template-columns: 1fr; }
  .script-side { position: static; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-grid; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .stepper li:nth-child(3) { border-left: 0; }
  .stepper li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .fields, .fields.three, .script-cols { grid-template-columns: 1fr; }
  .script-col + .script-col { border-left: 0; border-top: 1px solid var(--line-2); }
}

/* Priorisation de la mitigation */
.prio { display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1.5; }
.pr-p1 { background: var(--crit); color: #fff; }
.pr-p2 { background: var(--orange-soft); color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.pr-p3 { background: var(--amber-soft); color: var(--amber); }
.pr-p4 { background: var(--grey-soft); color: var(--grey); }
.pr-todo { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); border: 0; outline: 1px dashed transparent; }
.pr-none { color: var(--muted); padding-left: 0; }
.rowp-p1 td:first-child { box-shadow: inset 4px 0 0 var(--crit); }
.rowp-p2 td:first-child { box-shadow: inset 4px 0 0 var(--orange); }
.prio-head { border-top: 1px solid var(--line-2); padding-top: 10px; }
.prio-head h3 { margin-top: 4px; }
.pt-p1 .tile-n { color: var(--crit); }  .pt-p1:not(.zero) { background: var(--crit-soft); border-color: var(--crit); }
.pt-p2 .tile-n { color: var(--orange); } .pt-p2:not(.zero) { background: var(--orange-soft); border-color: var(--orange); }
.pt-todo .tile-n { color: var(--accent); } .pt-todo:not(.zero) { border-style: dashed; border-color: var(--accent); }
.pt-p3 .tile-n { color: var(--amber); }
.pt-p4 .tile-n { color: var(--grey); }
.prio-help { margin-top: 10px; }
.prio-help > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.prio-help ul { margin: 4px 0 8px; padding-left: 18px; }
.prio-matrix { max-width: 760px; margin-top: 6px; }
.fields.four { grid-template-columns: 1fr 1fr 1fr 2fr; }

.triage { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 250px; }
.triage form { margin: 0; }
.tg { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); }
.tg-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.tg-unset { color: var(--muted); border-style: dashed; }
.tg-unset .tg-mark { background: var(--grey-soft); }
.tg-yes { color: var(--red); background: var(--red-soft); border-color: var(--red); }
.tg-yes .tg-mark { background: var(--red); color: #fff; }
.tg-no { color: var(--muted); background: var(--surface-2); }
.tg-no .tg-mark { background: var(--green-soft); color: var(--green); }
.tg:hover { filter: brightness(.96); border-color: var(--muted); }
.tg:focus-visible, .tg-rest:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tg-rest { all: unset; cursor: pointer; font-size: 11.5px; color: var(--accent); padding: 2px 4px; }
.tg-rest:hover { text-decoration: underline; }
.triage.busy { opacity: .5; pointer-events: none; }

.triage-card .triage-head { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.prio-big .prio { font-size: 16px; padding: 4px 14px; }
.triage-questions .triage { margin-bottom: 8px; }
.triage-questions ul { padding-left: 18px; margin: 4px 0; }
@media (max-width: 900px) {
  .fields.four { grid-template-columns: 1fr 1fr; }
  .triage-card .triage-head { grid-template-columns: 1fr; }
}

/* Réponses automatiques (IA, reprise d'un autre événement) */
.tg-auto { border-style: dotted; }
.tg-src { display: inline-block; margin-left: 2px; padding: 0 4px; border-radius: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.yn { font-weight: 650; font-size: 12px; }
.yn-yes { color: var(--red); }
.yn-no { color: var(--green); }
.ai-triage { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.ai-triage p { margin: 0 0 6px; }
.ai-note { background: var(--accent-soft); border-radius: 6px; padding: 6px 8px; }

/* Connexion */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.login { width: min(400px, calc(100% - 32px)); }
.login-brand { justify-content: center; padding-bottom: 18px; }
.login .card h1 { margin-bottom: 14px; }
.login .center { text-align: center; color: var(--navy-ink); opacity: .7; margin-top: 12px; }
.side-user form { margin: 0; }
.tg-ro { cursor: default; }
.tg-ro:hover { filter: none; border-color: var(--line); }

/* Correctif disponible (vert = corrigeable) */
.fx { margin-left: 6px; }
.fx-yes { color: var(--green); background: var(--green-soft); border-color: var(--green); }
.fx-yes .tg-mark { background: var(--green); color: #fff; }
.fx-no { color: var(--amber); background: var(--amber-soft); border-color: var(--amber); }
.fx-no .tg-mark { background: var(--amber); color: #fff; }
.tile-sub { font-size: 11px; color: var(--green); font-weight: 600; }
.fix-ai { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fields.five { grid-template-columns: 1fr 1fr 1fr 1fr 2fr; }
@media (max-width: 900px) { .fields.five { grid-template-columns: 1fr 1fr; } }

/* Tableaux contenant des champs (Clients, Utilisateurs) */
.table td.cell-input { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; }
.table td.cell-input input { width: 100%; }
.table .col-short { width: 110px; }
.table .col-pw { white-space: nowrap; }
.table td.actions-cell { white-space: nowrap; text-align: right; }
.table td.actions-cell form { display: inline; }
.table td.cell-input .row-form input { flex: 0 0 150px; width: 150px; }
.fx-unset { color: var(--muted); border-style: dashed; }
.fx-unset .tg-mark { background: var(--grey-soft); }
.form > textarea { margin-bottom: 14px; }
.form > textarea + p { margin-top: -8px; }
.table th.num { text-align: right; }
.chip:not([class*=chip-]) { background: var(--grey-soft); color: var(--muted); }

/* Notes par serveur */
.ic-xs { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.note-preview { margin-top: 5px; font-size: 12px; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 4px; padding: 3px 7px; max-width: 34ch; }
.note-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; margin-top: 4px; font-size: 11.5px; color: var(--accent); }
.note-btn:hover { text-decoration: underline; }
.note-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.note-text { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; white-space: normal; }
.notes-card .form textarea { margin-bottom: 10px; }
dialog.dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px 16px; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog.dialog::backdrop { background: rgba(10, 15, 25, .5); }
dialog.dialog h2 { margin-bottom: 14px; }

/* Commande d'origine d'un serveur */
.origin-cmd .cmd { margin: 4px 0 10px; }
.tstate { font-weight: 600; }
.ts-active { color: var(--green); }
.ts-expired, .ts-used { color: var(--amber); }
.ts-revoked, .ts-closed { color: var(--red); }

/* Registre des commandes */
.cmd-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.cmd-item { border-top: 1px solid var(--line-2); padding-top: 12px; }
.cmd-item:first-child { border-top: 0; padding-top: 0; }
.cmd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.cmd-meta .cmd-revoke { margin: 0 0 0 auto; }
.cmd-item .cmd { margin: 6px 0 0; }
