/* ==========================================================================
   Plateforme S3 · Système de design
   ========================================================================== */
:root {
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Roboto Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;

  --bg: #f6f7f9;
  --bg-sunken: #eef0f4;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-hover: #f4f6f9;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --text-3: #8a94a6;

  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-soft: #eef2ff;
  --brand-ring: rgba(79, 70, 229, .22);

  --ok: #079455;    --ok-soft: #ecfdf3;   --ok-line: #abefc6;
  --warn: #dc6803;  --warn-soft: #fffaeb; --warn-line: #fedf89;
  --bad: #d92d20;   --bad-soft: #fef3f2;  --bad-line: #fecdca;
  --info: #475467;  --info-soft: #f2f4f7; --info-line: #e4e7ec;
  --nodata: #e4e7ec;

  --side-bg: #0c111d;
  --side-surface: #161b26;
  --side-border: #1f2532;
  --side-text: #94969c;
  --side-text-strong: #f5f5f6;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-sunken: #070a10;
  --surface: #121722;
  --surface-2: #151b27;
  --surface-hover: #1a2130;
  --border: #232a38;
  --border-strong: #333c4e;
  --text: #f0f2f5;
  --text-2: #a9b1c0;
  --text-3: #6f7889;
  --brand: #7c74ff;
  --brand-600: #6d63ff;
  --brand-soft: rgba(124, 116, 255, .14);
  --brand-ring: rgba(124, 116, 255, .35);
  --ok: #32d583;   --ok-soft: rgba(50, 213, 131, .12);  --ok-line: rgba(50, 213, 131, .3);
  --warn: #fdb022; --warn-soft: rgba(253, 176, 34, .12); --warn-line: rgba(253, 176, 34, .3);
  --bad: #f97066;  --bad-soft: rgba(249, 112, 102, .12); --bad-line: rgba(249, 112, 102, .3);
  --info: #a9b1c0; --info-soft: rgba(169, 177, 192, .1); --info-line: #333c4e;
  --nodata: #262e3d;
  --side-bg: #070a10;
  --side-surface: #111620;
  --side-border: #1a202c;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  
}
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 26px; line-height: 1.25; font-weight: 650; margin: 0; }
h2 { font-size: 15px; font-weight: 620; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--bg-sunken); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side-bg); border-right: 1px solid var(--side-border); padding: 18px 14px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; color: var(--side-text-strong); }
a.brand:hover { color: var(--side-text-strong); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 120%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 16px -4px rgba(99, 102, 241, .6);
}
.brand-logo .icon { color: #fff; stroke-width: 2.2; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--side-text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #5d6472; padding: 18px 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--side-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-surface); color: var(--side-text-strong); }
.nav a.active { background: var(--side-surface); color: var(--side-text-strong); box-shadow: inset 0 0 0 1px var(--side-border); }
.nav a.active .icon { color: #a5b4fc; }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: rgba(240, 68, 56, .16); color: #fda29b;
}
.nav .count.ok { background: rgba(23, 178, 106, .16); color: #75e0a7; }
.side-footer { margin-top: auto; border-top: 1px solid var(--side-border); padding-top: 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #273049; color: #c7d2fe; font-weight: 650; font-size: 13px; text-transform: uppercase;
}
.user-name { color: var(--side-text-strong); font-weight: 550; font-size: 13px; line-height: 1.2; }
.user-role { color: var(--side-text); font-size: 12px; }
.user form { margin-left: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: inherit; cursor: pointer; transition: background .15s, color .15s;
}
.sidebar .icon-btn { color: var(--side-text); }
.sidebar .icon-btn:hover { background: var(--side-surface); color: var(--side-text-strong); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 12px;
  padding: 0 32px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs .current { color: var(--text); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar .icon-btn { color: var(--text-2); border: 1px solid transparent; }
.topbar .icon-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); padding: 0 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
.live-dot.bad { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); } 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.menu-btn { display: none; }

.content { padding: 28px 32px 64px; max-width: 1320px; width: 100%; margin: 0 auto; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .lead { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 8px; }
.eyebrow:hover { color: var(--text); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.grid > .card { margin-top: 0; }
.grid > div > .card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); color: var(--text-2); font-size: 12.5px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Stat cards ---------- */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--text-2); font-weight: 550; font-size: 13px; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.bad { background: var(--bad-soft); color: var(--bad); }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -.025em; margin-top: 12px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 15px; color: var(--text-3); font-weight: 550; margin-left: 2px; letter-spacing: 0; }
.stat-value.text { font-size: 21px; }
.stat-meta { color: var(--text-2); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- Status banner ---------- */
.banner {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--ok-line); background: linear-gradient(90deg, var(--ok-soft), var(--surface) 75%);
  margin-bottom: 18px; box-shadow: var(--shadow-xs);
}
.banner.warn { border-color: var(--warn-line); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 75%); }
.banner.bad { border-color: var(--bad-line); background: linear-gradient(90deg, var(--bad-soft), var(--surface) 75%); }
.banner-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; box-shadow: 0 0 0 6px var(--ok-soft); }
.banner.warn .banner-icon { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }
.banner.bad .banner-icon { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-soft); }
.banner-icon .icon { stroke-width: 2.4; }
.banner-title { font-family: var(--font-display); font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.banner-text { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.banner .actions { margin-left: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--info-line);
  background: var(--info-soft); color: var(--info);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.ok .dot.live { animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--border); font-family: var(--mono); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.1), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { pointer-events: none; opacity: .75; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline-flex; margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 20px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 600; color: var(--text); }
a.cell-title:hover { color: var(--brand); }
.cell-sub { color: var(--text-3); font-size: 12.5px; margin-top: 1px; word-break: break-all; }
.target { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.target-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--border); flex: none; }

/* ---------- Uptime ticks ---------- */
.ticks { display: flex; gap: 2px; align-items: stretch; height: 26px; min-width: 150px; }
.ticks i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--ok); opacity: .9; transition: opacity .15s, transform .15s; }
.ticks i:hover { opacity: 1; transform: scaleY(1.12); }
.ticks i.ko { background: var(--bad); }
.ticks i.nd { background: var(--nodata); }
.ticks.lg { height: 38px; gap: 3px; }
.ticks-legend { display: flex; justify-content: space-between; color: var(--text-3); font-size: 12px; margin-top: 8px; }

/* ---------- Meters ---------- */
.meter { height: 6px; background: var(--bg-sunken); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .6s var(--ease); }
.meter.warn > span { background: var(--warn); } .meter.bad > span { background: var(--bad); }
.meter.brand > span { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
/* La classe « brand » sert aussi au logo : on annule ses effets sur les barres de progression */
.meter.brand { display: block; padding: 0; gap: 0; color: inherit; }
.resource { display: grid; gap: 8px; }
.resource + .resource { margin-top: 18px; }
.resource-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.resource-head strong { font-variant-numeric: tabular-nums; }

/* ---------- Score ring ---------- */
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--bg-sunken); }
.ring .value { stroke: var(--ok); stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.ring.B .value { stroke: #66c61c; } .ring.C .value { stroke: var(--warn); } .ring.D .value { stroke: #ef6820; } .ring.E .value { stroke: var(--bad); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.ring.lg { width: 112px; height: 112px; }
.ring.lg .label { font-size: 34px; }
.ring.sm { width: 40px; height: 40px; }
.ring.sm .label { font-size: 13px; }

/* ---------- Sparkline / response chart ---------- */
.chart { width: 100%; height: 160px; display: block; }
.chart .area { fill: url(#grad); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .ko { fill: var(--bad); opacity: .14; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-hover); color: var(--text); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .chev { color: var(--text-3); }
.sev { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.sev.bad { background: var(--bad-soft); color: var(--bad); }
.sev.warn { background: var(--warn-soft); color: var(--warn); }
.sev.ok { background: var(--ok-soft); color: var(--ok); }

.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-2); }
.kv dd { font-weight: 550; word-break: break-word; text-align: right; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 4px 20px; }
.timeline li { position: relative; padding: 12px 0 12px 26px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ok); }
.timeline li.open::before { border-color: var(--bad); background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.timeline li:last-child { border-left-color: transparent; }

/* ---------- Audit results ---------- */
.finding { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.finding .detail { color: var(--text-2); margin-top: 3px; word-break: break-word; }
.fix { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--bg-sunken); border: 1px solid var(--border); font-size: 13px; }
.fix .icon { color: var(--brand); margin-top: 1px; }
.summary { display: flex; align-items: center; gap: 24px; padding: 22px; flex-wrap: wrap; }
.summary-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.summary-stats .n { font-family: var(--font-display); font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Checklist ---------- */
.check { display: grid; grid-template-columns: 28px 1fr minmax(180px, 260px); gap: 16px; align-items: start; padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background .15s; }
.check:last-child { border-bottom: 0; }
.check:hover { background: var(--surface-2); }
.check.done .check-title { color: var(--text-2); }
.checkbox {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; transition: all .15s; margin-top: 1px;
}
.checkbox:hover { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.checkbox .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; transform: scale(.6); transition: all .15s; }
.check.done .checkbox { background: var(--ok); border-color: var(--ok); }
.check.done .checkbox .icon { opacity: 1; transform: none; }
.check-title { font-weight: 550; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cmd { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--bg-sunken); border: 1px solid var(--border); padding: 7px 10px; border-radius: 7px; word-break: break-word; }
.check-meta { color: var(--ok); font-size: 12.5px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.field .help { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.field .error { color: var(--bad); font-size: 12.5px; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
input[type=text], input[type=url], input[type=number], input[type=password], input[type=email], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; }
input::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.field.has-error input, .field.has-error select { border-color: var(--bad); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.segmented { display: inline-flex; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; width: 100%; }
.segmented label { flex: 1; margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 36px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 600; transition: all .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 100; width: min(400px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toast-in .35s var(--ease);
}
.toast.hide { animation: toast-out .3s var(--ease) forwards; }
.toast .t-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.toast.success .t-icon { background: var(--ok-soft); color: var(--ok); }
.toast.error .t-icon { background: var(--bad-soft); color: var(--bad); }
.toast .t-body { flex: 1; padding-top: 3px; font-weight: 500; }
.toast .icon-btn { width: 26px; height: 26px; color: var(--text-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--text-2); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-3); border: 1px solid var(--border); }
.empty h3 { margin-bottom: 4px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; }

/* ---------- Terminal ---------- */
.terminal { background: #0b0f17; color: #d0d5dd; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid #1f2532; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #111620; border-bottom: 1px solid #1f2532; color: #8a94a6; font-size: 12px; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #f04438; }
.terminal-bar i:nth-child(2) { background: #f79009; } .terminal-bar i:nth-child(3) { background: #17b26a; }
.terminal-bar span { margin-left: 8px; font-family: var(--mono); }
.terminal pre { margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.65; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 38px; color: var(--text-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; }
.steps li:last-child { padding-bottom: 0; }
.steps strong { color: var(--text); display: block; margin-bottom: 4px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside {
  position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; color: #e4e7ec;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(99,102,241,.45), transparent 60%),
              radial-gradient(900px 500px at 120% 110%, rgba(6,182,212,.28), transparent 60%), #0c111d;
}
.auth-aside::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { padding: 0; }
.auth-hero { margin: auto 0; max-width: 480px; }
.auth-hero h1 { color: #fff; font-size: 36px; line-height: 1.15; letter-spacing: -.03em; }
.auth-hero p { color: #a9b1c0; font-size: 15.5px; margin-top: 14px; }
.auth-features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; }
.auth-features .f-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #c7d2fe; flex: none; }
.auth-features strong { color: #fff; display: block; font-weight: 600; }
.auth-features span { color: #94969c; font-size: 13px; }
.auth-foot { color: #6f7889; font-size: 12.5px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.auth-card .lead { color: var(--text-2); margin: 6px 0 28px; }
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 3px; color: var(--text-3); }
.alert { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); font-weight: 550; }
.secure-note { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--text-3); font-size: 12.5px; margin-top: 22px; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Responsive shell ---------- */
.scrim { display: none; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,17,29,.5); z-index: 35; animation: fade .2s; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 56px; }
  .live { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1 1 0; min-width: 0; }
  .page-head .actions .btn { width: 100%; padding: 0 10px; }
  .banner { flex-wrap: wrap; }
  .banner .actions { margin-left: 0; width: 100%; }
  .check { grid-template-columns: 28px 1fr; }
  .check > :last-child { grid-column: 2; }
  .finding { grid-template-columns: 32px 1fr; }
  .finding > :last-child { grid-column: 2; }
  td, th { padding-left: 14px; padding-right: 14px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Logo Trigarde ---------- */
.brand-logo.brand-logo-img { background: none; box-shadow: 0 6px 16px -6px rgba(91, 63, 224, .7); border-radius: 10px; overflow: hidden; }
.brand-logo.brand-logo-img img { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: 800; letter-spacing: -.03em; font-size: 17px; }

/* Lien du profil et choix de la langue */
.user-lien { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; border-radius: 10px; }
.user-lien:hover .user-name { text-decoration: underline; }
.choix-langue { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.choix-langue button { border: 0; background: transparent; color: var(--text-3); font: 650 11.5px/1 var(--font-body, inherit); padding: 6px 8px; cursor: pointer; }
.choix-langue button.on { background: var(--bg-sunken); color: var(--text); }

/* Bandeau cookies */
.bandeau-cookies { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 980px; margin: 0 auto;
  display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(16, 24, 40, .18); }
.bandeau-cookies[hidden] { display: none; }
.bandeau-cookies .bc-texte { flex: 1 1 520px; min-width: 0; }
.bandeau-cookies p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.bandeau-cookies .bc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bandeau-cookies table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 12.5px; }
.bandeau-cookies th, .bandeau-cookies td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bandeau-cookies .bc-note { font-size: 12px; color: var(--text-3); }
@media print { .bandeau-cookies { display: none !important; } }

/* Avertissement grave (paiement réel en local, incident…) */
.notice.danger { border-color: var(--bad-line, var(--bad)); background: var(--bad-soft); }
.notice.danger .icon { color: var(--bad); }
