/* Guild Glory — sombre par défaut (clair sur demande), monochrome + accent turquoise, Geist (servie localement). */
/* Polices : /static/css/fonts.css (Geist, Geist Mono, DM Sans), chargé avant ce fichier. */

:root {
  color-scheme: light;
  --bg: #ECEDF0; --surface: #F4F5F7; --surface-2: #E8EAED; --input: #F8F9FA; --hover: rgb(24 28 38 / .06);
  --line: #DBDDE2; --line-2: #CBCED5; --line-3: #A9ADB6; --text: #1B1D21; --text-2: #40434A; --muted: #575B63; --faint: #5F636B;
  --accent: #1B1D21; --accent-hover: #33363C; --accent-ink: #F6F7F8; --accent-soft: rgb(24 28 38 / .06); --accent-line: rgb(24 28 38 / .3);
  --ok: #1E6E33; --ok-bg: rgb(30 110 51 / .1); --ok-line: rgb(30 110 51 / .35);
  --warn: #865000; --warn-bg: rgb(134 80 0 / .1); --warn-line: rgb(134 80 0 / .38);
  --bad: #B3261E; --bad-bg: rgb(179 38 30 / .09); --bad-line: rgb(179 38 30 / .38);
  --info: #0B5AB8; --info-bg: rgb(11 90 184 / .09); --info-line: rgb(11 90 184 / .32);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6;
  --chart-grid: #DBDDE2; --backdrop: rgb(24 28 38 / .42); --header-bg: rgb(236 237 240 / .88);
  --ring: 0 0 0 1px rgb(24 28 38 / .11), 0 1px 2px rgb(24 28 38 / .04);
  --shadow: 0 1px 2px rgb(24 28 38 / .04); --shadow-lg: 0 18px 40px -14px rgb(24 28 38 / .24);
  --shadow-btn: 0 2px 6px rgb(24 28 38 / .18);
  --radius: 14px; --radius-sm: 6px;
  --font: 'Geist', 'DM Sans', system-ui, sans-serif; --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a; --surface: #111111; --surface-2: #1a1a1a; --input: #0a0a0a; --hover: rgb(255 255 255 / .08);
  --line: #2e2e2e; --line-2: #383838; --line-3: #454545; --text: #ededed; --text-2: #b4b4b4; --muted: #9a9a9a; --faint: #8f8f8f;
  --accent: #d4d4d4; --accent-hover: #e5e5e5; --accent-ink: #0a0a0a; --accent-soft: rgb(255 255 255 / .07); --accent-line: rgb(255 255 255 / .3);
  --ok: #62c073; --ok-bg: rgb(98 192 115 / .1); --ok-line: rgb(98 192 115 / .35);
  --warn: #f5c542; --warn-bg: rgb(245 197 66 / .1); --warn-line: rgb(245 197 66 / .38);
  --bad: #ff8a8a; --bad-bg: rgb(255 138 138 / .1); --bad-line: rgb(255 138 138 / .4);
  --info: #6cb4ff; --info-bg: rgb(108 180 255 / .1); --info-line: rgb(108 180 255 / .32);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
  --chart-grid: #262626; --backdrop: rgb(0 0 0 / .6); --header-bg: rgb(10 10 10 / .85);
  --ring: 0 0 0 1px rgb(255 255 255 / .1);
  --shadow: none; --shadow-lg: 0 24px 50px -12px rgb(0 0 0 / .7); --shadow-btn: 0 8px 24px rgb(127 127 127 / .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.ico.sm { width: 15px; height: 15px; }

/* ---------- coquille ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 10px; min-height: 60px; max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--text); }
.nx-logo { display: block; flex-shrink: 0; width: 72px; aspect-ratio: 628 / 210; background: currentColor; color: var(--text); -webkit-mask: url("/static/img/nexx-logo.svg") center / contain no-repeat; mask: url("/static/img/nexx-logo.svg") center / contain no-repeat; }
.nx-brand-tag { flex: none; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line-3); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pill-credits { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 36px; border-radius: 6px; border: 1px solid var(--line-2); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.pill-credits:hover { border-color: var(--accent-line); }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.nav-toggle { display: none; }
.nx-lang { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; background: transparent; border: 1px solid var(--line-2); border-radius: 6px; color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 12px; }
.nx-lang:hover { background: var(--hover); }
html[lang="fr"] .nx-lang::after { content: "EN"; }
html[lang="en"] .nx-lang::after { content: "FR"; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 20px 0 32px; }
.side-group { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.side a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 550; }
.side a:hover { background: var(--hover); color: var(--text); }
.side a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); font-weight: 650; }
.side a .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.backdrop { display: none; }
main { min-width: 0; padding: 24px 0 72px; }
.view { display: flex; flex-direction: column; gap: 16px; animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 4vw, 32px); font-weight: 450; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 13.5px; }
.back:hover { color: var(--text); }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; margin-left: -8px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(290px, 86vw); max-height: none; padding: 16px 10px; background: var(--surface); border-right: 1px solid var(--line-2); transform: translateX(-102%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s; }
  .side.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .backdrop.open { display: block; position: fixed; inset: 0; z-index: 50; background: var(--backdrop); }
}

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.tile { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); flex: 0 0 auto; }
.sub-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: var(--surface); }
.sub-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }
.sub-title.accent { color: var(--ok); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: clamp(22px, 3.4vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.accent .kpi-value { color: var(--text); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .16s, border-color .16s, transform .16s; }
.btn:hover { border-color: var(--faint); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-btn); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }
.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn.block { width: 100%; min-height: 54px; font-size: 15.5px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block:disabled { opacity: 1; background: var(--surface-2); border-color: var(--line-2); color: var(--muted); }

/* ---------- formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.label.plain { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; justify-content: space-between; }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, textarea.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); transition: border-color .16s, box-shadow .16s; }
textarea.input { padding: 12px 14px; min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(127 127 127 / .12); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; 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='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--surface); }
.input.code { text-align: center; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 8px; }
.stepper button { min-height: 48px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 18px; font-weight: 600; cursor: pointer; }
.stepper button:hover { border-color: var(--faint); }
.stepper .input { text-align: center; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 6px; background: var(--accent-soft); flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 4px; background: none; color: var(--text-2); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--ring); }
.choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.choice button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); text-align: left; cursor: pointer; }
.choice button b { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.choice button span { color: var(--muted); font-size: 12.5px; }
.choice button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice button[aria-pressed="true"] span { color: var(--accent-ink); opacity: .72; }
.choice button[aria-pressed="true"] a { color: var(--accent-ink); }
.choice button:disabled { opacity: .5; cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.cost { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.cost b { font-weight: 650; }
.cost .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.clans { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.clan-input { position: relative; }
.clan-input .tag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--faint); pointer-events: none; }
.clan-input .input { padding-left: 74px; }

/* ---------- bandeaux, puces ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.notice .ico { margin-top: 2px; }
.notice.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.notice.info { border-color: var(--info-line); background: var(--info-bg); color: var(--text-2); }
.notice.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--text-2); }
.notice.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; border: 1px solid var(--line-2); color: var(--muted); background: var(--hover); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.chip.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip.live i { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.region { display: inline-grid; place-items: center; min-width: 30px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 11px; font-weight: 750; letter-spacing: .04em; }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--hover); }
.t .num { text-align: right; }
.t th.num { text-align: right; }
.t input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.cell-main { display: flex; flex-direction: column; min-width: 0; }
.cell-main small { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) {
  /* une ligne = une carte : en-tête (compte / nom) en haut, puis « titre de colonne … valeur » (data-label, posé par
     labelTables dans app.js) */
  table.t.stackable, table.t.stackable tbody { display: block; width: 100%; }
  table.t.stackable thead { display: none; }
  table.t.stackable tr { display: block; position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.t.stackable td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-width: 0; }
  table.t.stackable td::before { content: attr(data-label); flex: none; max-width: 48%; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; }
  table.t.stackable td[data-label=""]::before { content: none; }
  table.t.stackable td > * { min-width: 0; }
  table.t.stackable td:first-child { padding-top: 0; }
  /* cellule principale (pseudo, compte…) : pleine largeur, sans titre, en tête de la carte */
  table.t.stackable td:has(> .cell-main) { justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  table.t.stackable td:has(> .cell-main)::before { content: none; }
  /* case à cocher : en haut à droite de la carte */
  table.t.stackable td:has(> input[type="checkbox"]) { position: absolute; top: 12px; right: 14px; padding: 0; }
  table.t.stackable td:has(> input[type="checkbox"])::before { content: none; }
  table.t.stackable tr:has(> td > input[type="checkbox"]) td:has(> .cell-main) { padding-right: 34px; }
  table.t.stackable td.num { text-align: right; }
  .table-wrap:has(> table.t.stackable) { overflow-x: visible; }
}

/* ---------- vides, chargement ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; color: var(--faint); }
.empty b { color: var(--text-2); font-weight: 600; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- groupes ---------- */
.glist { display: grid; gap: 12px; }
.gcard { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: inherit; transition: border-color .16s; }
.gcard:hover { border-color: var(--line-3); background: var(--surface-2); }
.gcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gcard-title { font-weight: 650; display: flex; align-items: center; gap: 8px; min-width: 0; }
.gcard-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gcard-meta b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--text); transition: width .5s var(--ease); }
.squads { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.squad { display: flex; flex-direction: column; gap: 12px; }
.squad-head { display: flex; align-items: flex-start; gap: 12px; }
.squad-swatch { width: 10px; height: 10px; border-radius: 3px; margin-top: 6px; flex: 0 0 auto; }
.squad-name { font-weight: 500; font-size: 15.5px; }
.squad-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.squad-stats div { padding: 10px; border-radius: 6px; background: var(--surface-2); }
.squad-stats small { display: block; color: var(--muted); font-size: 11.5px; }
.squad-stats b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bots { display: grid; gap: 6px; }
.bot { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.bot-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.honor { font-variant-numeric: tabular-nums; font-weight: 650; }
.honor.low { color: var(--bad); }
.log { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); max-height: 200px; overflow: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.log div { padding: 3px 0; }
.log time { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* ---------- graphiques ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .lbl { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12.5px; transform: translate(-50%, calc(-100% - 12px)); }
.tip b { display: block; margin-bottom: 4px; font-weight: 650; }
.tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- résultats (images du chef) ---------- */
.results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.results figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.results canvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #0c0a18; }
.results figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- identifiants ---------- */
.cred { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px; border-radius: 6px; background: var(--surface-2); }
.cred .mono { overflow-wrap: anywhere; }
.secret { filter: blur(5px); transition: filter .16s; cursor: pointer; }
.secret.shown { filter: none; }

/* ---------- journal ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.feed-ic.ok { color: var(--ok); } .feed-ic.warning { color: var(--warn); } .feed-ic.error { color: var(--bad); }
.feed-item b { font-weight: 600; }
.feed-item p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.feed-item time { color: var(--faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- dialogues, toasts, menu ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--backdrop); }
dialog[open] { animation: pop .26s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
dialog h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
dialog .row.end { margin-top: 18px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 550; animation: pop .26s var(--ease) both; }
.toast.ok .ico { color: var(--ok); } .toast.bad { border-color: var(--bad-line); } .toast.bad .ico { color: var(--bad); }
.menu { position: absolute; right: 16px; top: 56px; z-index: 40; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px 14px; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-weight: 650; border-bottom: 1px solid var(--line); }
.unread { position: relative; }
.unread::before { content: ""; position: absolute; left: -9px; top: 18px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

pre.code { margin: 0; padding: 14px; border-radius: 10px; background: var(--input); border: 1px solid var(--line); font: 12.5px/1.55 var(--mono); overflow-x: auto; white-space: pre; }
.endpoint { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.endpoint:last-child { border-bottom: 0; }
.method { font: 700 11px var(--mono); padding: 2px 6px; border-radius: 5px; text-align: center; align-self: start; background: var(--info-bg); color: var(--info); }
.method.post { background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- tableau de bord admin : finances, anneau, états des bots ---- */
.kpi.warn { border-color: var(--warn-line); }
.fin-row.warn b { color: var(--warn); }
.fin-grid { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fin-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.fin-row span { color: var(--muted); }
.fin-row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.fin-row b small { font-weight: 450; margin-left: 6px; }
.fin-row.strong span, .fin-row.strong b { color: var(--text); font-size: 15.5px; }
.fin-row.warn span { color: var(--text-2); }
.donut { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut .chart { flex: 0 0 160px; }
.donut-v { font-size: 17px; font-weight: 600; fill: var(--text); }
.donut-s { font-size: 11px; }
.donut path { stroke: var(--surface); stroke-width: 1; cursor: default; }
.donut-legend { flex: 1 1 220px; display: grid; gap: 10px; min-width: 0; }
.donut-legend > div { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend small { grid-column: 2 / -1; }
.bot-live { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-live .ico { vertical-align: -2px; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: inherit; }
.th-sort:hover { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--focus, var(--text)); outline-offset: 2px; border-radius: 3px; }
.res-nav { margin-bottom: 10px; gap: 8px; }
/* ---- envoi Mobile Money manuel : montant, numéro et titulaire séparés ---- */
.pay-box { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.pay-step { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.pay-step .ico { flex: none; margin-top: 2px; }
.pay-line { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; }
.pay-line + .pay-line { border-top: 1px solid var(--line); }
.pay-k { font-size: 13px; color: var(--muted); }
.pay-v { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.pay-v.mono { letter-spacing: .04em; }
.pay-amount { font-size: 20px; letter-spacing: -.01em; }
@media (max-width: 420px) { .pay-line { grid-template-columns: minmax(0, 1fr) auto; } .pay-k { grid-column: 1 / -1; margin-bottom: -6px; } }
/* ---- résultat de match en grand ---- */
.results canvas { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgb(0 0 0 / .88); animation: zoom-in .16s var(--ease, ease-out); }
.zoom-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #f2f3f7; }
.zoom-bar .iconbtn { color: #f2f3f7; }
.zoom-title { font-size: 14px; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 16px; }
.zoom-body canvas { width: auto; height: auto; max-width: min(100%, 1400px); max-height: 100%; border-radius: 12px; background: #0c0a18; }
.zoom-nav { flex: none; width: 44px; height: 64px; border: 1px solid rgb(255 255 255 / .2); border-radius: 10px; background: rgb(255 255 255 / .08); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.zoom-nav:hover:not(:disabled) { background: rgb(255 255 255 / .16); }
.zoom-nav:disabled { opacity: .25; cursor: default; }
.zoom-nav:focus-visible, .zoom-bar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) { .zoom-nav { display: none; } .zoom-body { padding: 0 6px 12px; } }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zoom { animation: none; } }
/* ---- stock : pages et statistiques par serveur ---- */
.pager { gap: 8px; }
.link-num { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.link-num:hover { text-decoration-color: var(--text); }
.link-num:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.stock-stats tr.sel td { background: var(--hover); }

/* rang Clash Squad (logo du jeu + nom + points) */
.rank-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 13px; }
.rank-tag small { font-weight: 450; }
.rank-mini { display: inline-flex; align-items: center; flex: none; }
.rank-ic { flex: none; object-fit: contain; vertical-align: middle; }
.rank-up { color: var(--ok, #22c55e); font-size: 10px; margin-left: 3px; vertical-align: 1px; }
.rank-bronze { color: #b97a4a; } .rank-silver { color: #8f9bab; } .rank-gold { color: #c9971a; }
.rank-platinum { color: #2a9aa2; } .rank-diamond { color: #5b8def; } .rank-heroic { color: #a865e0; }
.rank-master, .rank-grandmaster { color: #e0603a; }
.rank-tag > span:not(.rank-up) { color: var(--text); }
@media (max-width: 640px) { .bot .rank-txt { display: none; } }

/* ---------- téléphone (la plupart des clients) ---------- */
@media (max-width: 640px) {
  .top-in { gap: 6px; padding: 0 12px; }
  .top-right { gap: 2px; }
  .nx-brand-tag { display: none; }
  .iconbtn { width: 36px; height: 36px; }
  .pill-credits { padding: 0 10px; min-height: 34px; }
  .shell { padding: 0 12px; }
  main { padding: 16px 0 56px; }
  .view { gap: 12px; }
  .card { padding: 16px; }
  .card.flush > div[style*="padding:20px"] { padding-left: 16px !important; padding-right: 16px !important; }
  /* indicateurs : deux par ligne au lieu d'un par écran */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 22px; white-space: normal; overflow-wrap: anywhere; }
  .page-head h1 { font-size: 24px; overflow-wrap: anywhere; }
  .page-head > .row { width: 100%; }
  .page-head > .row .btn { flex: 1 1 auto; justify-content: center; }
  /* bots d'une squad : nom sur une ligne, honneur + clan à droite, état en dessous */
  .bot { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 8px; }
  .bot > .honor[title] { display: none; }
  .bot-name .mono { display: none; }
  .squad-stats b { font-size: 16px; }
  .squad-stats small { font-size: 11px; }
  .legend { font-size: 12px; gap: 4px 12px; }
  .chart .axis text { font-size: 10.5px; }
  .chart .lbl { font-size: 11px; }
  .cred { grid-template-columns: minmax(0, 1fr); }
  .cred > .btn { justify-self: start; }
}
@media (max-width: 380px) {
  .squad-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .squad-stats div { padding: 8px; }
}

/* tableaux chiffrés (résultats d'un match, comptes d'un groupe) : valeurs sur deux colonnes, cartes deux fois moins hautes */
@media (max-width: 720px) {
  table.t.stackable.two tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  table.t.stackable.two td:has(> .cell-main) { grid-column: 1 / -1; }
  table.t.stackable.two td:has(.chip) { grid-column: 1 / -1; }
}
