/* ==========================================================================
   css/views.css — Styles Premium pour les 5 Sections :
   Serveurs, Anti-Raid, AutoMod, Tickets, Configuration & Thèmes
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. CONTENEURS DE VUES MULTIPLES
   ---------------------------------------------------------------------------- */
.dashboard-view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.dashboard-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* En-tête des vues */
.view-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.view-title-group h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-subtext {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

.view-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Boutons d'action standards */
/* Boutons d'action standards Dégradés */
.btn-primary {
  background: var(--grad);
  color: var(--accent-contrast, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.6);
  filter: brightness(1.08);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active, #save-antiraid-btn:active, #save-config-btn:active {
  transform: translateY(1px) scale(0.97);
}

/* Boutons de sauvegarde dédiés en dégradé émeraude éclatant */
#save-antiraid-btn, #save-config-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#save-antiraid-btn:hover, #save-config-btn:hover {
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55);
  filter: brightness(1.08);
}

/* ----------------------------------------------------------------------------
   2. SECTION SERVEURS
   ---------------------------------------------------------------------------- */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.server-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.server-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.server-card.is-active-guild {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.server-card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.server-icon-wrapper {
  position: relative;
  flex-shrink: 0;
}

.server-icon-img,
.server-icon-fallback {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.server-icon-fallback {
  background: var(--grad);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  font-family: var(--font-display);
}

.server-live-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--status-online);
  border: 2px solid var(--surface);
  box-shadow: 0 0 8px var(--status-online-glow);
}

.server-info {
  flex: 1;
  min-width: 0;
}

.server-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-meta-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.server-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--card-border);
}

.server-chip.chip-active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.server-chip.chip-members {
  background: rgba(34, 197, 94, 0.12);
  color: var(--status-online);
  border-color: rgba(34, 197, 94, 0.3);
}

.server-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--card-border);
  gap: 12px;
}

.server-id-text {
  font-size: 11px;
  font-family: monospace;
  color: var(--subtle);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.server-id-text:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------------------------
   3. SECTION ANTI-RAID & CENTRE DE SÉCURITÉ
   ---------------------------------------------------------------------------- */
.lockdown-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.lockdown-banner.is-locked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.18) 100%);
  border-color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.25);
}

.lockdown-text-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lockdown-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.lockdown-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 2px 0;
}

.lockdown-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.security-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 22px;
  margin-bottom: 30px;
}

/* Carte de Règle de Sécurité Cyber-Glassmorphism */
.rule-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  backdrop-filter: blur(var(--glass-blur));
  position: relative;
  overflow: hidden;
}

.rule-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.rule-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.rule-card:hover::before {
  opacity: 1;
}

.rule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.rule-title-group {
  flex: 1;
  min-width: 0;
}

.rule-title-group h3 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.rule-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* Vrai Commutateur Switch Toggle iOS / Anime Néon */
.switch-toggle-custom {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle-custom input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--input-bg);
  border: 1px solid var(--card-border);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #94a3b8;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.switch-toggle-custom input:checked + .switch-slider {
  background: var(--grad);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.switch-toggle-custom input:checked + .switch-slider::before {
  transform: translateX(20px);
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Corps de formulaire dans les cartes */
.rule-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--card-border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Curseurs Range Sliders Personnalisés */
.form-range,
input[type="range"].form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--track-bg);
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-range::-webkit-slider-thumb,
input[type="range"].form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--grad);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover,
input[type="range"].form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Menus Déroulants (Select) Élégants en Capsule */
.form-input,
select.form-input,
.control-select {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus,
select.form-input:focus,
.control-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Section Whitelist & URL Tester */
.antiraid-split-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.whitelist-box,
.url-tester-box {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--card-shadow);
}

.tag-cloud-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  min-height: 80px;
  padding: 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.domain-tag {
  background: var(--surface);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tag-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

.tag-remove-btn:hover {
  color: #ef4444;
}

.tag-input-row {
  display: flex;
  gap: 8px;
}

.tag-input-row input {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.tag-input-row input:focus {
  border-color: var(--accent);
}

/* Testeur d'URL */
.url-tester-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  display: none;
}

.url-tester-result.is-visible {
  display: block;
}

.url-tester-result.result-allowed {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.06);
}

.url-tester-result.result-blocked {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.06);
}

/* Tableau d'Audit Logs */
.audit-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: var(--card-shadow);
  -webkit-overflow-scrolling: touch;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.modern-table th {
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.modern-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  vertical-align: middle;
}

.modern-table tr:last-child td {
  border-bottom: none;
}

.severity-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  display: inline-block;
}

.severity-critique {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.severity-moyen {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.severity-faible,
.severity-info {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
}

/* ----------------------------------------------------------------------------
   4. SECTION TICKETS & LIVE CHAT
   ---------------------------------------------------------------------------- */
.ticket-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ticket-kpi-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  box-shadow: var(--card-shadow);
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--text);
  margin-top: 6px;
}

/* Onglets sous-tickets (Liste vs Panel Builder) */
.ticket-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.ticket-tab-btn {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ticket-tab-btn.active {
  background: var(--grad);
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Layout Messagerie Live */
.ticket-chat-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: 640px;
}

.ticket-list-sidebar {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticket-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
}

.ticket-list-scroll {
  flex: 1;
  overflow-y: auto;
}

.ticket-item-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-item-row:hover {
  background: var(--surface-alt);
}

.ticket-item-row.active {
  background: rgba(196, 70, 107, 0.08);
  border-left: 4px solid var(--accent);
}

.chat-conversation-panel {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
}

.chat-messages-stream {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 85%;
}

.chat-msg.is-staff {
  align-self: flex-start;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-bubble {
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}

.chat-meta {
  font-size: 11px;
  color: var(--subtle);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-author-name {
  font-weight: 800;
  color: var(--text);
}

.chat-badge-bot {
  background: #5865f2;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.chat-input-bar {
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
}

.chat-input-field {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}

.chat-input-field:focus {
  border-color: var(--accent);
}

/* Panel Builder & Live Preview Discord */
.panel-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.builder-form-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.form-input {
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

/* Discord Embed Live Preview */
.discord-preview-box {
  background: #313338;
  border: 1px solid #232428;
  border-radius: 16px;
  padding: 24px;
  color: #dbdee1;
  font-family: 'gg sans', 'Noto Sans', system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.discord-embed-wrap {
  border-left: 4px solid #38bdf8;
  background: #2b2d31;
  border-radius: 4px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
}

.discord-embed-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.discord-embed-desc {
  font-size: 13.5px;
  line-height: 1.4;
  color: #dbdee1;
  white-space: pre-line;
}

.discord-embed-banner {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 6px;
}

.discord-select-menu-mock {
  margin-top: 12px;
  background: #1e1f22;
  border: 1px solid #111214;
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #949ba4;
  font-size: 13.5px;
  cursor: pointer;
}

/* ----------------------------------------------------------------------------
   5. SECTION CONFIGURATION, ESPACE OWNER & CLÉS
   ---------------------------------------------------------------------------- */
.config-subnav {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.config-nav-btn {
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.config-nav-btn.active {
  background: var(--grad);
  color: var(--accent-contrast);
  border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.config-tab-pane {
  display: none;
}

.config-tab-pane.active {
  display: block;
}

/* Owner Banner */
.owner-certified-badge {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(202, 138, 4, 0.08) 100%);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.owner-badge-title {
  font-size: 15px;
  font-weight: 800;
  color: #eab308;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Clé d'accès box */
.key-code-box {
  background: var(--surface-alt);
  font-family: monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  color: var(--accent);
}

/* Multi-Bot Instance Cards */
.instance-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Thèmes & Color Pickers */
.theme-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.preset-chip-btn {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip-btn.active,
.preset-chip-btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.color-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.color-picker-item {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(var(--glass-blur));
  position: relative;
  overflow: hidden;
}

.color-picker-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 28px var(--accent-glow);
}

.color-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.color-label-main {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.color-label-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrapper input[type="color"] {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-input-wrapper input[type="color"]:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px var(--accent-glow);
}

.color-hex-val {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  width: 76px;
  padding: 6px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  text-align: center;
  transition: border-color var(--transition-fast);
}

.color-hex-val:focus {
  border-color: var(--accent);
  outline: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .ticket-chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .panel-builder-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   AJOUTS DE SÉCURITÉ & ACCENT THEME (Points 1, 4, 6 du brief)
   ============================================================================ */

/* Contrôles de formulaires avec couleur d'accent du thème */
input[type="checkbox"],
input[type="range"],
.form-range,
select {
  accent-color: var(--accent);
}

.form-range {
  width: 100%;
  cursor: pointer;
}

select.form-input {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}

select.form-input option {
  background: #1c1e2b;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
  white-space: normal;
}

/* Badge 'Bientôt disponible' pour réglages non reliés au bot */
.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
  border: 1px dashed var(--card-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: middle;
}

.rule-card.is-disabled {
  opacity: 0.65;
  border-style: dashed;
}

.rule-card.is-disabled .switch-slider {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Modal de confirmation Lockdown */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  width: min(540px, 92vw);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* ==========================================================================
   NOUVEAUX STYLES : PAGE SERVEURS SCÈNE + RAIL (Point 6)
   ========================================================================== */
.server-workspace-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: 520px;
}

.server-rail-col {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.server-rail-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.server-rail-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 0;
}

.server-rail-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.server-rail-btn:hover {
  border-radius: 16px;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.server-rail-btn.active {
  border-radius: 16px;
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.server-rail-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.server-rail-invite-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.25s ease;
  background: var(--surface-alt);
  margin-top: 6px;
}

.server-rail-invite-btn:hover {
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  transform: scale(1.08);
}

.server-stage-panel {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  padding: 32px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(var(--glass-blur));
}

.server-stage-backdrop {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(50px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  transform: scale(1.15);
  transition: background-image 0.4s ease;
}

.server-stage-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

.server-stage-header {
  display: flex;
  align-items: center;
  gap: 22px;
}

.server-stage-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.server-stage-avatar-img,
.server-stage-avatar-fallback {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.server-stage-avatar-fallback {
  background: var(--grad);
  color: var(--accent-contrast, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  font-family: var(--font-display);
}

.server-stage-titles {
  flex: 1;
  min-width: 0;
}

.server-stage-name {
  font-size: clamp(22px, 2.5vw, 32px);
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.server-stage-bot-perms {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-bot-perm {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.server-stage-id {
  font-size: 12px;
  font-family: monospace;
  color: var(--muted);
}

.server-stage-metrics-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  color: var(--text);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stage-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.metric-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
  display: inline-block;
}

.server-stage-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: auto;
}

.server-shortcut-card {
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.server-shortcut-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px var(--accent-glow);
}

.shortcut-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.shortcut-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.shortcut-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
}

.shortcut-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.shortcut-desc {
  margin: 0 0 14px 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.shortcut-action-link {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   STYLE UNIVERSEL EMOJIS PERSONNALISÉS (Point 4)
   ========================================================================== */
.custom-emoji {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.25em;
  object-fit: contain;
  display: inline-block;
}

.custom-emoji-lg {
  width: 1.6em;
  height: 1.6em;
  vertical-align: -0.3em;
}

/* ==========================================================================
   PIÈCES JOINTES ET LIGHTBOX TICKETS (Point 3)
   ========================================================================== */
.ticket-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text);
}

.ticket-attachment-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.ticket-attachment-remove {
  cursor: pointer;
  color: #ef4444;
  font-weight: 800;
  font-size: 14px;
  border: none;
  background: none;
  padding: 0 4px;
}

.chat-attachment-img {
  max-width: 240px;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  margin-top: 6px;
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease;
}

.chat-attachment-img:hover {
  transform: scale(1.02);
}

.chat-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--card-border);
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

/* Modal Lightbox */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.image-lightbox-modal.is-open {
  display: flex;
}

.image-lightbox-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   CORRECTIONS DE CONTRASTE & ACCENT THEMES (Point 8.a & 5.g)
   ========================================================================== */
.color-picker-item {
  background: var(--surface-alt) !important;
  border-color: var(--card-border) !important;
  color: var(--text) !important;
}

.color-picker-item span {
  color: var(--text) !important;
  font-weight: 700;
  font-size: 13px;
}

.color-hex-val {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--card-border) !important;
}

.server-select-btn {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--card-border) !important;
}

/* Curseurs, cases à cocher et listes utilisant la couleur d'accent du thème actif (Point 5.g) */
input[type="checkbox"],
input[type="radio"],
input[type="range"],
select {
  accent-color: var(--accent) !important;
}

@media (max-width: 768px) {
  .server-workspace-layout {
    flex-direction: column;
  }
  .server-rail-col {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .server-rail-scroll {
    flex-direction: row;
  }
  .server-stage-shortcuts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   BANDEAU STATUT RÉSEAU & RECONNEXION EXPONENTIELLE (Point D)
   ========================================================================== */
.connection-status-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: slideDown 0.25s ease-out;
}

.connection-status-banner.is-reconnecting {
  background: linear-gradient(90deg, #d97706, #b45309);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
}

.connection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Bouton Déconnexion Topbar (Point 1.b) */
.topbar-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 10px;
}

.topbar-auth-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #ef4444;
}

.topbar-auth-btn.is-unlocked {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}
