/* Jetons de thème : clair (shadcn, comme la console AWS) et sombre (D-EDGE). */
:root, [data-theme="light"] {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --muted: #f1f1f3;
  --border: #e4e4e7;
  --text: #09090b;
  --text-muted: #71717a;
  --primary: #18181b;
  --primary-fg: #fafafa;
  --ring: #a1a1aa;
  --accent: #6366f1;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --err: #dc2626;
  --err-bg: #fef2f2;
  --info-bg: #eef2ff;
  --chart-1: #3b82f6;
  --chart-2: #1e3a8a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --code-bg: #f4f4f5;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0b10;
  --surface: #12141c;
  --surface-2: #181b26;
  --muted: #1d2130;
  --border: #272b3b;
  --text: #e8e9f0;
  --text-muted: #8d92a8;
  --primary: #6366f1;
  --primary-fg: #ffffff;
  --ring: #6366f1;
  --accent: #8b5cf6;
  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --err: #f87171;
  --err-bg: rgba(239, 68, 68, 0.12);
  --info-bg: rgba(99, 102, 241, 0.12);
  --chart-1: #818cf8;
  --chart-2: #ec4899;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --code-bg: #0e1017;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body {
  background: radial-gradient(1100px 480px at 0% -10%, rgba(99, 102, 241, 0.16), transparent 60%), var(--bg);
}
a { color: inherit; text-decoration: none; }
code, .mono, pre, textarea.code { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace; }
code { font-size: 0.86em; background: var(--code-bg); padding: 1px 6px; border-radius: 6px; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; font-weight: 650; }
h3 { font-size: 15px; margin: 0; font-weight: 600; }
h4 { font-size: 13px; margin: 12px 0 4px; font-weight: 600; }
p { margin: 4px 0; }
.icon { width: 16px; height: 16px; flex: none; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.error { color: var(--err); }
.ok-t { color: var(--ok); display: inline-flex; gap: 4px; align-items: center; }
.err-t { color: var(--err); display: inline-flex; gap: 4px; align-items: center; }
.warn-t { color: var(--warn); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Coque : barre latérale + zone principale encadrée ---------- */
.shell { display: flex; height: 100vh; }
.sidebar {
  width: 272px; flex: none; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; padding: 4px 8px 10px; }
.brand-mark {
  font-size: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { color: var(--text-muted); font-size: 13px; padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.nav-item:hover { background: var(--muted); }
.nav-item.active { background: var(--muted); font-weight: 550; }
[data-theme="dark"] .nav-item.active { background: rgba(99, 102, 241, 0.18); }
.sidebar-foot { margin-top: auto; position: relative; display: flex; align-items: center; gap: 6px; }
.user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 8px; border-radius: 10px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.user:hover { background: var(--muted); }
.user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-text small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { border-radius: 999px; flex: none; }
.quick { position: relative; }
.inset {
  flex: 1; min-width: 0; margin: 10px 10px 10px 0; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.page { padding: 24px 28px 48px; max-width: 1400px; margin: 0 auto; }
.page.narrow { max-width: 1040px; }

/* ---------- En-têtes ---------- */
.page-head {
  display: flex; align-items: center; gap: 14px; margin: -24px -28px 20px; padding: 18px 28px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.ph-text { flex: 1; min-width: 200px; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.hero h2 { font-size: 24px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: flex-start; height: 44px; }
.btn.primary { background: var(--primary); color: var(--primary-fg); }
.btn.primary:hover:not(:disabled) { opacity: 0.9; }
.btn.outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.outline:hover:not(:disabled) { background: var(--muted); }
.btn.ghost { background: none; color: var(--text); }
.btn.ghost:hover { background: var(--muted); }
.btn.danger { background: var(--err); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 8px; border: 0; background: none; color: inherit; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--muted); }
.icon-btn.sm { width: 28px; height: 28px; }
.input, .select, textarea, .search {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; font: inherit; padding: 8px 10px; width: 100%;
}
.select { width: auto; min-width: 150px; height: 36px; padding: 0 10px; }
.input:focus, .select:focus, textarea:focus, .search:focus-within { outline: 2px solid var(--ring); outline-offset: -1px; }
textarea.code { font-size: 12.5px; line-height: 1.6; background: var(--code-bg); }
textarea.prompt { font-size: 14px; line-height: 1.6; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; background: var(--surface-2); flex: 1; min-width: 220px; }
.search input { border: 0; background: none; outline: none; font: inherit; color: inherit; flex: 1; min-width: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); margin: 6px 0; }
.form-field > span { font-weight: 550; color: var(--text); }
.form-field.check, label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.form-field label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.radio { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.radio.disabled { color: var(--text-muted); }
.switch-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.switch { width: 36px; height: 20px; border-radius: 999px; border: 0; background: var(--border); position: relative; cursor: pointer; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: left 0.15s; }
.switch.on { background: var(--primary); }
.switch.on i { left: 18px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.card.hover { display: flex; flex-direction: column; transition: border-color 0.15s, box-shadow 0.15s; }
.card.hover:hover { border-color: var(--ring); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head.muted-bg { background: var(--surface-2); }
.card-head p { margin-top: 4px; }
.card-body { padding: 16px 20px; }
.card-body + .card-body { border-top: 1px solid var(--border); }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); margin-top: auto; flex-wrap: wrap; }
.card-foot .menu-anchor { margin-left: auto; }
.card.info { background: var(--info-bg); border-color: transparent; }
.card.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-grid .card { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.kind-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 8px; background: var(--muted); color: var(--text-muted); flex: none;
}
.record h3 { font-size: 16px; }

/* Statistiques */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; margin: 0; }
.stat-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; }
.stat-head .icon { color: var(--text-muted); width: 18px; height: 18px; }
.stat-value { font-size: 30px; font-weight: 700; margin: 16px 0 2px; }
.split { display: flex; gap: 14px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); padding: 16px 20px; }
.metrics > div { display: flex; flex-direction: column; gap: 4px; }
.metrics b { font-size: 26px; }
.metrics b.amber { color: var(--warn); }
.metrics b.green { color: var(--ok); }
.metrics b.red { color: var(--err); }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mini-stats > div { display: flex; flex-direction: column; gap: 2px; }
.mini-stats b { font-size: 22px; }

/* Graphique */
.chart { width: 100%; height: 260px; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; text-anchor: middle; }
.legend { display: flex; justify-content: center; gap: 18px; font-size: 13px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Clé / valeur */
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.kv .k { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.kv .v { word-break: break-word; }
.code-box { display: block; padding: 12px 14px; border-radius: 10px; font-size: 13px; margin: 8px 0; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; background: none;
  color: var(--text-muted); font: inherit; font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
[data-theme="dark"] .tabs button.active { border-bottom-color: var(--primary); }
.tabs .count { background: var(--muted); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.chip.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }

/* Sous-navigation (fiche agent, politique, moteur, réglages) */
.split-layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; padding: 10px; position: sticky; top: 0; margin: 0; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-muted); }
.subnav a:hover { background: var(--muted); color: var(--text); }
.subnav a.active { background: var(--muted); color: var(--text); font-weight: 550; }
.subnav-group { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; font-weight: 600; font-size: 13px; }
.subnav code { background: none; padding: 0; }
.split-main { min-width: 0; }

/* Badges et pastilles de statut */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  background: var(--muted); color: var(--text); font-size: 12px; font-weight: 550; white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge.outline { background: none; border: 1px solid var(--border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--err-bg); color: var(--err); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.kd-mcp_server { background: #dbeafe; color: #1d4ed8; }
.kd-agent { background: #ede9fe; color: #6d28d9; }
.kd-skill { background: #ccfbf1; color: #0f766e; }
.kd-plugin { background: #e0e7ff; color: #4338ca; }
.kd-command { background: #fef3c7; color: #b45309; }
.kd-hook { background: #fce7f3; color: #be185d; }
[data-theme="dark"] .kd-mcp_server { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
[data-theme="dark"] .kd-agent { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-theme="dark"] .kd-skill { background: rgba(20, 184, 166, 0.16); color: #5eead4; }
[data-theme="dark"] .kd-plugin { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-theme="dark"] .kd-command { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
[data-theme="dark"] .kd-hook { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; }
.effect-permit { background: var(--ok-bg); color: var(--ok); }
.effect-forbid { background: var(--err-bg); color: var(--err); }
.mode-enforce { background: var(--ok-bg); color: var(--ok); }
.mode-logonly { background: var(--warn-bg); color: var(--warn); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.st-draft, .ps-draft { color: var(--text-muted); }
.st-pending_approval, .ps-in_review { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.st-approved, .ps-published { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.st-rejected { color: var(--err); background: var(--err-bg); border-color: transparent; }
.st-deprecated, .ps-archived { color: var(--text-muted); text-decoration: line-through; }
.origin { font-size: 12px; color: var(--text-muted); }
.o-console { color: #db2777; }
.o-local { color: var(--accent); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 550; color: var(--text-muted); font-size: 13px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td { background: var(--surface-2); }
.letter { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

/* Outils MCP */
.tool-row { margin-bottom: 10px; }
.tool-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.tool-detail { padding: 6px 18px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.param { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tool-form { display: flex; flex-direction: column; gap: 14px; }
.dashed { border: 1px dashed var(--border); border-radius: 10px; padding: 18px; text-align: center; }
.result { border-radius: 10px; padding: 12px 14px; }
.result.ok { background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.result.err { background: var(--err-bg); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); }
.result pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; max-height: 360px; overflow: auto; }

/* Cartes radio (création) */
.radio-card {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.radio-card span { display: flex; flex-direction: column; gap: 4px; }
.radio-card .dot { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--ring); flex: none; margin-top: 2px; }
.radio-card.selected { border: 2px solid var(--text); }
[data-theme="dark"] .radio-card.selected { border-color: var(--primary); }
.radio-card.selected .dot { border: 5px solid var(--text); }
[data-theme="dark"] .radio-card.selected .dot { border-color: var(--primary); }
.radio-card.disabled { opacity: 0.5; cursor: not-allowed; }

/* Menus, modales, panneaux */
.menu-anchor { position: relative; }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.menu {
  position: absolute; z-index: 31; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column;
}
.menu.right { left: auto; right: 0; }
.menu.up { top: auto; bottom: calc(100% + 6px); width: 100%; }
.menu button, .menu .menu-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.menu button:hover, .menu .menu-link:hover { background: var(--muted); }
.menu button.checked { background: var(--muted); font-weight: 600; }
.menu button.danger { color: var(--err); }
.menu-label { font-size: 12px; color: var(--text-muted); padding: 6px 10px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 40; }
.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, 94vw); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal.wide { width: min(980px, 94vw); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head > div { flex: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.sheet {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
}
.sheet .modal-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.picker-group { display: flex; flex-direction: column; gap: 4px; }
.picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 560px; overflow-y: auto; }
.picker-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.picker-item:hover { background: var(--muted); }
.picker-item > span { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.picker-item small { width: 100%; }
.picker-item.disabled { opacity: 0.6; }

/* Fil d'activité */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline blockquote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--border); color: var(--text-muted); }
.t-dot { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.t-dot .icon { width: 14px; height: 14px; }
.t-blue { background: #dbeafe; color: #1d4ed8; }
.t-amber { background: var(--warn-bg); color: var(--warn); }
.t-green { background: var(--ok-bg); color: var(--ok); }
.t-red { background: var(--err-bg); color: var(--err); }
.t-violet { background: #ede9fe; color: #6d28d9; }
.t-gray { background: var(--muted); color: var(--text-muted); }
[data-theme="dark"] .t-blue { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
[data-theme="dark"] .t-violet { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }

/* Code, diff, versions */
pre.md, pre.code-view { margin: 0; padding: 16px 20px; background: var(--code-bg); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 560px; overflow: auto; }
.diff { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 10px 0; }
.diff-path { padding: 7px 12px; background: var(--surface-2); font-size: 12px; border-bottom: 1px solid var(--border); }
.diff pre { margin: 0; padding: 10px 12px; font-size: 12px; color: var(--ok); background: var(--code-bg); overflow-x: auto; }
.diff-view .add { color: var(--ok); background: var(--ok-bg); display: block; }
.diff-view .del { color: var(--err); background: var(--err-bg); display: block; }
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.version-list li:last-child { border-bottom: 0; }
.version-list .badge { margin-left: 6px; }

/* Verdict de simulation */
.verdict { display: flex; gap: 12px; align-items: flex-start; margin: 0 20px 18px; padding: 14px; border-radius: 12px; }
.verdict .icon { width: 22px; height: 22px; }
.verdict.allow { background: var(--ok-bg); color: var(--ok); }
.verdict.deny { background: var(--err-bg); color: var(--err); }
.verdict p { color: var(--text); }

/* États vides, toasts */
.empty { text-align: center; padding: 44px 20px; border: 1px dashed var(--border); border-radius: 14px; margin: 10px 0 16px; }
.empty-icon { display: inline-flex; padding: 12px; border-radius: 999px; background: var(--muted); color: var(--text-muted); }
.empty-icon .icon { width: 22px; height: 22px; }
.empty-title { font-weight: 600; margin-top: 10px; }
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); max-width: 440px; cursor: pointer;
}
.toast.ok .icon { color: var(--ok); }
.toast.err .icon { color: var(--err); }
.sticky-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); margin: 0 -28px; padding: 14px 28px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; height: auto; }
  .sidebar { width: 100%; }
  .inset { margin: 0; border-radius: 0; }
  .page { padding: 16px; }
  .page-head { margin: -16px -16px 16px; padding: 14px 16px; }
  .split-layout, .grid-2, .grid-3, .form-grid, .stat-grid, .kv-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
.push-right { margin-left: auto; }
.env-prw { color: #db2777; border: 1px solid color-mix(in srgb, #db2777 40%, transparent); background: none; }
.env-dft { color: #0284c7; border: 1px solid color-mix(in srgb, #0284c7 40%, transparent); background: none; }
.env-local, .env-perso { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: none; }
.env-autre { background: none; border: 1px solid var(--border); }
pre.inline-code { margin: 0; padding: 8px 10px; background: var(--code-bg); border-radius: 8px; font-size: 12px; white-space: pre-wrap; max-width: 560px; }
