/* ══════════════════════════════════════════════
   LoreBot Dashboard
   Neutral dark + warm gold. Clean utility panel.
   ══════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  /* Backgrounds — true neutral dark */
  --bg-deepest: #0c0c0f;
  --bg-dark: #121215;
  --bg-surface-low: #1a1a1e;
  --bg-surface: #202025;
  --bg-surface-raised: #2a2a30;

  /* Accent — steel blue */
  --accent: #335988;
  --accent-dim: rgba(51, 89, 136, 0.10);
  --accent-hover: #2a4a73;

  /* Text — neutral */
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.22);

  /* Signals (moderation severity only — never decorative) */
  --signal-red: #ef4444;
  --signal-red-dim: rgba(239, 68, 68, 0.12);
  --signal-amber: #f59e0b;
  --signal-amber-dim: rgba(245, 158, 11, 0.12);
  --signal-green: #22c55e;
  --signal-green-dim: rgba(34, 197, 94, 0.12);

  /* Shadows */
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 12px 48px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-display: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Discord */
  --discord: #5865F2;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #101014 0%, #0a0a0e 50%, #080810 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 255, 255, 0.15); }

/* ── Focus: WCAG 2.1 AA visible focus states ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* ── Login ── */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 16px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: var(--shadow-elevated);
}
.login-card h1 { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; font-weight: 600; letter-spacing: -0.3px; }
.login-card p { color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  background: var(--bg-deepest);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent) 0%, #1e3a5c 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.sidebar-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; }

.nav-section { padding: 0 12px; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.3;
  padding: 18px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  margin: 1px 0;
  padding-left: 12px;
  border-radius: 6px;
}
.nav-item:hover { color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); }
.nav-item.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Nav icon squares ── */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(12, 12, 15, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.25);
  border-radius: 7px;
  font-size: 11px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-item:hover .nav-icon { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}
.user-pill { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.logout-link {
  font-size: 12px;
  color: var(--text-muted) !important;
  border-left: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}
.logout-link:hover { color: var(--signal-red) !important; }

/* ── Content ── */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 36px;
}

/* Headline: 600, 22px, -0.3px tracking */
h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.section { display: none; }
.section.active { display: block; }

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
  min-height: 20px;
}

/* ── Section header label ── */
.section-header-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-2 .card { margin-bottom: 0; }

/* ── Overview Banner ── */
.overview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.overview-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.banner-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  min-height: 18px;
}
.banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.automod-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
}
.automod-status-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Stat Grid (individual cards with icons) ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(12, 12, 15, 0.6);
  color: var(--text-secondary);
  border: 1px solid rgba(82, 82, 91, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.stat-card-icon.icon-red,
.stat-card-icon.icon-amber,
.stat-card-icon.icon-green { color: var(--text-secondary); }
.stat-card-body { min-width: 0; }
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 4px;
}

/* ── Stats Strip (compact version for sub-pages like Warnings) ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stats-strip .stat-item {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.stat-divider { display: none; }
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Overview two-column grid ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Quick Links ── */
.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.quick-link {
  background: var(--bg-surface);
  border: none;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-link:hover {
  background: var(--bg-surface-raised);
}
/* Featured quick links — first two */
.quick-link.ql-featured {
  grid-column: span 2;
  padding: 10px 12px;
}
.quick-link.ql-featured .ql-icon {
  width: 28px;
  height: 28px;
  font-size: 11px;
  border-radius: 6px;
}

/* ── Quick-link icon squares ── */
.ql-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(12, 12, 15, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.25);
  border-radius: 5px;
  font-size: 9px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.15s;
}
.quick-link:hover .ql-icon {
  color: var(--text-primary);
}
.quick-link-body { min-width: 0; }
.quick-link-title { font-size: 12px; font-weight: 600; }
.quick-link-desc { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* ── Overview activity mini-feed ── */
.overview-activity-card {
  padding: 0 !important;
  overflow: visible;
}
.overview-activity-card .section-header-label {
  padding: 14px 16px 8px;
}
.overview-activity-card .modlog-feed {
  max-height: 340px;
  padding: 8px 16px;
  overflow-y: auto;
}
.overview-activity-card .modlog-entry {
  padding: 8px 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
}
.overview-activity-card .modlog-entry:hover {
  background: rgba(0, 0, 0, 0.15);
}
.overview-activity-card .modlog-entry-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 10px;
  flex-shrink: 0;
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--border-hover);
}
/* Title: 600, 14px */
.card h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--accent);
}
/* Label: 600, 10px, uppercase */
.card h4 {
  font-size: 10px;
  color: var(--text-muted);
  margin: 12px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  line-height: 1.3;
}

/* ── Panels ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .form-group { margin-bottom: 0; }
.form-group label i {
  color: var(--accent);
  width: 14px;
  text-align: center;
  margin-right: 6px;
  font-size: 12px;
}

.panel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
}
.panel-split--asym { grid-template-columns: 3fr 2fr; }
.panel-col { padding: 20px; }
.panel-col + .panel-col { border-left: 1px solid var(--border-subtle); }

.panel-stack { padding: 0; }
.panel-section { padding: 20px; }
.panel-section + .panel-section { border-top: 1px solid var(--border-subtle); }

/* ── Card header with severity badge ── */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-header h3 { margin-bottom: 0; }
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(12, 12, 15, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.25);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--signal-amber-dim);
  color: var(--signal-amber);
  margin-left: auto;
}
.severity-badge.badge-red {
  background: var(--signal-red-dim);
  color: var(--signal-red);
}
.severity-badge.badge-orange {
  background: var(--signal-amber-dim);
  color: var(--signal-amber);
}

/* ── Toggle ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.toggle-row span { font-size: 12px; color: var(--text-secondary); }
.toggle-label { font-size: 14px; font-weight: 600; }
.toggle-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
/* (tier toggle overrides removed — tiers now use perk chips) */
.toggle input {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-hover);
  border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: transform 0.15s;
}
.toggle input:checked + .slider { background: var(--signal-green); }
.toggle input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 13px; font-weight: 500;
  font-family: inherit;
  text-decoration: none; transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn-discord {
  background: var(--discord); color: #fff;
  padding: 11px 28px;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}
.btn-discord:hover { background: #4752c4; box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35); }
.btn-primary {
  background: var(--accent);
  color: #e4e4e7;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger {
  background: var(--signal-red-dim); color: var(--signal-red);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--border-hover); }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-group select,
.form-group input,
.form-group textarea {
  width: 100%; padding: 9px 14px;
  background: rgba(0, 0, 0, 0.15); border: none;
  border-radius: 8px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s;
}
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.form-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ── Custom Dropdown ── */
.custom-dropdown {
  position: relative;
  width: 100%;
}
.custom-dropdown .cd-trigger {
  width: 100%;
  padding: 9px 14px;
  padding-right: 32px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.custom-dropdown .cd-trigger:hover {
  border-color: var(--border-subtle);
}
.custom-dropdown.open .cd-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 89, 136, 0.15);
}
.custom-dropdown .cd-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.2s;
}
.custom-dropdown.open .cd-arrow {
  transform: translateY(-50%) rotate(180deg);
}
.custom-dropdown .cd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.custom-dropdown.open .cd-menu {
  display: block;
  animation: cdFadeIn 0.12s ease-out;
}
@keyframes cdFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.custom-dropdown .cd-menu::-webkit-scrollbar { width: 6px; }
.custom-dropdown .cd-menu::-webkit-scrollbar-track { background: transparent; }
.custom-dropdown .cd-menu::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
.custom-dropdown .cd-option {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-dropdown .cd-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.custom-dropdown .cd-option.selected {
  background: rgba(51, 89, 136, 0.2);
  color: var(--text-primary);
}
.custom-dropdown .cd-optgroup {
  padding: 6px 10px 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.custom-dropdown .cd-search {
  padding: 6px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-surface-raised);
  z-index: 1;
}
.custom-dropdown .cd-search input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.custom-dropdown .cd-search input:focus {
  border-color: var(--accent);
}
.custom-dropdown .cd-no-results {
  padding: 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Channel Grid ── */
.channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.channel-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.channel-card:hover {
  border-color: var(--border-hover);
}
.channel-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.channel-card-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent);
  background: rgba(12, 12, 15, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.channel-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.channel-card select {
  width: 100%;
  padding: 9px 14px;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 8px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color 0.15s;
}
.channel-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.inline-form input {
  flex: 1; padding: 9px 14px;
  background: rgba(0, 0, 0, 0.15); border: none;
  border-radius: 8px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  color: var(--text-primary); font-size: 13px; font-family: inherit;
}
.inline-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }

/* ── Word Lists ── */
.wordlist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.wordlist-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.wordlist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.wordlist-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.wordlist-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}
.wordlist-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: auto;
}
.wordlist-items {
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  padding: 2px 0;
}
.wordlist-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-surface-low);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: default;
}
.wordlist-item:has(.wordlist-remove):hover {
  background: var(--bg-surface-raised);
  border-color: var(--border-active);
}
.wordlist-hits {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.wordlist-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  transition: color 0.1s;
}
.wordlist-remove:hover {
  color: var(--signal-red);
}
.wordlist-empty {
  padding: 16px 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.wordlist-card .inline-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Tags ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--bg-surface-low);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, border-color 0.15s;
}
.tag:hover { background: var(--bg-surface-raised); border-color: var(--border-active); }
.tag.default { opacity: 0.5; }
.tag .remove {
  cursor: pointer; color: var(--signal-red); font-weight: bold;
  margin-left: 3px; font-size: 13px; line-height: 1;
  opacity: 0.6; transition: opacity 0.15s;
  background: none; border: none; padding: 0; font-family: inherit;
}
.tag .remove:hover { opacity: 1; }
.tag.regex {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Auto-Responder ── */
.resp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
}
.resp-header .btn { margin-top: 4px; }
.resp-header .page-sub { margin-bottom: 20px; }

/* Pill-style tabs */
.resp-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: none;
  box-shadow: var(--shadow-card);
  width: fit-content;
}
.resp-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
  border-radius: 7px;
}
.resp-tab:hover { color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); }
.resp-tab.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

/* ── Auto-Responder accordion cards ── */
.resp-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}
.resp-accordion:hover {
  border-color: var(--border-hover);
}
.resp-accordion.expanded {
  border-color: var(--border-hover);
  background: var(--bg-surface);
}
.resp-accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.resp-accordion-header:hover {
  background: rgba(255, 255, 255, 0.02);
}
.resp-accordion-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.resp-accordion-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.resp-accordion.expanded .resp-accordion-chevron {
  transform: rotate(180deg);
}

/* Header badges (triggers/commands counts) */
.resp-header-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.resp-badge {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.resp-badge i {
  margin-right: 4px;
  font-size: 10px;
}

/* Accordion body */
.resp-accordion-body {
  padding: 2px 18px 18px;
  border-top: 1px solid var(--border-subtle);
}

/* Detail sections */
.resp-detail-section {
  margin-top: 16px;
}
.resp-detail-section:first-child {
  margin-top: 14px;
}
.resp-detail-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.resp-detail-value {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-wrap;
  width: 100%;
}
.resp-detail-value a {
  color: var(--accent);
  text-decoration: none;
}
.resp-detail-value a:hover {
  text-decoration: underline;
}
.resp-detail-value strong {
  color: var(--text-primary);
  font-weight: 600;
}
.resp-detail-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}
.resp-detail-name code {
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 500;
}
.resp-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.resp-accordion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.resp-delete-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.resp-delete-link:hover {
  color: var(--signal-red);
}
.resp-delete-link i {
  margin-right: 4px;
}

.resp-card-name {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  flex-shrink: 0;
  font-weight: 500;
}
.resp-card-meta { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* Edit form sections */
.resp-edit-section {
  margin-top: 16px;
}
.resp-edit-section:first-child {
  margin-top: 14px;
}

/* Inline edit inputs inside accordion */
.resp-accordion-body .form-input {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.resp-accordion-body .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* New response inline form */
.resp-new-form {
  margin-top: 12px;
}

/* Description preview in detail view */
.resp-desc-preview {
  background: var(--bg-surface-low);
  border-radius: 8px;
  padding: 14px 16px;
  max-height: 300px;
  overflow-y: auto;
}
.resp-desc-preview::-webkit-scrollbar { width: 4px; }
.resp-desc-preview::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-surface);
  border: none;
  border-radius: 14px;
  padding: 28px;
  width: 560px; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-modal);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-hover); }
.modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 20px;
  background: var(--bg-surface-raised);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none; z-index: 1000;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { color: var(--signal-green); }
.toast.error { color: var(--signal-red); }

/* ── Toast undo ── */
.toast .undo-btn {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: inherit; margin-left: 12px;
  padding: 0; text-decoration: underline;
}
.toast .undo-btn:hover { color: var(--text-primary); }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-dark);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Session expired ── */
.session-expired {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.session-expired-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 14px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-modal);
}
.session-expired-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.session-expired-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Automod confirm ── */
.automod-confirm {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.automod-confirm .btn-danger {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
  font-weight: 500;
}
.automod-confirm .btn-danger:hover {
  background: var(--signal-red-dim);
  color: var(--signal-red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Button variants ── */
.btn-ghost {
  background: var(--border-hover);
  color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Utility ── */
.mt-md { margin-top: 14px; }

/* ── Mod Log / Audit Feed ── */
.modlog-feed { max-height: 600px; overflow-y: auto; }
.modlog-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}
.modlog-entry:hover { background: rgba(255, 255, 255, 0.025); }
.modlog-entry-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  background: rgba(12, 12, 15, 0.6); color: var(--text-muted);
  border: 1px solid rgba(82, 82, 91, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.modlog-entry-icon.modlog-ban,
.modlog-entry-icon.modlog-severe_word,
.modlog-entry-icon.modlog-mute,
.modlog-entry-icon.modlog-warn,
.modlog-entry-icon.modlog-escalation,
.modlog-entry-icon.modlog-kick,
.modlog-entry-icon.modlog-link_block,
.modlog-entry-icon.modlog-word_catch { background: var(--bg-dark); color: var(--text-muted); }
.modlog-entry-body { flex: 1; min-width: 0; }
.modlog-entry-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.modlog-target { color: var(--accent); font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.modlog-entry-reason { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.modlog-entry-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Log filters (Activity Log, Audit Trail) ── */
.log-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.log-filter-input {
  flex: 1;
  padding: 9px 14px;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 8px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.log-filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* ── Log pagination ── */
.log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 12px;
}
.log-page-info {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: center;
}
.log-page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.18);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.log-page-btn:hover:not([disabled]) {
  background: var(--bg-surface-raised);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.log-page-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Hit count badge ── */
.tag-hit-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px; padding: 0 4px;
  background: var(--bg-surface-raised); border-radius: 8px;
  font-size: 10px; font-weight: 600; color: var(--text-secondary);
  font-family: inherit;
  margin-left: 4px;
}

/* ── Tier cards ── */
#tiers-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tier-card {
  background: var(--bg-surface);
  border: none;
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.tier-card:hover {
  border-color: var(--border-hover);
}
.tier-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tier-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tier-card-badge {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(12, 12, 15, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.tier-card-header .tier-name-input {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 6px;
  width: 140px;
  transition: border-color 0.15s, background 0.15s;
}
.tier-card-header .tier-name-input:hover {
  border-color: var(--border-subtle);
}
.tier-card-header .tier-name-input:focus {
  border-color: var(--accent);
  background: var(--bg-surface-low);
  outline: none;
}
.tier-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.tier-card-fields .form-group { margin-bottom: 0; }
.tier-card-fields .form-group label { font-size: 11px; margin-bottom: 3px; }
.tier-card-fields .form-group input,
.tier-card-fields .form-group select { padding: 7px 10px; font-size: 12px; }
button.tier-remove {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
button.tier-remove:hover {
  background: var(--signal-red-dim);
  color: var(--signal-red);
}
.tier-perks {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px 8px;
}
.perk-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 3px 0;
}
.perk-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.perk-item span {
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
}

/* ── Warning table ── */
.warnings-table { font-size: 13px; }
.warning-row {
  display: grid;
  grid-template-columns: 1fr 80px 120px;
  gap: 12px;
  padding: 10px 12px;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.015);
}
.warning-row:hover { background: rgba(255, 255, 255, 0.03); }
.warning-type-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
}
.warning-type-badge.official { background: var(--signal-red-dim); color: var(--signal-red); }
.warning-type-badge.automod { background: var(--signal-amber-dim); color: var(--signal-amber); }
.warning-user-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; margin-top: 8px; font-weight: 600; font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.warning-user-header:first-child { margin-top: 0; }

/* ── XP Leaderboard ── */
.leaderboard-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background 0.15s;
}
.leaderboard-row:nth-child(odd) { background: rgba(255, 255, 255, 0.015); }
.leaderboard-row:hover { background: rgba(255, 255, 255, 0.04); }
.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface-raised);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.leaderboard-row:nth-child(1) .leaderboard-rank { background: rgba(245, 158, 11, 0.15); color: var(--signal-amber); }
.leaderboard-row:nth-child(2) .leaderboard-rank { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.leaderboard-row:nth-child(3) .leaderboard-rank { background: rgba(180, 120, 60, 0.15); color: #cd7f32; }
.leaderboard-user { flex: 1; font-size: 13px; color: var(--text-primary); }
.leaderboard-xp { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.xp-level-display { font-size: 14px; font-weight: 600; color: var(--accent); }

/* XP & Leaderboard — blue icons, white text */
#section-xp .card-icon {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(51, 89, 136, 0.25);
}
#section-xp .card-header h3 { color: var(--text-primary); }

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

/* ── Empty state ── */
.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
  .toast { transition: opacity 0.01ms !important; transform: none !important; }
  .toast.show { transform: none !important; }
  .btn:active:not([disabled]) { transform: none !important; }
}

/* ── Permissions role list ── */
.perm-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.perm-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-surface-raised);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.perm-role-tag .perm-role-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  line-height: 1;
}
.perm-role-tag .perm-role-remove:hover { color: var(--signal-red); }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, color 0.15s;
}
.mobile-menu-btn:active { color: var(--text-primary); }
.mobile-menu-btn.hidden { opacity: 0; pointer-events: none; }

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .content { padding: 28px 24px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .tier-perks { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }

  .content {
    margin-left: 0;
    padding: 16px;
    padding-top: 60px;
    overflow-x: hidden;
  }

  /* Grids → single column */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .overview-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .wordlist-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  #tiers-list { grid-template-columns: 1fr; }
  .tier-card-fields { grid-template-columns: 1fr 1fr; }
  .tier-perks { grid-template-columns: 1fr 1fr; }
  .panel-split, .panel-split--asym { grid-template-columns: 1fr; }
  .panel-col + .panel-col { border-left: none; border-top: 1px solid var(--border-subtle); }
  .quick-links { grid-template-columns: 1fr; }
  .ql-featured { grid-column: span 1; }

  /* Banner — hamburger sits top-left, so no overlap */
  .overview-banner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; }
  .overview-title { font-size: 18px; }
  .banner-sub { font-size: 12px; }

  /* Typography */
  h1 { font-size: 18px; }
  .page-sub { font-size: 12px; margin-bottom: 16px; }

  /* Stat cards */
  .stat-card { padding: 10px 12px; gap: 10px; }
  .stat-card-icon { width: 28px; height: 28px; font-size: 11px; }
  .stat-card .stat-value { font-size: 16px; }
  .stat-card .stat-label { font-size: 10px; }

  /* Cards */
  .card { padding: 14px; margin-bottom: 10px; }
  .card-header { gap: 8px; padding-bottom: 10px; }
  .card-header h3 { font-size: 13px; }

  /* Modlog entries */
  .modlog-entry { padding: 8px 10px; gap: 8px; }
  .modlog-entry-icon { width: 24px; height: 24px; font-size: 10px; border-radius: 5px; }
  .modlog-entry-title { font-size: 12px; }
  .modlog-entry-reason { font-size: 11px; }
  .modlog-entry-meta { font-size: 10px; }

  /* Log filters */
  .log-filters { flex-wrap: wrap; gap: 8px; }
  .log-filters .form-group { flex: 1 1 100% !important; }
  .log-filter-input { font-size: 13px; padding: 8px 12px; }

  /* Pagination */
  .modlog-pagination { flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 12px; }
  .modlog-pagination button { padding: 6px 10px; font-size: 11px; }

  /* Auto-responder — full mobile treatment */
  .resp-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .resp-accordion { margin-bottom: 8px; }
  .resp-accordion-header { padding: 10px 12px; gap: 8px; }
  .resp-accordion-title { font-size: 13px; white-space: normal; }
  .resp-header-badges { gap: 4px; }
  .resp-badge { font-size: 10px; padding: 2px 6px; }
  .resp-accordion-body { padding: 10px 12px; }
  .resp-detail-label { font-size: 10px; }
  .resp-detail-value { font-size: 12px; }
  .resp-detail-tags { gap: 4px; }
  .resp-desc-preview { padding: 10px 12px; }
  .resp-accordion-body .form-input { font-size: 12px; padding: 8px 10px; }
  .resp-accordion-actions { flex-wrap: wrap; gap: 6px; }
  .resp-accordion-actions .btn { flex: 1; text-align: center; min-width: 0; }

  /* Toggle rows */
  .toggle-label { font-size: 13px; }
  .toggle-desc { font-size: 12px; }

  /* Buttons */
  .btn { padding: 8px 14px; font-size: 12px; }
  .btn-small { padding: 5px 10px; font-size: 11px; }

  /* Modal */
  .modal { width: calc(100% - 24px); max-width: none; padding: 16px; }
  .modal-header h3 { font-size: 16px; }

  /* Wordlist */
  .wordlist-card { padding: 12px; }
  .wordlist-item { font-size: 11px; padding: 3px 7px; }
  .wordlist-header h3 { font-size: 13px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { min-width: 0; width: 100%; }
  .inline-form .btn { width: 100%; text-align: center; }

  /* Warning table — stack rows vertically */
  .warning-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    font-size: 12px;
    padding: 10px;
  }
  .warnings-table { font-size: 12px; }
  .stats-strip { gap: 8px; }

  /* Leaderboard */
  .leaderboard-row { padding: 8px 10px; gap: 8px; }
  .leaderboard-rank { width: 24px; height: 24px; font-size: 11px; }
  .leaderboard-user { font-size: 12px; }
  .leaderboard-xp { font-size: 11px; }

  /* Automod confirm */
  .automod-confirm { flex-wrap: wrap; }

  /* Forms */
  .form-group label { font-size: 11px; }
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 13px; padding: 8px 10px; }

  /* Permissions */
  .perm-role-tag { font-size: 11px; padding: 4px 8px; }

  /* Tier cards */
  .tier-card { padding: 12px; }
  .tier-card-header .tier-name-input { font-size: 13px; width: 100px; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .content { padding: 56px 10px 16px; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tier-card-fields { grid-template-columns: 1fr; }
  .tier-perks { grid-template-columns: 1fr; }

  .card { padding: 10px; }
  .overview-banner { padding: 12px; }

  .stat-card { padding: 8px 10px; }
  .stat-card-icon { width: 24px; height: 24px; font-size: 10px; }
  .stat-card .stat-value { font-size: 14px; }

  .resp-accordion-header { padding: 8px 10px; }
  .resp-accordion-body { padding: 8px 10px; }
  .modlog-entry { padding: 6px 8px; }

  /* Warning rows fully stacked */
  .warning-row { grid-template-columns: 1fr; gap: 2px; }
}
