﻿@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Barlow+Condensed:wght@400;500;600;700&display=swap');

:root {
  --bg:        #0c0d14;
  --surface:   #13141e;
  --surface2:  #1a1b28;
  --bg2:       #1a1b28;
  --border:    #252738;
  --cyan:      #ccff00;
  --pink:      #ff1a6b;
  --purple:    #7c3aed;
  --yellow:    #ffd400;
  --green:     #ccff00;
  --red:       #ff3855;
  --text:      #f0f0fa;
  --muted:     #505268;
  --radius:    6px;
  --font:      'Barlow Condensed', sans-serif;
  --glow-cyan: 0 0 12px rgba(204,255,0,0.55), 0 0 28px rgba(204,255,0,0.2);
  --glow-pink: 0 0 12px rgba(255,26,107,0.55), 0 0 28px rgba(255,26,107,0.2);
  --glow-green:0 0 12px rgba(204,255,0,0.55), 0 0 28px rgba(204,255,0,0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  padding: 24px;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% 90%, rgba(124,58,237,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 5%,  rgba(204,255,0,0.05) 0%, transparent 50%);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Glitch title ── */
h1 {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 36px;
  position: relative;
  display: inline-block;
}

h1::before {
  content: attr(data-text);
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--pink);
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
  animation: glitch 6s infinite;
  opacity: 0.5;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

@keyframes glitch {
  0%, 90%, 100% { transform: translateX(0); }
  92%            { transform: translateX(-3px); }
  94%            { transform: translateX(3px); }
  96%            { transform: translateX(-1px); }
}

h2 {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 20px;
}

/* ── Auth section ── */
.auth-section {
  background: var(--surface);
  border: 1px solid var(--cyan);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 420px;
  margin: 80px auto;
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(204,255,0,0.03);
  position: relative;
  overflow: hidden;
}

.auth-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* corner brackets */
.auth-section::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  border-bottom: 2px solid var(--pink);
  border-right:  2px solid var(--pink);
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}

.form-group input {
  background: var(--surface2);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Barlow Condensed', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 2px;
}

.form-group input:focus {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

button {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(204,255,0,0.45);
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, border-color 0.18s;
}

button:hover {
  background: var(--cyan);
  color: #0c0d14;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

button::before { display: none; }

.error {
  color: var(--pink);
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 8px;
  text-shadow: var(--glow-pink);
}

.status-message {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  flex: 1;
  text-align: center;
}

/* ── Dashboard header ── */
.dashboard { display: block; }

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 80px; height: 1px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.logout-btn {
  color: var(--pink);
  border-color: rgba(255,26,107,0.45);
  font-size: 12px;
  padding: 8px 16px;
}

.logout-btn::before { background: var(--pink); }

.logout-btn:hover {
  color: var(--bg);
  box-shadow: var(--glow-pink);
}

/* ── Category sections ── */
.category-section { margin-bottom: 40px; }

.category-title {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
}

.category-title::before {
  content: '//';
  color: var(--muted);
}

.category-chevron {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.3s ease;
  margin-left: auto;
}

.category-title.collapsed .category-chevron {
  transform: rotate(-90deg);
}

.category-commands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.category-commands.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

/* ── Command cards ── */
.command-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.command-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
  transition: background 0.2s, box-shadow 0.2s;
}

.command-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 28px rgba(204,255,0,0.18), 0 0 12px rgba(204,255,0,0.1);
  background: var(--surface2);
}

.command-card:hover::before {
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.command-info { flex: 1; min-width: 0; }

.command-name {
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 6px;
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.command-card:hover .command-name {
  text-shadow: 0 6px 14px rgba(204,255,0,0.45);
}

.command-category {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bg);
  display: inline-block;
  background: var(--muted);
  padding: 2px 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.command-card:hover .command-category {
  background: var(--cyan);
  color: var(--bg);
}

.command-description {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.5px;
  transition: transform 0.25s ease;
}

.command-card:hover .command-description {
  transform: translateY(-2px);
}

/* ── Toggle switch ── */
.toggle-switch {
  position: relative;
  width: 54px;
  height: 28px;
  background: var(--surface2);
  border-radius: 2px;
  border: 1px solid var(--muted);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.toggle-switch.enabled {
  border-color: var(--green);
  box-shadow: var(--glow-green);
}

.toggle-switch .toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--muted);
  border-radius: 1px;
  transition: left 0.3s, background 0.3s, box-shadow 0.3s;
}

.toggle-switch.enabled .toggle-slider {
  left: calc(100% - 23px);
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ── Loading ── */
.loading {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  letter-spacing: 2px;
  font-size: 13px;
  animation: blink 1.2s step-end infinite;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── Tab navigation ── */
.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--muted);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: color 0.2s, border-color 0.2s;
  background: transparent;
  box-shadow: none;
}

.tab-btn::before { display: none; }

.tab-btn:hover {
  color: var(--cyan);
  box-shadow: none;
  background: transparent;
}

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

/* ── XP sections ── */
.xp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.xp-section:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 28px rgba(204,255,0,0.15);
}

.xp-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.xp-section:hover .xp-section-title {
  text-shadow: 0 6px 14px rgba(255,26,107,0.5), var(--glow-pink);
}

.xp-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.xp-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Barlow Condensed', sans-serif;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a5a7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.form-row select option { background: var(--surface2); color: var(--text); }

.form-row textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.xp-excluded-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.xp-excluded-item-body { flex: 1; min-width: 0; }

.xp-excluded-trigger {
  font-size: 0.82rem;
  color: var(--cyan);
  word-break: break-word;
}

.xp-excluded-match {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 6px;
}

.xp-excluded-responses {
  font-size: 0.78rem;
  color: var(--text);
  margin-top: 3px;
  word-break: break-word;
  opacity: 0.8;
}

.xp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xp-actions button { font-size: 10px; padding: 8px 14px; }

.danger-btn {
  color: var(--red) !important;
  border-color: var(--red) !important;
}

.danger-btn:hover {
  background: var(--red) !important;
  color: var(--bg) !important;
  box-shadow: var(--glow-pink) !important;
}

/* ── Leaderboard ── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 12px;
}

.leaderboard-table th {
  text-align: left;
  padding: 8px 12px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.leaderboard-table tbody tr:hover td { background: var(--surface2); }

.lb-rank { color: var(--muted); font-size: 11px; }
.lb-user { color: var(--text); }
.lb-level { color: var(--cyan); font-family: 'Orbitron', monospace; font-size: 11px; }
.lb-xp { color: var(--green); }
.lb-msgs { color: var(--muted); }

/* ── Disabled card state ── */
.command-card:has(.toggle-switch:not(.enabled)) .command-name {
  color: var(--muted);
}

/* ── Features ── */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.feature-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  transition: background 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 28px rgba(204,255,0,0.18), 0 0 12px rgba(204,255,0,0.1);
}

.feature-card:hover::before {
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.feature-info {
  flex: 1;
}

.feature-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.feature-card:hover .feature-name {
  color: var(--cyan);
}

.feature-description {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.feature-card:has(.toggle-switch.enabled) .feature-name {
  color: var(--cyan);
}

.feature-description strong {
  color: var(--text);
}

.feature-card:has(.toggle-switch:not(.enabled)) .feature-name {
  color: var(--muted);
}

/* ── Feature expand panel ── */
.feature-expand {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.welcome-section-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 22px;
  margin-bottom: 6px;
}

.feature-expand > .welcome-section-label:first-child {
  margin-top: 0;
}

.welcome-channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-channel-row select {
  flex: 1;
  max-width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a5a7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.welcome-channel-row select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(204,255,0,0.15);
}

.welcome-channel-row select option {
  background: var(--surface2);
  color: var(--text);
}

.welcome-msgs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.welcome-msgs-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.05em;
}

/* ── Placeholder help tooltip ── */
.placeholder-help {
  position: relative;
  display: inline-block;
}

.placeholder-help-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-family: 'Barlow Condensed', sans-serif;
  cursor: help;
  transition: border-color 0.2s, color 0.2s;
  user-select: none;
}

.placeholder-help:hover .help-icon {
  border-color: var(--cyan);
  color: var(--cyan);
}

.help-tooltip {
  display: none;
  position: absolute;
  right: 0;
  bottom: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 300px;
  z-index: 200;
  font-size: 0.78rem;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.placeholder-help:hover .help-tooltip {
  display: block;
}

.help-tooltip-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.help-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}

.help-row code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--yellow);
  white-space: nowrap;
  font-size: 0.75rem;
  min-width: 120px;
}

.help-row span {
  color: var(--muted);
}

.help-divider {
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.help-note {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

.help-example {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.help-example em {
  color: var(--text);
  font-style: normal;
  font-family: 'Barlow Condensed', sans-serif;
}

/* ── Message input rows ── */
#welcome-msg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.msg-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  padding: 8px 10px;
  resize: vertical;
  min-height: 52px;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.msg-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(204,255,0,0.15);
}

.msg-input::placeholder {
  color: var(--muted);
}

.msg-remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-remove-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: transparent;
  box-shadow: none;
}

.msg-remove-btn::before { display: none; }

.welcome-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Section search bar (top of each page) ── */
.section-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.section-search-bar:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(204,255,0,0.12);
}

.section-search-icon {
  color: var(--muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.section-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  width: 100%;
}

.section-search-bar input::placeholder { color: var(--muted); }

/* ── Global search page ── */
.global-search-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.global-search-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.global-search-bar:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(204,255,0,0.15);
}

.global-search-icon {
  color: var(--cyan);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.global-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  width: 100%;
}

.global-search-bar input::placeholder { color: var(--muted); }

.global-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-result-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(204,255,0,0.1);
}

.search-navigable { cursor: pointer; }

.search-feature-card { margin: 0; }

.search-feature-label { margin-bottom: 8px; }

.search-goto-arrow {
  color: var(--muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.18s, transform 0.18s;
}

.search-navigable:hover .search-goto-arrow {
  color: var(--cyan);
  transform: translateX(4px);
}

.search-result-badge {
  font-family: 'Orbitron', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--bg);
  background: var(--cyan);
}

.badge-commands { background: var(--pink); }
.badge-xp { background: var(--yellow); color: var(--bg); }
.badge-features { background: var(--green); color: var(--bg); }
.badge-bot-settings { background: var(--cyan); }

.search-result-body { flex: 1; min-width: 0; }

.search-result-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Login page ── */
.login-box {
  max-width: 440px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--cyan);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(204,255,0,0.03);
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scan 3s linear infinite;
}

.login-icon {
  font-size: 48px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 20px;
  display: block;
}

.login-desc {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.discord-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #5865f2;
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.discord-login-btn:hover {
  background: #4752c4;
  box-shadow: 0 0 16px rgba(88,101,242,0.5);
}

.discord-logo {
  width: 20px;
  height: 20px;
  fill: white;
  flex-shrink: 0;
}

.text-link {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.2s;
}

.text-link:hover { color: var(--cyan); }

/* ── Guild selector ── */
.guild-selector-panel {
  max-width: 700px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px 40px;
  text-align: center;
}

.guild-selector-header {
  margin-bottom: 40px;
}

.guild-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}

.guild-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s;
  width: 96px;
}

.guild-card:hover { transform: translateY(-5px); }

.guild-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guild-card:hover .guild-icon {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.guild-icon-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guild-card:hover .guild-icon-placeholder {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.guild-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-align: center;
  word-break: break-word;
  transition: color 0.2s;
}

.guild-card:hover .guild-name { color: var(--text); }

/* ── Guild switcher dropdown ── */
.guild-switcher {
  position: relative;
}

.guild-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.guild-switcher-btn:hover { border-color: var(--cyan); background: var(--surface2); }

.guild-switcher-current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guild-switcher-chevron {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
}

.guild-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.gs-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.gs-menu-item:hover { background: var(--surface2); }

.gs-menu-item--active .gs-name { color: var(--cyan); }

.gs-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gs-icon-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gs-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.gs-check {
  color: var(--cyan);
  font-size: 11px;
  flex-shrink: 0;
}

/* ── No access / Sad robot ── */
.no-access-box {
  text-align: center;
  max-width: 480px;
  margin: 60px auto;
}

.robot-wrap {
  margin-bottom: 28px;
}

.sad-robot {
  width: 140px;
  height: auto;
  animation: robot-float 3s ease-in-out infinite;
  overflow: visible;
}

@keyframes robot-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.robot-pupil {
  transform-origin: center;
  animation: robot-blink 5s ease-in-out infinite;
}

@keyframes robot-blink {
  0%, 38%, 46%, 100% { transform: scaleY(1); }
  42% { transform: scaleY(0.08); }
}

.robot-tear {
  animation: tear-fade 3.5s ease-in-out infinite;
}

.robot-teardrop {
  animation: tear-fall 3.5s ease-in-out infinite;
}

@keyframes tear-fade {
  0%, 50% { opacity: 0; }
  70%, 85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tear-fall {
  0%, 50% { opacity: 0; transform: translateY(0); }
  70% { opacity: 0.8; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

.no-access-msg {
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.no-access-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

.no-access-actions { margin-top: 8px; }

/* ── Dashboard header updates ── */
.header {
  justify-content: space-between;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-guild {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

.header-guild-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

.header-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}


.logout-btn-link { text-decoration: none; }

/* ── Dashboard sidebar layout ── */
.dashboard-body {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 0 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border-left: 3px solid transparent;
  user-select: none;
}

.sidebar-item:hover {
  background: rgba(204,255,0,0.04);
  color: var(--text);
}

.sidebar-item.active {
  background: rgba(204,255,0,0.08);
  color: var(--cyan);
  border-left-color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.sidebar-icon { font-size: 16px; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 14px;
}

.dashboard-content {
  flex: 1;
  padding-left: 28px;
  min-width: 0;
}

/* ── Settings cards ── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.settings-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 28px rgba(204,255,0,0.15);
}

.settings-card-title {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.settings-card:hover .settings-card-title {
  text-shadow: 0 6px 14px rgba(255,26,107,0.5), var(--glow-pink);
}

.settings-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.settings-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.settings-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  color: var(--cyan);
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'Barlow Condensed', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-row input:focus {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

/* ── Avatar upload ── */
.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.avatar-upload-area:hover {
  border-color: var(--cyan);
  background: rgba(204,255,0,0.03);
}
.avatar-upload-area.has-image {
  border-style: solid;
  border-color: var(--cyan);
}
#avatar-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.premium-lock {
  font-size: 9px;
  background: rgba(204,255,0,0.08);
  color: var(--cyan);
  border: 1px solid rgba(204,255,0,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.08em;
  vertical-align: middle;
  margin-left: 8px;
}

/* ── Prefix selector ── */
.prefix-selector {
  display: flex;
  gap: 10px;
}

.prefix-btn {
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 22px;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0;
  border-color: var(--muted);
  color: var(--muted);
  flex-shrink: 0;
}

.prefix-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
  text-shadow: var(--glow-cyan);
}

.prefix-btn.active::before { display: none; }

/* ── Free games textarea ── */
.fg-msg-input {
  min-height: 88px;
}

/* ── Audit Log ── */
.audit-log-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.audit-entry:hover {
  border-color: rgba(204,255,0,0.3);
  box-shadow: 0 4px 16px rgba(204,255,0,0.08);
  transform: translateY(-1px);
}

.audit-entry-reverted { opacity: 0.55; }

.audit-avatar { flex-shrink: 0; }

.audit-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.audit-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: var(--muted);
}

.audit-body {
  flex: 1;
  min-width: 0;
}

.audit-desc {
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.3px;
  margin-bottom: 5px;
}

.audit-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.audit-revert-btn {
  color: var(--yellow);
  border-color: var(--yellow);
  font-size: 10px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.audit-revert-btn:hover {
  background: var(--yellow) !important;
  color: var(--bg) !important;
  box-shadow: 0 0 8px var(--yellow), 0 0 20px rgba(240,224,0,0.3) !important;
}

.audit-reverted-badge {
  font-family: 'Orbitron', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--muted);
  color: var(--bg);
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Moderation / Automod ── */

#automod-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.automod-category-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.1em;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 18px;
}

.automod-expand {
  padding: 28px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.automod-setting-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.punishment-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.automod-setting-row-inline {
  flex-direction: row;
  gap: 32px;
  align-items: flex-start;
}

.automod-setting-row-inline > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.automod-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.automod-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: none;
  font-weight: normal;
  letter-spacing: normal;
  margin-top: 4px;
}

.automod-inline-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.automod-list-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 88px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.automod-list-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(204,255,0,0.08);
}

.automod-number-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  width: 72px;
  transition: border-color 0.2s;
}

.automod-number-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.automod-duration-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.duration-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.duration-unit {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  padding: 10px 14px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.duration-unit:focus {
  outline: none;
  border-color: var(--cyan);
}

.punishment-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  padding: 10px 14px;
  transition: border-color 0.2s;
  cursor: pointer;
  max-width: 220px;
}

.punishment-select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255,26,107, 0.08);
}

.automod-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ── Tickets ── */

.ticket-mode-label,
.ticket-field-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 10px;
  display: block;
}

.ticket-mode-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.ticket-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  transition: border-color 0.2s;
  flex: 1;
  min-width: 180px;
}

.ticket-mode-option:has(input:checked) {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(204,255,0,0.1);
}

.ticket-mode-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--cyan);
  flex-shrink: 0;
}

.ticket-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.ticket-type-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ticket-type-card:hover {
  border-color: var(--cyan);
}

.ticket-type-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.ticket-type-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.ticket-type-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ticket-meta-chip {
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 6px;
  color: var(--muted);
}

.ticket-role-chip {
  font-size: 10px;
  background: rgba(204,255,0,0.1);
  border: 1px solid rgba(204,255,0,0.3);
  border-radius: 2px;
  padding: 2px 6px;
  color: var(--cyan);
  display: inline-block;
  margin: 2px 3px 2px 0;
}

.ticket-type-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.small-btn {
  font-size: 10px;
  padding: 5px 10px;
}

.ticket-edit-form {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 16px;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ticket-form-row select,
.ticket-form-row input[type="text"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.ticket-form-row select:focus,
.ticket-form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
}

.tf-roles-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tf-role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  transition: background 0.15s;
}

.tf-role-item:hover {
  background: rgba(204,255,0,0.06);
}

.tf-role-item input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.tf-role-name {
  color: var(--text);
  font-size: 13px;
}

.ticket-form-actions {
  display: flex;
  gap: 8px;
}

/* ── Ticket History ── */

.ticket-history-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.ticket-history-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.ticket-history-group-header:hover {
  background: var(--surface);
}

.ticket-history-group-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
}

.ticket-history-group-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.th-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.th-badge-open {
  background: rgba(0, 255, 159, 0.1);
  color: var(--green);
  border-color: rgba(0, 255, 159, 0.3);
}

.ticket-history-chevron {
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}

.ticket-history-list {
  background: var(--bg);
}

.ticket-history-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
}

.ticket-history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  transition: background 0.1s;
}

.ticket-history-row:hover {
  background: var(--surface2);
}

.th-number {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  color: var(--cyan);
  min-width: 52px;
  flex-shrink: 0;
}

.th-user {
  color: var(--text);
  min-width: 110px;
  flex-shrink: 0;
}

.th-status {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.th-status-open    { background: rgba(0,255,159,0.12); color: var(--green); }
.th-status-closed  { background: rgba(90,110,138,0.2); color: var(--muted); }
.th-status-deleted { background: rgba(255,26,107,0.12); color: var(--red); }

.th-time {
  color: var(--muted);
  font-size: 11px;
  flex: 1;
}

/* ── Autopost & Stream Alerts ────────────────────────────────────── */

.ap-platform-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.ap-platform-chip {
  padding: 5px 13px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ap-platform-chip:not(.ap-premium):hover {
  border-color: var(--cyan);
  color: var(--text);
}

.ap-platform-chip.selected { color: var(--text); background: rgba(204,255,0,0.07); }

.ap-platform-chip.ap-plat-youtube.selected    { border-color: #FF4444; }
.ap-platform-chip.ap-plat-patreon.selected    { border-color: #FF424D; }
.ap-platform-chip.ap-plat-reddit.selected     { border-color: #FF5722; }
.ap-platform-chip.ap-plat-bluesky.selected    { border-color: #0085FF; }
.ap-platform-chip.ap-plat-medium.selected     { border-color: #AAAAAA; }
.ap-platform-chip.ap-plat-substack.selected   { border-color: #FF6719; }
.ap-platform-chip.ap-plat-soundcloud.selected { border-color: #FF3300; }
.ap-platform-chip.ap-plat-twitch.selected     { border-color: #9146FF; }
.ap-platform-chip.ap-plat-kick.selected       { border-color: #53FC18; }
.ap-platform-chip.ap-plat-twitter.selected    { border-color: #1DA1F2; }
.ap-platform-chip.ap-plat-instagram.selected  { border-color: #E1306C; }
.ap-platform-chip.ap-plat-tiktok.selected     { border-color: #69C9D0; }

.ap-platform-chip.ap-premium {
  opacity: 0.42;
  cursor: not-allowed;
}

.ap-premium-badge {
  font-size: 9px;
  background: rgba(255,212,0,0.12);
  border: 1px solid rgba(255,212,0,0.35);
  color: #ffd400;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.ap-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  gap: 12px;
}

.ap-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ap-platform-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ap-plat-youtube    { background: rgba(255,68,68,0.12);   border: 1px solid rgba(255,68,68,0.35);   color: #FF4444; }
.ap-plat-patreon    { background: rgba(255,66,77,0.12);   border: 1px solid rgba(255,66,77,0.35);   color: #FF424D; }
.ap-plat-reddit     { background: rgba(255,87,34,0.12);   border: 1px solid rgba(255,87,34,0.35);   color: #FF5722; }
.ap-plat-bluesky    { background: rgba(0,133,255,0.12);   border: 1px solid rgba(0,133,255,0.35);   color: #0085FF; }
.ap-plat-medium     { background: rgba(180,180,180,0.10); border: 1px solid rgba(180,180,180,0.28); color: #AAAAAA; }
.ap-plat-substack   { background: rgba(255,103,25,0.12);  border: 1px solid rgba(255,103,25,0.35);  color: #FF6719; }
.ap-plat-soundcloud { background: rgba(255,51,0,0.12);    border: 1px solid rgba(255,51,0,0.35);    color: #FF3300; }
.ap-plat-twitch     { background: rgba(145,70,255,0.12);  border: 1px solid rgba(145,70,255,0.35);  color: #9146FF; }
.ap-plat-kick       { background: rgba(83,252,24,0.10);   border: 1px solid rgba(83,252,24,0.32);   color: #53FC18; }
.ap-plat-twitter    { background: rgba(29,161,242,0.12);  border: 1px solid rgba(29,161,242,0.35);  color: #1DA1F2; }
.ap-plat-instagram  { background: rgba(225,48,108,0.12);  border: 1px solid rgba(225,48,108,0.35);  color: #E1306C; }
.ap-plat-tiktok     { background: rgba(105,201,208,0.12); border: 1px solid rgba(105,201,208,0.35); color: #69C9D0; }

.ap-account-url {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ap-account-ch {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.ap-account-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.sa-live-dot {
  font-size: 10px;
  color: #FF4444;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  animation: sa-blink 1.8s step-start infinite;
}

@keyframes sa-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.ap-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ap-form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-form-section select,
.ap-form-section input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.ap-form-section select:focus,
.ap-form-section input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
}

/* ── Sidebar premium badge ───────────────────────────────────────── */

.sidebar-premium {
  padding: 6px 14px 12px;
}

.sp-plan {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.sp-plan-name {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.sp-plan.sp-premium .sp-plan-name {
  color: #ffd400;
  text-shadow: 0 0 10px rgba(255, 212, 0, 0.4);
}

.sp-plan-icon {
  font-size: 11px;
  color: #ffd400;
}

.sp-plan-sub {
  font-size: 10px;
  color: var(--muted);
}

.sp-upgrade-btn {
  display: inline-block;
  font-size: 11px;
  font-family: var(--font);
  color: var(--cyan);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, text-shadow 0.15s;
}

.sp-upgrade-btn:hover {
  color: var(--text);
  text-shadow: var(--glow-cyan);
}

/* ── Reaction Roles ──────────────────────────────────────────────── */

.rr-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.02);
}

.rr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rr-panel-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rr-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.rr-panel-ch {
  font-size: 11px;
  color: var(--muted);
}

.rr-msg-link {
  font-size: 10px;
  color: var(--cyan);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.rr-msg-link:hover {
  opacity: 1;
}

.rr-panel-options {
  margin-bottom: 10px;
}

.rr-option-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.rr-option-label input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.rr-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rr-edit-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.rr-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.rr-edit-fields input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  transition: border-color 0.2s;
}

.rr-edit-fields input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
}

.rr-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rr-edit-status {
  font-size: 11px;
}

.rr-pairs {
  margin-bottom: 10px;
}

.rr-pair-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.rr-pair-row:last-child {
  border-bottom: none;
}

.rr-pair-emoji {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.rr-pair-arrow {
  color: var(--muted);
  font-size: 11px;
}

.rr-pair-role {
  font-size: 12px;
  color: var(--text);
  flex: 1;
}

.rr-pair-remove {
  padding: 1px 6px;
  font-size: 10px;
}

.rr-add-pair-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  flex-wrap: wrap;
}

.rr-emoji-input {
  width: 90px;
  padding: 5px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}

.rr-emoji-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.rr-add-pair-row .rr-role-select {
  flex: 1;
  min-width: 120px;
  padding: 5px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
}

.rr-add-pair-row .rr-role-select:focus {
  outline: none;
  border-color: var(--cyan);
}

.rr-pair-status {
  font-size: 11px;
}

/* ── Theme Testing Section ───────────────────────────────────────── */

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

.theme-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.theme-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

.theme-card.theme-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 8px 28px rgba(0,0,0,0.3);
}

/* Mini preview */
.theme-card-preview {
  background: var(--tc-bg);
  height: 130px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.tcp-bar {
  background: var(--tc-surface);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.tcp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tcp-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--tc-text);
  font-family: monospace;
}

.tcp-sidebar {
  position: absolute;
  top: 26px;
  left: 0;
  bottom: 0;
  width: 52px;
  background: var(--tc-surface);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 6px;
}

.tcp-sitem {
  height: 10px;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.tcp-sitem.active {
  border-left-color: var(--tc-accent);
  background: rgba(255,255,255,0.12);
}

.tcp-content {
  position: absolute;
  top: 30px;
  left: 60px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tcp-card {
  background: var(--tc-surface);
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255,255,255,0.06);
}

.tcp-card-title {
  height: 5px;
  border-radius: 2px;
  width: 60%;
  opacity: 0.9;
}

.tcp-card-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  width: 85%;
}

.tcp-btn {
  margin-top: 4px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid;
  align-self: flex-start;
  font-family: monospace;
}

/* Info below preview */
.theme-card-info {
  padding: 14px 16px;
}

.theme-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.theme-active-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--cyan);
  color: var(--bg);
  text-transform: uppercase;
}

/* ── Premium system ─────────────────────────────────────────────── */
.theme-card-preview {
  position: relative;
}
.theme-premium-lock {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--cyan);
  color: var(--bg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}
.plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}
.plan-badge-free {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.plan-badge-premium {
  background: rgba(0,245,255,0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,245,255,0.2);
}
.sidebar-premium-section {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.btn-upgrade-sidebar {
  font-size: 11px;
  padding: 6px 12px;
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}
.btn-upgrade-sidebar:hover { opacity: 0.85; }
.btn-manage-sidebar {
  font-size: 11px;
  padding: 6px 12px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-manage-sidebar:hover { color: var(--text); border-color: var(--muted); }

/* ── Admin panel ─────────────────────────────────────────────────── */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .admin-two-col { grid-template-columns: 1fr; }
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.admin-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  transition: border-color 0.2s;
}

.admin-stat-card--accent {
  border-color: rgba(var(--cyan-rgb, 204,255,0), 0.3);
}

.admin-stat-card--revenue .admin-stat-value {
  color: #4ade80;
}

.admin-stat-card--revenue {
  border-color: rgba(74, 222, 128, 0.2);
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cyan);
  font-family: 'Orbitron', monospace;
  margin-bottom: 5px;
  line-height: 1.1;
}

.admin-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Feature adoption bars */
.admin-adoption-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.admin-adoption-row:last-child { border-bottom: none; }

.admin-adoption-label {
  font-size: 11.5px;
  color: var(--text);
  min-width: 175px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-adoption-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.admin-adoption-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  min-width: 2px;
}

.admin-adoption-stat {
  font-size: 12px;
  color: var(--text);
  min-width: 56px;
  text-align: right;
  flex-shrink: 0;
}

.admin-adoption-pct {
  color: var(--muted);
  font-size: 10.5px;
  margin-left: 4px;
}

/* Recent rows */
.admin-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 10px;
}

.admin-recent-row:last-child { border-bottom: none; }

.admin-recent-id {
  font-family: monospace;
  font-size: 12px;
  color: var(--text);
}

.admin-recent-date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.plan-badge-admin {
  background: rgba(255, 200, 0, 0.1);
  color: #ffc800;
  border: 1px solid rgba(255, 200, 0, 0.25);
}
