/* ===================== Thème ===================== */
:root {
  --bg: #0a0a0a;
  --bg-elev: #0f0f0f;
  --surface: #121212;
  --surface-2: #181818;
  --surface-3: #1f1f1f;
  --border: #242424;
  --border-strong: #2e2e2e;
  --text: #ededed;
  --text-2: #b4b4b4;
  --muted: #7d7d7d;
  --faint: #555;
  --primary: #f2f2f2;
  --primary-text: #0a0a0a;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #93c5fd;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar: 252px;
  --nav-h: 62px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1rem; }
h3 { font-size: .9rem; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
::selection { background: #3a3a3a; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262626; border-radius: 10px; border: 2px solid var(--bg); }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: .82rem; }
.xs { font-size: .74rem; }
.mono { font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: .82rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-sm { display: none; }
@media (max-width: 700px) { .hide-sm { display: none; } .show-sm { display: block; } th, td { padding: 10px 12px; } }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }

/* ===================== Structure ===================== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border-strong);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: .74rem; }
.search-btn {
  margin: 4px 12px 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; text-align: left;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-btn kbd { margin-left: auto; }
kbd { font-family: inherit; font-size: .7rem; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; color: var(--text-2); }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-title { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  text-decoration: none; font-weight: 500; margin-bottom: 1px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav a.active svg { color: var(--text); }
.nav a svg { color: var(--muted); }
.nav .count { margin-left: auto; background: var(--text); color: var(--bg); border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 0 7px; line-height: 18px; }
.side-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar-txt {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--text-2); flex-shrink: 0; text-transform: uppercase;
}
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-weight: 600; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
main { flex: 1; padding: 28px 32px 48px; width: 100%; max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-102%); transition: transform .22s ease;
    height: 100%; width: min(84vw, 300px); padding-top: env(safe-area-inset-top);
  }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .65); }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top)); background: rgba(10, 10, 10, .9); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .title { font-weight: 600; flex: 1; }
  main { padding: 18px 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.25rem; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(12, 12, 12, .96);
    backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: .68rem; color: var(--muted); text-decoration: none; background: none; border: 0; position: relative; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav .dot { position: absolute; top: 9px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
}

/* ===================== Composants ===================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); min-height: 52px; }
.card-head h2 { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main, .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .cols-2 { grid-template-columns: 1fr; } .grid { gap: 12px; } .stack { gap: 12px; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* Statistiques */
.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 1.65rem; font-weight: 650; margin-top: 8px; letter-spacing: -.02em; }
.stat .value small { font-size: .85rem; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat .hint { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.stat svg.spark { display: block; width: 100%; height: 40px; margin-top: 10px; }
.meter { height: 4px; background: var(--surface-3); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--text-2); border-radius: 99px; }
@media (max-width: 700px) { .stat { padding: 14px; } .stat .value { font-size: 1.3rem; } }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); white-space: nowrap; line-height: 1.6;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .2); }
.badge.bad { color: var(--bad); background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .2); }
.badge.warn { color: var(--warn); background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .2); }
.badge.info { color: var(--info); background: rgba(147, 197, 253, .08); border-color: rgba(147, 197, 253, .2); }
.badge.solid { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong);
  background: var(--surface-2); padding: 0 13px; height: 36px; border-radius: 8px; cursor: pointer; font-weight: 550;
  white-space: nowrap; transition: background .12s, border-color .12s; text-decoration: none; font-size: .88rem;
}
.btn:hover { background: var(--surface-3); border-color: #3a3a3a; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); }
.btn.success { color: var(--ok); }
.btn.sm { height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 7px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

/* Onglets segmentés */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 5px 12px; border-radius: 6px; color: var(--muted); cursor: pointer; font-weight: 550; font-size: .84rem; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface-3); color: var(--text); }
.tabs .n { font-size: .72rem; color: var(--faint); }
.tabs.underline { background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0; width: 100%; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.tabs.underline button { border-radius: 0; padding: 10px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs.underline button.active { background: none; border-bottom-color: var(--text); }

/* Champs */
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 11px; height: 38px;
  font-size: 16px; transition: border-color .12s;
}
@media (min-width: 901px) { input, select, textarea { font-size: .9rem; } }
textarea { padding: 9px 11px; height: auto; min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #5a5a5a; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="color"] { padding: 3px; width: 46px; }
input[type="file"] { padding: 6px; height: auto; }
label.field { display: block; }
label.field > span { display: block; font-size: .8rem; color: var(--text-2); margin-bottom: 6px; font-weight: 550; }
label.field + label.field { margin-top: 12px; }
.help { color: var(--muted); font-size: .76rem; margin-top: 5px; }
.input-icon { position: relative; flex: 1; min-width: 180px; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 34px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); }

/* Listes et tableaux */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-height: 58px; }
.list-row:last-child { border-bottom: 0; }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 550; }
.list-row .meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 550; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-elev); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); font-size: .78rem; }
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; }
.chip button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; display: grid; }

.empty { color: var(--muted); text-align: center; padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 28px; height: 28px; color: var(--faint); }
.error-box { display: flex; gap: 10px; align-items: flex-start; background: rgba(248, 113, 113, .06); border: 1px solid rgba(248, 113, 113, .22); color: #fca5a5; padding: 12px 14px; border-radius: 10px; font-size: .86rem; }
.notice { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); padding: 12px 14px; border-radius: 10px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Bannière de l'accueil */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); min-height: 176px;
  background: radial-gradient(120% 140% at 0% 0%, #1c1c1c, #0d0d0d 60%); display: flex; align-items: flex-end;
}
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 10, .1), rgba(10, 10, 10, .92)); }
.hero .inner { position: relative; z-index: 1; padding: 22px; width: 100%; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero .logo { width: 58px; height: 58px; border-radius: 14px; background: #000; border: 1px solid var(--border-strong); object-fit: cover; }
.hero h1 { font-size: 1.6rem; }

.countdown { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg); background: rgba(251, 191, 36, .06); border: 1px solid rgba(251, 191, 36, .25); }
.countdown .time { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); }

/* Graphique en barres */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 26px; background: var(--text-2); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.bars .b span { font-size: .66rem; color: var(--faint); }

/* Console */
.console {
  background: #050505; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; height: calc(100vh - 270px); min-height: 360px;
  overflow-y: auto; font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: .78rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.console .l-err { color: #fca5a5; } .console .l-warn { color: #fcd34d; } .console .l-ok { color: #86efac; } .console .l-dim { color: var(--faint); }
@media (max-width: 900px) { .console { height: calc(100dvh - 330px - env(safe-area-inset-bottom)); } }

/* Assistant */
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px; }
@media (max-width: 900px) { .chat { height: calc(100dvh - var(--nav-h) - 150px - env(safe-area-inset-bottom)); } }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.msg { max-width: min(760px, 92%); line-height: 1.55; }
.msg.me { align-self: flex-end; background: var(--surface-3); border: 1px solid var(--border-strong); padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; }
.msg.bot p + p, .msg.bot ul, .msg.bot ol, .msg.bot pre { margin-top: 8px; }
.msg.bot ul, .msg.bot ol { padding-left: 20px; margin-bottom: 0; }
.msg.bot code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.msg.bot pre { background: #050505; border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.msg.bot pre code { background: none; padding: 0; }
.msg .who { font-size: .74rem; color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.proposal { align-self: flex-start; width: min(520px, 100%); border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.proposal .lbl { font-weight: 600; margin: 4px 0 12px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea { min-height: 42px; height: 42px; max-height: 160px; resize: none; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.suggest button { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 99px; padding: 7px 13px; cursor: pointer; color: var(--text-2); font-size: .84rem; }
.suggest button:hover { color: var(--text); border-color: #3a3a3a; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }

/* Fenêtres, tiroir, menus */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); animation: pop .15s; }
.modal.wide { max-width: 920px; }
@keyframes pop { from { transform: scale(.98); opacity: 0; } }
.modal-head { padding: 18px 20px 4px; }
.modal-head p { color: var(--muted); margin-top: 6px; font-size: .86rem; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.drawer-wrap { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .55); animation: fade .15s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg-elev); border-left: 1px solid var(--border-strong);
  display: flex; flex-direction: column; animation: slide .2s ease; box-shadow: var(--shadow);
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; padding-top: max(18px, env(safe-area-inset-top)); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }
@media (max-width: 900px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.menu { position: fixed; z-index: 80; min-width: 210px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 5px; box-shadow: var(--shadow); animation: fade .1s; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); text-align: left; font-size: .86rem; }
.menu button:hover { background: var(--surface-3); color: var(--text); }
.menu button.danger { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action-grid .btn { height: auto; padding: 12px 8px; flex-direction: column; gap: 7px; font-size: .8rem; white-space: normal; text-align: center; }
@media (max-width: 420px) { .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Palette de recherche */
.palette { max-width: 600px; align-self: flex-start; margin-top: 12vh; }
@media (max-width: 900px) { .palette { margin-top: 0; align-self: flex-end; } }
.palette .search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette .search input { border: 0; background: none; height: 28px; padding: 0; box-shadow: none; font-size: 1rem; }
.palette .results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette .group { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 4px; font-weight: 600; }
.palette .item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.palette .item.sel, .palette .item:hover { background: var(--surface-3); color: var(--text); }
.palette .item .meta { margin-left: auto; color: var(--muted); font-size: .78rem; }

/* Notifications */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px); }
@media (max-width: 900px) { #toasts { bottom: auto; top: max(12px, env(safe-area-inset-top)); right: 50%; transform: translateX(50%); } }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border-strong); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); animation: pop .15s; font-size: .88rem; }
.toast.ok svg { color: var(--ok); } .toast.bad svg { color: var(--bad); }

/* Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .visual { position: relative; background: #050505; overflow: hidden; display: flex; align-items: flex-end; padding: 40px; border-right: 1px solid var(--border); }
.login .visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .6; }
.login .visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(5, 5, 5, .95)); }
.login .visual.has-banner img { opacity: 1; }
.login .visual.has-banner::after { background: linear-gradient(180deg, transparent 70%, rgba(5, 5, 5, .85)); }
.login .visual .txt { position: relative; z-index: 1; }
.login .visual h2 { font-size: 1.8rem; }
.login .form-side { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login form { width: 100%; max-width: 360px; }
.login .brand-mark { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 22px; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login .visual { min-height: 200px; padding: 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login .visual.has-banner { min-height: 0; aspect-ratio: 16 / 9; }
  .login .visual h2 { font-size: 1.3rem; }
}

/* Réglages */
.settings-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; }
.settings-section .desc { color: var(--muted); font-size: .84rem; margin-top: 6px; }
@media (max-width: 900px) { .settings-section { grid-template-columns: 1fr; gap: 12px; } }
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.brand-preview img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #000; }
.brand-preview img.banner { width: 160px; height: 64px; }
/* Anticheat */
.ac-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ac-card { padding: 14px; display: flex; flex-direction: column; }
.ac-thumb { margin-top: 12px; aspect-ratio: 16 / 9; border-radius: 8px; background: #050505; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.ac-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.live-wrap { position: relative; }
.live-wrap .badge { position: absolute; top: 10px; left: 10px; }
.perm-group { margin-top: 14px; }
.perm-group h3 { margin-bottom: 6px; color: var(--text-2); }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.perm-row input { width: 18px; height: 18px; accent-color: #e5e5e5; }
.perm-row .default { margin-left: auto; font-size: .7rem; color: var(--faint); }
/* Carte */
.map-stage { height: calc(100vh - 230px); min-height: 420px; background: #070707; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; touch-action: none; }
@media (max-width: 900px) { .map-stage { height: calc(100dvh - 300px - env(safe-area-inset-bottom)); } }
.map-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.map-svg .grid { stroke: #1a1a1a; stroke-width: 6; }
.map-svg .mark { fill: #222; }
.map-svg .mark-label { fill: #5c5c5c; font-size: 110px; text-anchor: middle; font-family: inherit; }
.map-svg .pl { cursor: pointer; }
.map-svg .pl circle { fill: #f2f2f2; stroke: #0a0a0a; stroke-width: 8; }
.map-svg .pl text { fill: #d4d4d4; text-anchor: middle; font-family: inherit; paint-order: stroke; stroke: #0a0a0a; stroke-width: 10; }
.map-svg .pl.hit circle { fill: var(--warn); }
.map-svg .pl.dim { opacity: .3; }
/* Statistiques */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: .66rem; color: var(--faint); }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); }
.heat .h { text-align: center; }
.rank { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.rank .bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--text-2); }
.screenshot { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
