/* ZN Panel — design system */
:root {
  --bg: #08080a;
  --bg-2: #0c0c0f;
  --surface: #111114;
  --surface-2: #16161a;
  --surface-3: #1c1c21;
  --hover: #1f1f25;
  --line: #1e1e24;
  --line-2: #2a2a31;
  --text: #ededf0;
  --text-2: #a0a0ab;
  --muted: #6b6b76;
  --faint: #45454e;
  --accent: #7c5cff;
  --accent-h: #8f74ff;
  --accent-soft: rgba(124, 92, 255, .12);
  --accent-line: rgba(124, 92, 255, .35);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .1);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .1);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .1);
  --info: #60a5fa; --info-soft: rgba(96, 165, 250, .1);
  --r: 12px; --r-lg: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: "Inter Variable", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; letter-spacing: -.005em; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
img { display: block; }
.mono, pre, code { font-family: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.sp { flex: 1; }
.tnum { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; } svg.i.lg { width: 20px; height: 20px; }
::selection { background: rgba(124, 92, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232329; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #2e2e36; }
::-webkit-scrollbar-track { background: transparent; }
.glow { position: fixed; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(700px 260px at 30% -60px, rgba(124, 92, 255, .09), transparent 70%); }

/* ───── Sidebar ───── */
.side { position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 20; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); padding: 14px 10px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.logo { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.03em;
  background: linear-gradient(140deg, #8f74ff, #5b3ce6); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 8px 24px -8px rgba(124, 92, 255, .7); }
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow: auto; }
nav .grp { font-size: 11px; font-weight: 500; color: var(--faint); padding: 14px 10px 5px; }
nav .grp:first-child { padding-top: 0; }
nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; height: 32px; border-radius: 7px; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; font-weight: 450; }
nav a svg { color: var(--muted); transition: color .12s; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a:hover svg { color: var(--text-2); }
nav a.active { background: var(--surface-3); color: var(--text); }
nav a.active svg { color: var(--accent-h); }
nav a.soon { color: var(--faint); cursor: default; }
nav a.soon svg { color: var(--faint); }
nav a.soon:hover { background: none; }
nav .badge { margin-left: auto; font-size: 10.5px; font-weight: 500; padding: 0 6px; height: 18px; line-height: 18px; border-radius: 5px; background: var(--surface-2); color: var(--faint); border: 1px solid var(--line); }
nav .badge.hot { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin-top: 8px; }
.me img { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { color: var(--muted); font-size: 11px; }

/* ───── Shell / topbar ───── */
.shell { position: relative; z-index: 1; margin-left: 232px; min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 36px; background: rgba(8, 8, 10, .8); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.015em; }
.top p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.top .menu { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }
main { padding: 28px 36px 64px; max-width: 1480px; animation: enter .3s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-h h2 { font-size: 22px; font-weight: 650; letter-spacing: -.03em; margin: 0; }
.page-h p { margin: 4px 0 0; color: var(--muted); }

/* ───── Layout ───── */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; gap: 12px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 12px; }
.cols.half { grid-template-columns: 1fr 1fr; }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
section { margin-top: 28px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sec-h h3 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.sec-h .count { color: var(--muted); font-size: 12px; }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset; }
.card-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.card-h h2 { font-size: 13.5px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-h { padding: 18px 20px 0; }

/* KPI */
.kpi { padding: 18px 20px 0; overflow: hidden; display: flex; flex-direction: column; min-height: 132px; }
.kpi .head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi .head svg { color: var(--muted); }
.kpi .val { font-size: 28px; font-weight: 650; letter-spacing: -.04em; margin-top: 10px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: -.01em; margin-left: 2px; }
.kpi .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-bottom: 18px; }
.kpi .spark { margin: auto -20px 0; height: 44px; }
.kpi .meter { margin: auto 0 18px; }
.delta { font-weight: 600; font-size: 11.5px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.meter { height: 4px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: 9px; background: var(--accent); transition: width .8s var(--ease); }
.meter i.warn { background: var(--warn); } .meter i.bad { background: var(--bad); }

/* Status */
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.idle { background: var(--faint); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; height: 22px; padding: 0 8px; border-radius: 6px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.status.on { color: var(--ok); background: var(--ok-soft); border-color: rgba(52, 211, 153, .15); }
.status.off { color: var(--bad); background: var(--bad-soft); border-color: rgba(248, 113, 113, .15); }
.status.neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--line); }
.status.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, .15); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; height: 22px; padding: 0 7px; white-space: nowrap; }

/* Avatars */
.av { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: var(--text-2); flex-shrink: 0; background: var(--surface-3); border: 1px solid var(--line-2); object-fit: cover; }
.av.round { border-radius: 50%; }
.av-wrap { position: relative; flex-shrink: 0; }
.av-wrap .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border: 2.5px solid var(--surface); box-shadow: none; }
.guilds { display: flex; }
.guilds img, .guilds span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--surface); margin-left: -6px; background: var(--surface-3); font-size: 9px; display: grid; place-items: center; color: var(--text-2); font-weight: 600; }
.guilds > :first-child { margin-left: 0; }

/* Listes */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; padding-top: 0; }
.li .name { font-weight: 500; line-height: 1.3; }
.li small { color: var(--muted); font-size: 12px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 20px; height: 40px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); }
.tbl td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.click { cursor: pointer; }
.tbl .num { font-variant-numeric: tabular-nums; color: var(--text-2); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { font-weight: 500; display: block; line-height: 1.3; }
.who small { display: block; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 28px; height: 28px; color: var(--faint); margin: 0 auto 10px; display: block; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); padding: 0 12px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 12.5px; transition: background .12s, border-color .12s, color .12s, transform .06s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: #34343c; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset, 0 4px 14px -4px rgba(124, 92, 255, .6); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(248, 113, 113, .4); background: var(--bad-soft); }
.btn.primary.danger-btn { background: #dc2626; border-color: #dc2626; box-shadow: 0 4px 14px -4px rgba(220, 38, 38, .6); }
.btn.primary.danger-btn:hover { background: #ef4444; border-color: #ef4444; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 32px; padding: 0; } .btn.sm.icon { width: 28px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: wait; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); height: 26px; padding: 0 11px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.input, textarea.input, select.input { width: 100%; height: 36px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; color: var(--text); transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--faint); }
input[type=color].input { padding: 4px; width: 48px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); user-select: none; }
.switch input { appearance: none; width: 30px; height: 18px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); transition: transform .15s var(--ease); }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(12px); background: #fff; }

/* ───── Cartes bots ───── */
.bots-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.bot { display: flex; flex-direction: column; gap: 16px; padding: 18px; transition: border-color .15s, transform .15s var(--ease); }
.bot:hover { border-color: var(--line-2); }
.bot .top-row { display: flex; align-items: center; gap: 14px; }
.bot .top-row img.av { width: 48px; height: 48px; border-radius: 14px; }
.bot h4 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.015em; display: flex; align-items: center; gap: 6px; }
.bot .role { color: var(--muted); font-size: 12px; }
.bot .verified { display: inline-grid; place-items: center; height: 16px; padding: 0 5px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; }
.bot .stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.bot .stats div { padding: 9px 12px; border-left: 1px solid var(--line); }
.bot .stats div:first-child { border-left: 0; }
.bot .stats span { display: block; font-size: 11px; color: var(--muted); }
.bot .stats b { font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; }
.bot .foot { display: flex; align-items: center; gap: 6px; }
.bot .meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.bot.is-off { opacity: .75; }

/* ───── Console de contrôle ───── */
.ctrl-h { display: flex; align-items: center; gap: 16px; padding: 20px; }
.ctrl-h img.av { width: 60px; height: 60px; border-radius: 18px; }
.ctrl-h h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.025em; display: flex; align-items: center; gap: 8px; }
.ctrl-h p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.console { display: grid; grid-template-columns: 64px 240px minmax(0, 1fr); height: calc(100vh - 290px); min-height: 520px; margin-top: 12px; padding: 0; overflow: hidden; }
.rail { background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: auto; }
.rail button { width: 42px; height: 42px; border-radius: 14px; border: 0; padding: 0; cursor: pointer; background: var(--surface-3); color: var(--text-2); font-weight: 600; font-size: 12px; position: relative; transition: border-radius .15s var(--ease), background .15s; overflow: hidden; flex-shrink: 0; }
.rail button img { width: 100%; height: 100%; object-fit: cover; }
.rail button:hover { border-radius: 12px; background: var(--accent); color: #fff; }
.rail button.on { border-radius: 12px; box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--accent); }
.rail .sep { width: 28px; height: 1px; background: var(--line-2); margin: 2px 0; }
.chans { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chans .gh { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chans .gh small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.chans .scroll { overflow: auto; padding: 8px; flex: 1; }
.chans .cat { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 8px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chans a { display: flex; align-items: center; gap: 7px; padding: 0 8px; height: 30px; border-radius: 6px; color: var(--text-2); cursor: pointer; white-space: nowrap; overflow: hidden; font-size: 13px; }
.chans a span { overflow: hidden; text-overflow: ellipsis; }
.chans a svg { color: var(--faint); }
.chans a:hover { background: var(--surface-2); color: var(--text); }
.chans a.on { background: var(--surface-3); color: var(--text); }
.chans a.voice { opacity: .5; cursor: default; }
.room { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-h { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; border-bottom: 1px solid var(--line); font-weight: 600; flex-shrink: 0; }
.room-h svg { color: var(--muted); }
.feed { flex: 1; overflow: auto; padding: 16px 4px 8px; display: flex; flex-direction: column; }
.dmsg { display: flex; gap: 12px; padding: 6px 16px; position: relative; }
.dmsg:hover { background: rgba(255, 255, 255, .02); }
.dmsg img.av { width: 36px; height: 36px; border-radius: 50%; margin-top: 2px; }
.dmsg .body { min-width: 0; flex: 1; }
.dmsg .who-line { display: flex; align-items: baseline; gap: 8px; }
.dmsg .who-line b { font-weight: 600; font-size: 13.5px; }
.dmsg .who-line .botb { font-size: 9.5px; font-weight: 700; background: #5865f2; color: #fff; padding: 1px 4px; border-radius: 3px; }
.dmsg .who-line time { font-size: 11px; color: var(--faint); }
.dmsg .content { white-space: pre-wrap; word-break: break-word; color: #dcdce2; line-height: 1.5; }
.dmsg .content code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.dmsg .mention { background: rgba(88, 101, 242, .25); color: #c9cdfb; padding: 0 3px; border-radius: 3px; }
.dmsg .del { position: absolute; right: 12px; top: 6px; opacity: 0; }
.dmsg:hover .del { opacity: 1; }
.dmsg .att { max-width: 320px; max-height: 240px; border-radius: 8px; margin-top: 6px; }
.dmsg.grouped { padding-top: 1px; padding-bottom: 1px; }
.dmsg.grouped img.av { visibility: hidden; height: 0; }
.embed { margin-top: 6px; max-width: 520px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 14px; }
.embed .ea { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.embed .et { font-weight: 600; margin-bottom: 4px; }
.embed .ed { white-space: pre-wrap; word-break: break-word; color: #c8c8d0; font-size: 13px; }
.embed img { max-width: 100%; border-radius: 6px; margin-top: 8px; }
.embed .ef { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.composer-box { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--surface); flex-shrink: 0; }
.composer-box .row1 { display: flex; gap: 10px; align-items: flex-end; }
.composer-box textarea { flex: 1; min-height: 42px; max-height: 180px; resize: none; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; line-height: 1.45; }
.composer-box textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box .opts { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.embed-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 10px; }
.embed-form .full { grid-column: 1 / -1; }
.placeholder { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 40px; }
.placeholder svg { width: 32px; height: 32px; color: var(--faint); margin: 0 auto 12px; display: block; }

/* ───── Fournisseurs ───── */
.sup-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.sup { padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s, transform .2s var(--ease); }
.sup:hover { border-color: var(--line-2); transform: translateY(-2px); }
.sup .banner { position: relative; height: 128px; background: linear-gradient(135deg, #1a1530, #111114 60%); border-bottom: 1px solid var(--line); overflow: hidden; }
.sup .banner img { width: 100%; height: 100%; object-fit: cover; }
.sup .banner .ph { height: 100%; display: grid; place-items: center; }
.sup .banner .pin { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 7px; background: rgba(0, 0, 0, .6); color: var(--warn); display: grid; place-items: center; font-size: 12px; backdrop-filter: blur(6px); }
.sup-b { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.sup .desc { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.sup .stats-row { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.sup .stats-row b { color: var(--text); font-weight: 550; }
.sup .foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.av.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.av.xl { width: 60px; height: 60px; border-radius: 16px; font-size: 20px; background: var(--surface-2); padding: 6px; object-fit: contain; }
.sup .who .av { object-fit: contain; background: var(--surface-2); padding: 3px; }
.sup-hero { overflow: hidden; }
.sup-hero .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .12; filter: blur(2px); pointer-events: none; }
.sup-hero > * { position: relative; }

/* ───── Serveurs ───── */
.guild { cursor: pointer; }
.guild .top-row svg { color: var(--muted); }
.ch-cat { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.ch-cat svg { color: var(--muted); }
.ch-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 16px; border-bottom: 1px solid var(--line); min-height: 46px; }
.ch-row:last-child { border-bottom: 0; }
.ch-row:hover { background: var(--surface-2); }
.ch-row b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-ic { color: var(--faint); display: grid; }
.ch-row .actions { opacity: .55; transition: opacity .1s; }
.ch-row:hover .actions { opacity: 1; }
.rdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 220px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.danger-zone { border: 1px solid rgba(248, 113, 113, .25); background: var(--bad-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.danger-zone b { color: var(--bad); font-size: 12.5px; }

/* ───── Messagerie ───── */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); padding: 0; overflow: hidden; height: calc(100vh - 160px); min-height: 520px; }
.threads { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.th-h { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.th-list { overflow: auto; flex: 1; padding: 6px; }
.th { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; cursor: pointer; transition: background .1s; }
.th:hover { background: var(--surface-2); }
.th.on { background: var(--surface-3); }
.th .av { width: 38px; height: 38px; }
.th .mini { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); }
.th.on .mini { border-color: var(--surface-3); }
.th .l1 { display: flex; align-items: baseline; gap: 8px; }
.th .l1 b { font-weight: 550; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th .l1 time { font-size: 11px; color: var(--faint); flex-shrink: 0; }
.th .l2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th .l2.new { color: var(--text); font-weight: 500; }
.unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
.inbox .room { min-height: 0; }
@media (max-width: 820px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 120px); }
  .inbox .room { display: none; }
  .inbox.has-room .threads { display: none; }
  .inbox.has-room .room { display: flex; }
}

/* Logs */
.term { background: #060607; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.term-h { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.term-h .lights { display: flex; gap: 6px; } .term-h .lights i { width: 10px; height: 10px; border-radius: 50%; background: #2a2a31; }
.logs { margin: 0; padding: 16px 18px; height: calc(100vh - 230px); min-height: 360px; overflow: auto; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; color: #c4c4cc; }

/* Chat ticket */
.chat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.chat { height: calc(100vh - 290px); min-height: 380px; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; }
.msg.staff { align-self: flex-end; flex-direction: row-reverse; }
.msg.staff .bubble { background: rgba(124, 92, 255, .14); border-color: rgba(124, 92, 255, .28); border-radius: 14px 4px 14px 14px; }
.msg.internal { align-self: flex-end; flex-direction: row-reverse; }
.msg.internal .bubble { border-style: dashed; background: var(--warn-soft); border-color: rgba(251, 191, 36, .28); }
.msg.system { align-self: center; max-width: 90%; }
.msg.system .bubble { background: transparent; border: 0; color: var(--muted); font-size: 12px; text-align: center; padding: 2px; }
.msg .mav { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.msg .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.msg .meta b { color: var(--text); font-weight: 600; margin-right: 6px; font-size: 12.5px; }
.msg .txt { white-space: pre-wrap; word-break: break-word; }
.msg .att { max-width: 280px; max-height: 220px; border-radius: 8px; margin-top: 8px; }
.msg .file { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--accent-h); }
.composer { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; resize: none; min-height: 42px; max-height: 200px; }
.composer textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.kv { display: flex; flex-direction: column; }
.kv div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; padding: 9px 0; border-top: 1px solid var(--line); }
.kv div:first-child { border-top: 0; padding-top: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* Toast */
#toast { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
#toast div { display: flex; align-items: center; gap: 10px; background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); animation: enter .25s var(--ease); font-weight: 500; font-size: 12.5px; }
#toast div::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
#toast div.err::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ApexCharts */
.apexcharts-tooltip.apexcharts-theme-dark { background: var(--surface-3) !important; border: 1px solid var(--line-2) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .55) !important; border-radius: 9px !important; }
.apexcharts-tooltip-title { background: transparent !important; border-bottom: 1px solid var(--line-2) !important; font-family: inherit !important; font-size: 11.5px !important; color: var(--text-2); }
.apexcharts-tooltip-text { font-family: inherit !important; }
.apexcharts-xaxistooltip { display: none; }
.apexcharts-legend-text { font-family: inherit !important; }
.chart-h { min-height: 290px; margin: 0 -8px -8px; }
.chart-s { min-height: 230px; margin: 0 -8px -8px; }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ───── Connexion ───── */
body.auth { display: grid; place-items: center; padding: 20px; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px 32px 24px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 100px -30px rgba(0, 0, 0, .9); }
.auth-card h1 { margin: 16px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -.03em; }
.auth-card > p { margin: 0 0 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 6px; }
.auth-card input { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 12px; height: 54px; font-size: 22px; text-align: center; letter-spacing: .45em; font-variant-numeric: tabular-nums; }
.auth-card input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-card .btn { width: 100%; }
.auth-card .login-form input { height: 46px; font-size: 14px; letter-spacing: 0; text-align: left; padding: 0 14px; }
.auth-card .foot { margin: 22px 0 0; font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.qr { width: 184px; height: 184px; border-radius: 14px; background: #fff; padding: 10px; margin: 4px 0; }
.err { color: var(--bad); background: var(--bad-soft); border: 1px solid rgba(248, 113, 113, .2); padding: 8px 12px; border-radius: 9px; margin: 0; font-size: 12.5px; width: 100%; }

.hide-d { display: none !important; }
.rank { width: 18px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Modale */
.modal-bg { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); animation: fadein .15s ease; }
.modal-bg.out { opacity: 0; transition: opacity .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; padding: 22px; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9); animation: pop .2s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
select.input { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b76' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=datetime-local].input { color-scheme: dark; }
.range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.li.click { cursor: pointer; border-radius: 8px; transition: background .1s; }
.li.click:hover { background: var(--surface-2); }

/* ───── Responsive ───── */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.half, .cols.three, .chat-wrap { grid-template-columns: minmax(0, 1fr); }
  .console { grid-template-columns: 64px 200px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .side { transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: 30px 0 80px rgba(0, 0, 0, .7); }
  body.nav-open .side { transform: none; }
  .shell { margin-left: 0; }
  .top { padding: 0 14px; height: 56px; }
  .top .menu { display: grid; }
  .clock, .pill span:last-child { display: none; }
  main { padding: 20px 14px 40px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .hide-m { display: none !important; }
  .hide-d { display: grid !important; }
  .ctrl-h { flex-wrap: wrap; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
  .msg { max-width: 92%; }
  .console { grid-template-columns: 56px minmax(0, 1fr); height: auto; }
  .console .chans { display: none; }
  .console.show-chans .chans { display: flex; grid-column: 2; }
  .console.show-chans .room { display: none; }
  .grid2, .embed-form { grid-template-columns: 1fr; }
  .bots-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ───────── Dashboards ───────── */
.dash-sec + .dash-sec { margin-top: 26px; }
.dash-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--text-2); }
.dash-h h2 { font-size: 13.5px; font-weight: 600; margin: 0; color: var(--text); }
.dash-h p { margin: 0 0 0 4px; font-size: 12px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card.dash { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s, background .12s; }
.card.dash:hover { border-color: var(--accent-line); background: var(--surface-2); transform: translateY(-1px); }
.dash-top { display: flex; align-items: center; gap: 10px; }
.dash-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dash-t small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ext { color: var(--muted); }
.card.dash:hover .dash-ext { color: var(--accent); }
.card.dash p { margin: 0; color: var(--text-2); font-size: 12.5px; flex: 1; }
.dash-st { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.dash-st .tag { margin-left: auto; }
