/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0f1a;
  --bg2:         #131626;
  --bg3:         #1a1d32;
  --surface:     rgba(255,255,255,0.04);
  --surface-h:   rgba(255,255,255,0.07);
  --border:      rgba(255,255,255,0.08);
  --border-h:    rgba(255,255,255,0.15);
  --blurple:     #5865f2;
  --blurple-h:   #4752c4;
  --blurple-glow:rgba(88,101,242,0.25);
  --green:       #57f287;
  --green-dim:   rgba(87,242,135,0.15);
  --red:         #ed4245;
  --red-dim:     rgba(237,66,69,0.15);
  --yellow:      #fee75c;
  --yellow-dim:  rgba(254,231,92,0.15);
  --orange:      #e67e22;
  --orange-dim:  rgba(230,126,34,0.15);
  --text:        #e3e5e8;
  --text-muted:  #87919e;
  --text-dim:    #4e5058;
  --font:        'Inter', system-ui, sans-serif;
  --radius:      12px;

  /* Aliases used in inline styles across newer pages */
  --primary:        var(--blurple);
  --bg-primary:     var(--bg);
  --bg-secondary:   var(--bg2);
  --text-secondary: var(--text-muted);
  --radius-sm:   8px;
  --sidebar-w:   240px;
  --header-h:    64px;
  --transition:  0.18s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blurple); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Splash / Loader ──────────────────────────────────────────────────────── */
.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blurple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(88,101,242,0.25) 0%, transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: fadeUp 0.4s ease;
}
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--blurple), #7b68ee);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px var(--blurple-glow);
}
.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-card p  { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; line-height: 1.6; }
.login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--blurple);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px var(--blurple-glow);
}
.login-btn:hover {
  background: var(--blurple-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--blurple-glow);
}
.login-btn:active { transform: translateY(0); }
.login-error {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
}

/* ── Dashboard Shell ──────────────────────────────────────────────────────── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blurple), #7b68ee);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-logo-text { font-size: 15px; font-weight: 700; }
.sidebar-logo-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 12px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.nav-item i { width: 16px; text-align: center; font-size: 14px; }
.nav-item:hover { background: var(--surface-h); color: var(--text); }
.nav-item.active {
  background: rgba(88,101,242,0.15);
  color: var(--blurple);
}
.nav-item.active i { color: var(--blurple); }
.nav-badge {
  margin-left: auto;
  background: var(--blurple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.sidebar-user-sub  { font-size: 11px; color: var(--text-muted); }
.sidebar-logout {
  background: none; border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.sidebar-logout:hover { color: var(--red); background: var(--red-dim); }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-header {
  height: var(--header-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13,15,26,0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 { font-size: 18px; font-weight: 700; }
.page-header-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-content { padding: 28px 32px; flex: 1; }

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color var(--transition), transform var(--transition);
  animation: fadeUp 0.3s ease both;
}
.stat-card:hover { border-color: var(--border-h); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.blurple { background: rgba(88,101,242,0.15); color: var(--blurple); }
.stat-icon.green   { background: var(--green-dim);  color: var(--green); }
.stat-icon.red     { background: var(--red-dim);    color: var(--red); }
.stat-icon.yellow  { background: var(--yellow-dim); color: var(--yellow); }
.stat-icon.orange  { background: var(--orange-dim); color: var(--orange); }
.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Charts Grid ──────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.chart-wrap { position: relative; height: 200px; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.table-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.table-card-header h2 { font-size: 15px; font-weight: 600; }
.table-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.2);
  white-space: nowrap;
}
tbody tr {
  border-top: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--surface-h); }
tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}
.table-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.table-empty i { font-size: 32px; display: block; margin-bottom: 12px; opacity: 0.4; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-warn    { background: var(--yellow-dim); color: var(--yellow); }
.badge-mute    { background: var(--orange-dim); color: var(--orange); }
.badge-unmute  { background: var(--green-dim);  color: var(--green); }
.badge-kick    { background: var(--red-dim);    color: var(--red); }
.badge-ban     { background: var(--red-dim);    color: var(--red); }
.badge-unban   { background: var(--green-dim);  color: var(--green); }
.badge-default { background: var(--surface-h);  color: var(--text-muted); }
.badge-blurple { background: rgba(88,101,242,0.15); color: var(--blurple); }
.badge-green   { background: var(--green-dim);  color: var(--green); }
.badge-red     { background: var(--red-dim);    color: var(--red); }

.status-badge-pending     { background: var(--yellow-dim); color: var(--yellow); }
.status-badge-in_progress { background: rgba(88,101,242,0.15); color: var(--blurple); }
.status-badge-delivered   { background: var(--green-dim);  color: var(--green); }
.status-badge-on_hold     { background: var(--orange-dim); color: var(--orange); }
.status-badge-cancelled   { background: var(--red-dim);    color: var(--red); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--blurple); color: #fff; }
.btn-primary:hover { background: var(--blurple-h); transform: translateY(-1px); }
.btn-danger  { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.btn-success:hover { background: var(--green); color: #000; }
.btn-ghost   { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-h); color: var(--text); border-color: var(--border-h); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 8px; }

/* ── Form Controls ────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-control {
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-control:focus { border-color: var(--blurple); box-shadow: 0 0 0 3px var(--blurple-glow); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control option { background: var(--bg3); }

/* ── Moderation Action Panel ─────────────────────────────────────────────── */
.action-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.action-panel h2 { font-size: 15px; font-weight: 600; margin-bottom: 20px; }
.action-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.action-btn-warn   { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(254,231,92,0.3); }
.action-btn-warn:hover   { background: var(--yellow); color: #000; }
.action-btn-mute   { background: var(--orange-dim); color: var(--orange); border-color: rgba(230,126,34,0.3); }
.action-btn-mute:hover   { background: var(--orange); color: #fff; }
.action-btn-unmute { background: var(--green-dim);  color: var(--green);  border-color: rgba(87,242,135,0.3); }
.action-btn-unmute:hover { background: var(--green); color: #000; }
.action-btn-kick   { background: var(--red-dim);    color: var(--red);    border-color: rgba(237,66,69,0.3); }
.action-btn-kick:hover   { background: var(--red); color: #fff; }
.action-btn-ban    { background: rgba(176,0,0,0.15); color: #ff6b6b;      border-color: rgba(176,0,0,0.4); }
.action-btn-ban:hover    { background: #b00000; color: #fff; }
.action-btn-unban  { background: var(--green-dim);  color: var(--green);  border-color: rgba(87,242,135,0.3); }
.action-btn-unban:hover  { background: var(--green); color: #000; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border-h);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: scaleIn 0.2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--surface-h); }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.modal-error {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--red-dim);
  border: 1px solid rgba(237,66,69,0.4);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
}

/* ── Mod Points Leaderboard ───────────────────────────────────────────────── */
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.lb-row:hover { background: var(--surface-h); }
.lb-rank { font-size: 16px; font-weight: 700; width: 28px; text-align: center; color: var(--text-muted); }
.lb-rank.gold   { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }
.lb-user { flex: 1; }
.lb-user-name { font-size: 14px; font-weight: 600; }
.lb-user-id   { font-size: 11px; color: var(--text-muted); }
.lb-points { font-size: 18px; font-weight: 700; color: var(--yellow); }
.lb-actions { display: flex; gap: 6px; }

/* ── Ratings ──────────────────────────────────────────────────────────────── */
.ratings-breakdown { margin-top: 12px; }
.rating-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.rating-bar-label { width: 32px; color: var(--text-muted); font-weight: 600; }
.rating-bar-bg    { flex: 1; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.rating-bar-fill  { height: 100%; border-radius: 4px; background: var(--yellow); transition: width 0.5s ease; }
.rating-bar-count { width: 40px; text-align: right; color: var(--text-muted); }
.rating-stars     { color: var(--yellow); font-size: 20px; letter-spacing: 2px; margin-bottom: 4px; }
.rating-avg       { font-size: 40px; font-weight: 700; margin-bottom: 4px; }

/* ── User Info Chip ───────────────────────────────────────────────────────── */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
}
.user-chip img {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg3);
}
.user-chip-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-size: 13px;
  font-weight: 500;
  animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blurple); }
.toast i { font-size: 15px; }
.toast.success i { color: var(--green); }
.toast.error   i { color: var(--red); }
.toast.info    i { color: var(--blurple); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blurple); border-bottom-color: var(--blurple); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Misc utilities ───────────────────────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono     { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mb-16   { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 13px; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

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

/* ── Hamburger (mobile only) ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
}
.hamburger:hover { color: var(--text); background: var(--surface-h); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .page-header { padding: 0 16px; }
}

/* ── Autocomplete Search Suggestions ───────────────────────────────────────── */
.user-search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.suggestion-item:hover {
  background: var(--surface-h);
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── AI Moderation page additions ─────────────────────────────────────────── */
.badge-danger { background: var(--red-dim); color: var(--red); }
.btn-green { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.btn-green:hover { background: var(--green); color: #000; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* Custom range inputs */
input[type="range"] {
  -webkit-appearance: none;
  background: var(--border);
  height: 6px;
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blurple);
  cursor: pointer;
  transition: background var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--blurple-h);
}

/* Moderated channels checkboxes block */
.channel-select-list {
  background: var(--bg3);
}
.channel-select-list label {
  color: var(--text-muted);
  transition: color var(--transition);
}
.channel-select-list label:hover {
  color: var(--text);
}

/* ── AI Data Viewer: Chat Thread ──────────────────────────────────────────── */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  animation: bubbleIn 0.18s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble-user {
  align-self: flex-end;
  background: var(--blurple);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-bot {
  align-self: flex-start;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble-system {
  align-self: center;
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(254,231,92,0.2);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  opacity: 0.7;
}
.chat-bubble-label {
  font-size: 10px;
  opacity: 0.6;
  margin-bottom: 3px;
}
.convo-row-expand {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 2px;
  animation: bubbleIn 0.2s ease;
}

/* ── Custom Filters badge ─────────────────────────────────────────────────── */
.filter-phrase-badge {
  display: inline-block;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(237,66,69,0.25);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.3px;
}
