/* ============================================================
   WEYZ Dashboard — design system "Mono"
   Simple, efficace, moderne : même palette strictement noir & blanc,
   mais typographie nette (plus de police graffiti), aplats francs
   (plus de dégradés/texture/filigrane) et surfaces plates façon
   dashboard SaaS. Le rouge/vert/orange restent réservés aux seuls
   statuts fonctionnels (erreur/succès/attention).
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* Surfaces */
  --bg: #060606;
  --bg-elevated: #101010;
  --surface: #181818;
  --surface-hover: #212121;
  --surface-2: #262626;
  --border: #2f2f2f;
  --border-soft: #1c1c1c;

  /* Texte */
  --text: #f6f6f4;
  --text-dim: #a8a7a3;
  --text-faint: #6d6c68;

  /* Accent — noir & blanc, comme le tag */
  --accent: #f6f6f4;
  --accent-strong: #ffffff;
  --accent-ink: #0a0a0a;

  /* Chrome (breloques, quincaillerie des sacs) */
  --chrome-a: #e7e7ee;
  --chrome-b: #8d8b96;

  /* Sémantique — seule touche de couleur tolérée, réservée aux statuts */
  --success: #7fbf9e;
  --warning: #d9a15a;
  --danger: #d3695f;
  --info: var(--accent);

  --radius-sm: 6px;
  --radius: 11px;
  --radius-lg: 20px;

  --shadow: 0 12px 34px rgba(0, 0, 0, 0.6);

  --font-display: "Big Shoulders Display", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#login-screen,
#app-shell,
#toast-root {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

a {
  color: var(--accent-strong);
}

button {
  font-family: var(--font-body);
}

.hidden {
  display: none !important;
}

/* ---------- Login ---------- */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  text-transform: uppercase;
}

.wordmark .dot {
  color: var(--chrome-b);
}

.login-card .wordmark {
  font-size: 32px;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-body);
}

.field-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #2a0f0c;
}

.btn-block {
  width: 100%;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(211, 105, 95, 0.12);
  border-color: rgba(211, 105, 95, 0.35);
  color: #f2b3ac;
}

.alert-success {
  background: rgba(127, 191, 158, 0.12);
  border-color: rgba(127, 191, 158, 0.35);
  color: #b7e2c6;
}

/* ---------- Shell ---------- */

#app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

#sidebar {
  position: relative;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-soft);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  margin-bottom: 2px;
}

#sidebar .wordmark {
  font-size: 22px;
}

#sidebar .tagline {
  padding: 0 8px;
  color: var(--text-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-2);
  color: var(--accent-strong);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-icon {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.nav-section-label {
  padding: 18px 12px 6px 16px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--text-faint);
}

#main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-soft);
}

#topbar h1 {
  font-size: 21px;
  font-weight: 700;
}

#user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.role-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  color: var(--accent-strong);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

#content {
  position: relative;
  padding: 28px 32px 48px;
  flex: 1;
  overflow-y: auto;
}

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-tile {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
}

.stat-tile-clickable {
  appearance: none;
  display: block;
  cursor: pointer;
  text-align: left;
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease;
}
.stat-tile-clickable:hover {
  border-color: var(--accent);
}

.stat-tile .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.stat-tile .value {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pill-live {
  background: rgba(127, 191, 158, 0.14);
  color: var(--success);
}
.pill-live .pill-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(127, 191, 158, 0.2);
}

.pill-off {
  background: rgba(114, 108, 122, 0.16);
  color: var(--text-faint);
}
.pill-off .pill-dot {
  background: var(--text-faint);
}

.pill-warning {
  background: rgba(217, 161, 90, 0.16);
  color: var(--warning);
}

/* ---------- Sous-onglets (idée audit 2026-08-28) ----------
   Bascule entre plusieurs vues au sein d'une même page (ex: page Modération
   → "Avertissements" / "Auto-modération") sans changer de route ni recharger
   la page. Réutilise la même palette noir & blanc que .btn-ghost/.btn-primary
   ci-dessus plutôt qu'un nouveau jeu de couleurs. */

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.subtab-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 4px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.subtab-btn:hover {
  color: var(--text);
}

.subtab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent-strong);
}

/* ---------- Panels / cards ---------- */

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.panel .panel-desc {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-bottom: 18px;
}

/* ---------- Bascule salon / message privé ---------- */

.mode-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 20px;
  gap: 2px;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-switch-btn.active {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.mode-switch-btn:not(.active):hover {
  color: var(--text);
}

/* ---------- Message composer ---------- */

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .composer-grid {
    grid-template-columns: 1fr;
  }
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .row-3 {
    grid-template-columns: 1fr;
  }
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-row input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.preview-sticky {
  position: sticky;
  top: 20px;
}

.preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* Destinataires DM : recherche + chips */

.dm-search-results {
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}

.dm-search-results:not(:empty) {
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.dm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  font-size: 12.5px;
  color: var(--text);
}

.dm-chip .avatar {
  width: 20px;
  height: 20px;
}

.dm-chip-remove {
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}

.dm-chip-remove:hover {
  color: var(--danger);
}

.preview-dm-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.14);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* Émoji personnalisé rendu dans l'aperçu (voir renderEmojiMarkup en JS) —
   taille alignée sur le texte environnant, comme sur le vrai client Discord. */
.preview-emoji {
  width: 1.375em;
  height: 1.375em;
  vertical-align: -0.35em;
  object-fit: contain;
}

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

#emoji-picker {
  position: relative;
  margin-top: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
}

.emoji-picker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.emoji-picker-label:not(:first-child) {
  margin-top: 12px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
}

.emoji-btn-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.emoji-btn-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.emoji-btn-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ---------- Import d'image/GIF depuis le PC ---------- */

.upload-preview {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.upload-preview img {
  max-width: 100%;
  max-height: 110px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  display: block;
}

.upload-preview .dm-chip-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-ink);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 13px;
  padding: 0;
}

/* Mimique la carte d'embed Discord (thème sombre officiel — volontairement
   indépendant de la DA WEYZ : l'aperçu doit ressembler à Discord, pas à nous). */
.discord-mock {
  background: #313338;
  border-radius: var(--radius);
  padding: 16px;
  font-family: "gg sans", var(--font-body);
}

.discord-mock .discord-role-mention {
  display: inline-block;
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.embed-card {
  border-left: 4px solid var(--embed-color, var(--accent));
  background: #2b2d31;
  border-radius: 4px;
  padding: 12px 14px;
  max-width: 100%;
}

.embed-card .embed-title {
  color: #f2f3f5;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.embed-card .embed-desc {
  color: #dbdee1;
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin-bottom: 8px;
}

.embed-card .embed-image {
  width: 100%;
  border-radius: 4px;
  margin-top: 8px;
  display: block;
}

.embed-card .embed-thumb {
  float: right;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  margin-left: 12px;
}

.embed-card .embed-footer {
  color: #949ba4;
  font-size: 11.5px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.embed-empty {
  color: #6c7076;
  font-size: 13px;
  font-style: italic;
}

/* ---------- Hub des modules (cogs) ---------- */

.cogs-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.cogs-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

.cog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
}

.cog-row .pill {
  flex-shrink: 0;
}

.cog-label {
  color: var(--text-dim);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}

tr:last-child td {
  border-bottom: none;
}

td.mono,
.mono {
  font-family: var(--font-mono);
}

/* ---------- Système (idée 2026-08-29) : console de logs ---------- */

.log-console {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-height: 420px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

/* (idée 2026-08-29, demande Lucas) : logs "plus jolis" — une ligne par
   entrée (heure courte à gauche, message à droite) au lieu du bloc de texte
   brut d'avant, colorée selon le niveau détecté (voir parseLogLine() dans
   js/pages/system.js). */
.log-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 1px 0;
}

.log-time {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-level-error .log-msg {
  color: var(--danger);
}

.log-level-warning .log-msg {
  color: var(--warning);
}

.log-level-debug .log-msg {
  color: var(--text-faint);
}

.log-level-system .log-msg {
  color: var(--text-faint);
  font-style: italic;
}

.log-level-info .log-msg {
  color: var(--text-dim);
}

/* ---------- Gifs (idée 2026-08-29, demande Lucas) ----------
   Réutilisé tel quel par js/pages/images.js (page "Images", même structure
   de grille de vignettes) — pas de classes .images-grid/.image-card
   dupliquées, .gifs-grid/.gif-card conviennent déjà telles quelles. */

.gifs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.gif-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gif-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.gif-card-name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gif-card-meta {
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- Members ---------- */

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.member-row:hover {
  background: var(--surface-hover);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
  flex-shrink: 0;
}

.member-name {
  font-weight: 600;
}

.member-sub {
  font-size: 12px;
  color: var(--text-faint);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.profile-header .avatar {
  width: 64px;
  height: 64px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* ---------- Rôle Reaction ---------- */

.rp-panel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.rp-panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rp-panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rp-panel-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.rp-panel-title {
  font-weight: 700;
  font-size: 15px;
}

.rp-panel-channel {
  font-size: 12px;
  color: var(--text-faint);
}

.rp-panel-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.rp-panel-entries {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.rp-entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 12.5px;
  color: var(--text);
}

.rp-entry-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.rp-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.rp-entry-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 32px;
  gap: 8px;
  align-items: center;
}

@media (max-width: 640px) {
  .rp-entry-row {
    grid-template-columns: 40px 1fr 32px;
  }
  .rp-entry-row .rp-label-input {
    grid-column: 1 / -1;
  }
}

.rp-emoji-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
  font-size: 17px;
  line-height: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.rp-emoji-btn:hover {
  border-color: var(--accent);
}

.rp-emoji-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.rp-entry-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.rp-entry-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- Personnalisation ---------- */

.bp-identity-preview {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.bp-banner {
  height: 100px;
  background: var(--surface-2) center/cover no-repeat;
}

.bp-avatar {
  position: absolute;
  left: 16px;
  top: 62px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid var(--bg-elevated);
  background: var(--surface-2);
  object-fit: cover;
}

.bp-username {
  padding: 46px 16px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.bp-status-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 10px 12px;
  background: #2b2d31;
  border-radius: var(--radius-sm);
  font-family: "gg sans", var(--font-body);
  font-size: 13px;
  color: #dbdee1;
}

.bp-status-preview .bp-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #23a55a;
  flex-shrink: 0;
}

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

#toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  min-width: 240px;
}

.toast-error {
  border-left-color: var(--danger);
}
.toast-success {
  border-left-color: var(--success);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.6s;
  }
}

.empty-state {
  color: var(--text-faint);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* ---------- Alerte "attention" (idée audit 2026-08-28) ----------
   Manquait à côté de .alert-error/.alert-success : sert à la page "Succès"
   pour signaler que le système est mis en pause côté bot (ACHIEVEMENTS_ENABLED
   = False dans cogs/achievements.py, décision explicite de Lucas) sans que ce
   soit une vraie erreur. Même construction que .alert-error/.alert-success
   (fond translucide + bordure de la couleur sémantique), avec --warning. */
.alert-warning {
  background: rgba(217, 161, 90, 0.12);
  border-color: rgba(217, 161, 90, 0.35);
  color: #f0c898;
}

/* ---------- Succès : paliers par catégorie (idée audit 2026-08-28) ----------
   Un badge par palier (Bronze → Diamant), avec le nombre de membres l'ayant
   débloqué — sur le modèle visuel de .stat-tile (surface plate, bordure fine)
   plutôt qu'un nouveau style de carte. */
.achv-category {
  margin-bottom: 22px;
}
.achv-category:last-child {
  margin-bottom: 0;
}

.achv-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.tier-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tier-chip {
  flex: 1 1 150px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.tier-chip .tier-chip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tier-chip .tier-chip-threshold {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.tier-chip .tier-chip-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ---------- Succès : sous-onglet "Images" (idée 2026-08-29, demande Lucas)
   ----------
   Une ligne par succès (miniature + nom + actions) plutôt qu'une grille de
   cartes façon .gifs-grid : ~38 succès au total (30 à paliers + 2 combo + 3
   rôle + 3 classement), une liste compacte reste plus lisible/scannable
   qu'une grille de grandes vignettes pour ce volume. */
.achv-image-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achv-image-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.achv-image-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.achv-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achv-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9.5px;
  color: var(--text-faint);
  padding: 4px;
}

.achv-image-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.achv-image-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.achv-image-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.achv-image-upload-btn {
  cursor: pointer;
}

/* ---------- Stats : mini-graphique en barres CSS (idée audit 2026-08-28) ----------
   Aucune librairie de graphique dans ce projet vanilla JS/sans build : des
   barres CSS suffisent pour une tendance 14 jours, sans dépendance ajoutée.
   Couleurs reprises telles quelles de CHART_MSG_COLOR/CHART_VOCAL_COLOR
   (cogs/stats.py, graphique matplotlib de !stats) pour que le code couleur
   "messages = vert / vocal = rose" reste le même entre le bot et le dashboard. */
:root {
  --chart-msg: #57f287;
  --chart-vocal: #eb459e;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 90px;
}

.bar-chart .bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 4px;
}

.bar-chart .bar {
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--chart-msg);
}

.bar-chart-vocal .bar {
  background: var(--chart-vocal);
}

.bar-chart-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 6px;
  font-family: var(--font-mono);
}
