
:root {
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
}

:root,
[data-theme="dark"] {
  --bg: #10142a;
  --side: #0b0f21;
  --panel: #171c38;
  --panel-2: #1f2547;
  --line: #2a3160;
  --text: #e9ecfb;
  --muted: #9aa2cc;
  --accent: #9299ff;
  --accent-2: #5fd0ff;
  --accent-ink: #0d1030;
  --ok: #52e0a2;
  --bad: #ff6f86;
  --warn: #ffc857;
  --dot: rgba(146, 153, 255, 0.2);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f2f3fb;
  --side: #ffffff;
  --panel: #ffffff;
  --panel-2: #eceefb;
  --line: #d9dcf0;
  --text: #171a33;
  --muted: #565d85;
  --accent: #4a51d4;
  --accent-2: #0b86bd;
  --accent-ink: #ffffff;
  --ok: #0f9364;
  --bad: #d0325a;
  --warn: #b98000;
  --dot: rgba(74, 81, 212, 0.16);
  --shadow: 0 8px 24px rgba(30, 36, 90, 0.14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Trame de points qui s'estompe vers le bas de la page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 460px);
  mask-image: linear-gradient(to bottom, #000, transparent 460px);
}
.shell, .bare-wrap { position: relative; z-index: 1; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink);
}
.skip:focus { left: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--font-mono); }

/* ----- Structure --------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 32px;
  padding: 28px 18px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; padding: 0 6px; }
.brand svg { width: 36px; height: 36px; color: var(--accent); flex: none; }
.brand b { display: block; font: 600 17px/1.15 var(--font-display); }
.brand small { display: block; color: var(--muted); font-size: 12.5px; }

.nav { display: grid; gap: 4px; }
.nav a, .side-foot a, .side-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted);
  font: 500 15px var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.nav a:hover, .side-foot a:hover, .side-btn:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg, .side-foot svg, .side-btn svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 4px; }

.main { width: 100%; max-width: 1200px; padding: 48px clamp(18px, 4vw, 56px) 80px; }
.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ----- Titres ------------------------------------------------------------ */

h1 { margin: 0; font: 700 clamp(26px, 3.4vw, 36px)/1.15 var(--font-display); letter-spacing: -0.02em; }
h2 { margin: 0; font: 600 20px/1.2 var(--font-display); }
h3 { margin: 0; font: 600 16px/1.3 var(--font-display); }
.lede { margin: 8px 0 0; max-width: 60ch; color: var(--muted); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.stamp { color: var(--muted); font-size: 13.5px; }

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head .count { margin-left: 10px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font: 500 13px var(--font-body); vertical-align: 2px; }
section + section { margin-top: 52px; }

/* ----- Vue d'ensemble ---------------------------------------------------- */

.overview {
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: 52px; padding: 34px clamp(20px, 3vw, 44px);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gauge { position: relative; width: 200px; height: 200px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; }
.gauge .track { stroke: var(--panel-2); }
.gauge .ring { stroke-linecap: round; stroke-dasharray: 0 400; transition: stroke-dasharray 1.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.gauge .ring.a { stroke: var(--accent); }
.gauge .ring.b { stroke: var(--accent-2); transition-delay: 0.15s; }
.gauge-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-label strong { font: 700 34px/1 var(--font-display); }
.gauge-label span { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

.overview h2 { font-size: 22px; }
.overview p { margin: 6px 0 0; max-width: 52ch; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 18px 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.legend b { color: var(--text); font-weight: 600; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.legend .sw.a { background: var(--accent); }
.legend .sw.b { background: var(--accent-2); }

.totals { display: flex; flex-wrap: wrap; gap: 20px 0; margin: 26px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.totals div { padding: 0 30px; border-left: 1px solid var(--line); }
.totals div:first-child { padding-left: 0; border-left: 0; }
.totals dt { color: var(--muted); font-size: 13.5px; }
.totals dd { margin: 2px 0 0; font: 600 30px/1.2 var(--font-display); }

/* ----- Liste des serveurs ------------------------------------------------ */

.toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg button {
  padding: 7px 14px; border: 0; border-radius: 7px;
  background: none; color: var(--muted);
  font: 500 14px var(--font-body); cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg .n { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }

.list { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.list-head, .row {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) minmax(180px, 1.1fr) minmax(170px, 1fr) 90px 110px 16px;
  align-items: center; gap: 20px; padding: 16px 20px;
}
.list-head { padding-block: 12px; background: var(--side); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.row { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: background 0.15s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }
.row.risk { box-shadow: inset 3px 0 0 var(--bad); }
.row::after {
  content: ""; justify-self: end; width: 8px; height: 8px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: rotate(45deg); opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.row:hover::after { opacity: 1; transform: translateX(3px) rotate(45deg); }
.row .id { font: 500 14px var(--font-mono); overflow-wrap: anywhere; }
.who { display: flex; align-items: center; gap: 14px; }
.identicon { flex: none; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; font-weight: 500; }

.badges { display: grid; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.badge.on::before { background: var(--ok); }
.badge.off { color: var(--bad); }

.meter { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; max-width: 110px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter .num { min-width: 2.2ch; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--warn); }

.skel span { height: 14px; border-radius: 6px; background: var(--panel-2); animation: pulse 1.6s ease-in-out infinite; }
.skel span:first-child { height: 36px; border-radius: 10px; }
@keyframes pulse { 50% { opacity: 0.45; } }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 6px; color: var(--text); font: 600 16px var(--font-display); }

/* ----- Champs et boutons ------------------------------------------------- */

.search {
  width: 280px; max-width: 100%; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); font: inherit;
}
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--accent); }

.btn {
  padding: 10px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); font: 600 14px var(--font-body); cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: rgba(255, 111, 134, 0.45); color: var(--bad); }
.btn.danger:hover { background: rgba(255, 111, 134, 0.1); border-color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* ----- Page serveur ------------------------------------------------------ */

.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }

.id-line { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.id-line h1 { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; font-size: clamp(20px, 3vw, 30px); overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin: 0 0 52px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fact { margin: 0; padding: 22px 26px; background: var(--panel); }
.fact dt { color: var(--muted); font-size: 13.5px; }
.fact dd { margin: 4px 0 0; font: 600 22px/1.3 var(--font-display); }
.fact dd.state { display: flex; align-items: center; gap: 10px; }
.fact dd.state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.fact dd.state.on::before { background: var(--ok); }

.activity {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px);
  padding: 26px clamp(18px, 3vw, 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-bottom: 22px; border-bottom: 1px solid var(--line); position: relative; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.chart .b { width: 100%; max-width: 30px; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--accent); opacity: 0.5; transition: opacity 0.15s; }
.chart .b.zero { background: var(--line); opacity: 1; }
.chart .col:hover .b:not(.zero), .chart .col.today .b:not(.zero) { opacity: 1; }
.chart .d { position: absolute; bottom: -22px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.activity .hint { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }

.top { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.top li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.top .who-id { font: 500 13.5px var(--font-mono); overflow-wrap: anywhere; }
.top .cnt { font-weight: 600; font-variant-numeric: tabular-nums; }
.top .bar { grid-column: 1 / -1; max-width: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { padding: 12px 16px; background: var(--side); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.reason { max-width: 46ch; overflow-wrap: anywhere; }
td.nowrap { white-space: nowrap; color: var(--muted); }
tbody tr:hover { background: var(--panel); }

.backups { margin: 0; padding: 0; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.backups li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); transition: opacity 0.25s, transform 0.25s; }
.backups li:last-child { border-bottom: 0; }
.backups li.removing { opacity: 0; transform: translateX(12px); }
.backups .name { font-weight: 500; overflow-wrap: anywhere; }
.backups .when { display: block; color: var(--muted); font-size: 13.5px; }

/* ----- Fenêtre de confirmation et notifications -------------------------- */

dialog { max-width: min(440px, 92vw); padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); }
dialog::backdrop { background: rgba(6, 8, 20, 0.72); }
dialog h3 { margin: 0 0 8px; font-size: 18px; }
dialog p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 10px; }
.toast { padding: 12px 16px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--r-sm); box-shadow: var(--shadow); animation: toast-in 0.2s ease-out; }
.toast.error { border-left-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----- Connexion et pages d'erreur --------------------------------------- */

.auth { width: min(400px, 100%); padding: 34px clamp(20px, 5vw, 36px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.auth .mark { width: 52px; height: 52px; margin-bottom: 20px; color: var(--accent); }
.auth h1 { font-size: 28px; }
.auth .lede { margin-bottom: 26px; }
.field label { display: block; margin-bottom: 8px; font-weight: 500; }
.field input { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); font: 400 15px var(--font-mono); }
.field input:focus { border-color: var(--accent); }
.form-error { margin: 0 0 18px; padding: 10px 14px; border-left: 3px solid var(--bad); border-radius: var(--r-sm); background: rgba(255, 111, 134, 0.09); color: var(--bad); }
.auth .btn { width: 100%; margin-top: 18px; padding: 12px 16px; font-size: 15px; }

.error-page { width: min(460px, 100%); }
.error-page .code { font: 700 clamp(72px, 16vw, 120px)/1 var(--font-display); letter-spacing: -0.04em; color: var(--accent); }
.error-page h1 { margin-top: 12px; font-size: 26px; }
.error-page .btn { display: inline-block; margin-top: 24px; text-decoration: none; }

/* ----- Adaptation mobile ------------------------------------------------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand small { display: none; }
  .side-foot { margin-top: 0; grid-auto-flow: column; }
  .nav { grid-auto-flow: column; }
  .nav a span, .side-foot a span, .side-btn span { display: none; }
  .nav a, .side-foot a, .side-btn { width: auto; }
  .main { padding-top: 28px; }
  .toolbar { flex-wrap: wrap; width: 100%; }
  .search { flex: 1 1 200px; width: auto; }

  .overview { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .overview p { margin-inline: auto; }
  .legend { justify-content: center; }
  .totals { justify-content: center; }
  .totals div { padding: 0 14px; }
  .activity { grid-template-columns: 1fr; }

  .list-head { display: none; }
  .row { grid-template-columns: 1fr 1fr; gap: 14px 20px; }
  .row::after { display: none; }
  .row > :first-child { grid-column: 1 / -1; }
  .row > :first-child::before { display: none; }
  .row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   Version 3 : nouvelles fonctionnalités
   ========================================================================== */

/* ----- Pastille d'état du bot ------------------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pill.on i { background: var(--ok); }
.pill.off i { background: var(--bad); }
.side .pill { margin: 0 6px 8px; align-self: flex-start; }

/* ----- Serveurs : nom et icône ------------------------------------------ */

.gicon { flex: none; width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.who .names { min-width: 0; }
.who .name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.who .sub { display: block; color: var(--muted); font: 400 12.5px var(--font-mono); overflow-wrap: anywhere; }
.who .id { font: 500 14px var(--font-mono); }

select.search { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  width: auto; }

.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn.ghost { background: transparent; }
a.btn { display: inline-block; text-decoration: none; }
.toolbar { flex-wrap: wrap; justify-content: flex-end; }
.kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: 500 12px var(--font-mono); color: var(--muted); }

/* ----- Onglets ------------------------------------------------------------ */

.tabs { display: flex; gap: 4px; margin: 0 0 36px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  position: relative; padding: 12px 16px; border: 0; background: none; color: var(--muted);
  font: 500 15px var(--font-body); white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .count { margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; }
.tabpanel[hidden] { display: none; }

/* ----- Panneaux, interrupteurs, formulaires ------------------------------ */

.panel { padding: 24px clamp(18px, 3vw, 30px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel + .panel { margin-top: 20px; }
.panel h3 { margin-bottom: 4px; }
.panel .muted { margin: 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .panel + .panel { margin-top: 0; }

.switches { display: grid; gap: 0; margin-top: 8px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-row b { display: block; font-weight: 600; }
.switch-row span { color: var(--muted); font-size: 13.5px; }
.switch { position: relative; flex: none; width: 46px; height: 26px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.switch[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: #fff; }
.switch:disabled { opacity: 0.55; cursor: progress; }

.stack { display: grid; gap: 16px; }
.field select, .field textarea {
  width: 100%; padding: 11px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text); font: 400 15px var(--font-body);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .help { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.field input[type="password"], .field input[type="text"] { font-family: var(--font-body); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.auth .btn.full, .btn.full { width: 100%; }

.danger-zone { border-color: rgba(255, 111, 134, 0.45); }
.danger-zone h3 { color: var(--bad); }
.danger-zone .inline-actions { margin-top: 16px; justify-content: space-between; }

/* ----- Détails Discord ---------------------------------------------------- */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 18px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv dd.mono { font-family: var(--font-mono); font-weight: 400; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; max-height: 340px; overflow: auto; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.chip small { color: var(--muted); }

/* ----- Tableaux : actions de ligne ---------------------------------------- */

td.actions { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; }

/* ----- Journal du bot ----------------------------------------------------- */

.console {
  height: min(64vh, 640px); overflow: auto; padding: 14px 0;
  background: var(--side); border: 1px solid var(--line); border-radius: var(--r-md);
  font: 400 13px/1.6 var(--font-mono);
}
.console .ln { display: grid; grid-template-columns: 132px 76px minmax(0, 1fr); gap: 12px; padding: 1px 18px; }
.console .ln:hover { background: var(--panel); }
.console .t { color: var(--muted); white-space: nowrap; }
.console .lv { font-weight: 500; }
.console .lv.INFO { color: var(--accent-2); }
.console .lv.WARNING { color: var(--warn); }
.console .lv.ERROR, .console .lv.CRITICAL { color: var(--bad); }
.console .m { white-space: pre-wrap; overflow-wrap: anywhere; }
.console .placeholder { padding: 36px 18px; text-align: center; color: var(--muted); font-family: var(--font-body); }

/* ----- Membres ------------------------------------------------------------ */

.search-lg { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.search-lg .search { flex: 1 1 320px; width: auto; padding: 12px 14px; font-size: 15px; }
.search-lg .btn { padding: 12px 22px; }

.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.profile img, .profile .identicon { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.profile h2 { font-size: 22px; }
.profile p { margin: 2px 0 0; color: var(--muted); }
.result-block + .result-block { margin-top: 28px; }
.result-block h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.result-block h3 a { color: inherit; text-decoration: none; }
.result-block h3 a:hover { color: var(--accent); }

.leaderboard { list-style: none; margin: 0; padding: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.leaderboard li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard button { all: unset; cursor: pointer; }
.leaderboard li:hover { background: var(--panel); }
.leaderboard .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.leaderboard .who-id { font: 500 14px var(--font-mono); overflow-wrap: anywhere; }
.leaderboard .who-name { display: block; color: var(--muted); font: 400 13px var(--font-body); }
.leaderboard .cnt { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ----- Paramètres --------------------------------------------------------- */

.settings { display: grid; gap: 20px; max-width: 760px; }
.settings .panel + .panel { margin-top: 0; }
.settings h3 { margin-bottom: 6px; }
.settings .btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.notice { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--warn); border-radius: var(--r-sm); background: rgba(255, 200, 87, 0.08); color: var(--text); font-size: 14px; }

/* ----- Adaptations mobile v3 ---------------------------------------------- */

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .side .pill { margin: 0; align-self: center; }
  .side .pill span { display: none; }
  .console .ln { grid-template-columns: 1fr; gap: 0; padding: 4px 14px; }
  .console .t, .console .lv { display: inline; }
  .toolbar { justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}

.activity.one { grid-template-columns: 1fr; }

.top li { grid-template-columns: minmax(0, 1fr) auto auto; }
.top .who-id { text-decoration: none; }
.top .who-id:hover { color: var(--accent); }
.backups .inline-actions { flex-wrap: nowrap; }

/* Totaux : grille régulière (6 valeurs possibles) */
.totals { display: grid; grid-template-columns: repeat(3, max-content); gap: 22px 48px; }
.totals div, .totals div:first-child { padding: 0; border-left: 0; }
.totals div[hidden] { display: none; }
@media (max-width: 860px) {
  .totals { grid-template-columns: repeat(2, max-content); justify-content: center; text-align: center; gap: 18px 36px; }
  .totals div { padding: 0; }
}

@media (max-width: 860px) { .row > :first-child::before { display: none !important; } }
