/* =====================================================================
   Bot Panel — thème "graphite"
   Noir neutre, filets fins, typographie serrée. Le vert sert aux états
   actifs, l'or est réservé à tout ce qui touche au Premium.
   ===================================================================== */

:root {
  --bg: #0A0A0B;
  --bg-elev: #0D0D0F;
  --surface: #111113;
  --surface-2: #161619;
  --surface-3: #1E1E22;
  --border: #26262B;
  --border-soft: #1B1B1F;
  --border-strong: #34343A;

  --accent: #4ADE80;
  --accent-2: #86EFAC;
  --accent-3: #22C55E;
  --accent-soft: rgba(74, 222, 128, 0.10);
  --accent-ink: #04210F;

  --gold: #E6C46F;
  --gold-2: #F6E2A8;
  --gold-3: #B8913E;
  --gold-soft: rgba(230, 196, 111, 0.09);
  --gold-line: rgba(230, 196, 111, 0.28);

  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.10);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.10);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.10);

  --text: #EDEDEF;
  --text-muted: #8A8A93;
  --text-faint: #5C5C66;

  --gradient-brand: linear-gradient(135deg, #86EFAC 0%, #22C55E 100%);
  --gradient-gold: linear-gradient(135deg, #F6E2A8 0%, #E6C46F 45%, #B8913E 100%);
  --gradient-surface: linear-gradient(180deg, #121215 0%, #101012 100%);
  --glass: rgba(10, 10, 11, 0.78);

  --font-display: 'Geist', 'Inter', system-ui, sans-serif;
  --font-body: 'Geist', 'Inter', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 3px rgba(255, 255, 255, 0.06);
  --shadow-glow-accent: 0 0 0 1px rgba(74, 222, 128, 0.25), 0 8px 24px -8px rgba(74, 222, 128, 0.25);
  --inset-hairline: inset 0 1px 0 rgba(255, 255, 255, 0.03);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(74, 222, 128, 0.22); color: #fff; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.022em; }

a { color: inherit; text-decoration: none; }

p { line-height: 1.55; }

code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}

:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { display: block; flex-shrink: 0; }

[hidden] { display: none !important; }

.gradient-text {
  background: linear-gradient(180deg, #FFFFFF 0%, #A1A1AA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes floatGlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes sheen {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: translateY(0.5px); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover { background: #FFFFFF; border-color: #FFFFFF; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--inset-hairline);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }

.btn-ghost.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-ghost.btn-danger:hover { color: #fff; background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.5); }

.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 0.7rem; font-size: 0.8rem; border-radius: var(--radius-sm); }

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn-icon:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- Écran de connexion ---------- */

.auth-screen {
  min-height: calc(100vh - 53px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(255, 255, 255, 0.06), transparent 70%),
    var(--bg);
}
/* Grille en filigrane derrière la carte */
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 55% 55% at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.6rem 2.2rem 2.2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--inset-hairline);
  animation: popIn 0.35s var(--ease);
  position: relative;
  z-index: 1;
}

.auth-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--inset-hairline), 0 0 0 6px rgba(255, 255, 255, 0.015);
}

.auth-card h1 { font-size: 1.45rem; margin-bottom: 0.5rem; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1.6rem; line-height: 1.55; }

.auth-features {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 1.6rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 0.65rem 0.9rem;
  background: var(--bg-elev);
}
.auth-features li + li { border-top: 1px solid var(--border-soft); }
.auth-features li::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex-shrink: 0;
}

.auth-note { color: var(--text-faint); font-size: 0.78rem; margin-top: 1.3rem; line-height: 1.5; }

/* ---------- Sélecteur de langue ---------- */

.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2px;
}
.lang-switcher-btn {
  background: none;
  border: none;
  border-radius: 5px;
  padding: 0.22rem 0.45rem;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  filter: grayscale(0.6);
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease), filter 0.15s var(--ease);
}
.lang-switcher-btn:hover { opacity: 0.85; }
.lang-switcher-btn.active { opacity: 1; filter: none; background: var(--surface-3); }

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


.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.guild-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: var(--inset-hairline);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  animation: fadeInUp 0.3s var(--ease) backwards;
  position: relative;
}
.guild-card::after {
  content: "";
  margin-left: auto;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--text-faint);
  border-top: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.guild-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.guild-card:hover::after { border-color: var(--text); transform: translateX(2px) rotate(45deg); }

.guild-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px var(--border); }
.guild-icon-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600; font-size: 1rem;
}
.guild-name { font-weight: 500; font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state {
  color: var(--text-muted);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state-icon {
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.empty-sub { font-size: 0.84rem; margin-top: 0.4rem; color: var(--text-faint); }

/* ---------- Layout dashboard ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  padding: 0.9rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.5rem 0.4rem;
}
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.015em; }
.brand-tier {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.guild-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--inset-hairline);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.guild-switch:hover { border-color: var(--border); background: var(--surface-2); }
.guild-switch-icon { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.guild-switch-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text); font-size: 0.75rem; font-weight: 600;
}
.guild-switch-name { flex: 1; min-width: 0; font-size: 0.84rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-switch-caret { color: var(--text-faint); display: inline-flex; }

.nav-search-wrap { position: relative; display: flex; align-items: center; }
.nav-search-icon { position: absolute; left: 0.6rem; color: var(--text-faint); display: inline-flex; pointer-events: none; }
.nav-search-kbd { position: absolute; right: 0.45rem; pointer-events: none; }
.nav-search {
  width: 100%;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0 3.4rem 0 1.85rem;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-search::placeholder { color: var(--text-faint); }
.nav-search:hover { border-color: var(--border); }
.nav-search:focus { outline: none; border-color: var(--border-strong); background: var(--surface); }
.nav-search::-webkit-search-cancel-button { display: none; }

.nav-scroll { flex: 1; overflow-y: auto; margin: 0.2rem -0.25rem 0; padding: 0 0.25rem; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group + .nav-group { margin-top: 1rem; }
.nav-group-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0.6rem;
  margin-bottom: 0.3rem;
}
.nav-group.nav-group-hidden,
.nav-item.nav-item-hidden { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 450;
  height: 32px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: color 0.12s var(--ease), background 0.12s var(--ease), border-color 0.12s var(--ease);
}
.nav-item .nav-icon { display: inline-flex; color: var(--text-faint); transition: color 0.12s var(--ease); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-premium { display: inline-flex; color: var(--gold); opacity: 0.75; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item:hover .nav-icon { color: var(--text-muted); }
.nav-item.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(74, 222, 128, 0.22);
  font-weight: 500;
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item.active .nav-premium { opacity: 1; }

.sidebar-footer { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--border-soft); }

/* Carte Premium : liseré doré via un double fond (padding-box / border-box) */
.premium-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #17150F, #121110) padding-box,
    linear-gradient(135deg, rgba(246, 226, 168, 0.55), rgba(184, 145, 62, 0.15) 45%, rgba(230, 196, 111, 0.35)) border-box;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.premium-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(246, 226, 168, 0.08) 50%, transparent 65%);
  background-size: 200% 100%;
  animation: sheen 6s linear infinite;
  pointer-events: none;
}
.premium-card:hover { box-shadow: 0 8px 24px -10px rgba(230, 196, 111, 0.35); }
.premium-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  color: #1A1408;
  background: var(--gradient-gold);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 4px 12px -4px rgba(230, 196, 111, 0.5);
  flex-shrink: 0;
}
.premium-card-text { flex: 1; min-width: 0; font-size: 0.8rem; }
.premium-card-text strong { font-weight: 500; color: var(--gold-2); }
.premium-card-arrow { color: var(--gold-3); display: inline-flex; }

.user-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.35rem; }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
}
.user-name { flex: 1; min-width: 0; font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { color: var(--text-faint); display: inline-flex; padding: 0.3rem; border-radius: var(--radius-sm); transition: color 0.15s var(--ease), background 0.15s var(--ease); }
.user-logout:hover { color: var(--text); background: var(--surface-2); }

/* Colonne principale */
.main-col { min-width: 0; display: flex; flex-direction: column; }

.main-header {
  position: sticky;
  top: 0;
  z-index: 9;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2.75rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; min-width: 0; }
.breadcrumb-link { color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s var(--ease); }
.breadcrumb-link:hover { color: var(--text-muted); }
.breadcrumb-sep { color: var(--border-strong); }
.breadcrumb-current { color: var(--text); font-weight: 500; white-space: nowrap; }
.main-header-actions { display: flex; align-items: center; gap: 0.6rem; }

.main { padding: 2.2rem 2.75rem 6rem; width: 100%; }

/* ---------- Panneaux ---------- */

.panel { display: none; max-width: 880px; counter-reset: section; }
.panel.panel-wide { max-width: 1180px; }
.panel.active { display: block; animation: panelIn 0.32s var(--ease); }
.panel.active .section,
.panel.active .section-card,
.panel.active .ov-layout,
.panel.active .kpi-strip { animation: fadeInUp 0.38s var(--ease) both; }
.panel.active > :nth-child(3) { animation-delay: 0.03s; }
.panel.active > :nth-child(4) { animation-delay: 0.06s; }
.panel.active > :nth-child(5) { animation-delay: 0.09s; }
.panel.active > :nth-child(6) { animation-delay: 0.12s; }
.panel.active .form-block > .section:nth-child(2) { animation-delay: 0.08s; }
.panel.active .form-block > .section:nth-child(3) { animation-delay: 0.12s; }
.panel.active .form-block > .section:nth-child(4) { animation-delay: 0.16s; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* En-tête : catégorie, titre, statut d'enregistrement, interrupteur du module */
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}
.panel-head-text { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.panel-eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.panel h2 { font-size: 1.6rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; line-height: 1.15; }
.panel-lead { color: var(--text-muted); font-size: 0.88rem; margin: 0.1rem 0 0; max-width: 60ch; }

.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-faint);
  transition: color 0.2s var(--ease);
}
.panel-status .icon { color: var(--accent); transition: opacity 0.2s var(--ease); }
.panel-status[data-state="unsaved"] { color: var(--warning); }
.panel-status[data-state="unsaved"] .icon,
.panel-status[data-state="saving"] .icon { opacity: 0; width: 0; }

.module-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  height: 38px;
  padding: 0 0.55rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.module-switch:hover { border-color: var(--border-strong); }
.module-switch-text { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); min-width: 4.6em; text-align: right; }
.module-switch:has(input:checked) { border-color: rgba(74, 222, 128, 0.3); background: linear-gradient(90deg, transparent, var(--accent-soft)); }
.module-switch:has(input:checked) .module-switch-text { color: var(--text); }

/* Encart "Ce que fait ce module" */
.panel-about {
  border-left: 2px solid var(--border-strong);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 0 0 1.6rem;
  max-width: 68ch;
}
.panel-about-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}
.panel-about p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }
.panel-about p strong { color: var(--text); font-weight: 500; }
.panel-about .panel-about-hint { margin-top: 0.4rem; color: var(--text-faint); font-size: 0.8rem; }

/* Bandeau affiché quand le module du panneau est coupé */
.module-off {
  display: none;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.07), rgba(251, 191, 36, 0.02));
}
.panel[data-enabled="0"] .module-off { display: flex; animation: fadeInUp 0.25s var(--ease); }
.module-off-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  color: var(--warning); background: rgba(251, 191, 36, 0.1);
}
.module-off-text { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.module-off-text strong { font-size: 0.84rem; font-weight: 600; }
.module-off-text span { font-size: 0.78rem; color: var(--text-muted); }
/* Atténue le contenu (et pas la carte elle-même, dont l'opacité est animée à l'ouverture) */
.panel[data-enabled="0"] .section > *,
.panel[data-enabled="0"] .section-card > *,
.panel[data-enabled="0"] .subtab-bar > * { opacity: 0.5; transition: opacity 0.2s var(--ease); }
.panel[data-enabled="0"] .section:hover > *,
.panel[data-enabled="0"] .section-card:hover > * { opacity: 1; }

/* ---------- Sections numérotées ---------- */

.form-block { position: relative; }
.form-block + .section,
.section + .form-block,
.section + .section,
.form-block > .section + .section { margin-top: 0.85rem; }

.section {
  counter-increment: section;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--inset-hairline);
}
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.15rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
}
.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}
.section-num::before { content: counter(section); }
.section-head-text { min-width: 0; }
.section-title { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em; }
.section-hint { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-faint); line-height: 1.5; }
.section-hint code, .section-hint strong { color: var(--text-muted); }
.section-body { padding: 1.15rem; }
.section-body > :last-child,
.section-body .field:last-child,
.section-body .grid-2:last-child .field { margin-bottom: 0; }
.section-body .field-hint-block { margin: -0.6rem 0 1.25rem; }
.section-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; }
.section-actions .field-hint { margin: 0; }

/* Lignes à interrupteur à l'intérieur d'une section : fond légèrement enfoncé */
.section-body .field-row { background: var(--bg-elev); border-color: var(--border-soft); }

/* Sous-onglets du jeu de cartes : chaque bloc devient une carte titrée par son libellé */
.subpanel-intro { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin: 0 0 1.1rem; max-width: 72ch; }
.subpanel-intro code { color: var(--text); }
.section-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--inset-hairline);
}
.field.section-card > label:first-child { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.25rem; }
.field.section-card > label:first-child + .field-hint { margin: 0 0 0.9rem; }
.field.section-card > label:first-child + :not(.field-hint) { margin-top: 0.75rem; }
.section-card .field:last-child { margin-bottom: 0; }

/* ---------- Barre d'enregistrement ---------- */

.save-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 19, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.save-bar-state { display: inline-flex; align-items: center; gap: 0.5rem; flex: 1; font-size: 0.8rem; color: var(--text-muted); min-width: 0; }
.save-bar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex-shrink: 0; transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.save-bar-kbd { display: inline-flex; gap: 3px; opacity: 0.8; }
.form-block[data-state="unsaved"] .save-bar { border-color: rgba(251, 191, 36, 0.35); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(251, 191, 36, 0.05); }
.form-block[data-state="unsaved"] .save-bar-state { color: var(--text); }
.form-block[data-state="unsaved"] .save-bar-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.form-block[data-state="saving"] .save-bar-dot { background: var(--text-muted); box-shadow: none; animation: pulse 0.9s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- Champs de formulaire ---------- */

.field { margin-bottom: 1.5rem; }
.field label { display: block; font-weight: 500; font-size: 0.82rem; margin-bottom: 0.45rem; color: var(--text); }
.field-hint { color: var(--text-faint); font-size: 0.78rem; margin: 0.45rem 0 0; line-height: 1.5; }
.field-hint strong, .field-hint code { color: var(--text-muted); }

.field-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  transition: border-color 0.15s var(--ease);
}
.field-row:hover { border-color: var(--border); }
.field-row label { margin-bottom: 0.1rem; }
.field-row .field-hint { margin-top: 0.15rem; }

/* ---------- Groupes de modules (/admin/premium) ---------- */

.module-group {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- Sous-onglets (contrôle segmenté) ---------- */

.subtab-bar {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 1.8rem;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.subtab-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.subtab-item:hover { color: var(--text); }
.subtab-item.active {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--inset-hairline), var(--shadow-sm);
}
.subtab-count { margin-left: 0.3rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); }
.subtab-item.active .subtab-count { color: var(--text-muted); }

/* Formulaire repliable (ex : "Ajouter une carte") : le libellé fait office de bouton */
.disclosure { padding: 0; }
.disclosure-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.15rem;
  list-style: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-lg);
  transition: background 0.12s var(--ease);
}
.disclosure-summary::-webkit-details-marker { display: none; }
.disclosure-summary::before {
  content: "+";
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(74, 222, 128, 0.25);
  transition: transform 0.2s var(--ease);
}
.disclosure-summary:hover { background: var(--surface-2); }
.disclosure[open] > .disclosure-summary { border-bottom: 1px solid var(--border-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.disclosure[open] > .disclosure-summary::before { content: "−"; }
.disclosure-body { padding: 1.1rem 1.15rem 1.15rem; animation: fadeInUp 0.2s var(--ease); }
.disclosure-body > .field:last-child, .disclosure-body > :last-child { margin-bottom: 0; }

.subpanel { display: none; }
.subpanel.active { display: block; animation: fadeInUp 0.25s var(--ease); }

input[type="text"], input[type="number"], input[type="url"], input[type="file"], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  padding: 0.55rem 0.75rem;
  min-height: 36px;
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type="text"]:hover, input[type="number"]:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input[type="text"]:focus, input[type="number"]:focus, input[type="url"]:focus, textarea:focus, select:focus {
  border-color: #4A4A52;
  outline: none;
  box-shadow: var(--shadow-glow);
}
textarea { line-height: 1.55; }
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A8A93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
select option { background: var(--surface); color: var(--text); }
input[type="number"] { font-family: var(--font-mono); font-size: 0.84rem; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem 1.25rem; align-items: start; }
.grid-2.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2.grid-preview { grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; }

/* ---------- Interrupteur ---------- */

.switch { position: relative; display: inline-block; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block; width: 36px; height: 20px;
  background: #2A2A30;
  border-radius: 999px; cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: background 0.2s var(--ease);
}
.switch-thumb {
  display: block; width: 16px; height: 16px;
  background: #E4E4E7;
  border-radius: 50%; margin: 2px;
  transition: transform 0.22s var(--ease-spring), background 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.switch input:checked + .switch-track { background: var(--accent-3); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid rgba(74, 222, 128, 0.6); outline-offset: 2px; }

/* ---------- Aperçu Discord ---------- */

.preview-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.preview-label {
  font-size: 0.66rem; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}

.discord-embed {
  background: #2B2D31;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.85rem 0.95rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #DBDEE1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), var(--shadow-sm);
}
.embed-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--surface-3); border: 1px solid var(--border); }
.embed-text { word-break: break-word; }
.embed-text strong { color: white; }

.discord-embed-full {
  position: relative;
  background: #2B2D31;
  border-left: 3px solid #5865f2;
  border-radius: 6px;
  padding: 0.85rem 0.95rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #DBDEE1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), var(--shadow-sm);
  max-width: 480px;
}
.embed-full-author { font-weight: 600; color: #fff; margin-bottom: 0.3rem; }
.embed-full-title { font-weight: 700; color: #fff; margin-bottom: 0.3rem; font-size: 0.95rem; }
.embed-full-description { white-space: pre-wrap; word-break: break-word; margin-bottom: 0.5rem; }
.embed-full-image { display: block; max-width: 100%; border-radius: 4px; margin-top: 0.4rem; }
.embed-full-thumbnail { position: absolute; top: 0.9rem; right: 1rem; width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.embed-full-footer { font-size: 0.75rem; color: #949BA4; margin-top: 0.5rem; }
#embed-preview-empty { margin: 0; }

/* ---------- Bannière de bienvenue (image) ---------- */

.banner-upload { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.welcome-card {
  position: relative;
  height: 210px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.12), transparent 60%),
    linear-gradient(180deg, #151517, #0B0B0C);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
}
.welcome-card-overlay { position: absolute; inset: 0; background: rgba(8, 8, 9, 0.45); }
.welcome-card-avatar {
  position: relative;
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--surface-3);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15);
}
.welcome-card-title { position: relative; font-weight: 600; font-size: 1.02rem; color: white; text-align: center; padding: 0 1rem; letter-spacing: -0.01em; }
.welcome-card-subtitle { position: relative; font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); text-align: center; }

.leave-card {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(248, 113, 113, 0.12), transparent 60%),
    linear-gradient(180deg, #151517, #0B0B0C);
  background-size: cover;
  background-position: center;
}
.leave-card .welcome-card-avatar { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15); }

.section-divider { border: none; border-top: 1px solid var(--border-soft); margin: 2.2rem 0; }

.preview-block { margin-top: 1.1rem; }
.preview-sticky { position: sticky; top: 72px; }

.role-menu-card { padding: 0.85rem 0.95rem; margin-bottom: 0.7rem; background: var(--bg-elev); }
.role-menu-card > .field-row { background: none; border: none; padding: 0; }
.role-menu-card .chip-list, .role-menu-card .inline-add, .role-menu-card .banner-upload { margin-top: 0.65rem; margin-bottom: 0; }
.role-menu-card .role-menu-empty { margin-top: 0.5rem; }

.bot-profile { margin-bottom: 1.3rem; }
.bot-profile .bot-identity { margin-bottom: 0; }

.section .stats-grid { margin-bottom: 0; }
.section .chart-card { background: none; border: none; padding: 0; margin: 0; }
.section .chart-card + .chart-card { margin-top: 1.3rem; padding-top: 1.2rem; border-top: 1px solid var(--border-soft); }
.section .table-card { margin-bottom: 0; }

/* ---------- Sélecteur d'emoji ---------- */

.emoji-picker { position: relative; }

.emoji-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.emoji-picker-trigger:hover { border-color: var(--border-strong); }
.emoji-picker-trigger.open { border-color: #4A4A52; box-shadow: var(--shadow-glow); }

.emoji-picker-trigger-preview { display: flex; align-items: center; gap: 0.5rem; color: var(--text-faint); }
.emoji-picker-trigger-preview.filled { color: var(--text); }
.emoji-picker-trigger-preview img { width: 20px; height: 20px; object-fit: contain; }
.emoji-picker-trigger-preview .emoji-char { font-size: 1.05rem; line-height: 1; }
.emoji-picker-trigger-caret { color: var(--text-faint); font-size: 0.7rem; }

.emoji-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  width: 320px;
  max-width: 90vw;
  background: rgba(17, 17, 19, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem;
  animation: popIn 0.15s var(--ease);
}

.emoji-picker-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.55rem;
}
.emoji-picker-search:focus { border-color: var(--border-strong); outline: none; }

.emoji-picker-body { max-height: 260px; overflow-y: auto; }
.emoji-picker-section + .emoji-picker-section { margin-top: 0.7rem; }
.emoji-picker-heading {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.emoji-picker-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-option {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.1s var(--ease);
}
.emoji-option:hover { background: var(--surface-3); }
.emoji-option img { width: 22px; height: 22px; object-fit: contain; }
.emoji-option[hidden] { display: none; }

.emoji-picker-empty { color: var(--text-faint); font-size: 0.8rem; text-align: center; padding: 1rem 0; margin: 0; }

/* ---------- Statistiques ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1.25rem;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: var(--surface);
  padding: 1rem 1.1rem 1.05rem;
  transition: background 0.15s var(--ease);
}
.stat-card:hover { background: var(--surface-2); }
.stat-icon { display: inline-flex; color: var(--text-faint); margin-bottom: 0.3rem; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-label { color: var(--text-muted); font-size: 0.76rem; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.chart-wrap { position: relative; height: 240px; margin-top: 0.8rem; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

.top-members-list {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.top-members-list > .field-hint { padding: 0.9rem 1rem; margin: 0; }
.top-member-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  transition: background 0.12s var(--ease);
}
.top-member-row + .top-member-row { border-top: 1px solid var(--border-soft); }
.top-member-row:hover { background: var(--surface-2); }
.top-member-rank { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); width: 1.4rem; flex-shrink: 0; text-align: center; }
.top-member-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.top-member-name { flex: 1; font-size: 0.86rem; font-weight: 500; }
.top-member-count { color: var(--text-muted); font-size: 0.78rem; font-family: var(--font-mono); }

/* ---------- Notifications YouTube / Twitch ---------- */

.alerts-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.5rem; }

.alert-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  animation: fadeInUp 0.2s var(--ease);
  transition: border-color 0.15s var(--ease);
}
.alert-card:hover { border-color: var(--border); }

.alert-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }

.alert-platform-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.alert-platform-youtube { background: rgba(255, 60, 60, 0.08); border-color: rgba(255, 60, 60, 0.25); color: #FF8A8A; }
.alert-platform-twitch { background: rgba(145, 71, 255, 0.08); border-color: rgba(145, 71, 255, 0.3); color: #C4A8FF; }

.alert-target { font-weight: 500; font-size: 0.88rem; }
.alert-arrow { color: var(--text-faint); }
.alert-channel { color: var(--text-muted); font-size: 0.85rem; }
.alert-card-head .btn-icon { margin-left: auto; }

.alert-message { width: 100%; margin-bottom: 0.6rem; font-family: var(--font-mono); font-size: 0.8rem; }

/* ---------- Apparence du bot ---------- */

.bot-banner-preview {
  height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(74, 222, 128, 0.14), transparent 60%),
    linear-gradient(180deg, #18181B, #111113);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-soft);
  border-bottom: none;
}

.bot-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0.9rem 1.1rem;
  margin-top: -1px;
  margin-bottom: 1.6rem;
}

.bot-avatar-preview { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); margin-top: -28px; }
.bot-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600; font-size: 1.3rem; text-transform: uppercase;
}
.bot-identity-name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }

/* ---------- Chips ---------- */

.chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.3rem 0.22rem 0.6rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: border-color 0.15s var(--ease);
  animation: popIn 0.15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); }
.chip-remove {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 0.95rem;
  padding: 0 0.25rem; border-radius: 4px; line-height: 1.2;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.chip-remove:hover { color: var(--danger); background: var(--danger-soft); }

.inline-add { display: flex; gap: 0.5rem; align-items: center; }
.inline-add input { flex: 1; }

/* ---------- Cartes à collectionner ---------- */

.chip-star { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 0.95rem; padding: 0 0.1rem; line-height: 1; }
.chip-star:hover { color: var(--gold-2); }

.chip-thumb { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

.chip-edit { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 0 0.2rem; font-size: 0.82rem; }
.chip-edit:hover { color: var(--text); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.7rem; margin-bottom: 0.8rem; }

.card-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s var(--ease);
  animation: popIn 0.15s var(--ease);
}
.card-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-tile-image {
  width: 100%;
  aspect-ratio: 5 / 7;
  border-radius: 6px;
  background-color: var(--surface-3);
  background-size: cover;
  background-position: center;
  margin-bottom: 0.3rem;
}
.card-tile-name { font-weight: 500; font-size: 0.82rem; line-height: 1.25; }
.card-tile-rarity { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.card-tile-meta { color: var(--text-muted); font-size: 0.72rem; }
.card-tile-actions { display: flex; align-items: center; gap: 0.2rem; }
.card-tile-actions .card-shop-toggle { flex: 1; }

/* ---------- Capacités ---------- */

.move-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
}
.move-check-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; cursor: pointer; }
.move-check-item input { width: auto; accent-color: var(--accent-3); }
.move-check-item em { color: var(--text-faint); font-style: normal; font-size: 0.76rem; }

.move-power-legend { margin: 0 0 0.9rem; padding-left: 1.1rem; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.move-power-legend li { margin-bottom: 0.15rem; }
.move-power-legend strong { color: var(--text); font-weight: 500; }

/* Ligne d'ajout d'une capacité : passe sur plusieurs lignes plutôt que d'écraser le champ nom.
   Les sélecteurs répètent la classe parente pour l'emporter sur ".inline-add input { flex: 1; }". */
.move-add-row { flex-wrap: wrap; }
.move-add-row input.move-add-name { flex: 1 1 200px; min-width: 160px; }
.move-add-row select.move-add-kind { flex: 1 1 200px; min-width: 180px; }
.move-add-row input.move-add-number { flex: 0 1 110px; min-width: 90px; }

/* ---------- Modale ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--inset-hairline);
  animation: popIn 0.18s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
}
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-faint); font-size: 1.25rem; cursor: pointer; line-height: 1; padding: 0.2rem 0.4rem; border-radius: var(--radius-sm); }
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: 1.15rem; display: flex; flex-direction: column; gap: 0.9rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.85rem 1.15rem; border-top: 1px solid var(--border-soft); background: var(--bg-elev); border-radius: 0 0 14px 14px; }

.rarity-weights-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.rarity-weight-row {
  display: grid;
  grid-template-columns: 110px 90px 70px;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
}
.rarity-weight-label { font-weight: 600; font-size: 0.82rem; }
.rarity-weight-input { padding: 0.35rem 0.55rem; }
.rarity-weight-pct { color: var(--text-muted); font-size: 0.78rem; font-family: var(--font-mono); text-align: right; }

/* ---------- Tables ---------- */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table th {
  text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint); padding: 0.7rem 1rem; font-weight: 600; background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft);
}
.cmd-table td { padding: 0.7rem 1rem; border-top: 1px solid var(--border-soft); font-size: 0.85rem; }
.cmd-table tr:first-child td { border-top: none; }
.cmd-table tbody tr { transition: background 0.12s var(--ease); }
.cmd-table tr:hover td { background: var(--surface-2); }
.cmd-table td:last-child { width: 40px; text-align: right; }
.cmd-table .empty-row td { color: var(--text-faint); text-align: center; padding: 1.4rem 1rem; }
.cmd-table .empty-row:hover td { background: transparent; }
.emoji-cell-img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }

.new-cmd-form { display: flex; gap: 0.5rem; }
.new-cmd-form input:first-child { flex: 0 0 160px; }
.new-cmd-form input:last-of-type { flex: 1; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(22, 22, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1rem 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 1100;
}
.toast::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex-shrink: 0;
}
.toast.show { opacity: 1; animation: toastIn 0.25s var(--ease); transform: translate(-50%, 0); }
.toast.toast-error::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- Ligue de dresseurs ---------- */

.league-trainers-list { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 0.8rem; }

.league-trainer-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  animation: fadeInUp 0.2s var(--ease);
}

.league-trainer-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.league-trainer-position { font-family: var(--font-mono); font-weight: 500; color: var(--text-faint); font-size: 0.85rem; min-width: 1.6rem; }
.league-trainer-portrait {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3);
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px var(--border);
}
.league-trainer-info { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 220px; }
.league-trainer-name {
  font-weight: 500; font-size: 0.92rem; background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 0.2rem 0.4rem; transition: border-color 0.15s var(--ease);
}
.league-trainer-name:hover, .league-trainer-name:focus { border-color: var(--border); }
.league-trainer-reward-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.league-trainer-reward-row select { max-width: 220px; }
.league-trainer-actions { display: flex; align-items: center; gap: 0.3rem; margin-left: auto; }
.league-trainer-team { border-top: 1px dashed var(--border); padding-top: 0.7rem; }
.league-trainer-cards-list:empty::after { content: "Aucune carte dans l'équipe de ce dresseur."; color: var(--text-faint); font-size: 0.8rem; }
.league-trainer-cards-list { margin-bottom: 0.6rem; }

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

.btn-gold { color: var(--gold-2); border-color: var(--gold-line); background: linear-gradient(180deg, #17150F, #121110); }
.btn-gold:hover { color: #fff; border-color: rgba(230, 196, 111, 0.5); background: linear-gradient(180deg, #1D1A12, #151310); }
.btn-gold .icon { color: var(--gold); }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1.4rem;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.kpi { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.95rem 1.1rem 1rem; background: var(--surface); min-width: 0; }
.kpi-label { font-size: 0.74rem; color: var(--text-muted); }
.kpi-value { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-total { color: var(--text-faint); font-weight: 500; }
.kpi-mono { font-family: var(--font-mono); font-size: 1.2rem; }
.kpi-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi-bar { display: block; height: 3px; margin-top: 0.3rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.kpi-bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.5s var(--ease); }

.ov-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.segmented-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.32rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.segmented-item:hover { color: var(--text); }
.segmented-item.active { background: var(--surface-3); border-color: var(--border); color: var(--text); box-shadow: var(--inset-hairline), var(--shadow-sm); }
.segmented-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.segmented-item.active .segmented-count { color: var(--text-muted); }

.ov-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
  color: var(--text-faint);
}
.ov-search .icon { position: absolute; left: 0.7rem; pointer-events: none; }
.ov-search input {
  width: 100%;
  height: 34px;
  padding: 0 0.75rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
}
.ov-search input::placeholder { color: var(--text-faint); }
.ov-search input:focus { outline: none; border-color: var(--border-strong); box-shadow: var(--shadow-glow); }
.ov-search input::-webkit-search-cancel-button { filter: invert(0.6); }

.ov-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  min-height: 520px;
}

.ov-list { border-right: 1px solid var(--border-soft); padding: 0.4rem 0 0.8rem; background: var(--bg-elev); }
.ov-group + .ov-group { margin-top: 0.35rem; }
.ov-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.1rem 0.4rem;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
}
.ov-group-count { font-family: var(--font-mono); letter-spacing: 0; font-weight: 500; }

.ov-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0.45rem;
  padding: 0.45rem 0.55rem 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.ov-row:hover { background: var(--surface-2); color: var(--text); }
.ov-row:focus-visible { outline: 2px solid rgba(74, 222, 128, 0.5); outline-offset: -2px; }
.ov-row.selected { background: var(--accent-soft); border-color: rgba(74, 222, 128, 0.2); color: var(--text); }
.ov-row-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border-strong); transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.ov-row.is-on .ov-row-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.ov-row-icon { display: inline-flex; color: var(--text-faint); }
.ov-row.selected .ov-row-icon, .ov-row:hover .ov-row-icon { color: var(--text-muted); }
.ov-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 450; }
.ov-row.is-on .ov-row-name { color: var(--text); }
.ov-row-premium { display: inline-flex; color: var(--gold); opacity: 0.8; }
.ov-row-switch { display: inline-flex; cursor: pointer; }
.ov-empty { color: var(--text-faint); font-size: 0.82rem; text-align: center; padding: 2rem 1rem; margin: 0; }

.ov-detail { padding: 1.5rem 1.6rem; min-width: 0; }
.ov-detail-item { animation: fadeInUp 0.25s var(--ease); }
.ov-detail-head { display: flex; align-items: center; gap: 0.85rem; }
.ov-detail-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--inset-hairline);
}
.ov-detail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ov-detail-title h3 { font-size: 1.25rem; }
.ov-detail-switch { display: inline-flex; cursor: pointer; }
.ov-detail-meta { display: flex; align-items: center; gap: 0.5rem; margin: 0.95rem 0 1.3rem; }
.state-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 500;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.state-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.state-pill.is-on { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(74, 222, 128, 0.25); }
.state-pill.is-on::before { background: var(--accent); }

.ov-detail-body { padding: 1.1rem 0 0; border-top: 1px solid var(--border-soft); }
.ov-detail-text { margin: 0; font-size: 0.92rem; line-height: 1.65; color: var(--text); }
.ov-detail-text code { font-size: 0.8em; }
.ov-detail-hint { margin: 0.8rem 0 0; font-size: 0.8rem; color: var(--text-faint); line-height: 1.55; }

.ov-locked {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 1.2rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--gold-2);
  border: 1px solid var(--gold-line);
  background: linear-gradient(90deg, rgba(230, 196, 111, 0.09), rgba(230, 196, 111, 0.02));
  transition: border-color 0.15s var(--ease);
}
.ov-locked:hover { border-color: rgba(230, 196, 111, 0.5); }
.ov-locked-icon { display: inline-flex; color: var(--gold); }
.ov-locked-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 500; white-space: nowrap; }

.ov-detail-actions { margin-top: 1.5rem; display: flex; gap: 0.5rem; }

/* ---------- Barre latérale : pastilles d'état et compteurs ---------- */

.nav-group-label { display: flex; align-items: center; justify-content: space-between; }
.nav-group-count, .nav-count { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0; font-weight: 500; color: var(--text-faint); }
.nav-count { margin-left: auto; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border-strong); transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.nav-dot.is-on { background: var(--accent); border-color: var(--accent); }
.breadcrumb-group { color: var(--text-faint); white-space: nowrap; }

/* ---------- Coque des pages hors configuration (joueurs, premium, crédits) ---------- */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-soft);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.site-bar-inner { max-width: 1200px; margin: 0 auto; height: 52px; padding: 0 1.5rem; display: flex; align-items: center; gap: 0.6rem; }
.site-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; letter-spacing: -0.01em; }
.site-brand .logo-mark { color: var(--accent); }
.site-bar-sep { color: var(--border-strong); }
.site-bar-section { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

.game-nav {
  display: flex;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 2.2rem;
  padding: 3px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.game-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.game-nav-item .icon { color: var(--text-faint); transition: color 0.12s var(--ease); }
.game-nav-item:hover { color: var(--text); background: var(--surface-2); }
.game-nav-item.active { color: var(--text); background: var(--surface-3); border-color: var(--border); box-shadow: var(--inset-hairline), var(--shadow-sm); }
.game-nav-item.active .icon { color: var(--accent); }
.game-nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.66rem;
  color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold-line);
}

.page-head { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 2rem; width: 100%; }
.page-head-center { align-items: center; text-align: center; }
.page-head h1 { font-size: 1.9rem; letter-spacing: -0.025em; line-height: 1.15; }
.page-head-sub { margin: 0; max-width: 62ch; color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.page-head-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.page-head-center .page-head-extra { justify-content: center; }

.invalid-link { max-width: 460px; width: 100%; margin: 5rem auto 0; }
.invalid-link-title { margin: 0; color: var(--text); font-weight: 600; }

/* Conteneur standard des pages simples (premium, crédits, administration) */
.page-shell { max-width: 960px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.page-shell-narrow { max-width: 720px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--inset-hairline);
}
.card-pad { padding: 1.25rem 1.35rem; }
.callout {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.callout .icon { margin-top: 2px; }
.callout strong { color: var(--text); font-weight: 600; }
.callout-success { border-color: rgba(74, 222, 128, 0.3); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.callout-success .icon { color: var(--accent); }
.callout-warning { border-color: rgba(251, 191, 36, 0.3); background: linear-gradient(90deg, var(--warning-soft), transparent); }
.callout-warning .icon { color: var(--warning); }


.site-bar-user { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }

/* ---------- Page Premium (offre d'un serveur) ---------- */

.premium-guild {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.7rem 0.25rem 0.3rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 0.82rem; font-weight: 500;
}
.premium-guild img, .premium-guild-fallback { width: 22px; height: 22px; border-radius: 50%; }
.premium-guild-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-size: 0.7rem; }
.premium-notice { margin-bottom: 1.25rem; }

.premium-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.premium-feature-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; }
.premium-feature-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0; font-size: 0.9rem; }
.premium-feature-list li + li { border-top: 1px solid var(--border-soft); }
.premium-feature-check {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  color: var(--accent); background: var(--accent-soft);
}

.premium-plan {
  position: relative;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, #17150F, #111110) padding-box,
    linear-gradient(150deg, rgba(246, 226, 168, 0.6), rgba(184, 145, 62, 0.12) 45%, rgba(230, 196, 111, 0.4)) border-box;
  box-shadow: 0 24px 60px -30px rgba(230, 196, 111, 0.35);
  overflow: hidden;
}
.premium-plan::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(246, 226, 168, 0.06) 50%, transparent 65%);
  background-size: 200% 100%;
  animation: sheen 7s linear infinite;
  pointer-events: none;
}
.premium-plan > * { position: relative; z-index: 1; }
.premium-plan-head { display: flex; align-items: center; gap: 0.8rem; }
.premium-plan-icon { width: 38px; height: 38px; border-radius: 10px; }
.premium-plan-title {
  font-size: 1.5rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.premium-plan-text { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }
.premium-price { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin: 2px 0 0; }
.premium-plan .state-pill { align-self: flex-start; }
.premium-plan #action-feedback:empty { display: none; }

/* ---------- Administration premium ---------- */

.admin-callout { margin-bottom: 1rem; }
.admin-block { margin-bottom: 1rem; overflow: hidden; }
.admin-block-head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.admin-block-head > div { flex: 1; min-width: 200px; }
.admin-block-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold-line);
}
.admin-block-title { font-size: 0.95rem; }
.admin-block-hint { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-faint); }
.admin-search { width: 240px; }
.admin-block-footer { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 0.75rem 1.15rem; border-top: 1px solid var(--border-soft); background: var(--bg-elev); }
.admin-block-footer .field-hint { margin: 0 auto 0 0; }

.premium-groups { display: flex; flex-direction: column; }
.premium-group { display: flex; align-items: flex-start; gap: 0.9rem; padding: 0.95rem 1.15rem; cursor: pointer; transition: background 0.12s var(--ease); }
.premium-group + .premium-group { border-top: 1px solid var(--border-soft); }
.premium-group:hover { background: var(--surface-2); }
.premium-group .switch { margin-top: 2px; }
.premium-group-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.premium-group-text strong { font-size: 0.88rem; font-weight: 600; }
.premium-group-desc { font-size: 0.8rem; color: var(--text-muted); }
.premium-group-modules { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }

.sub-list { display: flex; flex-direction: column; }
.sub-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.15rem; transition: background 0.12s var(--ease); }
.sub-row + .sub-row { border-top: 1px solid var(--border-soft); }
.sub-row:hover { background: var(--surface-2); }
.sub-row-icon { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.sub-row-icon-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-size: 0.8rem; font-weight: 600; }
.sub-row-name { flex: 1; min-width: 0; font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-row-actions { display: flex; gap: 0.4rem; }
.sub-empty { padding: 1rem 1.15rem; margin: 0; }
.state-pill.is-warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.3); }
.state-pill.is-warning::before { background: var(--warning); }

/* ---------- Activité du bot (journal) ---------- */

.log-cat-moderation { --log-color: #F87171; }
.log-cat-messages { --log-color: #FBBF24; }
.log-cat-roles { --log-color: #C084FC; }
.log-cat-channels { --log-color: #60A5FA; }
.log-cat-server { --log-color: #E6C46F; }
.log-cat-publish { --log-color: #4ADE80; }

.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--log-color, var(--text-faint)); flex-shrink: 0; }
#activity-filters { flex-wrap: wrap; }

.log-card { overflow: hidden; }
.log-list { display: flex; flex-direction: column; }
.log-day {
  padding: 0.55rem 1.15rem;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft);
}
.log-day:not(:first-child) { border-top: 1px solid var(--border-soft); }
.log-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.75rem 1.15rem;
  transition: background 0.12s var(--ease);
}
.log-item + .log-item { border-top: 1px solid var(--border-soft); }
.log-item:hover { background: var(--surface-2); }
.log-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--log-color);
  background: color-mix(in srgb, var(--log-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--log-color) 28%, transparent);
}
.log-main { flex: 1; min-width: 0; }
.log-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.86rem; }
.log-title strong { font-weight: 600; }
.log-target { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.78rem; }
.log-meta { margin-top: 0.15rem; font-size: 0.76rem; color: var(--text-faint); overflow-wrap: anywhere; }
.log-time { flex-shrink: 0; font-size: 0.74rem; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-footer { display: flex; justify-content: center; padding: 0.75rem; border-top: 1px solid var(--border-soft); }
.log-empty { padding: 3rem 1.5rem; text-align: center; }
.log-empty .empty-state-icon { margin-bottom: 0.9rem; }
.log-empty-title { margin: 0; font-weight: 600; }
.log-empty-inline { margin: 0; padding: 1rem 1.15rem; font-size: 0.82rem; color: var(--text-faint); }

.ov-recent { margin-top: 1rem; overflow: hidden; }
.ov-recent-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.8rem 0.7rem 1.15rem; border-bottom: 1px solid var(--border-soft); }
.ov-recent-head .panel-about-label { margin: 0; }
.log-list-compact .log-item { padding: 0.6rem 1.15rem; }

/* ---------- Sécurité : anti-nuke (liste + détail), liste blanche ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.nuke-callout { margin-bottom: 1rem; }

.nuke-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.nuke-list { border-right: 1px solid var(--border-soft); padding: 0.3rem 0 0.7rem; background: var(--bg-elev); }
.nuke-group + .nuke-group { margin-top: 0.25rem; }
.nuke-row {
  display: flex; align-items: center; gap: 0.65rem;
  margin: 0 0.45rem;
  padding: 0.42rem 0.55rem 0.42rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.nuke-row:hover { background: var(--surface-2); color: var(--text); }
.nuke-row:focus-visible { outline: 2px solid rgba(74, 222, 128, 0.5); outline-offset: -2px; }
.nuke-row.selected { background: var(--accent-soft); border-color: rgba(74, 222, 128, 0.2); color: var(--text); }
.nuke-row.is-on .ov-row-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.nuke-row.is-on .nuke-row-name { color: var(--text); }
.nuke-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nuke-detail { padding: 1.4rem 1.5rem 1.2rem; min-width: 0; }
.nuke-detail-item { animation: fadeInUp 0.22s var(--ease); }
.nuke-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.nuke-detail-head h3 { font-size: 1.25rem; margin-top: 0.2rem; }
.nuke-summary { margin: 1.1rem 0 0.4rem; padding: 0 0 1.1rem; border-bottom: 1px solid var(--border-soft); }
.nuke-sentence { margin: 0; font-size: 0.95rem; line-height: 1.65; color: var(--text-muted); }
.nuke-sentence strong { color: var(--text); font-weight: 600; }
.nuke-sentence .nuke-response { color: var(--danger); }

.nuke-step { padding: 1rem 0; }
.nuke-step + .nuke-step { border-top: 1px solid var(--border-soft); }
.nuke-step-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.nuke-step-head strong { display: block; font-size: 0.9rem; }
.nuke-step-head span:not(.step-num) { display: block; font-size: 0.76rem; color: var(--text-faint); margin-top: 0.1rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
  border: 1px solid var(--border-strong); background: var(--bg);
}
.nuke-step-body { margin: 0.9rem 0 0 calc(22px + 0.7rem); }
.nuke-step-body > .field:last-child { margin-bottom: 0; }
.nuke-detection { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.nuke-detection .field { margin-bottom: 0; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.stepper-btn {
  width: 34px; height: 36px; border: none; background: transparent; color: var(--text-muted);
  font-size: 1rem; cursor: pointer; transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.stepper-btn:hover { background: var(--surface-3); color: var(--text); }
.stepper input[type="number"] {
  width: 52px; min-height: 36px; padding: 0; border: none; border-radius: 0; text-align: center;
  background: transparent; box-shadow: none; -moz-appearance: textfield;
  border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft);
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-suffix { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.input-suffix input[type="number"] { width: 70px; border: none; border-radius: 0; background: transparent; box-shadow: none; }
.input-suffix span { padding: 0 0.75rem; font-size: 0.78rem; color: var(--text-faint); border-left: 1px solid var(--border-soft); align-self: stretch; display: flex; align-items: center; }

.whitelist-card .inline-add { margin-top: 0.75rem; }
.whitelist-card .chip-list:empty { margin-bottom: 0; }

/* ---------- Panneau admin du propriétaire (/admin) ---------- */

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.admin-shell { max-width: 1180px; }
.admin-identity { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 0.4rem; }
.admin-identity-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.admin-identity-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-size: 0.75rem; font-weight: 600; }
.admin-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.admin-avatar-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); font-size: 1.5rem; }
.admin-avatar-controls { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-avatar-controls .admin-actions { margin-top: 0; }
.admin-identity-name { font-weight: 500; font-size: 0.88rem; }

.admin-tabs { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.admin-tab .icon { opacity: 0.75; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--inset-hairline), var(--shadow-sm);
}
.admin-tab.active .icon { opacity: 1; color: var(--accent); }
.admin-tab.active .subtab-count { color: var(--text-muted); }

.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeInUp 0.25s var(--ease); }

.kpi-sub { font-size: 0.74rem; color: var(--text-faint); }
.admin-status { color: var(--danger); }
.admin-status.is-on { color: var(--accent); }
.state-pill.is-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.3); }
.state-pill.is-danger::before { background: var(--danger); }

.admin-card { overflow: hidden; }
.admin-card + .admin-card { margin-top: 1rem; }
.admin-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0.8rem 0.7rem 1.15rem;
  border-bottom: 1px solid var(--border-soft);
}
.admin-card-head-flat { padding: 0 0 1rem; border-bottom: none; }
.admin-card-title { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-size: 0.9rem; font-weight: 600; }
.admin-card-title .icon { color: var(--text-muted); }
.admin-card-title-spaced { margin-bottom: 1.1rem; }
.admin-card-title .section-num { margin: 0; }
.admin-muted-num { flex-shrink: 0; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.admin-mono { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); }
.admin-hint { margin: -0.4rem 0 0; min-height: 1em; }
.admin-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.2rem; }
.admin-actions-inline { display: flex; gap: 0.5rem; }
.admin-stack { display: flex; flex-direction: column; gap: 1rem; }
.admin-stack .admin-card + .admin-card { margin-top: 0; }

.admin-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.admin-overview-grid > .admin-card + .admin-card { margin-top: 0; }

.admin-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.admin-shortcut {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  color: var(--text);
  font: 500 0.86rem var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.admin-shortcut:hover { border-color: var(--border-strong); background: var(--surface-2); }
.admin-shortcut-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 128, 0.22);
}
.admin-shortcut-gold .admin-shortcut-icon { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }

/* Serveurs */
.admin-toolbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-search-wide { flex: 1; min-width: 220px; }
.admin-search-wide input { width: 100%; }
.admin-server-row { padding: 0.75rem 1rem 0.75rem 1.15rem; }
.admin-server-row .sub-row-icon { width: 36px; height: 36px; border-radius: 10px; }
.admin-server-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.admin-server-name { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-server-name .premium-badge { margin-left: 0.35rem; }
.admin-server-meta { font-size: 0.76rem; color: var(--text-faint); }
.admin-server-row .sub-row-actions { opacity: 0.85; transition: opacity 0.12s var(--ease); }
.admin-server-row:hover .sub-row-actions { opacity: 1; }

.admin-modal { max-width: 520px; }
.admin-detail-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
}
.admin-detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.admin-detail-row > span { color: var(--text-muted); flex-shrink: 0; }
.admin-detail-row strong { font-weight: 500; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.admin-detail-sub { font-size: 0.74rem; font-weight: 400; color: var(--text-faint); }
.admin-footer-left { margin-right: auto; }

/* Messages */
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.admin-form .admin-card + .admin-card { margin-top: 1rem; }
.admin-check { display: flex; align-items: center; gap: 0.55rem; font-size: 0.84rem; color: var(--text-muted); cursor: pointer; }
.admin-check input { accent-color: var(--accent); }
input[type="color"]#msg-embed-color { width: 100%; height: 38px; padding: 3px; cursor: pointer; }

.discord-message { display: flex; gap: 0.8rem; padding: 1rem; background: #313338; border-radius: var(--radius-lg); border: 1px solid var(--border-soft); }
.discord-message-avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--surface-3); overflow: hidden; }
.discord-message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.discord-message-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.discord-message-author { font-weight: 600; font-size: 0.88rem; color: #F2F3F5; display: flex; align-items: center; gap: 0.35rem; }
.discord-bot-tag { font-size: 0.6rem; font-weight: 600; padding: 0.05rem 0.3rem; border-radius: 3px; background: #5865F2; color: #fff; }
.discord-message-text { font-size: 0.86rem; line-height: 1.45; color: #DBDEE1; white-space: pre-wrap; word-break: break-word; }
.discord-message code, .discord-embed-full code { font-family: var(--font-mono); font-size: 0.78rem; background: #1E1F22; padding: 0.05rem 0.25rem; border-radius: 3px; }

/* Notes de mise à jour */
.admin-notes-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 1rem; align-items: start; }
.admin-notes-list-card { position: sticky; top: 72px; }
.admin-notes-list { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }
.admin-note-item {
  display: flex; flex-direction: column; gap: 0.35rem;
  width: 100%;
  padding: 0.75rem 1.15rem;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.admin-note-item + .admin-note-item { border-top: 1px solid var(--border-soft); }
.admin-note-item:hover { background: var(--surface-2); }
.admin-note-item.active { background: var(--surface-2); border-left-color: var(--accent); }
.admin-note-item-title { font-size: 0.86rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-note-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; color: var(--text-faint); }
.admin-notes-empty { padding: 4rem 1.5rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.admin-note-textarea { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.65; min-height: 320px; resize: vertical; }
.admin-label-meta { float: right; font-weight: 400; font-size: 0.74rem; color: var(--text-faint); }
.admin-field-last { margin-bottom: 0; }
.admin-notes-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; margin-top: 1rem; }
.admin-notes-bottom .admin-card + .admin-card { margin-top: 0; }
.admin-note-preview { max-width: none; border-left-color: #5865F2; }
.admin-note-preview .embed-full-description { margin-bottom: 0; }

/* Activité */
.admin-activity-filters { margin-bottom: 1rem; flex-wrap: wrap; }
.admin-log-guild { color: var(--text-muted); font-weight: 500; }
.log-cat-security { --log-color: #FB923C; }

/* Système */
.admin-setting-row { align-items: center; gap: 1rem; padding: 0.85rem 1.15rem; }
.admin-setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.84rem; }
.admin-setting-text span { font-size: 0.76rem; color: var(--text-faint); }

@media (max-width: 1100px) {
  .admin-split, .admin-notes-layout, .admin-notes-bottom { grid-template-columns: minmax(0, 1fr); }
  .admin-notes-list-card { position: static; }
  .admin-notes-list { max-height: 260px; }
}

@media (max-width: 900px) {
  .admin-overview-grid, .admin-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .admin-server-row .sub-row-actions { width: 100%; padding-left: calc(36px + 0.75rem); }
  .admin-tabs { width: 100%; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .nuke-layout { grid-template-columns: 1fr; }
  .nuke-list { border-right: none; border-bottom: 1px solid var(--border-soft); }
  .ov-layout { grid-template-columns: 1fr; min-height: 0; }
  .ov-list { border-right: none; }
  .ov-detail { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.grid-preview { grid-template-columns: 1fr; }
  .preview-sticky { position: static; }
}

@media (max-width: 900px) {
  /* minmax(0, …) : sans ça, la rangée de navigation horizontale imposerait sa largeur à la page */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 0.75rem 1rem;
  }
  .sidebar-brand { padding: 0.1rem 0.2rem; }
  /* Sur mobile, la navigation devient une rangée horizontale déroulante : les conteneurs de
     groupe disparaissent (`display: contents`) et les boutons redeviennent des enfants flex directs. */
  .nav-search-wrap { display: none; }
  .nav-scroll { display: flex; gap: 0.25rem; overflow-x: auto; margin: 0; padding: 0; }
  .nav-group { display: contents; }
  .nav-group-label { display: none; }
  .nav-item { width: auto; flex-shrink: 0; }
  .sidebar-footer { flex-direction: row; align-items: center; border-top: none; padding-top: 0; }
  .premium-card { flex: 1; }
  .user-name { display: none; }
  .main-header { padding: 0 1rem; }
  .site-bar-inner { padding: 0 1rem; }
  .site-bar-user { display: none; }
  .log-item { flex-wrap: wrap; }
  .log-time { width: 100%; padding-left: calc(30px + 0.85rem); }
  .premium-layout { grid-template-columns: 1fr; }
  .admin-search { width: 100%; }
  .sub-row { flex-wrap: wrap; }
  .page-head h1 { font-size: 1.55rem; }
  .main { padding: 1.5rem 1rem 4rem; }
  .grid-2, .grid-2.grid-even, .grid-3 { grid-template-columns: 1fr; }
  .panel-head { flex-direction: column; gap: 1rem; }
  .ov-toolbar { flex-direction: column; align-items: stretch; }
  .ov-search { width: 100%; }
  .save-bar-kbd { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Liens vers les CGU / la politique de confidentialité en bas des pages publiques */
.legal-footer { display: flex; justify-content: center; gap: 0.6rem; padding: 1.5rem 1rem 2rem; font-size: 0.8rem; color: var(--text-faint); }
.legal-footer a, .auth-note a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.legal-footer a:hover, .auth-note a:hover { color: var(--text); }
.premium-consent { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.8rem; line-height: 1.5; color: var(--text-muted); margin: 0 0 0.8rem; cursor: pointer; }
.premium-consent input { margin-top: 0.2rem; flex-shrink: 0; }
.premium-consent a { color: var(--accent); }

/* Sélecteur de rôles (templates/_role_picker.html) : pastilles à activer d'un clic */
.role-picker {
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  background: var(--gradient-surface); box-shadow: var(--inset-hairline);
  overflow: hidden;
}
.role-picker-toolbar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border-soft);
}
.role-picker .role-picker-search-wrap {
  margin: 0; font-weight: 400;
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem;
  height: 32px; padding: 0 0.65rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border-soft); color: var(--text-faint);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  cursor: text;
}
.role-picker-search-wrap:focus-within { border-color: var(--border-strong); box-shadow: var(--shadow-glow); color: var(--text-muted); }
.role-picker-search-wrap svg { flex-shrink: 0; }
.role-picker .role-picker-search {
  flex: 1; min-width: 0; width: auto; min-height: 0; height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none;
  color: var(--text); font: inherit; font-size: 0.84rem; outline: none;
}
.role-picker-search::placeholder { color: var(--text-faint); }
.role-picker-actions { display: flex; gap: 0.1rem; flex-shrink: 0; }
.role-picker-action {
  background: none; border: 0; padding: 0.3rem 0.5rem; border-radius: var(--radius-sm);
  font: inherit; font-size: 0.78rem; color: var(--text-muted); cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.role-picker-action:hover { color: var(--text); background: var(--surface-2); }
.role-picker-action:focus-visible { outline: none; box-shadow: var(--shadow-glow); }
.role-picker-count {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0.18rem 0.55rem;
}
.role-picker-count:empty { display: none; }

.role-picker-list {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0.4rem;
  max-height: 232px; overflow-y: auto; padding: 0.7rem;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.role-picker .role-picker-item {
  --role-color: var(--text-faint);
  margin: 0; font-weight: 400;
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem; max-width: 100%;
  height: 30px; padding: 0 0.7rem 0 0.6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  font-size: 0.8rem; color: var(--text-muted); cursor: pointer; user-select: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.role-picker .role-picker-item[hidden] { display: none; }
.role-picker-item:hover { color: var(--text); border-color: var(--border-strong); }
.role-picker-item:active { transform: scale(0.97); }
/* Case native masquée visuellement mais toujours utilisable au clavier (Tab + Espace). */
.role-picker-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.role-picker-item:has(input:focus-visible) { box-shadow: var(--shadow-glow); border-color: var(--border-strong); }
.role-picker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--role-color); }
.role-picker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-picker-check { display: none; color: var(--accent); margin-left: -0.1rem; }
.role-picker-check svg { display: block; }
.role-picker-item:has(input:checked) { color: var(--text); background: var(--accent-soft); border-color: rgba(74, 222, 128, 0.35); }
.role-picker-item:has(input:checked) .role-picker-check { display: inline-flex; }
.role-picker-item.is-managed { opacity: 0.4; cursor: not-allowed; }
.role-picker-item.is-in-menu { cursor: default; border-style: dashed; background: transparent; color: var(--text-faint); }
.role-picker-item.is-managed:active, .role-picker-item.is-in-menu:active { transform: none; }
.role-picker-nomatch { width: 100%; margin: 0.3rem 0.2rem; font-size: 0.8rem; color: var(--text-faint); }
.role-menu-card .role-picker { margin-top: 0.75rem; }
.role-menu-card .role-menu-add-role { margin-top: 0.6rem; }
.role-menu-card .role-menu-add-role:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) {
  .role-picker-toolbar { flex-wrap: wrap; }
  .role-picker .role-picker-search-wrap { flex-basis: 100%; }
}

/* Description du message d'un menu de rôles à réaction */
.role-menu-card .role-menu-desc { margin-top: 0.7rem; }
.role-menu-card .role-menu-desc-input { min-height: 64px; font-size: 0.84rem; }
.role-menu-desc-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.4rem; }
.role-menu-desc-foot .field-hint { margin: 0; }
.role-menu-desc-foot .role-menu-desc-save { flex-shrink: 0; }
.role-menu-desc-foot .role-menu-desc-save:disabled { opacity: 0.45; cursor: default; }
