@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/vendor/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/vendor/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #18223a;
  --surface-3: #1f2b47;
  --border: #26324d;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #f59e0b;
  --primary-hover: #fbbf24;
  --on-primary: #0b1020;
  --positive: #34d399;
  --positive-bg: rgba(52, 211, 153, 0.12);
  --negative: #f87171;
  --negative-bg: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --warning-bg: rgba(245, 158, 11, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- structure ---------- */
.app { display: grid; grid-template-columns: 244px 1fr; height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--warning-bg); color: var(--primary); }
.mode-card {
  margin-top: auto; display: flex; gap: 10px; padding: 12px;
  background: var(--info-bg); border: 1px solid rgba(96, 165, 250, 0.25); border-radius: var(--radius-sm);
  color: var(--info); font-size: 12.5px;
}
.mode-card strong { display: block; font-size: 13px; }
.mode-card.is-live { background: var(--negative-bg); border-color: rgba(248, 113, 113, 0.45); color: var(--negative); }
.banner-live { background: var(--negative-bg); border: 1px solid rgba(248, 113, 113, 0.45); color: #fecaca; }
.status-pill .live-tag { padding: 1px 7px; border-radius: 999px; background: var(--negative); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
.problems { margin: 8px 0 0; padding-left: 18px; color: #fecaca; font-size: 13px; }
.mode-card p { color: var(--text-muted); margin-top: 2px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.page { display: none; flex-direction: column; gap: 18px; max-width: 1400px; margin: 0 auto; }
.page.is-active { display: flex; }

/* ---------- éléments ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hint { color: var(--text-muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-danger { background: var(--negative-bg); color: var(--negative); border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.status-pill[data-state="running"] { color: var(--positive); border-color: rgba(52, 211, 153, 0.35); }
.status-pill[data-state="running"] .status-dot { background: var(--positive); box-shadow: 0 0 0 4px var(--positive-bg); }
.status-pill[data-state="starting"] { color: var(--primary); }
.status-pill[data-state="starting"] .status-dot { background: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
.status-pill[data-state="crashed"] { color: var(--negative); border-color: rgba(248, 113, 113, 0.35); }
.status-pill[data-state="crashed"] .status-dot { background: var(--negative); }
@keyframes pulse { 50% { opacity: 0.35; } }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-label { color: var(--text-muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; }
.kpi-value .unit { font-size: 13px; font-weight: 500; letter-spacing: 0; margin-left: 6px; opacity: 0.7; }
.kpi-sub { font-size: 13px; margin-top: 2px; color: var(--text-muted); }
.is-stale .kpi-value, .is-stale td { opacity: 0.55; }
.up { color: var(--positive); }
.down { color: var(--negative); }

.chart { height: 280px; }
.chart-tall { height: 380px; }
.empty { color: var(--text-muted); text-align: center; padding: 36px 16px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid rgba(38, 50, 77, 0.6); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.right, td.right { text-align: right; }
tr.clickable { cursor: pointer; transition: background 0.12s; }
tr.clickable:hover, tr.clickable.is-selected { background: var(--surface-2); }
.pair { font-weight: 600; }
.pair small { color: var(--text-muted); font-weight: 400; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-up { background: var(--positive-bg); color: var(--positive); }
.badge-down { background: var(--negative-bg); color: var(--negative); }
.badge-neutral { background: var(--surface-3); color: var(--text-muted); }
.badge-gold { background: var(--warning-bg); color: var(--primary); }
.badge-info { background: var(--info-bg); color: var(--info); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; }
.banner strong { display: block; }
.banner-error { background: var(--negative-bg); border: 1px solid rgba(248, 113, 113, 0.35); color: #fecaca; }
.banner-warn { background: var(--warning-bg); border: 1px solid rgba(245, 158, 11, 0.35); color: #fde68a; }
.banner-info { background: var(--info-bg); border: 1px solid rgba(96, 165, 250, 0.3); color: #bfdbfe; }
.banner .btn { margin-left: auto; }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.segmented button { min-height: 34px; padding: 0 14px; border: 0; background: none; border-radius: 7px; color: var(--text-muted); font-weight: 500; font-size: 14px; }
.segmented button.is-active { background: var(--surface-3); color: var(--text); }

.log { margin: 0; height: calc(100vh - 250px); overflow: auto; padding: 14px; background: #070b16; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 12.5px/1.6 "Cascadia Mono", Consolas, monospace; color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }

/* ---------- comité ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.fact-label { color: var(--text-muted); font-size: 12.5px; }
.fact-value { font-weight: 600; margin-top: 2px; }
.summary-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary-row span:first-child { color: var(--text-muted); }
.timeline { display: flex; flex-direction: column; }
.meeting { padding: 14px 0; border-bottom: 1px solid rgba(38, 50, 77, 0.6); }
.meeting:last-child { border-bottom: 0; }
.meeting-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.meeting-date { font-weight: 600; }
.voice { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 14px; margin-top: 6px; }
.voice-name { color: var(--primary); font-weight: 600; font-size: 13px; }
.voice p { color: #cbd5e1; }
.list-plain { margin: 6px 0 0; padding-left: 18px; color: #cbd5e1; font-size: 14px; }
.report { font-size: 14px; color: #cbd5e1; max-height: 520px; overflow: auto; padding-right: 6px; }
.report h1 { font-size: 16px; margin: 0 0 10px; color: var(--text); }
.report h2 { font-size: 14.5px; margin: 18px 0 8px; color: var(--primary); }
.report p { margin: 8px 0; }
.report ul { margin: 6px 0; padding-left: 20px; }
.report table { margin: 8px 0; }

/* ---------- réglages ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field label, .field .label { font-weight: 500; font-size: 14px; }
.field .help { color: var(--text-muted); font-size: 13px; }
.input {
  min-height: 42px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 100%; transition: border-color 0.15s;
}
.input:hover { border-color: #3a4a6e; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 180px; }
.key-card { padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; }
.key-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.key-msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice {
  text-align: left; padding: 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: #3a4a6e; }
.choice.is-active { border-color: var(--primary); background: var(--warning-bg); }
.choice strong { display: block; font-size: 14px; }
.choice span { color: var(--text-muted); font-size: 12.5px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background 0.15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked { background: var(--primary); border-color: var(--primary); }
.switch input:checked::after { transform: translateX(20px); background: var(--on-primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; font-weight: 500; }
.chip button { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--text-muted); }
.chip button:hover { background: var(--negative-bg); color: var(--negative); }
.chip .icon { width: 14px; height: 14px; }

/* ---------- messages ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); font-size: 14px; max-width: 380px; animation: toast-in 0.2s ease-out; }
.toast.is-error { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }
.toast.is-success { border-color: rgba(52, 211, 153, 0.45); color: #a7f3d0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 7, 15, 0.7); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal { width: min(440px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6); }
.modal h2 { font-size: 17px; }
.modal p { color: var(--text-muted); margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 76px 1fr; }
  .brand > div:last-child, .mode-card, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; gap: 0; }
  .choice-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
