/* Styles propres au dashboard — s'appuient sur les variables de style.css */

.dash { padding: 104px 0 80px; min-height: 100dvh; }
.dash-header { margin-bottom: 36px; }
.dash-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; }
.dash-sub { color: var(--text-2); margin-top: 8px; }

.back-link { color: var(--text-2); font-size: 0.92rem; display: inline-flex; align-items: center; gap: 7px; transition: color var(--transition); }
.back-link:hover { color: var(--accent); }

/* Profil dans la nav */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user img, .nav-user .nav-avatar-fallback {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: var(--surface-2);
}
/* L'image : rendu net (jamais display:grid sur une <img>, ça la déforme). */
.nav-user img { display: block; object-fit: cover; }
/* Le repli (initiale) : centrage en grille. */
.nav-user .nav-avatar-fallback { display: grid; place-items: center; color: var(--accent); font-weight: 700; }
.nav-user-name { font-size: 0.9rem; font-weight: 500; }

/* Grille de serveurs */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.guild-card { padding: 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.guild-avatar {
  width: 66px; height: 66px; border-radius: 22px; object-fit: cover;
  background: var(--surface-2); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent);
}
.guild-name { font-weight: 600; font-size: 1.02rem; }
.guild-card .btn { width: 100%; justify-content: center; }

/* En-tête de serveur (page de gestion) */
.guild-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.guild-head .guild-avatar { width: 56px; height: 56px; border-radius: 18px; }

/* Panneaux de config */
.panels { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.panel { padding: 26px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.panel-head .emoji {
  font-size: 1.15rem; width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 11px;
  background: var(--accent-soft); line-height: 1;
}
.panel-head h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
.panel-desc { color: var(--text-2); font-size: 0.9rem; margin-bottom: 18px; }

/* Panneaux repliables : flèche dans l'entête (clic sur l'entête = plier/déplier) */
.panel-head { cursor: pointer; -webkit-user-select: none; user-select: none; }
.panel-head::after {
  content: "\f078"; /* chevron-down (Font Awesome) */
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  margin-left: auto; flex-shrink: 0;
  color: var(--text-2); font-size: 0.8rem;
  opacity: 0.65; transition: transform 0.25s ease, opacity 0.15s, color 0.15s;
}
.panel-head:hover::after { opacity: 1; color: var(--text); }
.panel.is-collapsed > .panel-head::after { transform: rotate(-90deg); }
.panel.is-collapsed > .panel-head { margin-bottom: 0; }
.panel.is-collapsed > :not(.panel-head) { display: none !important; }

/* Champs */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 7px; }
/* Un interrupteur dans un .field doit rester en ligne (sinon le rond chevauche le texte) */
.field > label.toggle { display: inline-flex; margin-bottom: 0; }
.field .hint { color: var(--text-2); font-size: 0.8rem; margin-top: 6px; }
.field-narrow { max-width: 160px; }
.row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; margin-bottom: 16px; }

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit; font-size: 0.95rem;
  transition: border-color var(--transition);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: var(--ring); }
input[type='color'].swatch {
  width: 46px; height: 36px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: none; cursor: pointer;
}

/* Interrupteur */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.92rem; -webkit-user-select: none; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: relative; width: 44px; height: 26px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 999px; transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.toggle .track::before {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2); transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .track::before { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Liste de rôles */
.role-list { display: flex; flex-wrap: wrap; gap: 9px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer; font-size: 0.88rem; -webkit-user-select: none; user-select: none;
  transition: border-color var(--transition), background var(--transition);
}
.role-chip input { display: none; }
.role-chip .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.role-chip.selected { border-color: var(--accent); background: var(--accent-soft); }
.role-chip.too-high { opacity: 0.55; }

/* Listes en lecture seule (stats / réactions) */
.readonly-list { display: flex; flex-direction: column; gap: 10px; }
.readonly-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.92rem;
}
.readonly-row .val { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

.mt-20 { margin-top: 20px; }

/* En-tête serveur (vue d'ensemble) */
.server-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 22px;
}
.server-head .guild-avatar { width: 60px; height: 60px; border-radius: 18px; font-size: 1.5rem; }
.sh-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.sh-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-left: auto; }
.sh-stat { text-align: center; }
.sh-stat b { display: block; font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.sh-stat span { color: var(--text-2); font-size: 0.8rem; }

/* Bienvenue / au revoir : formulaire + aperçu côte à côte */
.wg-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.grid2-narrow { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.wg-preview { position: sticky; top: 96px; }
.preview-label { font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.preview-label i { color: var(--accent); }
.wg-preview .discord-mock { position: relative; animation: none; }
.preview-empty { color: var(--text-2); font-size: 0.9rem; text-align: center; padding: 20px; }
.preview-note { font-size: 0.76rem; color: var(--text-2); margin-top: 10px; display: flex; align-items: center; gap: 6px; }

/* Variables cliquables (insèrent dans le message) */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.var-chip {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
  color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 7px; padding: 3px 8px; cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.var-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.var-chip:active { transform: scale(0.95); }

/* Bouton « modifications non enregistrées » */
.btn.dirty { box-shadow: 0 0 0 3px rgba(91, 110, 240, 0.28); }

@media (max-width: 1000px) {
  .wg-layout { grid-template-columns: 1fr; }
  .wg-preview { position: static; }
}

/* Réactions de mot */
.reaction-form .field { margin-bottom: 14px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; max-height: 130px; overflow-y: auto; }
.emoji-pick {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2);
  cursor: pointer; transition: border-color var(--transition), transform var(--transition);
}
.emoji-pick:hover { border-color: var(--accent); transform: translateY(-1px); }
.emoji-pick:active { transform: scale(0.92); transition-duration: 100ms; }
.emoji-pick img { width: 22px; height: 22px; }
.emoji-picker .muted { padding: 4px 2px; }

.field-mid { max-width: 360px; }

/* Membres & rôles */
.mb-results { margin-top: 16px; }
.mb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.mb-card { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; transition: border-color var(--transition); }
.mb-card:hover { border-color: var(--border-strong); }
.mb-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.mb-info { min-width: 0; }
.mb-tag { font-weight: 600; }
.mb-norole { font-size: 0.84rem; margin-top: 4px; }
.mb-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.mb-role { font-size: 0.73rem; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 999px; line-height: 1.4; }
.mb-head { margin-bottom: 14px; color: var(--text-2); font-size: 0.95rem; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 0.86rem; }
.mb-chip img { width: 22px; height: 22px; border-radius: 50%; }

/* Badges */
.count-badge { font-size: 0.78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.owner-badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #d9a441; background: rgba(217,164,65,0.14); border: 1px solid rgba(217,164,65,0.4); padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.bot-badge { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; color: #fff; background: var(--accent); padding: 1px 5px; border-radius: 4px; vertical-align: middle; }

/* Tous les membres : barre d'outils + tableau */
.mb-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.mb-toolbar #mb-filter { flex: 1; min-width: 180px; }
.mb-toolbar #mb-sort { width: 240px; }
.mb-table { display: flex; flex-direction: column; }
.mb-row { display: flex; align-items: center; gap: 13px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.mb-row:last-child { border-bottom: none; }
.mb-row-main { min-width: 0; flex: 1; }
.mb-row-sub { font-size: 0.82rem; color: var(--text-2); margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mb-toprole { font-size: 0.74rem; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; }
.mb-row-meta { display: flex; flex-direction: column; gap: 3px; text-align: right; font-size: 0.78rem; color: var(--text-2); white-space: nowrap; }
.mb-row-meta i { width: 14px; margin-right: 3px; }

/* Journal du serveur (audit) */
.audit-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.audit-toolbar #audit-filter { flex: 1; min-width: 180px; }
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; align-items: flex-start; gap: 13px; padding: 11px 6px; border-bottom: 1px solid var(--border); }
.audit-item:last-child { border-bottom: none; }
.audit-ic { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; }
.audit-body { flex: 1; min-width: 0; }
.audit-line { font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.audit-av { width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; }
.audit-action { color: var(--text-2); }
.audit-target { font-weight: 600; }
.audit-reason { font-size: 0.82rem; color: var(--text-2); font-style: italic; margin-top: 3px; }
.audit-time { font-size: 0.77rem; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }

/* ----- Connexion dans la nav (accueil) ----- */
.nav-auth { display: flex; align-items: center; gap: 10px; }
.nav-user-link { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); transition: border-color var(--transition), background var(--transition); }
.nav-user-link:hover { border-color: var(--accent); background: var(--surface-2); }
.nav-admin-btn { white-space: nowrap; }

/* ----- Console admin ----- */
.admin-bot { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.admin-bot-av { width: 60px; height: 60px; border-radius: 16px; flex-shrink: 0; box-shadow: 0 0 0 2px var(--accent-soft); }
.admin-bot-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.admin-bot-meta { font-size: 0.88rem; color: var(--text-2); margin-top: 3px; }
.dot-online { width: 10px; height: 10px; border-radius: 50%; background: #57c98a; box-shadow: 0 0 0 3px rgba(87, 201, 138, 0.2); }
.admin-stat { cursor: default; }
.admin-stat::after { content: none !important; }
.admin-stat:hover { transform: none; }
.admin-stat h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }

/* Tickets : éditeur de types + aperçu */
.tk-type { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.tk-type-head { display: flex; align-items: center; gap: 10px; }
.tk-type-head .tk-t-emoji { width: 64px; text-align: center; flex-shrink: 0; }
.tk-type-head .tk-t-label { flex: 1; font-weight: 600; }
.tk-type-head .tk-t-en { flex-shrink: 0; }
.tk-type .tk-t-welcome { resize: vertical; min-height: 48px; }
.tk-pv-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tk-pv-type { font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); }
/* Aperçu fidèle du panneau de tickets (façon Discord) */
.tk-pv-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tk-pv-desc { color: var(--text); font-size: 0.9rem; line-height: 1.5; }
.tk-pv-sep { height: 1px; background: var(--border-strong); margin: 12px 0; opacity: 0.7; }
.tk-pv-label { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tk-pv-cat { font-size: 0.88rem; color: var(--text); padding: 2px 0 2px 10px; border-left: 3px solid var(--border-strong); margin-bottom: 3px; }
.tk-pv-hint { font-size: 0.76rem; color: var(--text-2); line-height: 1.6; margin-top: 8px; }
.tk-pv-select { margin-top: 0; cursor: default; }
.tk-pv-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-pv-btn { font-size: 0.84rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; background: #5865f2; color: #fff; border: none; cursor: default; }
.tk-pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-pv-btn2 { font-size: 0.84rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; background: #4e5058; color: #fff; border: none; cursor: default; }
.tk-bottom { margin-bottom: 24px; }

/* Liste des commandes (page admin) */
.cmd-cat { margin-bottom: 22px; }
.cmd-cat:last-child { margin-bottom: 0; }
.cmd-cat h3 { font-family: var(--font-display); font-size: 1.02rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cmd-cat h3 i { color: var(--accent); }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cmd-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cmd-name { font-weight: 700; color: var(--text); font-family: var(--font-display); }
.cmd-lock { color: var(--text-2); font-size: 0.78rem; margin-left: 4px; }
.cmd-desc { color: var(--text-2); font-size: 0.84rem; margin-top: 3px; line-height: 1.45; }
.cmd-subs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cmd-sub { font-size: 0.74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.cmd-toolbar { margin-bottom: 14px; gap: 10px; display: flex; flex-wrap: wrap; }
.cmd-toolbar .input { flex: 1; min-width: 160px; }
.cmd-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cmd-stat { font-size: 0.86rem; color: var(--text-2); }
.cmd-stat b { color: var(--text); font-size: 1.05rem; }
.cmd-top b { color: var(--accent); font-size: 0.86rem; }
.cmd-uses { float: right; font-size: 0.74rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }

/* Auto-modération */
.am-rule .panel-head .am-head-toggle { margin-left: auto; }
.am-rule.am-off > :not(.panel-head) { opacity: 0.5; }
.am-rule .am-scope-targets { margin-top: 4px; }

/* Sous-onglets de la section Tickets */
.tk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.tk-tab { flex: 1; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; font-size: 0.92rem; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-radius: 10px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.tk-tab:hover { color: var(--text); background: var(--surface); }
.tk-tab.is-active { color: #fff; background: var(--accent); box-shadow: 0 4px 14px -4px var(--accent); }
.tk-tab.is-active .count-badge { color: #fff; background: rgba(255, 255, 255, 0.22); }
.tk-pane { display: none; }
.tk-pane.is-active { display: block; animation: tkFade 0.2s ease; }
@keyframes tkFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tk-claim-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tk-claim-row .muted { margin: 8px 0 0; font-size: 0.85rem; line-height: 1.5; }
.tk-claim-row code, .tk-type code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 0.85em; }
.tk-type .field label .muted { font-weight: 400; font-size: 0.8rem; }
.tk-type select[multiple] { padding: 4px; }

/* Multi-sélection par pastilles (exclusions niveaux) */
.chip-multi { display: flex; flex-wrap: wrap; gap: 7px; max-height: 180px; overflow-y: auto; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.xchip {
  font: inherit; font-size: 0.84rem; font-weight: 500; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.xchip:hover { border-color: var(--accent); color: var(--text); }
.xchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Bouton « Actualiser salons & rôles » (sidebar) */
.side-refresh {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 14px; padding: 9px 11px; border-radius: 11px;
  background: none; border: 1px dashed var(--border-strong); color: var(--text-2);
  font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.side-refresh:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.side-refresh.spin i { animation: spin360 0.6s linear; }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* Panneau de restauration de sauvegarde */
.bk-restore-panel { padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; }

/* Niveaux : récompenses + classement */
.lv-addreward { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.lv-addreward #lv-rw-level { width: 110px; }
.lv-addreward #lv-rw-role { flex: 1; min-width: 180px; }
.lv-rewards { display: flex; flex-direction: column; gap: 8px; }
.lv-reward { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.lv-rw-lvl { font-weight: 700; color: var(--accent); font-family: var(--font-display); }
.lv-reward i { color: var(--text-2); font-size: 0.8rem; }
.lv-rw-role { flex: 1; font-weight: 500; }
.lv-reward .btn-danger { flex-shrink: 0; }
.lv-lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.lv-lb-row:last-child { border-bottom: none; }
.lv-lb-rank { width: 34px; text-align: center; font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.lv-lb-row img { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.lv-lb-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-lb-stat { font-size: 0.85rem; color: var(--text-2); white-space: nowrap; }

/* Options d'embed avancées (details/summary) */
.embed-adv { margin: 4px 0 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.embed-adv > summary {
  list-style: none; cursor: pointer; padding: 12px 15px; font-weight: 600; font-size: 0.92rem;
  display: flex; align-items: center; gap: 9px; -webkit-user-select: none; user-select: none; transition: color var(--transition);
}
.embed-adv > summary::-webkit-details-marker { display: none; }
.embed-adv > summary i { color: var(--accent); }
.embed-adv > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; font-size: 0.7rem; color: var(--text-2); transition: transform var(--transition); }
.embed-adv[open] > summary::after { transform: rotate(180deg); }
.embed-adv > summary:hover { color: var(--accent); }
.embed-adv-body { padding: 4px 15px 16px; }

/* Aperçu embed : auteur / image / footer */
.discord-embed-author { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 600; margin-bottom: 8px; }
.discord-embed-author img { width: 22px; height: 22px; border-radius: 50%; }
.discord-embed-image { margin-top: 10px; }
.discord-embed-image img { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; }
.discord-embed-footer { margin-top: 10px; font-size: 0.78rem; color: var(--text-2); }

/* Bannière « modifications non enregistrées » */
.save-banner {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120%);
  display: flex; align-items: center; gap: 9px;
  background: #e0a23a; color: #1a1205; font-weight: 600; font-size: 0.9rem;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 14px 34px -12px rgba(0,0,0,0.5);
  z-index: 1500; opacity: 0; pointer-events: none; transition: transform 0.3s var(--ease, ease), opacity 0.3s ease;
}
.save-banner.show { transform: translate(-50%, 0); opacity: 1; }

/* Sélecteur de serveur custom (sidebar) */
.srv-switch { position: relative; margin: 0 0 14px; }
.srv-switch-btn {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-align: left; transition: border-color var(--transition), background var(--transition);
}
.srv-switch-btn:hover { border-color: var(--border-strong); }
.srv-switch-cur { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; overflow: hidden; }
.srv-switch-cur > i { color: var(--text-2); font-size: 0.82rem; }
.srv-switch-caret { color: var(--text-2); font-size: 0.7rem; flex-shrink: 0; transition: transform var(--transition); }
.srv-switch-btn[aria-expanded='true'] .srv-switch-caret { transform: rotate(180deg); }
.srv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-ic { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; object-fit: cover; }
.srv-ini { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700; }

.srv-switch-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 1200;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 20px 46px -16px rgba(0, 0, 0, 0.55);
  padding: 6px; display: none; flex-direction: column; gap: 2px;
  max-height: 320px; overflow-y: auto;
}
.srv-switch-menu.open { display: flex; animation: navDropIn 0.16s ease; }
.srv-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; background: none; border-radius: 9px;
  color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; text-align: left;
  transition: background var(--transition);
}
.srv-opt:hover { background: var(--surface-2); }
.srv-opt.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.srv-opt .srv-name { flex: 1; }
.srv-opt > i { color: var(--accent); font-size: 0.8rem; }
.srv-empty { padding: 12px; text-align: center; font-size: 0.86rem; }

/* Score de configuration */
.config-score { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.cs-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.95rem; }
.cs-head i { color: var(--accent); margin-right: 7px; }
.cs-head b { font-family: var(--font-display); font-size: 1.25rem; color: var(--accent); }
.cs-bar { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.cs-bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s var(--ease, ease); }
.cs-sub { font-size: 0.84rem; }

/* Activité récente */
.ov-activity { margin-top: 18px; }
.act-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.act-item:last-child { border-bottom: none; }
.act-ic { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; }
.act-body { flex: 1; min-width: 0; font-size: 0.9rem; }
.act-time { font-size: 0.78rem; color: var(--text-2); white-space: nowrap; }

/* Avertissement de permission par section */
.perm-warn { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; margin-bottom: 18px; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; background: rgba(224, 85, 106, 0.1); border: 1px solid rgba(224, 85, 106, 0.35); color: var(--text); }
.perm-warn i { color: #e0556a; margin-top: 2px; }
.perm-warn-soft { background: rgba(224, 162, 58, 0.1); border-color: rgba(224, 162, 58, 0.35); }
.perm-warn-soft i { color: #e0a23a; }

/* Messages programmés */
.sched-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.sched-row:last-child { border-bottom: none; }
.sched-row.off { opacity: 0.5; }
.sched-main { flex: 1; min-width: 0; }
.sched-text { font-weight: 500; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; }
.sched-meta { font-size: 0.8rem; color: var(--text-2); margin-top: 3px; }
.sched-toggle { flex-shrink: 0; }

/* États vides illustrés */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 38px 20px; text-align: center; color: var(--text-2);
}
.empty-state i { font-size: 2rem; opacity: 0.45; }
.empty-state p { font-size: 0.95rem; max-width: 40ch; }

/* Sparklines sur les cartes de stats */
.admin-stat { position: relative; overflow: hidden; }
.spark { position: absolute; bottom: 0; left: 0; right: 0; width: 100%; height: 32px; opacity: 0.55; }

/* Graphe de croissance */
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.chart-legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-2); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .lg i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-legend .lg-servers i { background: #5b6ef0; }
.chart-legend .lg-users i { background: #57c98a; }
.chart-range { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.chart-range button { border: none; background: none; color: var(--text-2); font: inherit; font-size: 0.84rem; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: background var(--transition), color var(--transition); }
.chart-range button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.06)); }
.growth-chart { width: 100%; }
.growth-svg { width: 100%; height: auto; display: block; }
.growth-svg .grid { stroke: var(--border); stroke-width: 1; }
.growth-svg .ylab, .growth-svg .xlab { font-size: 11px; fill: var(--text-2); font-family: var(--font-body); }

/* Barre de membres sur les cartes serveur (admin) */
.gbar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; max-width: 320px; }
.gbar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Journal d'erreurs admin */
.errlog-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.errlog-item { display: flex; align-items: flex-start; gap: 11px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.errlog-level { flex-shrink: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border: 1px solid; border-radius: 999px; }
.errlog-msg { flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.78rem; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; word-break: break-word; margin: 0; }
.errlog-time { flex-shrink: 0; font-size: 0.74rem; color: var(--text-2); white-space: nowrap; }

/* Rôles à réaction */
.rr-pairs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rr-pair { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.rr-pe { font-size: 1.15rem; min-width: 24px; text-align: center; }
.rr-pe img { width: 22px; height: 22px; vertical-align: middle; }
.rr-pl { font-weight: 600; }
.rr-pair .btn-icon { margin-left: auto; }
.rr-addform { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; }
.rr-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; }
.rr-addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rr-addrow .rr-emoji { width: 100px; }
.rr-addrow .rr-label { flex: 1; min-width: 120px; width: auto; }
.rr-addrow .rr-role { width: 190px; }
.rr-bottom { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.rr-bottom .rr-channel { width: 230px; }
@media (max-width: 560px) {
  .rr-addform .rr-emoji, .rr-addform .rr-label, .rr-addform .rr-role, .rr-bottom .rr-channel { width: 100%; }
}

/* Logs */
.logs-editor { display: flex; flex-direction: column; gap: 12px; }
.log-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.log-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.log-emoji { font-size: 1.3rem; }
.log-label { font-weight: 600; }
.log-desc { font-size: 0.84rem; }
.log-row .log-channel { width: auto; min-width: 200px; flex: 1; max-width: 280px; }
@media (max-width: 560px) { .log-row .log-channel { max-width: none; width: 100%; } }

/* Réactions groupées par mot */
.rx-emojis { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.rx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-size: 1.05rem; transition: border-color var(--transition); }
.rx-chip img { width: 20px; height: 20px; vertical-align: middle; }
.rx-chip i { color: var(--text-2); font-size: 0.7rem; }
.rx-chip:hover { border-color: #e0556a; }
.rx-chip:hover i { color: #e0556a; }

/* Sauvegardes */
.backup-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.backup-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.backup-row .bk-name { font-weight: 600; flex: 1; min-width: 140px; }
.backup-row .bk-date { color: var(--text-2); font-size: 0.85rem; }
.bk-content { flex-basis: 100%; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Badges giveaway */
.gw-badge { font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.gw-badge.live { color: #57c98a; background: rgba(87, 201, 138, 0.14); }
.gw-badge.ended { color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }

/* Squelettes de chargement (manage) */
.sk-block { border-radius: 16px; margin-bottom: 18px; height: 120px; }
.sk-block.sk-tall { height: 220px; }
.sk-block.sk-sm { height: 56px; }

/* Aperçu serveur */
.preview-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.prev-h { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; }
.prev-roles { display: flex; flex-wrap: wrap; gap: 7px; max-height: 320px; overflow-y: auto; }
.prev-role { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 0.84rem; }
.prev-role .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.prev-channels { display: flex; flex-direction: column; gap: 3px; max-height: 320px; overflow-y: auto; }
.prev-cat { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); margin: 12px 0 5px; font-weight: 700; }
.prev-cat:first-child { margin-top: 0; }
.prev-ch { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.9rem; padding: 2px 0; }
.prev-ch i { width: 14px; text-align: center; font-size: 0.8rem; }
@media (max-width: 700px) { .preview-cols { grid-template-columns: 1fr; } }

.reaction-list { display: flex; flex-direction: column; gap: 10px; }
.reaction-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
}
.reaction-row .rx-emoji { font-size: 1.25rem; width: 28px; min-width: 28px; max-width: 28px; text-align: center; overflow: hidden; white-space: nowrap; flex-shrink: 0; }
.reaction-row .rx-emoji img { width: 24px; height: 24px; vertical-align: middle; }
.reaction-row .rx-word { flex: 1; min-width: 120px; font-weight: 600; }
.reaction-row .input { width: auto; flex: 1; min-width: 120px; }
.reaction-row .btn-icon {
  width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.reaction-row .btn-icon:hover { color: var(--text); border-color: var(--accent); }
.reaction-row .btn-icon:active { transform: scale(0.92); transition-duration: 100ms; }
.reaction-row .btn-icon.danger:hover { color: #fff; background: #e0556a; border-color: #e0556a; }

/* Éditeur de statistiques */
.stat-editor { display: flex; flex-direction: column; gap: 16px; }
.stat-card { padding: 20px; }
.stat-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stat-card-head .emoji { font-size: 1.35rem; }
.stat-card-head h3 { font-size: 1.05rem; flex: 1; }
.stat-card-head .stat-val {
  font-family: var(--font-display); font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; font-size: 0.85rem;
}
.stat-card .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card .preview { font-size: 0.85rem; color: var(--text-2); margin-top: 10px; }
.stat-card .preview b { color: var(--text); font-weight: 600; }
.stat-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-sm { padding: 9px 15px; font-size: 0.88rem; }
.btn-ghost { background: none; border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: none; border: 1px solid #e0556a55; color: #e0556a; }
.btn-danger:hover { background: #e0556a; color: #fff; border-color: #e0556a; }

@media (max-width: 560px) { .stat-card .grid2 { grid-template-columns: 1fr; } }

.panel-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.muted { color: var(--text-2); font-size: 0.9rem; }
.warn-text { color: #e9a13b; font-size: 0.82rem; margin-top: 8px; }

/* État vide */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 2.2rem; color: var(--text-2); margin-bottom: 14px; }
.empty-state h3 { font-family: var(--font-display); margin-bottom: 8px; }
.empty-state p { color: var(--text-2); margin-bottom: 20px; }

/* Squelette de chargement */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 150px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 13px 20px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity var(--transition), transform var(--transition);
  z-index: 200; font-size: 0.92rem; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok i { color: #57c98a; }
.toast.error { border-color: #e0556a; }
.toast.error i { color: #e0556a; }

/* ===== Page de gestion : layout sidebar + sections ===== */
.manage { padding: 100px 0 70px; min-height: 100dvh; }
.manage > .back-link { display: inline-flex; margin-bottom: 18px; }

.manage-layout { display: grid; grid-template-columns: 256px 1fr; gap: 28px; align-items: start; }

.side {
  position: sticky; top: 96px;
  max-height: calc(100dvh - 120px); overflow-y: auto;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 92%, var(--accent) 8%));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
  scrollbar-width: thin;
}
.side-guild { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.side-guild .guild-avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 1.1rem; box-shadow: 0 0 0 2px var(--accent-soft); }
.side-guild-name { font-weight: 600; font-size: 0.98rem; line-height: 1.25; word-break: break-word; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }

/* Barre de recherche de la sidebar */
.side-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; margin-bottom: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.side-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.side-search > i { color: var(--text-2); font-size: 0.85rem; }
.side-search input { flex: 1; min-width: 0; border: none; background: none; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; }
.side-search input::placeholder { color: var(--text-2); }
.side-search-clear { border: none; background: none; color: var(--text-2); cursor: pointer; padding: 2px; line-height: 1; border-radius: 6px; }
.side-search-clear:hover { color: var(--accent); }

/* Groupes repliables */
.side-group { display: flex; flex-direction: column; }
.side-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; border: none; background: none; cursor: pointer; font: inherit;
  font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-2); font-weight: 700; opacity: 0.9;
  padding: 15px 6px 7px; transition: color var(--transition), opacity var(--transition);
}
.side-group-head:hover { color: var(--accent); opacity: 1; }
.side-group-head i { font-size: 0.62rem; transition: transform 0.22s ease; }
.side-group.collapsed .side-group-head i { transform: rotate(-90deg); }
.side-group-body { display: flex; flex-direction: column; gap: 2px; }
.side-group.collapsed .side-group-body { display: none; }
.side-group.has-active .side-group-head { color: var(--accent); opacity: 1; }
.side-noresult { color: var(--text-2); font-size: 0.85rem; text-align: center; padding: 18px 6px; }

/* Masquage recherche */
.side-item.search-hidden, .side-group.search-hidden { display: none; }

.side-label { font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-2); margin: 18px 6px 7px; font-weight: 700; opacity: 0.85; }
.side-label:first-child { margin-top: 2px; }
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border: none; background: none;
  color: var(--text-2); border-radius: 11px; cursor: pointer;
  font: inherit; font-size: 0.93rem; font-weight: 500; text-align: left; width: 100%;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.side-item mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.side-item i {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center; text-align: center; font-size: 0.9rem;
  border-radius: 9px; background: var(--surface-2); color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.side-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.side-item:hover i { color: var(--text); }
.side-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-item.active i { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

.manage-content { min-width: 0; }

/* ===== Transcripts de tickets ===== */
.ts-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); margin-bottom: 8px;
}
.ts-row:hover { border-color: var(--border-strong); }
.ts-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ts-type { font-weight: 600; }
.ts-id { color: var(--text-2); font-size: 0.8rem; font-family: 'Space Grotesk', monospace; }
.ts-meta { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .ts-row { flex-direction: column; align-items: stretch; } .ts-row .btn { justify-content: center; } }

/* ===== Statistiques du serveur ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.ss-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.ss-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.ss-card .ss-ico { font-size: 1.1rem; }
.ss-card .ss-val { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.ss-card .ss-lbl { color: var(--text-2); font-size: 0.82rem; }
.ss-card.ss-wide { grid-column: span 2; }
.ss-card .ss-sub { color: var(--text-2); font-size: 0.78rem; margin-top: 2px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr 1fr; } .ss-card.ss-wide { grid-column: span 2; } }

/* ===== Polish visuel ===== */
/* Barre d'accent sur l'élément de sidebar actif */
.side-item { position: relative; }
.side-item.active::before {
  content: ''; position: absolute; left: -2px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2));
}
/* Chevron sur les cartes de la vue d'ensemble (indique que c'est cliquable) */
.ov-card { position: relative; }
.ov-card::after {
  content: '\f054'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 18px; right: 18px; color: var(--text-2); font-size: 0.72rem;
  opacity: 0; transform: translateX(-3px); transition: opacity var(--transition), transform var(--transition);
}
.ov-card:hover::after { opacity: 0.7; transform: translateX(0); }
.ov-card:hover { transform: translateY(-4px); }
/* Titre de section avec petit trait d'accent */
.section-head h1 { position: relative; }
.panel-head h2 { letter-spacing: -0.01em; }
.section { animation: fadeSection 0.25s ease; }
.section[hidden] { display: none; }
@keyframes fadeSection { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.section-head h1 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; padding-left: 14px; }
.section-head h1::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  border-radius: 4px; background: linear-gradient(var(--accent), var(--accent-2));
}
.section-head p { color: var(--text-2); margin-top: 6px; font-size: 0.95rem; padding-left: 14px; }

/* Vue d'ensemble */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 16px; }
.ov-card { padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.ov-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.05rem; margin-bottom: 12px; }
.ov-card h3 { font-size: 1.02rem; }
.ov-state { font-size: 0.9rem; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; }
.ov-state .dot-state { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); }
.ov-state.on { color: #57c98a; }
.ov-state.on .dot-state { background: #57c98a; }

/* Tablette : sidebar en haut, grilles à 2 colonnes empilées */
/* Bouton « menu des réglages » : masqué sur grand écran, visible sur mobile */
.side-mobile-toggle { display: none; }

@media (max-width: 860px) {
  .manage-layout { grid-template-columns: 1fr; }
  .side { position: static; padding: 14px; }
  .side-nav { flex-direction: column; gap: 2px; }
  .wg-layout { grid-template-columns: 1fr; }
  .wg-preview { position: static; }
  .grid2 { grid-template-columns: 1fr; }

  /* La barre latérale devient un menu déroulant compact */
  .side-mobile-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; margin-top: 4px; padding: 13px 15px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px;
    color: var(--text); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: border-color var(--transition);
  }
  .side-mobile-toggle:hover { border-color: var(--accent); }
  .side-mobile-toggle .smt-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .side-mobile-toggle .smt-label > i { color: var(--accent); }
  .side-mobile-toggle #side-mobile-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-mobile-toggle .smt-caret { color: var(--text-2); font-size: 0.8rem; transition: transform 0.25s ease; }
  .side-mobile-toggle[aria-expanded='true'] .smt-caret { transform: rotate(180deg); }

  /* Repliée par défaut ; dépliée quand le menu est ouvert */
  .side-collapse { display: none; margin-top: 10px; }
  .side.nav-open .side-collapse { display: block; }
  /* Items un peu plus grands au doigt */
  .side-item { padding: 12px 13px; font-size: 0.95rem; }
}

/* Téléphones */
@media (max-width: 560px) {
  .dash, .manage { padding-top: 88px; }
  .manage.container, .dash.container { padding-left: 14px; padding-right: 14px; }
  .guild-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .section-head h1 { font-size: 1.32rem; }
  .server-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .sh-stats { margin-left: 0; gap: 20px; width: 100%; flex-wrap: wrap; }
  .row { gap: 12px 18px; }
  .grid2-narrow { grid-template-columns: 1fr; }
  .panel-actions { flex-wrap: wrap; }
  .panel-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* Réactions : la ligne passe en bloc lisible */
  .reaction-row { align-items: stretch; }
  .reaction-row .rx-word, .reaction-row .input { flex: 1 1 100%; }
  .nav-user-name { display: none; }
  /* Membres & audit : on empile proprement */
  .mb-toolbar #mb-sort, .mb-toolbar #mb-filter { width: 100%; }
  .mb-row { flex-wrap: wrap; }
  .mb-row-meta { flex-direction: row; gap: 14px; text-align: left; width: 100%; padding-left: 55px; }
  /* Messages programmés : la ligne passe en bloc */
  .sched-row { flex-wrap: wrap; }
  .sched-main { flex: 1 1 100%; }
  /* Vue d'ensemble : 1 colonne nette */
  .overview-grid { grid-template-columns: 1fr; }
  /* Graphe admin : légende + plage empilées */
  .chart-toolbar { gap: 10px; }
  /* Audit : la barre passe full width */
  .audit-toolbar #audit-filter { width: 100%; }
}

/* ===========================================================
   REDESIGN — Minimaliste épuré (scopé aux pages dashboard)
   Palette matte neutre · cartes plates · pas de glow/lift.
   =========================================================== */
html[data-theme='dark'] .dash-page {
  --bg: #131317;
  --bg-2: #17171c;
  --surface: #1a1a21;
  --surface-2: #212129;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededf2;
  --text-2: #9a9aa8;
  --accent-soft: rgba(91, 110, 240, 0.13);
  --shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.012;
  --radius-lg: 18px;
  --radius: 14px;
}

/* Cartes plates : on retire le glow souris, le liseré, l'élévation au survol */
.dash-page .spotlight { box-shadow: none; transition: border-color 0.16s ease, background 0.16s ease; }
.dash-page .spotlight::before,
.dash-page .spotlight::after { display: none !important; }
.dash-page .spotlight:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.dash-page .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Plus de respiration */
.dash-page .panels { gap: 18px; }
.dash-page .section-head { margin-bottom: 6px; }
.dash-page .section-head h1 { letter-spacing: -0.02em; }

/* Entêtes de panneau plus sobres */
.dash-page .panel-head .emoji { background: var(--surface-2); border: 1px solid var(--border); }

/* Cartes de la vue d'ensemble : plates, hover discret */
.dash-page .ov-card { transition: border-color 0.16s ease, transform 0.16s ease; }
.dash-page .ov-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }

/* Champs : focus sobre */
.dash-page .input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }

/* Boutons : on enlève les ombres marquées (sauf l'indicateur "dirty") */
.dash-page .btn:not(.dirty) { box-shadow: none; }

/* Détails du redesign épuré */
.dash-page .side { background: var(--surface); }
.dash-page .server-head { background: var(--surface); }
.dash-page ::-webkit-scrollbar { width: 10px; height: 10px; }
.dash-page ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.dash-page ::-webkit-scrollbar-thumb:hover { background: var(--text-2); background-clip: padding-box; }
.dash-page ::-webkit-scrollbar-track { background: transparent; }
.dash-page .save-banner { box-shadow: var(--shadow); }

/* ===========================================================
   MOBILE — ajustements pour les sections récentes
   =========================================================== */
/* Les titres de panneau peuvent rétrécir (évite les débordements en flex) */
.panel-head h2 { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  /* Liste des commandes (admin) : une colonne, barre empilée */
  .cmd-grid { grid-template-columns: 1fr; }
  .cmd-toolbar { flex-direction: column; }
  .cmd-toolbar .input, .cmd-toolbar #admin-cmd-sort, .cmd-toolbar .btn { width: 100%; }
  .cmd-summary { gap: 6px 14px; font-size: 0.82rem; }

  /* Sous-onglets Tickets : 3 onglets tiennent sur une ligne */
  .tk-tabs { padding: 4px; gap: 4px; }
  .tk-tab { min-width: 0; flex: 1 1 0; padding: 9px 6px; font-size: 0.8rem; gap: 5px; }

  /* Auto-modération : l'interrupteur reste accessible, le contenu en pile */
  .am-rule .panel-head { gap: 8px; }
  .am-rule .panel-head .am-head-toggle { margin-left: auto; }
  .tk-claim-row .muted, .am-rule .panel-desc { font-size: 0.82rem; }

  /* Aperçu ticket : ne déborde pas */
  .discord-mock { padding: 14px; }
  .tk-pv-btns, .tk-pv-actions { gap: 6px; }

  /* Bandeau « non enregistré » : pleine largeur, animation conservée */
  .save-banner { left: 12px; right: 12px; bottom: 12px; transform: translateY(140%); justify-content: center; }
  .save-banner.show { transform: translateY(0); }
}

/* ===========================================================
   Aide "?" pour copier un ID + popup
   =========================================================== */
.id-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%; padding: 0; line-height: 1;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-2); font-size: 0.72rem; font-weight: 800; cursor: pointer;
  vertical-align: middle; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.id-help:hover, .id-help:focus-visible { background: var(--accent); color: #fff; border-color: var(--accent); outline: none; }
.idh-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; padding: 18px; }
.idh-overlay.open { display: flex; animation: idhFade 0.15s ease; }
@keyframes idhFade { from { opacity: 0; } to { opacity: 1; } }
.idh-card { position: relative; width: 100%; max-width: 470px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); max-height: 90dvh; overflow-y: auto; }
.idh-card h3 { font-family: var(--font-display); font-size: 1.12rem; margin-bottom: 18px; padding-right: 30px; }
.idh-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-2); font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0; }
.idh-close:hover { color: var(--text); }
.idh-steps { list-style: none; counter-reset: idh; display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; }
.idh-steps li { counter-increment: idh; position: relative; padding-left: 40px; font-size: 0.92rem; line-height: 1.5; }
.idh-steps li::before { content: counter(idh); position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }
.idh-steps em { color: var(--text); font-style: normal; font-weight: 600; }
.idh-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.84rem; line-height: 1.5; }

/* ===========================================================
   MOBILE — config plus lisible & tactile
   =========================================================== */
@media (max-width: 860px) {
  /* Navigation des sections : groupes empilés, items pleine largeur (menu déroulant) */
  .side-item { width: 100%; justify-content: flex-start; border-radius: 12px; }
}
@media (max-width: 560px) {
  /* Champs plus grands et lisibles au doigt (16px = pas de zoom auto iOS) */
  .input { padding: 13px 14px; font-size: 16px; border-radius: 12px; }
  textarea.input { min-height: 110px; }
  .field > label { font-size: 0.95rem; margin-bottom: 9px; }
  .field { margin-bottom: 20px; }
  /* Groupes d'interrupteurs : un par ligne, plus gros, séparés */
  .row { flex-direction: column; align-items: stretch; gap: 0; }
  .row .toggle { padding: 13px 2px; font-size: 1rem; border-bottom: 1px solid var(--border); justify-content: space-between; }
  .row .toggle:last-child { border-bottom: none; }
  .toggle .track { width: 50px; height: 30px; }
  .toggle .track::before { width: 24px; height: 24px; }
  .toggle input:checked + .track::before { transform: translateX(20px); }
  /* Chips multi-sélection : cibles plus grandes */
  .xchip { padding: 9px 13px; font-size: 0.9rem; }
  /* Cartes de type / règles : aérées */
  .tk-type, .am-rule { padding: 16px; }
  .grid2 { gap: 14px; }
  /* Boutons d'action en pleine largeur */
  .panel-actions .btn, .tk-bottom .btn { width: 100%; }
  /* Popup d'aide ID : plein écran confort */
  .idh-card { padding: 20px; }
}

/* ===========================================================
   Créateur d'embed
   =========================================================== */
.ec-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.ec-field-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ec-field-head .ec-f-name { flex: 1; }
.ec-field-head .toggle { flex-shrink: 0; }
.ec-f-value { min-height: 44px; resize: vertical; }
.ec-side { display: flex; flex-direction: column; }
.ec-send { display: flex; gap: 10px; margin-top: 14px; }
.ec-send .input { flex: 1; }

/* Aperçu façon Discord */
.ec-pv-content { font-size: 0.93rem; margin: 4px 0 8px; line-height: 1.45; word-break: break-word; }
.ec-pv-embed { position: relative; max-width: 432px; }
.ec-pv-empty { padding: 22px; text-align: center; }
.ec-pv-thumb { position: absolute; top: 14px; right: 14px; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.ec-pv-embed.has-thumb .discord-embed-title,
.ec-pv-embed.has-thumb .discord-embed-desc,
.ec-pv-embed.has-thumb .discord-embed-author { padding-right: 78px; }
.discord-embed-footer { display: flex; align-items: center; gap: 6px; }
.discord-embed-footer img { width: 20px; height: 20px; border-radius: 50%; }
.discord-embed-author span, .discord-embed-footer span { min-width: 0; }
.ec-pv-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; margin-top: 10px; }
.ec-pv-field { grid-column: 1 / -1; min-width: 0; }
.ec-pv-field.inline { grid-column: span 1; }
.ec-pv-fname { font-weight: 700; font-size: 0.82rem; color: var(--text); margin-bottom: 2px; word-break: break-word; }
.ec-pv-fval { font-size: 0.85rem; color: var(--text-2); line-height: 1.4; word-break: break-word; }
.ec-link { color: #00a8fc; }
.ec-pv-embed code, .ec-pv-content code { background: rgba(0,0,0,0.28); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; font-family: ui-monospace, Consolas, monospace; }

@media (max-width: 560px) {
  .ec-send { flex-direction: column; }
  .ec-send .btn { width: 100%; }
}

/* ===========================================================
   Console admin — UI rehaussée
   =========================================================== */
.admin-bot {
  gap: 20px; padding: 22px 26px;
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface) 84%, var(--accent) 16%));
}
.admin-bot-av { width: 68px; height: 68px; border-radius: 18px; box-shadow: 0 0 0 2px var(--accent-soft); }
.admin-bot-info { flex: 1; min-width: 0; }
.admin-bot-name { font-size: 1.3rem; flex-wrap: wrap; }
.admin-bot-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.admin-bot-meta i { color: var(--accent); margin-right: 4px; opacity: 0.85; }
.ab-online { font-size: 0.74rem; font-weight: 700; color: #57c98a; background: rgba(87, 201, 138, 0.13); padding: 2px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.dot-online { animation: pulseDot 2.2s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(87, 201, 138, 0.5); } 60% { box-shadow: 0 0 0 6px rgba(87, 201, 138, 0); } }
.ab-pills { display: flex; gap: 10px; flex-shrink: 0; }
.ab-pill { text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 11px 18px; min-width: 80px; }
.ab-pill b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ab-pill span { font-size: 0.73rem; color: var(--text-2); }

/* Cartes de stats */
.admin-stat { padding: 20px 22px; }
.admin-stat .ov-icon { background: var(--accent-soft); color: var(--accent); }
.admin-stat h3 { margin: 10px 0 2px; }

/* Titres de section un poil plus compacts sur l'admin */
.dash-page .section-head h1 { font-size: 1.5rem; }
.dash-page .section-head { margin-bottom: 14px; }

@media (max-width: 700px) {
  .admin-bot { flex-wrap: wrap; }
  .ab-pills { width: 100%; }
  .ab-pill { flex: 1; min-width: 0; }
}

/* Encart compteur du salon piège */
.hp-count-box {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hp-count-box #hp-count { color: var(--accent); font-weight: 700; }

/* Encart explicatif du salon piège */
.hp-explain .hp-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hp-explain .hp-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; color: var(--text-2); line-height: 1.5; }
.hp-explain .hp-steps li strong { color: var(--text); }
.hp-explain .hp-ic { flex-shrink: 0; font-size: 1.1rem; width: 26px; text-align: center; }
.hp-explain .hint { margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm, 10px); background: var(--surface-2); border: 1px solid var(--border); }

/* Avis / feedback de tickets */
.fb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface-2); }
.fb-staff { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.fb-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.fb-score { font-size: 0.9rem; }
.fb-stars { letter-spacing: 1px; }
.fb-recent { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 8px; margin-bottom: 8px; }
.fb-recent-head { font-size: 0.85rem; }
.fb-comment { margin-top: 4px; font-style: italic; color: var(--text-2); font-size: 0.9rem; }

/* ----- Mode support : le propriétaire consulte un serveur en lecture seule ----- */
/* Se place sous le bandeau d'annonce s'il y en a un, au-dessus de la navbar. */
.support-bar {
  position: fixed;
  top: var(--banner-h, 0px);
  left: 0;
  right: 0;
  z-index: calc(var(--z-nav) + 2);
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  padding: 10px 24px;
  font-size: 0.88rem;
  color: #f2e6cf;
  background: rgba(12, 15, 33, 0.92);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-top: 2px solid #f0a93b;
  border-bottom: 1px solid rgba(240, 169, 59, 0.28);
}
.support-bar i { color: #f0a93b; }
.support-bar b { color: #fff; }
.support-bar a {
  margin-left: auto;
  color: #f0a93b;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(240, 169, 59, 0.42);
  border-radius: 999px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.support-bar a:hover { background: rgba(240, 169, 59, 0.16); border-color: #f0a93b; }

/* Les contrôles sont réellement « disabled » (posé en JS) : il faut qu'ils en
   aient l'air. Le texte reste lisible — on vient consulter une configuration,
   pas la deviner — mais plus rien n'invite au clic. */
:root.support-mode input:disabled,
:root.support-mode select:disabled,
:root.support-mode textarea:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  background: var(--surface-2);
}
:root.support-mode button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
:root.support-mode .toggle input:disabled + .track { opacity: 0.5; cursor: not-allowed; }
/* La sidebar colle au viewport : sans ça elle passerait sous la barre support. */
:root.support-mode .side { top: calc(96px + var(--support-h, 0px)); }

/* ----- Alertes push : un bloc par déclencheur ----- */
.al-rule {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.al-rule .row { margin-bottom: 6px; }
.al-rule .hint { margin-bottom: 10px; }
.al-rule .field { margin-bottom: 0; }

/* ----- Aperçu du bandeau dans la console admin -----
   Le vrai bandeau est en « position: fixed » : sans cette remise à plat,
   l'aperçu s'échapperait de son panneau pour se coller en haut de l'écran. */
.site-banner--preview {
  position: static;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  animation: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(12, 15, 33, 0.96);
}
.site-banner--preview .sb-inner { max-width: none; padding: 11px 16px; }
.site-banner--preview .sb-close { cursor: default; }
:root[data-theme='light'] .site-banner--preview { background: #f4f5fb; }

/* ----- Tickets : guide de lecture + cartes simplifiées ----- */
.tk-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tk-guide-step {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.tk-guide-step .num {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  color: var(--accent); background: var(--accent-soft);
}
.tk-guide-step strong { display: block; font-size: 0.88rem; }
.tk-guide-step span:not(.num) { font-size: 0.78rem; color: var(--text-2); line-height: 1.45; }

.tk-adv { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tk-adv summary {
  cursor: pointer; padding: 9px 14px; font-size: 0.88rem; color: var(--text-2);
  list-style: none; user-select: none;
}
.tk-adv summary::-webkit-details-marker { display: none; }
.tk-adv summary i { margin-right: 6px; color: var(--accent); }
.tk-adv[open] summary { border-bottom: 1px solid var(--border); }
.tk-adv-body { padding: 14px; }

.tk-xp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.85rem; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}

/* ----- Panneaux de tickets supplémentaires ----- */
.tk-xp {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface-2);
}
.tk-xp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tk-xp-head strong i { color: var(--accent); margin-right: 6px; font-size: 0.85em; }
.tk-xp-actions { display: flex; gap: 8px; }
.tk-xp-types { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

/* ----- Économie : ligne d'article de la boutique ----- */
.eco-item {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) 110px minmax(140px, 2fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .eco-item { grid-template-columns: 1fr 100px auto; }
  .eco-item .eco-i-desc { grid-column: 1 / -1; }
}
.eco-item--salary { grid-template-columns: minmax(160px, 2fr) 130px auto; }

/* ----- Console admin : en-tête du menu + rôle ----- */
.admin-side-head { display: flex; align-items: center; gap: 12px; }
.admin-side-ic {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; font-size: 1.1rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, #7d8cff));
}
.admin-side-role { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.admin-side-role i { color: var(--accent); }

/* Titre de sous-panneau (Journal, etc.) */
.panel-title { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }

/* Fil d'audit */
.audit-feed { display: flex; flex-direction: column; }
.audit-time { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.audit-body code, .audit-item code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; font-size: 0.82em; }

/* ----- Recherche & RGPD (console admin) ----- */
.dl-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dl-kind { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dl-kind-btn { background: var(--surface); border: 0; color: var(--text-2); padding: 8px 14px; cursor: pointer; font-size: 0.9rem; }
.dl-kind-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dl-search .input { flex: 1; min-width: 180px; }
.dl-total { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }
.dl-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 14px; }
.dl-cat { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.dl-cat-label { flex: 1; font-size: 0.88rem; }
.dl-cat-n { font-weight: 700; font-family: var(--font-display); }
.dl-cat-detail { flex-basis: 100%; font-size: 0.78rem; }
.dl-erase { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.dl-erase .warn-text { margin-bottom: 10px; }
