/* ============================================================
   Dashboard des bots — fond « abysse », une seule teinte d'accent.
   Les couleurs d'état (vert / ambre / rouge) ne servent qu'à l'état.
   ============================================================ */
:root {
  --bg: #0d1819;
  --panel: #132224;
  --raised: #193033;
  --line: #243d40;
  --line-soft: #1c3032;
  --ink: #e4eeeb;
  --ink-2: #b4c8c5;
  --muted: #8aa5a3;
  --iris: #a9b6ff;
  --iris-ink: #121a3d;
  --ok: #4fd69c;
  --warn: #f2b84b;
  --bad: #ff7070;
  --off: #6d8483;

  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 6px;
  --rail: 240px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.5 var(--font-ui);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--iris); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--iris) 35%, transparent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.grow { flex: 1; min-width: 0; }

/* ── Boutons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--raised); color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: #20393c; border-color: #31504f; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--iris); border-color: var(--iris); color: var(--iris-ink); font-weight: 600; }
.btn.primary:hover { background: #bcc6ff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 14%, var(--raised)); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--raised); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }

/* ── Formulaires ─────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 500; color: var(--ink-2); font-size: 13.5px; }
.hint { color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 36px; padding: 0 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
}
textarea { height: auto; padding: 9px 11px; min-height: 84px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238aa5a3' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
input:hover, select:hover, textarea:hover { border-color: #31504f; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 22%, transparent); }
input::placeholder, textarea::placeholder { color: #5f7a79; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--iris); margin: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink-2);
  font-size: 13px; cursor: pointer; user-select: none;
}
.chip:hover { border-color: #3a5b5a; }
.chip[aria-pressed=true], .chip.on { background: color-mix(in srgb, var(--iris) 18%, transparent); border-color: color-mix(in srgb, var(--iris) 60%, var(--line)); color: var(--ink); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--off)); flex: none; }

/* ── Connexion ───────────────────────────────────────────── */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(400px, 100%); }
.gate h1 { font: 650 clamp(30px, 6vw, 40px)/1.05 var(--font-display); letter-spacing: -.02em; margin-bottom: 8px; }
.gate .lead { color: var(--muted); margin-bottom: 28px; }
.gate .btn { width: 100%; height: 42px; }
.gate form { display: grid; gap: 12px; margin-top: 4px; }
.gate .sep { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: 13px; }
.gate .sep::before, .gate .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notice { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); margin-bottom: 18px; font-size: 13.5px; }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: #ffc2c2; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: #ffe2a6; }

/* ── Coque ───────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 14px 14px; border-right: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg) 70%, #000);
}
.brand { font: 650 19px/1.15 var(--font-display); letter-spacing: -.01em; padding: 0 10px 22px; }
.brand small { display: block; font: 400 12.5px/1.4 var(--font-ui); color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav { display: grid; gap: 2px; overflow-y: auto; }
.nav h3 { font: 500 12.5px/1 var(--font-ui); color: var(--muted); padding: 18px 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px;
  color: var(--ink-2); border-radius: var(--r-sm); text-decoration: none;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a[aria-current=page] { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--iris); }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--raised); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--iris); }
.rail-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.rail-foot .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot .who span { font-size: 12.5px; color: var(--muted); }

.topbar { display: none; }
.main { padding: 32px clamp(18px, 4vw, 48px) 64px; min-width: 0; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font: 650 28px/1.1 var(--font-display); letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Surfaces ────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card h2 { font: 600 16px/1.2 var(--font-display); padding: 16px 20px 0; letter-spacing: -.005em; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.empty .btn { margin-top: 14px; }

/* ── État : LED + libellé (jamais la couleur seule) ──────── */
.led { width: 9px; height: 9px; border-radius: 50%; background: var(--tone, var(--off)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--off)) 22%, transparent); }
.is-online { --tone: var(--ok); }
.is-starting, .is-backoff { --tone: var(--warn); }
.is-failed { --tone: var(--bad); }
.is-offline { --tone: var(--off); }
.is-starting .led, .is-backoff .led { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; border: 1px solid var(--line); color: var(--ink-2); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.badge.iris { color: var(--iris); border-color: color-mix(in srgb, var(--iris) 45%, var(--line)); }

/* ── Vue d'ensemble ──────────────────────────────────────── */
.hero { margin-bottom: 30px; }
.hero h2 { font: 650 clamp(30px, 5vw, 46px)/1.05 var(--font-display); letter-spacing: -.025em; display: flex; align-items: center; gap: 16px; padding: 0; }
.hero h2 .led { width: 14px; height: 14px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone, var(--off)) 22%, transparent); }
.hero p { color: var(--ink-2); margin-top: 10px; font-size: 16px; }

.strips { display: grid; gap: 14px; margin-bottom: 28px; }
.strip { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.strip .bar { background: var(--tone, var(--off)); }
.strip .body { padding: 18px 22px; display: grid; gap: 12px; min-width: 0; }
.strip .top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.strip .name { font: 650 24px/1.1 var(--font-display); letter-spacing: -.015em; }
.strip .vitals { display: flex; flex-wrap: wrap; gap: 6px 26px; color: var(--ink-2); }
.strip .vitals span b { font-weight: 600; color: var(--ink); }
.strip .metrics { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.metric b { font: 650 20px/1 var(--font-display); margin-right: 6px; }
.metric span { color: var(--muted); }
.strip .tail { font: 400 12.5px/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 10px; border-top: 1px dashed var(--line); }
.strip .tail.err { color: #ffb0b0; }
.strip .side { padding: 18px 22px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 14px; border-left: 1px solid var(--line-soft); }
.strip .side .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.spark { display: block; }
.spark-cap { font-size: 12.5px; color: var(--muted); text-align: right; }

.list { display: grid; }
.list > * { padding: 12px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: baseline; }
.list > *:first-child { border-top: 0; }
.list .when { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.card > .list { margin-top: 10px; }

/* ── Services ────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line); color: var(--ink-2); background: transparent; cursor: pointer; text-decoration: none; }
.tab:hover { background: var(--panel); text-decoration: none; }
.tab[aria-selected=true] { background: var(--raised); color: var(--ink); border-color: #355655; }
.svc-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.facts { display: grid; margin: 0; padding: 6px 20px 16px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.terminal-wrap { overflow: hidden; }
.term-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar input[type=search] { width: 190px; height: 30px; }
.terminal { height: min(62vh, 640px); overflow: auto; padding: 12px 0; background: #091213; font: 400 12.5px/1.55 var(--font-mono); }
.logline { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 0 16px; white-space: pre-wrap; word-break: break-word; }
.logline:hover { background: #0f1c1d; }
.logline time { color: #56706f; user-select: none; }
.logline.err span { color: #ffb0b0; }
.logline.sys span { color: var(--iris); font-style: italic; }
.logline.out span { color: #cfe0dd; }
.term-empty { padding: 28px 16px; color: var(--muted); font-family: var(--font-ui); font-size: 14px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-card { overflow: hidden; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: #17292b; }
.t .right { text-align: right; }
.t .nw { white-space: nowrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { height: 34px; padding: 0 14px; background: transparent; border: 0; border-right: 1px solid var(--line); color: var(--ink-2); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed=true] { background: var(--raised); color: var(--ink); }

/* ── Panneau latéral & modales ───────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(3, 9, 10, .66); z-index: 40; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 41; display: flex; flex-direction: column; animation: slide .18s ease-out; box-shadow: -20px 0 50px rgba(0, 0, 0, .35); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head, .modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2, .modal-head h2 { font: 600 18px/1.2 var(--font-display); padding: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.modal { position: fixed; z-index: 41; top: 6vh; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pop .15s ease-out; }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

.qa { display: grid; gap: 14px; margin-bottom: 22px; }
.qa dt { color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.qa dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.chat { display: grid; gap: 12px; margin: 6px 0 16px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.msg .avatar { width: 30px; height: 30px; }
.msg .meta { font-size: 13px; color: var(--muted); }
.msg .meta b { color: var(--ink); font-weight: 600; margin-right: 8px; }
.msg .text { white-space: pre-wrap; word-break: break-word; margin-top: 1px; }
.reply { display: grid; gap: 8px; position: sticky; bottom: 0; background: var(--panel); padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ── Panels / options ────────────────────────────────────── */
.opt { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.opt:first-child { border-top: 0; }
.opt .emo { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--raised); display: grid; place-items: center; font-size: 20px; }
.opt .emo img { width: 24px; height: 24px; }
.opt h3 { font-size: 15px; font-weight: 600; }
.opt .roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.q-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; }
.q-row .opts { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; }

/* ── BDA ─────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat b { display: block; font: 650 30px/1 var(--font-display); letter-spacing: -.02em; }
.stat span { display: block; color: var(--muted); margin-top: 8px; font-size: 13.5px; }
.queue-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 18px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.queue-row:first-child { border-top: 0; }
.meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--iris); border-radius: 3px; }
.meter.low i { background: var(--warn); }
.section-t { font: 600 16px/1.2 var(--font-display); margin: 30px 0 12px; }
.sub { font: 600 15px/1.2 var(--font-display); margin: 26px 0 12px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.status-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; }

/* ── Toasts ──────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: slide .18s ease-out; display: flex; gap: 10px; align-items: flex-start; }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.toast.ok .led { --tone: var(--ok); }
.toast.bad .led { --tone: var(--bad); }
.toast .led { margin-top: 6px; }

.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--panel), var(--raised), var(--panel)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .svc-layout { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s ease; background: var(--bg); }
  .shell.nav-open .rail { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .topbar { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 30; background: var(--bg); }
  .topbar b { font: 650 17px var(--font-display); }
  .main { padding-top: 22px; }
  .strip { grid-template-columns: 6px minmax(0, 1fr); }
  .strip .side { grid-column: 2; flex-direction: row; align-items: center; border-left: 0; border-top: 1px solid var(--line-soft); padding: 12px 22px; flex-wrap: wrap; }
  .grid2 { grid-template-columns: 1fr; }
  .status-row { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { padding: 12px 6px; border-bottom: 1px solid var(--line-soft); }
  table.t.stack td { border: 0; padding: 3px 12px; }
  table.t.stack td.right { text-align: left; }
  .queue-row { grid-template-columns: 1fr; gap: 8px; }
  .q-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head .actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Page d'un ticket ───────────────────────────────────── */
.tk-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tk-head .avatar { width: 52px; height: 52px; font-size: 20px; }
.tk-head h1 { font: 650 26px/1.1 var(--font-display); letter-spacing: -.02em; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tk-side { display: grid; gap: 16px; }
.tk-layout .chat { max-height: 58vh; overflow: auto; padding-right: 4px; }
.tk-layout .reply { position: static; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line); }
.timeline time { color: var(--muted); font-size: 12.5px; }
.pick-list { display: grid; gap: 4px; margin-top: 12px; max-height: 50vh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; text-align: left; cursor: pointer; }
.pick:hover { background: var(--raised); border-color: var(--line); }
@media (max-width: 960px) { .tk-layout { grid-template-columns: 1fr; } }

/* ── Logo, barre de progression ──────────────────────────── */
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { border-radius: 9px; flex: none; }
.gate-logo { border-radius: 14px; margin-bottom: 22px; display: block; }
.progress { position: fixed; z-index: 90; top: 0; left: 0; height: 2px; width: 100%; background: var(--ok); transform: scaleX(0); transform-origin: left; opacity: 0; transition: transform .6s ease, opacity .3s ease; pointer-events: none; }
.progress.on { transform: scaleX(.7); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .progress { transition: none; } }

/* ── Staff et absences ───────────────────────────────────── */
.staff-list { display: grid; gap: 2px; }
.staff-row, .abs-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line-soft); }
.staff-row:first-child, .abs-row:first-child { border-top: 0; }
.abs-row { align-items: flex-start; }
.staff-id, .abs-main { min-width: 0; flex: 1; display: grid; gap: 2px; line-height: 1.35; }
.staff-id b, .abs-main b { font-weight: 500; }
.staff-state { white-space: nowrap; font-size: 13.5px; }
.abs-reason { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.small { font-size: 12.5px; }
input[type=date] { height: 36px; padding: 0 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; color-scheme: dark; }
.card .card-title { padding: 0; font: 600 16px/1.2 var(--font-display); margin-bottom: 12px; }
@media (max-width: 720px) { .staff-row { flex-wrap: wrap; } .staff-state { width: 100%; padding-left: 44px; } .abs-row { flex-wrap: wrap; } }

/* ── Mentions légales ────────────────────────────────────── */
.legal-note { margin-top: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.legal-note a, .rail-legal a, .legal a { color: var(--ink-2); }
.rail-legal { font-size: 12px; color: var(--muted); padding: 10px 10px 0; }
.legal { max-width: 720px; margin: 0 auto; padding: 40px 20px 80px; }
.legal-back { display: inline-block; margin-bottom: 28px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.legal header { margin-bottom: 32px; }
.legal header img { border-radius: 12px; margin-bottom: 16px; }
.legal h1 { font: 650 clamp(28px, 5vw, 38px)/1.1 var(--font-display); letter-spacing: -.02em; margin-bottom: 6px; }
.legal section { margin-bottom: 26px; }
.legal h2 { font: 600 18px/1.3 var(--font-display); margin-bottom: 8px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.65; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.legal footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* ============================================================
   Mouvement : courbes douces, durées courtes, rien qui boucle
   sauf l'état « en attente ».
   ============================================================ */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
#view.enter > * > * { animation: rise .5s var(--ease) both; }
#view.enter .grades > *, #view.enter .stats > * { animation: rise .55s var(--ease) both; }
#view.enter > * > :nth-child(1) { animation-delay: 0ms; }
#view.enter > * > :nth-child(2) { animation-delay: 50ms; }
#view.enter > * > :nth-child(3) { animation-delay: 100ms; }
#view.enter > * > :nth-child(4) { animation-delay: 150ms; }
#view.enter > * > :nth-child(5) { animation-delay: 200ms; }
#view.enter > * > :nth-child(6) { animation-delay: 250ms; }
#view.enter > * > :nth-child(7) { animation-delay: 300ms; }
#view.enter > * > :nth-child(8) { animation-delay: 350ms; }
#view.enter .grades > :nth-child(1), #view.enter .stats > :nth-child(1) { animation-delay: 55ms; }
#view.enter .grades > :nth-child(2), #view.enter .stats > :nth-child(2) { animation-delay: 110ms; }
#view.enter .grades > :nth-child(3), #view.enter .stats > :nth-child(3) { animation-delay: 165ms; }
#view.enter .grades > :nth-child(4), #view.enter .stats > :nth-child(4) { animation-delay: 220ms; }
#view.enter .grades > :nth-child(5), #view.enter .stats > :nth-child(5) { animation-delay: 275ms; }
#view.enter .grades > :nth-child(6), #view.enter .stats > :nth-child(6) { animation-delay: 330ms; }
#view.enter .grades > :nth-child(7), #view.enter .stats > :nth-child(7) { animation-delay: 385ms; }
#view.enter .grades > :nth-child(8), #view.enter .stats > :nth-child(8) { animation-delay: 440ms; }
.btn { transition: transform .12s var(--ease), background-color .15s, border-color .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.card:hover, .stat:hover, .grade:hover, .item-card:hover { background-image: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(169, 182, 255, .065), transparent 70%); }
.stat { transition: border-color .2s, transform .25s var(--ease); }
.stat:hover { border-color: #3a5b5a; transform: translateY(-2px); }
.stat span { display: flex; align-items: center; gap: 8px; }
.seg button { transition: background-color .2s, color .2s; }
.modal { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.97); } }
.scrim { backdrop-filter: blur(3px); }
.drawer { animation: slide .28s var(--ease); }
.toast { animation: slide .3s var(--ease); }
.nav { position: relative; }
.nav a { position: relative; z-index: 1; }
.nav.sliding a[aria-current=page] { background: transparent; box-shadow: none; }   /* pendant le glissement, la pastille remplace la surbrillance du lien */
.nav-ind { position: absolute; left: 0; top: 0; width: 100%; border-radius: var(--r-sm); background: var(--raised); box-shadow: inset 2px 0 0 var(--iris); pointer-events: none; opacity: 0; transition: transform .4s var(--ease), height .25s var(--ease); }
.nav.sliding .nav-ind { opacity: 1; }

/* ── Aides de mise en page ───────────────────────────────── */
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.grow > input, .row.grow > select { flex: 1; min-width: 0; }
.t .right, .right { text-align: right; }
.notice.info { border-color: color-mix(in srgb, var(--iris) 40%, var(--line)); color: var(--ink-2); }
.notice a { color: var(--iris); }
input[type=color].color { width: 46px; height: 34px; padding: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
input[type=color].color:disabled { opacity: .35; cursor: not-allowed; }
.emoji-in { width: 64px !important; text-align: center; flex: none !important; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }

/* ── Éditeurs de messages ────────────────────────────────── */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 24px; align-items: start; }
.compose-side { position: sticky; top: 16px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.send-card .field { margin-bottom: 14px; }
.sub-title { font: 600 15px/1.2 var(--font-display); margin: 24px 0 10px; }
.stack-list { display: grid; gap: 10px; margin-bottom: 10px; }
.item-card { padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.add-row { margin: 10px 0 18px; }
.mdarea textarea { border-top-left-radius: 0; border-top-right-radius: 0; resize: vertical; }
.md-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.md-btn { min-width: 30px; height: 26px; padding: 0 7px; background: transparent; border: 0; border-radius: 5px; color: var(--ink-2); cursor: pointer; font: 600 13px var(--font-ui); transition: background-color .15s, color .15s; }
.md-btn:hover { background: var(--raised); color: var(--ink); }
.md-btn.i { font-style: italic; } .md-btn.u { text-decoration: underline; } .md-btn.s { text-decoration: line-through; }
.stats-line { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.stats-line .over { color: var(--bad); font-weight: 600; }
.tools { flex: none; }
@media (max-width: 1100px) { .compose { grid-template-columns: 1fr; } .compose-side { position: static; max-height: none; order: -1; } }

/* ── Aperçu Discord ──────────────────────────────────────── */
.dc-card { background: #313338; border-color: #26282c; padding: 16px; overflow: hidden; }
.dc-msg { display: flex; gap: 14px; color: #dbdee1; font-family: "gg sans", "Geist", system-ui, sans-serif; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: #1e1f22; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; line-height: 1.2; }
.dc-head b { color: #f2f3f5; font-weight: 500; font-size: 16px; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; }
.dc-ts { color: #949ba4; font-size: 12px; }
.dc-container { background: #2b2d31; border: 1px solid #3f4147; border-radius: 8px; padding: 12px 14px 12px 16px; max-width: 520px; overflow: hidden; }
.dc-container.has-accent { box-shadow: inset 4px 0 0 var(--accent); }
.dc-block + .dc-block { margin-top: 4px; }
.dc-md { font-size: 15px; line-height: 1.375; overflow-wrap: anywhere; }
.dc-md h1 { font-size: 24px; } .dc-md h2 { font-size: 20px; } .dc-md h3 { font-size: 16px; }
.dc-md h1, .dc-md h2, .dc-md h3 { font-weight: 700; line-height: 1.25; margin: 4px 0; color: #f2f3f5; }
.dc-md p { margin: 0; }
.dc-gap { height: 8px; }
.dc-sub { display: block; font-size: 12px; line-height: 1.33; color: #949ba4; }
.dc-md ul { margin: 2px 0; padding-left: 22px; list-style: disc; }
.dc-md blockquote { margin: 2px 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc-md a { color: #00a8fc; text-decoration: none; } .dc-md a:hover { text-decoration: underline; }
.dc-code { background: #1e1f22; border-radius: 4px; padding: 0 4px; font: .875em var(--font-mono); }
.dc-pre { margin: 4px 0; background: #1e1f22; border: 1px solid #1a1b1e; border-radius: 4px; padding: 8px; font: 13px/1.4 var(--font-mono); white-space: pre-wrap; }
.dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; } .dc-spoiler.open { background: #3c3e44; color: inherit; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; white-space: nowrap; }
.dc-mention.role { background: color-mix(in srgb, currentColor 16%, transparent); display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; }
.dc-mention.role i { width: 8px; height: 8px; border-radius: 50%; }
.dc-emoji { width: 22px; height: 22px; vertical-align: -5px; }
.dc-time { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }
.dc-section { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.dc-section .dc-md { flex: 1; min-width: 0; }
.dc-thumb { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex: none; }
.dc-sep { border: 0; height: 1px; margin: 8px 0; background: transparent; }
.dc-sep.line { background: #3f4147; } .dc-sep.large { margin: 16px 0; }
.dc-gallery { display: grid; gap: 4px; margin: 8px 0; border-radius: 8px; overflow: hidden; }
.dc-gallery.n2, .dc-gallery.n3, .dc-gallery.n4 { grid-template-columns: 1fr 1fr; }
.dc-gallery img { width: 100%; max-height: 300px; object-fit: cover; display: block; background: #1e1f22; min-height: 40px; }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; background: #4e5058; color: #fff !important; border-radius: 3px; font: 500 14px var(--font-ui); text-decoration: none !important; }
.dc-btn.ok { background: #248046; } .dc-ext { opacity: .7; font-size: 12px; }

/* ── Équipe par grade ────────────────────────────────────── */
.staff-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; align-items: start; }
.grade { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--role, var(--line)); border-radius: var(--r-lg); padding: 14px 14px 8px; transition: border-color .2s; }
.grade header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.role-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 10px 3px 8px; border-radius: 99px; font-weight: 500; font-size: 13.5px; background: color-mix(in srgb, var(--role) 14%, transparent); border: 1px solid color-mix(in srgb, var(--role) 38%, var(--line)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--role); flex: none; }
.count { font: 500 12.5px var(--font-mono); color: var(--muted); }
.none { color: var(--muted); font-style: italic; padding: 6px 2px 10px; font-size: 13.5px; }
.people { list-style: none; display: grid; gap: 2px; padding: 0; margin: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: var(--r-sm); transition: background-color .15s; }
.person:hover { background: color-mix(in srgb, var(--raised) 70%, transparent); }
.person.st-available { --tone: var(--ok); } .person.st-pending { --tone: var(--warn); } .person.st-absent { --tone: var(--bad); }
.av { position: relative; display: inline-flex; flex: none; }
.av .dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: var(--tone); border: 2.5px solid var(--panel); box-sizing: border-box; }
.person.st-pending .dot { animation: ring 1.8s ease-out infinite; }
.person-id { min-width: 0; display: grid; line-height: 1.3; }
.person-id b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-st { font-size: 12.5px; color: var(--tone); }
.led.st-available { --tone: var(--ok); } .led.st-pending { --tone: var(--warn); animation: pulse 1.6s ease-in-out infinite; } .led.st-absent { --tone: var(--bad); }
.abs-card { position: sticky; top: 16px; }
@media (max-width: 1100px) { .staff-layout { grid-template-columns: 1fr; } .abs-card { position: static; } }

.card .dc-md h1, .card .dc-md h2, .card .dc-md h3 { padding: 0; }
.stack-gap { display: grid; gap: 14px; }
.stack-gap > .field { margin-bottom: 0; }   /* seulement les champs posés directement dans la pile (pas ceux des cartes) */

.check-list { display: grid; gap: 8px; max-height: 190px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ============================================================
   Notifications, fiches, statistiques, modération, logs
   ============================================================ */
.brand .bell-wrap, .topbar .bell-wrap { margin-left: auto; }
.bell-wrap { position: relative; flex: none; }
.bell { position: relative; }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #2a0b0b; font: 650 10.5px/17px var(--font-ui); text-align: center; animation: pop-badge .35s var(--ease); }
@keyframes pop-badge { from { transform: scale(.4); opacity: 0; } }
.notif-pop { font: 400 14.5px/1.5 var(--font-ui); letter-spacing: 0; color: var(--ink); text-align: left; position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: min(360px, calc(100vw - 28px)); max-height: min(70vh, 520px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); animation: pop-in .18s var(--ease); }
.topbar .notif-pop { left: auto; right: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--panel); }
.link-btn { background: none; border: 0; padding: 0; color: var(--iris); font: inherit; font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.notif-list { list-style: none; margin: 0; padding: 4px; }
.notif a { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.notif a:hover { background: var(--raised); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--off); }
.notif.lvl-ok .notif-dot { background: var(--ok); } .notif.lvl-warn .notif-dot { background: var(--warn); } .notif.lvl-danger .notif-dot { background: var(--bad); } .notif.lvl-info .notif-dot { background: var(--iris); }
.notif.fresh a { background: color-mix(in srgb, var(--iris) 7%, transparent); }
.notif-body { display: grid; gap: 2px; min-width: 0; line-height: 1.35; }
.notif-body b { font-weight: 550; } .notif-body span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.notif time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notif-none { padding: 26px 14px; text-align: center; color: var(--muted); margin: 0; }

.me-link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
a.me-link:hover .who b { text-decoration: underline; }
.person { position: relative; }
.person-link { position: absolute; inset: 0; border-radius: var(--r-sm); z-index: 1; }
.person-link:focus-visible { outline: 2px solid var(--iris); }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row span { display: grid; gap: 2px; } .switch-row small { color: var(--muted); font-size: 13px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; cursor: pointer; transition: background-color .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease); }
.switch:checked { background: var(--ok); } .switch:checked::after { transform: translateX(16px); background: #0d2418; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }

.stat b.sm { font-size: 20px; padding-top: 6px; }
.row.wrap { flex-wrap: wrap; }
.legend { display: flex; gap: 16px; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.legend .k::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--iris); }
.legend .k.b::before { background: var(--ok); }
.linechart { width: 100%; height: auto; display: block; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 6px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar i { display: block; width: 100%; max-width: 22px; border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow .55s var(--ease) both; }
.bar span { font-size: 10.5px; color: var(--muted); height: 12px; white-space: nowrap; }
@keyframes grow { from { transform: scaleY(0); } }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto 34px; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 4px; background: var(--iris); animation: widen .6s var(--ease) both; transform-origin: left; }
@keyframes widen { from { transform: scaleX(0); } }
.hb-v { color: var(--ink-2); } .hb-r { color: var(--warn); font-size: 12.5px; text-align: right; }
.rating-box { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.rating-big { display: grid; gap: 4px; justify-items: center; }
.rating-big b { font: 650 44px/1 var(--font-display); } .rating-big span { color: var(--warn); letter-spacing: 2px; }

.quick-wrap { position: relative; }
.quick-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; width: min(380px, 86vw); max-height: 300px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); padding: 4px; animation: pop-in .16s var(--ease); }
.quick-menu button { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; }
.quick-menu button:hover, .quick-menu button:focus-visible { background: var(--raised); outline: 0; }
.quick-menu button span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-menu .hint { padding: 10px; margin: 0; }
.reply-card { display: grid; gap: 8px; align-content: start; }
.reply-text { margin: 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.person-row:hover { background: var(--raised); }
.timeline.sanc li { align-items: flex-start; }
.log-list { list-style: none; margin: 0; padding: 4px 0; }
.log-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.log-row:last-child { border-bottom: 0; }
.log-main { display: grid; gap: 2px; min-width: 0; } .log-text { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.log-row time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* Transition entre pages : la vue s'efface, la suivante monte (voir main.js) */
#view { transition: opacity .11s ease, transform .11s ease; }
#view.leaving { opacity: 0; transform: translateY(-4px); pointer-events: none; }
.page-skel { display: grid; gap: 14px; animation: fade .2s both; }
.page-skel .skeleton { margin: 0; }
.sk-title { height: 30px; width: min(280px, 60%); } .sk-sub { height: 14px; width: min(420px, 80%); }
.sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; } .sk-stat { height: 84px; } .sk-block { height: 220px; }
@media (prefers-reduced-motion: reduce) { #view { transition: none; } .bar i, .hb-t i, .notif-pop, .quick-menu, .bell-badge { animation: none; } }
@media (max-width: 720px) { .hbar { grid-template-columns: minmax(60px, 34%) 1fr auto; } .hb-r { display: none; } .log-row { grid-template-columns: 30px 1fr; } .log-row time { grid-column: 2; } }
.log-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; margin-top: 6px; }
.log-tools select { width: auto; min-width: 220px; } .log-tools input[type=search] { flex: 1; min-width: 180px; }

/* ── Communauté, événements, recherche ── */
.poll-line { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 10px; align-items: center; margin: 6px 0; }
.poll-bar { height: 8px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.poll-bar i { display: block; height: 100%; background: var(--iris); border-radius: 6px; transition: width .4s var(--ease); }
.ev-card.is-off { opacity: .6; }
.ev-card { display: grid; gap: 10px; align-content: start; }
select[multiple] { min-height: 120px; }
.sr-layer { position: fixed; inset: 0; z-index: 90; background: rgba(6, 12, 12, .62); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade-in .12s ease-out; }
.sr-box { width: min(620px, 100%); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg, 14px); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); overflow: hidden; }
.sr-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.sr-in input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--ink); font-size: 16px; min-width: 0; }
.sr-list { max-height: min(50vh, 420px); overflow: auto; padding: 6px; }
.sr-item { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.sr-item.on { background: var(--panel); }
.sr-type { flex: none; min-width: 74px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sr-main { display: grid; min-width: 0; } .sr-main b, .sr-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sr-main small { color: var(--muted); }
.sr-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
@media (max-width: 960px) { .sr-foot { display: none; } .sr-layer { padding-top: 8vh; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.card-pad > .check { margin: 10px 0 6px; }
select[multiple] { background-image: none; padding-right: 10px; }
.ladder-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ladder-row input[type=number] { width: 84px; } .ladder-row select { width: auto; }

/* ── Messages de ticket (containers, embeds) ── */
.msg-body { display: grid; gap: 6px; min-width: 0; margin-top: 3px; word-break: break-word; }
.msg-body > .dc-block { color: var(--ink); } .msg-body .dc-md { color: inherit; }
.msg-body .dc-container { max-width: min(560px, 100%); }
.dc-md-col { flex: 1; min-width: 0; display: grid; gap: 4px; }
.dc-embed { border-left: 4px solid #4f545c; background: #2b2d31; color: #dbdee1; border-radius: 4px; padding: 8px 12px; max-width: min(520px, 100%); display: grid; gap: 4px; }
.dc-etitle { font-weight: 600; color: #f2f3f5; }
.dc-fields { display: grid; gap: 6px; } .dc-field b { display: block; font-size: 13px; color: #f2f3f5; }
.dc-eimg { max-width: min(400px, 100%); max-height: 300px; border-radius: 6px; display: block; }
.dc-reply { color: var(--muted); font-size: 12.5px; }
.dc-btn.p { background: #5865f2; } .dc-btn.d { background: #da373c; } .dc-btn.off { opacity: .5; }
.dc-file { display: inline-block; background: rgba(255,255,255,.06); border-radius: 4px; padding: 2px 8px; font-size: 13px; }
.dc-md p { margin: 0; } .dc-md { overflow-wrap: anywhere; }

.grade-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.grade-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.ladder { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.grade-card { display: grid; gap: 10px; }
.grade-flow { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .grade-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .grade-row input[type=text] { grid-column: 2 / 4; grid-row: 2; } }

.tk-transcript { width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); display: block; }
.nav { scrollbar-width: none; -ms-overflow-style: none; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); padding: 6px 0; }
.nav::-webkit-scrollbar { display: none; }
.dc-btn.live { cursor: pointer; font: inherit; border: 0; }
.dc-btn.live:hover { filter: brightness(1.15); }
.badge .dc-emoji { width: 16px; height: 16px; vertical-align: -3px; }
.badge img, .pick-list b img { width: 16px; height: 16px; vertical-align: -3px; }
.sr-in svg { width: 18px; height: 18px; flex: none; }
.sr-in input::placeholder { color: var(--muted); }
.sr-in input[type=search]::-webkit-search-cancel-button { display: none; }
.sr-item:hover { background: var(--panel); }
.sr-item .sr-main b { font-weight: 550; }
.sr-x { display: none; } @media (max-width: 960px) { .sr-x { display: inline-flex; } }
.legal:has(.legal-table) { max-width: 980px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); min-width: 120px; }
.legal-table th { color: var(--muted); font-weight: 500; }
.ret-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; } .ret-row label { flex: 1; }

/* ── Écran de connexion / accès (carte centrée) ── */
.gate { background: radial-gradient(900px 420px at 12% -8%, color-mix(in srgb, var(--iris) 16%, transparent), transparent), radial-gradient(800px 380px at 95% 0, color-mix(in srgb, var(--ok) 12%, transparent), transparent), var(--bg); }
.gate-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px; box-shadow: 0 30px 80px -34px #000; }
.gate-logo { height: 56px; width: auto; margin: 0 auto 18px; border-radius: 0; }
.gate-pill { display: block; width: max-content; margin: 0 auto 14px; padding: 3px 12px; border-radius: 99px; background: color-mix(in srgb, var(--iris) 16%, transparent); color: var(--iris); font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.gate h1 { text-align: center; font-size: 26px; }
.gate .lead { text-align: center; margin-bottom: 24px; }
.gate .legal-note { text-align: center; margin-top: 20px; font-size: 12.5px; }
.gate input { width: 100%; }

/* ── Menu en groupes repliables ── */
.ng-h { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; font: 500 12.5px/1 var(--font-ui); color: var(--muted); padding: 13px 10px 10px; border-radius: var(--r-sm); transition: color .2s; }
.ng-h:hover, .ng.open .ng-h { color: var(--ink); }
.ng-h { position: relative; z-index: 1; }   /* toujours au-dessus de la pastille du menu */
.ng-chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .35s var(--ease); margin-right: 3px; }
.ng.open .ng-chev { transform: rotate(45deg); }
.ng-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease); }
.ng.open .ng-b { grid-template-rows: 1fr; }
.ng-in { overflow: hidden; min-height: 0; display: grid; gap: 2px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .35s var(--ease); }
.ng.open .ng-in { opacity: 1; transform: none; }
.ng:not(.open) .ng-in a { visibility: hidden; transition: visibility 0s .38s; }

/* ── Transitions de pages et d'onglets plus douces ── */
#view { transition: opacity .17s ease, transform .17s ease, filter .17s ease; }
#view.leaving { opacity: 0; transform: translateY(-6px) scale(.995); filter: blur(3px); }
@keyframes svin { from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(4px); } }
.sv-in { animation: svin .45s var(--ease) both; }
.sv-out { opacity: 0; transform: translateY(-6px); filter: blur(3px); transition: opacity .12s, transform .12s, filter .12s; pointer-events: none; }
.sv-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.sv-sub.open { grid-template-rows: 1fr; }
.sv-sub > * { overflow: hidden; min-height: 0; }
.sv-seg { margin: 0 0 14px; flex-wrap: wrap; }
.sv-body, .sv-inner { transition: opacity .12s, transform .12s, filter .12s; }
@media (prefers-reduced-motion: reduce) { .sv-in, #view, .ng-b, .ng-in { animation: none; transition: none; } }
.sv-sub > .sv-seg { justify-self: start; width: max-content; max-width: 100%; }

/* ── Maintenance ── */
.maint-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 14px; background: #4a3512; color: #ffd48a; font-size: 13px; border-top: 1px solid #6b4d1a; }
.maint-bar svg { width: 16px; height: 16px; }
.maint-ico { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--iris); animation: maintpulse 2.4s ease-in-out infinite; }
.maint-ico svg { width: 28px; height: 28px; }
@keyframes maintpulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 10px rgba(140, 150, 255, .08); } }
.gate.maint .gate-card { text-align: center; }
@media (max-width: 960px) { .maint-bar { bottom: 60px; } }

/* ── Pages publiques : état des services, suivi de ticket ── */
.sitepage .card { margin-bottom: 12px; }
.sitepage .notice { margin-bottom: 16px; }
.sitepage h2 { margin: 24px 0 10px; }
.uptime { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin-top: 10px; }
.uptime i { display: block; height: 26px; border-radius: 3px; background: var(--line); }
.uptime i.ok { background: #2fbf71; } .uptime i.warn { background: #e5a23d; } .uptime i.bad { background: #e5484d; }
.status-avg { margin-top: 6px; text-align: right; }
.status-inc, .track-steps { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

/* ── Référents ── */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.ref-grid .field { margin-bottom: 0; }
.ref-scores { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.ref-scores li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.ref-stars { color: #e5a23d; letter-spacing: .08em; white-space: nowrap; }
.ref-comment { white-space: pre-line; color: var(--ink-2); line-height: 1.6; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ref-chips .badge { cursor: pointer; border: 0; }
.ref-pick { display: grid; gap: 8px; max-height: 280px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ref-pick .check img, .ref-pick .check .av { width: 22px; height: 22px; }
.ref-table { overflow-x: auto; }
.ref-stars .ref-off { opacity: .25; }
.ref-list { display: grid; gap: 16px; }
.ref-manage { margin-top: 22px; }
.ref-card .field { margin-bottom: 14px; }
.ref-card .ref-grid { margin: 12px 0 14px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .stats.three { grid-template-columns: 1fr 1fr; } }
.ref-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ref-grid { grid-template-columns: 1fr; } }
.ref-grid .field { grid-template-rows: 1fr auto; align-items: end; }
