/* =====================================================================================
   HydroShell — espaces sécurisés · système de design
   Identité : bleu marine (#0B3C5D) + cyan (#00B4D8), esprit « plan technique » et eau.
   Polices auto-hébergées (aucune requête vers un tiers) : Space Grotesk (titres, chiffres) + Inter (interface).
   ===================================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e1e8ef;
  --line-strong: #c9d5df;
  --ink: #0f2536;
  --ink-2: #3f566a;
  --ink-3: #5a6f82;

  --brand: #0b3c5d;
  --brand-2: #072b44;
  --accent: #00b4d8;
  --accent-ink: #006c88; /* cyan lisible sur fond clair (contraste 6:1) */
  --btn-bg: #0b3c5d;
  --btn-ink: #ffffff;
  --btn-bg-hover: #072b44;
  --focus: #00b4d8;

  --ok: #0b7a53;
  --ok-bg: #e3f5ed;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --crit: #b3261e;
  --crit-bg: #fbe8e6;
  --info: #0b3c5d;
  --info-bg: #e5f0f7;
  --neutral: #4b6072;
  --neutral-bg: #edf1f5;

  --side-bg: #0b3c5d;
  --side-bg-2: #082f49;
  --side-ink: #d3e6f1;
  --side-ink-strong: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(11, 60, 93, 0.06), 0 1px 1px rgba(11, 60, 93, 0.04);
  --shadow-2: 0 8px 24px rgba(11, 60, 93, 0.12), 0 2px 6px rgba(11, 60, 93, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09151f;
    --surface: #0f2233;
    --surface-2: #132a3d;
    --line: #1e3a50;
    --line-strong: #2b4c66;
    --ink: #e8f1f7;
    --ink-2: #b1c5d3;
    --ink-3: #8ea6b7;
    --accent-ink: #3cc9e8;
    --btn-bg: #00b4d8;
    --btn-ink: #06222f;
    --btn-bg-hover: #2cc6e6;
    --ok: #4bd6a0;
    --ok-bg: #0e2c22;
    --warn: #f0b34a;
    --warn-bg: #33250a;
    --crit: #ff8a80;
    --crit-bg: #3a1714;
    --info: #8fd3ea;
    --info-bg: #10304a;
    --neutral: #a9bccb;
    --neutral-bg: #17303f;
    --side-bg: #071520;
    --side-bg-2: #050f18;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09151f; --surface: #0f2233; --surface-2: #132a3d; --line: #1e3a50; --line-strong: #2b4c66;
  --ink: #e8f1f7; --ink-2: #b1c5d3; --ink-3: #8ea6b7; --accent-ink: #3cc9e8;
  --btn-bg: #00b4d8; --btn-ink: #06222f; --btn-bg-hover: #2cc6e6;
  --ok: #4bd6a0; --ok-bg: #0e2c22; --warn: #f0b34a; --warn-bg: #33250a; --crit: #ff8a80; --crit-bg: #3a1714;
  --info: #8fd3ea; --info-bg: #10304a; --neutral: #a9bccb; --neutral-bg: #17303f;
  --side-bg: #071520; --side-bg-2: #050f18;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
:root[data-theme="dark"] a:hover { color: #fff; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 0.8125rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.noscript { font: 16px/1.5 system-ui, sans-serif; padding: 2rem; max-width: 40rem; }

/* ---------- Icônes ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.i-lg { width: 1.5rem; height: 1.5rem; }

/* ---------- Coquille de l'application ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--side-ink-strong); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #062433; display: grid; place-items: center; }
.brand-mark .i { width: 20px; height: 20px; }
.brand-name { font: 700 1.1rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand-sub { display: block; font: 500 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #8fb6cc; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-title { font: 600 0.6875rem/1 var(--font-ui); letter-spacing: 0.09em; text-transform: uppercase; color: #7fa6bd; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: 0.9rem; position: relative;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(0,180,216,.16); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,180,216,.22); color: #fff; display: grid; place-items: center; font: 600 0.8rem var(--font-display); flex: none; }
.who-name { font-weight: 600; font-size: 0.85rem; color: #fff; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 0.75rem; color: #8fb6cc; }
.side-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px 0; }
.side-actions > a { flex-basis: 100%; }
.side-actions button, .side-actions a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 8px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: var(--side-ink); font-size: 0.8125rem; cursor: pointer; text-decoration: none;
}
.side-actions button:hover, .side-actions a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-actions a { flex: 1 1 100%; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { width: 100%; max-width: 1140px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 36px) 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head .lead { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8125rem; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%);
    transition: transform 0.25s var(--ease); box-shadow: var(--shadow-2);
  }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(4,16,26,.55); z-index: 35; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: var(--side-bg); color: #fff; padding: 10px 14px;
  }
  .topbar .brand { padding: 0; }
  .topbar .icon-btn { margin-left: auto; }
  .page { padding-top: 20px; }
}
@media (min-width: 961px) { .scrim { display: none; } }

/* Champ mot de passe : bouton « afficher » dans le champ */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 34px; width: 36px; padding: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; min-height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-ink); font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--neutral-bg); color: var(--ink); }
.btn-danger { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.btn-danger:hover { background: var(--crit); color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 0.8125rem; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cartes, indicateurs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-body { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
a.kpi:hover { border-color: var(--accent); box-shadow: var(--shadow-2); transform: translateY(-2px); color: inherit; }
.kpi-label { font-size: 0.8125rem; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 8px; padding-right: 44px; }
.kpi-value { font: 600 2rem/1.1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: 0.8125rem; color: var(--ink-3); }
.kpi.alert { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
.kpi.alert .kpi-value { color: var(--crit); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi-icon { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }

/* ---------- Pastilles de statut ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--crit); }
.pill.info { background: var(--info-bg); color: var(--info); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #062433; font-size: 0.6875rem; font-weight: 700; }
.badge.crit { background: var(--crit); color: #fff; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.actions-cell { text-align: right; white-space: nowrap; }
.table .title { font-weight: 600; color: var(--ink); text-decoration: none; }
.table a.title:hover { color: var(--accent-ink); text-decoration: underline; }
.table .sub { display: block; font-size: 0.8125rem; color: var(--ink-3); font-weight: 400; }
@media (max-width: 720px) {
  .table.stack-mobile thead { display: none; }
  .table.stack-mobile, .table.stack-mobile tbody, .table.stack-mobile tr, .table.stack-mobile td { display: block; width: 100%; }
  .table.stack-mobile tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.stack-mobile td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.stack-mobile td::before { content: attr(data-label); color: var(--ink-3); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: left; flex: none; }
  .table.stack-mobile td.actions-cell { justify-content: flex-end; padding-top: 8px; }
  .table.stack-mobile td.actions-cell::before { display: none; }
}

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.field .req { color: var(--crit); margin-left: 2px; }
.field .hint { font-size: 0.8125rem; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:hover { border-color: var(--ink-3); }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input[aria-invalid="true"] { border-color: var(--crit); }
.field-error { color: var(--crit); font-size: 0.8125rem; font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.form-error { background: var(--crit-bg); color: var(--crit); border-radius: 10px; padding: 11px 14px; font-size: 0.9rem; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.check-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); font-size: 0.9rem; }
.check:hover { border-color: var(--line-strong); background: var(--surface-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
:root[data-theme="dark"] .check input { accent-color: var(--accent); }
.check.on { border-color: var(--accent); background: var(--info-bg); }
.check small { display: block; color: var(--ink-3); }

.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--ink-2); background: var(--surface-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--info-bg); }
.dropzone .i { width: 26px; height: 26px; color: var(--accent-ink); }
.dropzone strong { display: block; color: var(--ink); margin-top: 4px; }
.dropzone .file-name { margin-top: 6px; font-weight: 600; color: var(--ok); word-break: break-all; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Onglets, fil d'Ariane, listes ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 0.9rem; cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover, .tabs button:hover { color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; }
.list .s { font-size: 0.8125rem; color: var(--ink-3); }
.item-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); flex: none; }
.item-icon.ok { background: var(--ok-bg); color: var(--ok); }
.item-icon.warn { background: var(--warn-bg); color: var(--warn); }
.item-icon.crit { background: var(--crit-bg); color: var(--crit); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-size: 0.9rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.crit { background: var(--crit-bg); color: var(--crit); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice .i { margin-top: 2px; }
.notice strong { color: inherit; }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; }
.copy-box code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: 0.85rem; }

/* ---------- États vides, chargement ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .art { width: 112px; height: 76px; margin: 0 auto 14px; color: var(--accent); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 42ch; margin: 0 auto; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.sk-line { height: 14px; margin: 10px 0; }
.sk-title { height: 28px; width: 40%; margin-bottom: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Fenêtre modale et notifications ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
dialog.modal::backdrop { background: rgba(4, 16, 26, 0.6); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; max-height: min(70vh, 640px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-2); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-2); font-size: 0.9rem; animation: toast-in 0.25s var(--ease); }
.toast.err { background: var(--crit); }
.toast.ok .i { color: #4bd6a0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Graphique d'audience, chronologie ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bars .bar { flex: 1; min-width: 3px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: 0.85; transition: opacity 0.15s; position: relative; }
.bars .bar:hover { opacity: 1; background: var(--brand); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

/* ---------- Connexion / invitation ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between;
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(900px 500px at 15% 10%, #14608f 0%, transparent 60%),
    linear-gradient(160deg, #0b3c5d, #06263b);
}
.auth-hero .brand { padding: 0; }
.auth-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); max-width: 16ch; margin-bottom: 14px; }
.auth-hero p { color: #c3dcea; max-width: 44ch; font-size: 1.05rem; }
.auth-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: #d6e8f2; }
.auth-list li { display: flex; gap: 12px; align-items: center; }
.auth-list .i { color: var(--accent); }
.waves { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; opacity: 0.9; pointer-events: none; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .card-pad { padding: 30px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 0.8125rem; color: var(--ink-3); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 24px 22px 90px; min-height: 0; }
  .auth-hero h1 { font-size: 1.7rem; }
  .auth-list { display: none; }
  .auth-main { padding: 0 16px 32px; margin-top: -60px; position: relative; z-index: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .actions, .toasts { display: none !important; }
  .app { display: block; }
}
