/* ============================================
   ModereX Control Panel - Professional Styles
   ============================================ */

:root {
  /* ========== THEME HUE - Change this to shift entire color scheme ========== */
  /* Blue: 215, Green: 145, Red: 0, Purple: 265, Teal: 175, Orange: 25 */
  --theme-h: 215;

  /* ========== Derived Background Colors (from theme hue) ========== */
  --bg0: hsl(var(--theme-h), 25%, 2%);
  --bg1: hsl(var(--theme-h), 30%, 5%);
  --bg2: hsl(var(--theme-h), 38%, 8%);
  --surface: hsl(var(--theme-h), 42%, 11%);
  --surface2: hsl(var(--theme-h), 32%, 6%);

  /* ========== Derived Border Colors ========== */
  --border: hsl(var(--theme-h), 42%, 18%);
  --border-light: hsl(var(--theme-h), 38%, 23%);

  /* ========== Derived Text Colors ========== */
  --text: hsl(var(--theme-h), 60%, 97%);
  --text-secondary: hsl(var(--theme-h), 30%, 75%);
  --muted: hsl(var(--theme-h), 25%, 54%);
  --muted2: hsl(var(--theme-h), 24%, 38%);

  /* ========== Primary Color (main accent) ========== */
  --primary-rgb: 45, 122, 237;
  --primary: hsl(var(--theme-h), 83%, 55%);
  --primary-light-rgb: 90, 156, 255;
  --primary-light: hsl(var(--theme-h), 100%, 68%);
  --primary-dark: hsl(var(--theme-h), 78%, 43%);
  --primary-glow: rgba(var(--primary-rgb), 0.35);

  /* ========== Accent Color (secondary, typically purple) ========== */
  --accent-rgb: 124, 92, 255;
  --accent: #7c5cff;
  --accent-light: #9d82ff;

  /* ========== Status Colors (fixed - not theme-dependent) ========== */
  --ok-rgb: 16, 185, 129;
  --ok: #10b981;
  --ok-glow: rgba(var(--ok-rgb), 0.30);
  --warn-rgb: 245, 158, 11;
  --warn: #f59e0b;
  --warn-glow: rgba(var(--warn-rgb), 0.30);
  --bad-rgb: 239, 68, 68;
  --bad: #ef4444;
  --bad-glow: rgba(var(--bad-rgb), 0.30);

  /* ========== Special Effects ========== */
  --watchlist-glow: 0 0 20px rgba(var(--warn-rgb), 0.45), 0 0 40px rgba(var(--warn-rgb), 0.20);
  --line-glow: rgba(var(--primary-light-rgb), 0.22);

  /* ========== Shadows ========== */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  /* ========== Radii ========== */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* ========== Glass Effects (derived from theme) ========== */
  --glass: hsla(var(--theme-h), 42%, 11%, 0.85);
  --glass2: hsla(var(--theme-h), 32%, 6%, 0.75);

  /* ========== Typography ========== */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ========== Transitions ========== */
  --transition-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== IP BLUR (Privacy) ===== */
.ip-blur {
  filter: blur(4px);
  transition: filter var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.ip-blur:hover,
.ip-blur.revealed {
  filter: blur(0);
  user-select: text;
}

/* ===== PERMISSION DENIED / LOCKED CONTENT ===== */
.no-permission {
  position: relative;
  pointer-events: none;
  opacity: 0.4;
  cursor: not-allowed !important;
  user-select: none;
}

.no-permission::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.1) 10px,
    rgba(0, 0, 0, 0.1) 20px
  );
  border-radius: inherit;
  pointer-events: none;
}

.no-permission-tooltip {
  position: relative;
  cursor: not-allowed !important;
}

.no-permission-tooltip::before {
  content: attr(data-permission-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--bg2);
  color: var(--bad);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  border: 1px solid rgba(var(--bad-rgb), 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.no-permission-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

.btn.no-permission,
.btn-primary.no-permission,
.btn-outline.no-permission {
  pointer-events: auto;
  cursor: not-allowed !important;
  opacity: 0.5;
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}

.btn.no-permission:hover,
.btn-primary.no-permission:hover,
.btn-outline.no-permission:hover {
  transform: none !important;
  box-shadow: none !important;
}

.section-locked {
  position: relative;
}

.section-locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border-radius: inherit;
  z-index: 10;
}

.section-locked-overlay svg {
  width: 32px;
  height: 32px;
  color: var(--bad);
}

.section-locked-overlay span {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ===== NO PERMISSION OVERLAY (for modals) ===== */
.no-permission-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
  gap: 12px;
}

.no-permission-overlay i {
  font-size: 3rem;
  color: var(--bad);
  margin-bottom: 0.5rem;
}

.no-permission-overlay span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  max-width: 80%;
  line-height: 1.5;
}

.no-permission-overlay button {
  margin-top: 1rem;
  padding: 10px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.no-permission-overlay button:hover {
  background: var(--bg2);
  border-color: var(--border-light);
}

/* ===== PAGE PERMISSION BOX (full-page centered card) ===== */
.page-permission-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem;
}

.page-permission-box .permission-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 4rem;
  text-align: center;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.page-permission-box .permission-card i {
  font-size: 4rem;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 1.5rem;
  display: block;
}

.page-permission-box .permission-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.page-permission-box .permission-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ===== NO PERMISSION TABLE STATE ===== */
.table-no-permission {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.table-no-permission i {
  font-size: 3rem;
  color: var(--bad);
  margin-bottom: 1rem;
}

.table-no-permission span {
  font-size: 0.95rem;
  text-align: center;
}

/* ===== EMPTY TABLE STATE (no results) ===== */
.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.table-empty i {
  font-size: 3rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.table-empty span {
  font-size: 0.95rem;
  text-align: center;
}

/* ===== DISABLED BUTTON STATE ===== */
button.btn-disabled,
button:disabled:not(.filter-btn) {
  opacity: 0.5;
  cursor: not-allowed;
}

button.btn-disabled:hover,
button:disabled:not(.filter-btn):hover {
  transform: none !important;
}

/* ===== CUSTOM TOOLTIP ===== */
.mx-tooltip {
  position: fixed;
  background: var(--bg2);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 10000;
  display: none;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  max-width: 250px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mx-tooltip.visible {
  display: block;
  opacity: 1;
}

/* ===== NO-PERMISSION STYLES ===== */
.no-permission {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.btn.no-permission,
button.no-permission {
  pointer-events: auto; /* Allow hover for custom tooltip */
  cursor: not-allowed !important;
}

/* ===== AUTOMOD DISABLED STATES ===== */
.automod-no-edit .rule-card input,
.automod-no-edit .rule-card select,
.automod-no-edit .rule-card textarea,
.automod-no-edit .rule-card .toggle,
.automod-no-edit .rule-card button:not(.btn-view-only) {
  pointer-events: none !important;
  opacity: 0.6;
}

.automod-view-only {
  position: relative;
}

.automod-view-only::after {
  content: 'View Only';
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--muted);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: 
    radial-gradient(ellipse 1400px 900px at 10% 15%, rgba(var(--primary-rgb), 0.18), transparent 55%),
    radial-gradient(ellipse 1200px 800px at 90% 80%, rgba(var(--accent-rgb), 0.12), transparent 50%),
    radial-gradient(ellipse 800px 600px at 50% 100%, rgba(var(--ok-rgb), 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 2px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ===== BACKGROUND EFFECTS ===== */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: -4;
  opacity: 0.95;
}

.bg-aurora {
  position: fixed;
  inset: -10%;
  z-index: -3;
  background:
    radial-gradient(60% 45% at 20% 10%, rgba(var(--primary-rgb), 0.28), transparent 60%),
    radial-gradient(55% 45% at 80% 20%, rgba(var(--accent-rgb), 0.22), transparent 58%),
    radial-gradient(65% 55% at 50% 85%, rgba(var(--ok-rgb), 0.18), transparent 60%);
  filter: blur(10px);
  opacity: 0.98;
  animation: auroraShift 12s ease-in-out infinite;
  pointer-events: none;
}

.bg-lines {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    radial-gradient(rgba(var(--primary-light-rgb), 0.22) 1px, transparent 1px),
    repeating-linear-gradient(120deg, rgba(var(--primary-light-rgb), 0.08), rgba(var(--primary-light-rgb), 0.08) 1px, transparent 1px, transparent 160px),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 200px);
  background-size: 180px 180px, 320px 320px, 280px 280px, 360px 360px;
  opacity: 0.52;
  animation: starDrift 18s linear infinite;
  pointer-events: none;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="4" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23n)" opacity="0.18"/></svg>');
  mix-blend-mode: overlay;
  opacity: 0.22;
  animation: noiseShift 12s linear infinite;
}

@keyframes noiseShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(15px, -10px); }
  100% { transform: translate(0, 0); }
}

@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes starDrift {
  0% { background-position: 0 0, 40px 20px, 0 0, 0 0; }
  50% { background-position: 60px -30px, -80px 40px, -100px 80px, 120px -60px; }
  100% { background-position: 0 0, 40px 20px, 0 0, 0 0; }
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex;
  height: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.95), rgba(6, 9, 16, 0.92));
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-width: 260px;
  backdrop-filter: blur(20px);
  position: relative;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.12), transparent 40%);
  opacity: 0.6;
  pointer-events: none;
}

.sb-head {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1f6bff, #35b5ff);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform var(--transition), box-shadow var(--transition);
}

.logo-img {
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
}

.logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(var(--primary-rgb), 0.45));
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.logo i {
  font-size: 18px;
  color: white;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand b {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--primary-light);
}

.brand span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sb-scroll {
  padding: 16px 14px 0 14px;
  overflow-y: auto;
  height: calc(100vh - 160px);
}

.sb-group {
  padding: 8px 0 16px 0;
}

.sb-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 12px 10px 12px;
  font-weight: 600;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid transparent;
  user-select: none;
  line-height: 1.2;
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  overflow: hidden;
}

.sb-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.sb-item:hover::before {
  transform: translateX(100%);
}

.sb-item i {
  width: 18px;
  text-align: center;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
  font-size: 14px;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transform: translateX(4px);
}

.sb-item:hover i {
  color: var(--primary-light);
}

.sb-item.active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.08));
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  color: var(--text);
}

.sb-item.active i {
  color: var(--primary-light);
}

.sb-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sb-foot {
  margin-top: auto;
  padding: 14px 16px 16px 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  transition: all var(--transition);
}

.status-card:hover {
  border-color: var(--border-light);
  background: rgba(0, 0, 0, 0.35);
}

.status-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-left small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok-glow);
  animation: pulse 2s ease-in-out infinite;
  transition: background 0.3s, box-shadow 0.3s;
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok-glow);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 12px rgba(var(--warn-rgb), 0.4);
}

.dot.bad {
  background: var(--error);
  box-shadow: 0 0 12px rgba(var(--bad-rgb), 0.4);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== DEVELOPER MODE TOGGLE ===== */
.dev-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 12px;
}

.dev-mode-toggle:hover {
  border-color: var(--border-light);
  background: rgba(0, 0, 0, 0.35);
}

.dev-mode-toggle.active {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
}

.dev-mode-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  font-size: 12px;
}

.dev-mode-text {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dev-mode-toggle.active .dev-mode-text {
  color: #a78bfa;
}

.dev-mode-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  position: relative;
  transition: all var(--transition);
}

.dev-mode-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: all var(--transition);
}

.dev-mode-toggle.active .dev-mode-switch {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.5);
}

.dev-mode-toggle.active .dev-mode-switch::after {
  left: calc(100% - 16px);
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Developer sidebar section */
.sb-dev-section .sb-item {
  color: #a78bfa;
}

.sb-dev-section .sb-item:hover {
  background: rgba(139, 92, 246, 0.1);
}

.sb-dev-section .sb-item.active {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.sb-dev-section .sb-item.active::before {
  background: #a78bfa;
}

/* ===== STRESS TEST STYLES ===== */
.stress-progress {
  margin-top: 10px;
}

.stress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.stress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.stress-log {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  max-height: 80px;
  overflow-y: auto;
}

.stress-log-entry {
  padding: 2px 0;
}

.stress-log-entry.success {
  color: var(--ok);
}

.stress-log-entry.error {
  color: var(--error);
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== LOADING LINE BAR ===== */
.loading-line {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(var(--primary-rgb), 0.15);
  overflow: visible;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-line.active {
  opacity: 1;
}

.loading-line.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease-out 0.4s; /* Longer fade after brief delay */
}

.loading-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent-light));
  box-shadow: 0 0 10px var(--primary-glow), 0 0 5px var(--primary-light);
  transition: width 0.15s ease-out, box-shadow 0.3s ease, height 0.3s ease;
  border-radius: 0 2px 2px 0;
}

/* Completion flash effect - brighter glow and slight height increase */
.loading-line.complete .loading-line-fill {
  width: 100%;
  height: 4px;
  top: -0.5px;
  box-shadow:
    0 0 20px rgba(var(--primary-rgb), 0.8),
    0 0 40px rgba(var(--primary-rgb), 0.5),
    0 0 8px var(--primary-light);
  animation: loadingComplete 0.5s ease-out;
}

@keyframes loadingComplete {
  0% {
    box-shadow:
      0 0 10px var(--primary-glow),
      0 0 5px var(--primary-light);
  }
  50% {
    box-shadow:
      0 0 30px rgba(var(--primary-rgb), 1),
      0 0 60px rgba(var(--primary-rgb), 0.7),
      0 0 15px var(--primary-light);
  }
  100% {
    box-shadow:
      0 0 20px rgba(var(--primary-rgb), 0.8),
      0 0 40px rgba(var(--primary-rgb), 0.5),
      0 0 8px var(--primary-light);
  }
}

.loading-line.fade-out .loading-line-fill {
  width: 100%;
  opacity: 0.7;
  transition: opacity 0.6s ease-out, box-shadow 0.6s ease-out;
}

.loading-line-fill.no-transition {
  transition: none !important;
}

/* ===== TOPBAR ===== */
.topbar {
  position: relative;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.8), rgba(8, 12, 20, 0.5));
  backdrop-filter: blur(16px);
  gap: 16px;
  /* Removed overflow: hidden to allow search dropdown to display properly */
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

/* Version badge in topbar (debug mode only) - now hidden by default */
.version-badge {
  display: none !important; /* Permanently hidden - version shown in sidebar only */
}

.gsearch-container {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 150px;
  max-width: 600px;
  /* Ensure dropdown can escape container bounds */
  z-index: 101;
}

.gsearch {
  position: relative;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gsearch i {
  position: absolute;
  left: 14px;
  color: var(--muted);
  transition: color var(--transition);
  font-size: 13px;
}

.gsearch input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  transition: all var(--transition);
}

.gsearch input::placeholder {
  color: var(--muted);
}

.gsearch input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gsearch:focus-within i {
  color: var(--primary-light);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-shrink: 0;
  /* Prevent items from wrapping or causing layout shift */
  white-space: nowrap;
}

/* ===== CHIPS ===== */
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  user-select: none;
  white-space: nowrap;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--border-light);
  background: rgba(0, 0, 0, 0.4);
}

.chip i {
  color: var(--muted);
  font-size: 12px;
}

.chip.warn {
  border-color: rgba(var(--warn-rgb), 0.25);
  background: rgba(var(--warn-rgb), 0.08);
  color: var(--warn);
}

.chip.ok {
  border-color: rgba(var(--ok-rgb), 0.25);
  background: rgba(var(--ok-rgb), 0.08);
  color: var(--ok);
}

.chip.bad {
  border-color: rgba(var(--bad-rgb), 0.25);
  background: rgba(var(--bad-rgb), 0.08);
  color: var(--bad);
}

.chip.info {
  border-color: rgba(var(--primary-rgb), 0.25);
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary-light);
}

.sim-note {
  opacity: 0.85;
}

.top-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  transition: all var(--transition);
  flex-shrink: 0;
}

.top-profile:hover {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-1px);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.profile-chevron {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  transition: transform var(--transition);
}

.top-profile.open .profile-chevron {
  transform: rotate(180deg);
}

.top-profile {
  cursor: pointer;
  position: relative;
}

/* ===== RANK BADGE ===== */
.rank-badge-container {
  position: relative;
}

.rank-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--rank-bg, rgba(139, 92, 246, 0.15));
  border: 1px solid var(--rank-border, rgba(139, 92, 246, 0.3));
  color: var(--rank-color, #a78bfa);
  box-shadow: 0 0 15px var(--rank-glow, rgba(139, 92, 246, 0.2));
  animation: rankGlow 2s ease-in-out infinite alternate;
}

@keyframes rankGlow {
  0% {
    box-shadow: 0 0 10px var(--rank-glow, rgba(139, 92, 246, 0.2));
  }
  100% {
    box-shadow: 0 0 20px var(--rank-glow, rgba(139, 92, 246, 0.35)),
                0 0 30px var(--rank-glow, rgba(139, 92, 246, 0.15));
  }
}

.rank-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--rank-glow, rgba(139, 92, 246, 0.4));
}

.rank-badge i {
  font-size: 12px;
}

/* Custom Rank Tooltip */
.rank-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: rgba(15, 15, 20, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  backdrop-filter: blur(20px);
}

.rank-badge-container:hover .rank-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rank-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: rgba(15, 15, 20, 0.98);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.rank-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--rank-color, #a78bfa);
  font-weight: 600;
  font-size: 13px;
}

.rank-tooltip-header i {
  font-size: 14px;
}

.rank-tooltip-body {
  padding: 12px 16px;
}

.rank-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.rank-tooltip-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-tooltip-label {
  font-size: 12px;
  color: var(--muted);
}

.rank-tooltip-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: rgba(15, 15, 20, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  backdrop-filter: blur(20px);
}

.profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: rgba(15, 15, 20, 0.98);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-header img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-dropdown-name {
  font-weight: 600;
  font-size: 14px;
}

.profile-dropdown-rank {
  font-size: 12px;
  color: var(--rank-color, var(--primary-light));
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.profile-dropdown-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.profile-dropdown-item.logout {
  color: var(--error);
}

.profile-dropdown-item.logout:hover {
  background: rgba(var(--bad-rgb), 0.1);
  color: var(--error);
}

/* Notification Badge */
.notification-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--error);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  margin-left: auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn:hover::before {
  opacity: 1;
}

.btn:not(.primary):not(.bad):hover {
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn.primary:hover {
  box-shadow: 0 12px 32px var(--primary-glow);
  transform: translateY(-2px);
}

.btn.ghost {
  background: rgba(0, 0, 0, 0.3);
}

.btn.bad {
  background: rgba(var(--bad-rgb), 0.1);
  border-color: rgba(var(--bad-rgb), 0.25);
  color: var(--bad);
}

.btn.bad:hover {
  background: rgba(var(--bad-rgb), 0.18);
  box-shadow: 0 8px 24px var(--bad-glow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== FILTER BUTTONS (Toggleable) ===== */
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font);
  transition: all var(--transition);
  user-select: none;
  min-width: 80px;
}

.filter-btn i {
  font-size: 11px;
  transition: transform var(--transition);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 0 14px var(--primary-glow);
}

.filter-btn.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
}

.filter-btn.active i {
  transform: scale(1.1);
}

.filter-btn.active.ban {
  background: rgba(var(--bad-rgb), 0.12);
  border-color: rgba(var(--bad-rgb), 0.35);
  color: var(--bad);
  box-shadow: 0 0 16px var(--bad-glow);
}

.filter-btn.active.mute {
  background: rgba(var(--warn-rgb), 0.12);
  border-color: rgba(var(--warn-rgb), 0.35);
  color: var(--warn);
  box-shadow: 0 0 16px var(--warn-glow);
}

.filter-btn.active.warn {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
}

.filter-btn.active.kick {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent-light);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
}

/* ===== MINI BUTTONS ===== */
.mini {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini i {
  font-size: 11px;
}

.mini:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.mini:not(.primary):not(.bad):not(.ok):hover {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 12px var(--primary-glow);
}

.mini.primary {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: rgba(var(--primary-rgb), 0.3);
  color: var(--primary-light);
}

.mini.primary:hover {
  background: rgba(var(--primary-rgb), 0.22);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.mini.bad {
  background: rgba(var(--bad-rgb), 0.1);
  border-color: rgba(var(--bad-rgb), 0.25);
  color: var(--bad);
}

.mini.bad:hover {
  background: rgba(var(--bad-rgb), 0.18);
  box-shadow: 0 4px 16px var(--bad-glow);
}

.mini.ok {
  background: rgba(var(--ok-rgb), 0.1);
  border-color: rgba(var(--ok-rgb), 0.25);
  color: var(--ok);
}

.mini.ok:hover {
  background: rgba(var(--ok-rgb), 0.18);
  box-shadow: 0 4px 16px var(--ok-glow);
}

/* ===== CONTENT ===== */
.content {
  flex: 1;
  overflow: auto;
  padding: 24px 24px 60px 24px;
}

.page {
  display: none;
  animation: fadeUp 0.32s ease both;
}

.page.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-title h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.page-title p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== PANELS ===== */
.panel {
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.75), rgba(12, 18, 32, 0.65));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.panel:hover {
  border-color: var(--border-light);
}

.panel.pad {
  padding: 20px;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: 16px;
}

/* Consistent spacing between grid sections */
.grid + .grid {
  margin-top: 16px;
}

.grid + .panel {
  margin-top: 16px;
}

.panel + .grid {
  margin-top: 16px;
}

.panel + .panel {
  margin-top: 16px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-2wide {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 1100px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.cols-2wide {
    grid-template-columns: 1fr;
  }
}

/* ===== STAT CARDS ===== */
.stat {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat small {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.stat b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.stat .hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat .icon {
  position: absolute;
  right: 16px;
  top: 16px;
  color: rgba(255, 255, 255, 0.06);
  font-size: 24px;
  transition: all var(--transition);
}

.stat:hover .icon {
  color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.stat.clickable {
  cursor: pointer;
}

.stat.clickable:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.stat.mini {
  padding: 12px 14px;
}

.stat.mini small {
  font-size: 9px;
}

.stat.mini b {
  margin-top: 4px;
  font-size: 20px;
}

.stat.mini .icon {
  font-size: 18px;
  right: 12px;
  top: 12px;
}

/* ===== CARDS ===== */
.card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  box-sizing: border-box;
}

/* Only add margin-top when card is not in a grid */
.card:not(.grid .card) {
  margin-top: 16px;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card h3 i {
  font-size: 14px;
}

.card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Clickable rule cards */
.card.rule-card-clickable {
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.card.rule-card-clickable::after {
  content: 'Click to edit';
  position: absolute;
  top: 8px;
  right: 70px;
  font-size: 10px;
  color: var(--primary-light);
  opacity: 0;
  transform: translateX(5px);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.card.rule-card-clickable:hover::after {
  opacity: 0.7;
  transform: translateX(0);
}

.card.rule-card-clickable:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(var(--primary-rgb), 0.1);
}

.card.rule-card-clickable:active {
  transform: translateY(0);
}

/* ===== TABLES ===== */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  /* Hide scrollbars but allow scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.table-wrap::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.table-wrap table td.flag-cell,
.table-wrap table th.flag-cell {
  text-align: center;
  white-space: nowrap;
}

.table-wrap table td.flag-cell .badge {
  justify-content: center;
}

.table-wrap tr.watchlist-row td {
  background: rgba(var(--warn-rgb), 0.08);
}

.table-wrap tr.watchlist-row:hover td {
  background: rgba(var(--warn-rgb), 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Auto-scale columns for specific tables */
.table-wrap.auto-scale table {
  table-layout: fixed;
}

.table-wrap.auto-scale th,
.table-wrap.auto-scale td {
  white-space: normal;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(8, 12, 20, 0.9);
  z-index: 2;
}

tr {
  transition: background var(--transition);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: rgba(var(--primary-rgb), 0.05);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all var(--transition);
}

.badge:hover {
  transform: translateY(-1px);
}

.badge.blue {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.25);
  color: var(--primary-light);
}

.badge.green {
  background: rgba(var(--ok-rgb), 0.08);
  border-color: rgba(var(--ok-rgb), 0.2);
  color: var(--ok);
}

.badge.red {
  background: rgba(var(--bad-rgb), 0.08);
  border-color: rgba(var(--bad-rgb), 0.2);
  color: var(--bad);
}

.badge.yellow {
  background: rgba(var(--warn-rgb), 0.08);
  border-color: rgba(var(--warn-rgb), 0.2);
  color: var(--warn);
}

.badge.gray {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-secondary);
}

.badge.purple {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
  color: var(--accent-light);
}

/* ===== INPUTS ===== */
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
}

.input::placeholder {
  color: var(--muted);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%23a8b8d8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: all var(--transition);
}

select.input:hover {
  border-color: var(--border-light);
  background-color: rgba(255, 255, 255, 0.03);
}

select.input::-ms-expand {
  display: none;
}

select.input option {
  background: var(--bg1);
  color: var(--text);
  padding: 12px 16px;
  border: none;
}

select.input option:hover,
select.input option:focus,
select.input option:checked {
  background: var(--primary);
  color: white;
}

select.input optgroup {
  background: var(--bg0);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px;
}

/* Small select variant */
select.input.small {
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  background-position: right 8px center;
}

/* Color Picker - Custom styled */
input[type="color"].input,
.color-picker {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 44px;
  height: 36px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}

input[type="color"].input::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"].input::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius) - 4px);
}

input[type="color"].input::-moz-color-swatch {
  border: none;
  border-radius: calc(var(--radius) - 4px);
}

input[type="color"].input:hover,
.color-picker:hover {
  border-color: var(--primary);
}

input[type="color"].input:focus,
.color-picker:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Inline color picker with label */
.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrapper input[type="color"] {
  flex-shrink: 0;
}

.color-input-wrapper .color-hex {
  flex: 1;
  min-width: 80px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.toolbar .left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.toolbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hintline {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== PLAYER AVATAR ===== */
.pwrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwrap b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phead {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  flex: 0 0 auto;
  transition: all var(--transition);
}

.phead:hover {
  transform: scale(1.05);
  border-color: var(--border-light);
}

.phead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== WATCHLIST GLOW EFFECT ===== */
.watchlist-item {
  position: relative;
  transition: all var(--transition);
}

.watchlist-item.watching {
  box-shadow: var(--watchlist-glow);
  border-color: rgba(var(--warn-rgb), 0.35) !important;
}

.watchlist-item.watching::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(var(--warn-rgb), 0.15), transparent 50%);
  pointer-events: none;
}

.watchlist-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn-glow);
  animation: pulse 2s ease-in-out infinite;
}

/* ===== OVERLAYS ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 24px;
}

.overlay.show {
  display: flex;
}

.overlay.top {
  z-index: 8000;
}

.overlay.fade-out {
  animation: overlayOut 0.22s ease forwards;
}

/* ===== MODALS ===== */

/* Dynamic modals (alertActionModal, alertDetailModal) */
#alertActionModal,
#alertDetailModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
}

#alertActionModal.show,
#alertDetailModal.show {
  display: flex;
}

#alertActionModal .modal-bg,
#alertDetailModal .modal-bg {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

#alertActionModal .modal-content,
#alertDetailModal .modal-content {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface), var(--bg1));
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s ease;
}

#alertActionModal .modal-header,
#alertDetailModal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

#alertActionModal .modal-header h2,
#alertDetailModal .modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

#alertActionModal .modal-footer,
#alertDetailModal .modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.modal {
  width: min(960px, 96vw);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface), var(--bg1));
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s ease;
}

.modal.fade-out {
  animation: modalOut 0.22s ease forwards;
}

.punish-modal {
  width: min(860px, 96vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
}

.punish-modal .modal-body {
  overflow: auto;
}

.punish-types {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.punish-types .action-btn {
  min-width: 120px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalOut {
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes overlayOut {
  to {
    opacity: 0;
  }
}

.modal-top {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.modal-top b {
  font-size: 14px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.2);
}

/* ===== DRAWERS ===== */
.drawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 5600;
  display: none;
}

.drawerOverlay.show {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(540px, 96vw);
  background: linear-gradient(180deg, var(--surface), var(--bg1));
  border-left: 1px solid var(--border-light);
  box-shadow: -20px 0 80px rgba(0, 0, 0, 0.5);
  z-index: 5700;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-top {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.drawer-top .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px 0 20px;
}

.action-cluster {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn.delete {
  padding: 10px 16px;
  border-color: rgba(var(--bad-rgb), 0.35);
  color: var(--bad);
  min-width: 88px;
}

.mini.delete {
  padding: 10px 14px;
  font-size: 13px;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.condition-row .spacer {
  margin-left: auto;
}

.toggle.tiny {
  width: 38px;
  height: 20px;
}

.toggle.tiny .toggle-thumb {
  width: 14px;
  height: 14px;
}

.toggle.tiny.on .toggle-thumb {
  left: 20px;
}

/* ===== COMMAND BLACKLIST ===== */

.cmdbl-embed {
  background: var(--surface);
  border: 1px solid var(--border);
}

.cmdbl-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: all var(--transition);
}

.cmdbl-entry:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cmdbl-entry.expired {
  opacity: 0.6;
}

.cmdbl-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cmdbl-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.cmdbl-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.cmdbl-command {
  flex: 1;
  min-width: 120px;
}

.cmdbl-info {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cmdbl-actions {
  margin-left: auto;
}

.cmdbl-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cmdbl-meta small {
  color: var(--text-secondary);
  font-size: 11px;
}

.cmdbl-meta i {
  opacity: 0.6;
  margin-right: 4px;
}

/* ===== EXPANDABLE REASON TEXT ===== */

.reason-text {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.reason-text:hover {
  color: var(--primary-light);
}

.reason-text.expanded {
  word-break: break-word;
  white-space: pre-wrap;
}

.reason-text .expand-hint {
  color: var(--muted);
  font-size: 10px;
  margin-left: 4px;
}

.reason-text.expanded .expand-hint {
  display: none;
}

/* ===== AUTOMOD RULES ENHANCED STYLING ===== */

.rules-embed {
  background: var(--surface);
  border: 1px solid var(--border);
}

.rules-embed .card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.rules-embed .card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Rule header */
.rule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rule-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-title b {
  font-size: 15px;
  color: var(--text);
}

.rule-type-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Rule conditions container */
.rule-conditions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-conditions .card {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border);
  padding: 12px;
}

/* Condition row improvements */
.condition-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.condition-row .badge {
  flex-shrink: 0;
}

.condition-row .input {
  flex: 0 0 auto;
}

.condition-row select.input {
  min-width: 140px;
}

/* Rule actions footer */
.rule-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.rule-threshold {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-threshold .badge {
  font-size: 11px;
}

.rule-threshold .input {
  width: 70px;
}

/* Rule disabled state */
.rule-card.disabled {
  opacity: 0.6;
}

.rule-card.disabled .card {
  background: rgba(0, 0, 0, 0.3);
}

/* ===== AUTOMOD PERMISSION STATES ===== */

/* No edit permission - make everything non-interactable */
.automod-no-edit .input,
.automod-no-edit select,
.automod-no-edit textarea,
.automod-no-edit .toggle,
.automod-no-edit button:not(.mini):not(.details-btn) {
  pointer-events: none !important;
  opacity: 0.6;
  cursor: not-allowed !important;
}

.automod-no-edit .toggle {
  opacity: 0.5;
}

.automod-no-edit .rule-card-clickable {
  cursor: default !important;
}

/* Hide delete buttons without delete permission */
.automod-no-delete .delete,
.automod-no-delete [onclick*="deleteRule"] {
  display: none !important;
}

/* Automod overlay message */
.automod-permission-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}

.automod-permission-overlay-content {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px;
}

.automod-permission-overlay-content i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.automod-permission-overlay-content p {
  margin: 0;
  font-size: 14px;
}

/* Hintline styling */
.hintline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Rule type colors */
.rule-type-word-filter { color: var(--warn); }
.rule-type-spam { color: var(--bad); }
.rule-type-caps { color: var(--primary-light); }
.rule-type-anticheat { color: #9d82ff; }

/* Pagination improvements */
#rulesPagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

#rulesPagination .mini {
  min-width: 32px;
}

/* Block helper class for inline form */
.block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 0 16px var(--primary-glow);
}

.action-btn.warn {
  border-color: rgba(var(--warn-rgb), 0.35);
  color: var(--warn);
}

.action-btn.mute {
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-light);
}

.action-btn.ban {
  border-color: rgba(var(--bad-rgb), 0.35);
  color: var(--bad);
}

.action-btn.compact {
  padding: 8px 12px;
}

.action-btn.primary {
  background: rgba(var(--primary-rgb), 0.16);
  border-color: rgba(var(--primary-rgb), 0.45);
  color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  outline: none;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}

.toggle:active .toggle-thumb {
  transform: scale(0.9);
}

.toggle.on {
  background: rgba(var(--primary-light-rgb), 0.25);
  border-color: rgba(var(--primary-light-rgb), 0.5);
  box-shadow: 0 0 12px rgba(var(--primary-light-rgb), 0.3);
}

.toggle.on .toggle-thumb {
  left: 22px;
  background: var(--primary-light);
  box-shadow: 0 0 8px rgba(var(--primary-light-rgb), 0.5);
}

.toggle-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.toggle-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

/* ===== COMBO LIST ===== */
.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 100%;
  margin-top: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  max-height: 240px;
  overflow: auto;
  display: none;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.combo.open .combo-list {
  display: block;
}

.combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.combo-item:last-child {
  border-bottom: none;
}

.combo-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ===== PUNISHMENT PLAYER SELECTION ===== */
.punish-player-combo .punish-player-list {
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 280px;
}

.punish-player-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.punish-player-result:last-child {
  border-bottom: none;
}

.punish-player-result:hover {
  background: rgba(var(--primary-rgb), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
}

.punish-player-result.empty {
  justify-content: center;
  color: var(--muted);
  cursor: default;
  background: var(--bg2);
}

.punish-player-result.empty:hover {
  background: var(--bg2);
  box-shadow: none;
}

.punish-player-result .player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.punish-player-result .player-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.punish-player-result .player-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.punish-player-result .player-platform {
  font-size: 11px;
  color: var(--muted);
}

/* Player Tags (selected players) */
.punish-player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.punish-player-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--primary-light);
}

.punish-player-tag .tag-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.punish-player-tag .tag-name {
  font-weight: 500;
}

.punish-player-tag .tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s ease;
  margin-left: 2px;
}

.punish-player-tag .tag-remove:hover {
  background: rgba(var(--bad-rgb), 0.4);
  color: var(--bad);
}

.punish-player-tag .tag-remove i {
  font-size: 9px;
}

/* ===== EVIDENCE ATTACHMENT SECTION ===== */
.evidence-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.evidence-header:hover {
  background: rgba(0, 0, 0, 0.25);
}

.evidence-header i:first-child {
  color: var(--primary-light);
}

.evidence-toggle-icon {
  color: var(--muted);
  transition: transform var(--transition);
  font-size: 12px;
}

.evidence-section.expanded .evidence-toggle-icon {
  transform: rotate(180deg);
}

.evidence-content {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.evidence-search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.evidence-search-container .evidence-search {
  flex: 1;
}

.evidence-search-container .evidence-search input {
  width: 100%;
}

/* Evidence Log List */
.evidence-log-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.evidence-log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}

.evidence-log-empty i {
  font-size: 24px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.evidence-log-empty p {
  margin: 0;
  font-size: 13px;
}

/* Evidence Log Item */
.evidence-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.evidence-log-item:last-child {
  border-bottom: none;
}

.evidence-log-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.evidence-log-item.selected {
  background: rgba(var(--primary-rgb), 0.15);
}

.evidence-log-item .evidence-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 2px;
}

.evidence-log-item.selected .evidence-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.evidence-log-item .evidence-checkbox i {
  font-size: 10px;
  color: white;
  opacity: 0;
  transition: opacity var(--transition);
}

.evidence-log-item.selected .evidence-checkbox i {
  opacity: 1;
}

.evidence-log-item .evidence-log-content {
  flex: 1;
  min-width: 0;
}

.evidence-log-item .evidence-log-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.evidence-log-item .evidence-log-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary-light);
}

.evidence-log-item .evidence-log-type.chat { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.evidence-log-item .evidence-log-type.command { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.evidence-log-item .evidence-log-type.automod { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.evidence-log-item .evidence-log-time {
  font-size: 11px;
  color: var(--muted);
}

.evidence-log-item .evidence-log-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selected Evidence Pills */
.evidence-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(var(--primary-rgb), 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(var(--primary-rgb), 0.2);
  border-radius: 16px;
  font-size: 11px;
  color: var(--primary-light);
}

.evidence-pill.file {
  background: rgba(var(--ok-rgb), 0.2);
  color: var(--ok);
}

.evidence-pill .pill-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background var(--transition);
}

.evidence-pill .pill-remove:hover {
  background: rgba(var(--bad-rgb), 0.4);
  color: var(--bad);
}

.evidence-pill .pill-remove i {
  font-size: 8px;
}

/* Evidence max warning */
.evidence-max-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(var(--warn-rgb), 0.15);
  border: 1px solid rgba(var(--warn-rgb), 0.3);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 12px;
  margin-top: 10px;
}

/* Loading state */
.evidence-log-list.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.evidence-log-list.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== EVIDENCE UPLOAD MODAL ===== */
.evidence-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition);
}

.evidence-dropzone:hover,
.evidence-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.evidence-dropzone i {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 16px;
  transition: color var(--transition);
}

.evidence-dropzone:hover i,
.evidence-dropzone.dragover i {
  color: var(--primary-light);
}

.evidence-dropzone .dropzone-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.evidence-dropzone .dropzone-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px 0;
}

.evidence-dropzone .dropzone-formats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.evidence-dropzone .dropzone-formats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evidence-dropzone .dropzone-formats i {
  font-size: 12px;
  margin: 0;
  color: var(--text-secondary);
}

/* File Preview */
.evidence-file-preview {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview-info > i {
  font-size: 32px;
  color: var(--primary-light);
}

.file-preview-info > i.video {
  color: var(--accent);
}

.file-preview-details {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Upload Progress */
.evidence-upload-progress {
  margin-top: 16px;
}

.evidence-upload-progress .progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.evidence-upload-progress .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.evidence-upload-progress .progress-text {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* Upload Status */
.evidence-upload-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.evidence-upload-status.success {
  background: rgba(var(--ok-rgb), 0.15);
  border: 1px solid rgba(var(--ok-rgb), 0.3);
  color: var(--ok);
}

.evidence-upload-status.error {
  background: rgba(var(--bad-rgb), 0.15);
  border: 1px solid rgba(var(--bad-rgb), 0.3);
  color: var(--bad);
}

/* ===== EVIDENCE VIEWER (in punishment details) ===== */
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.evidence-item {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.evidence-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.evidence-item-time {
  font-size: 11px;
  color: var(--muted);
}

.evidence-item-content {
  margin-top: 8px;
}

.evidence-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition);
}

.evidence-image:hover {
  transform: scale(1.02);
}

.evidence-video-preview {
  cursor: pointer;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: background var(--transition);
}

.evidence-video-preview:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

/* ===== IMAGE LIGHTBOX ===== */
.image-lightbox-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.image-lightbox {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-lightbox img {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: var(--bad);
}

.lightbox-controls {
  margin-top: 16px;
}

/* ===== VIDEO PLAYER ===== */
.video-player-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.video-player-container {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.video-player-wrapper {
  background: black;
}

.video-player-wrapper video {
  width: 100%;
  max-height: 70vh;
  display: block;
}

.video-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg1);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.video-speed-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.video-speed-controls .mini {
  padding: 4px 8px;
  font-size: 11px;
}

.video-speed-controls .mini.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== TOGGLE SWITCH (checkbox-based) ===== */
.toggle-switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch-label input[type="checkbox"]:checked + .toggle-switch {
  background: rgba(var(--primary-light-rgb), 0.25);
  border-color: rgba(var(--primary-light-rgb), 0.5);
  box-shadow: 0 0 12px rgba(var(--primary-light-rgb), 0.3);
}

.toggle-switch-label input[type="checkbox"]:checked + .toggle-switch::after {
  left: 20px;
  background: var(--primary-light);
  box-shadow: 0 0 8px rgba(var(--primary-light-rgb), 0.5);
}

/* ===== MODERN SELECT DROPDOWN ===== */
.punish-select {
  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='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  transition: all var(--transition);
}

.punish-select:hover {
  border-color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.05);
}

.punish-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}

/* Execute button states */
#punishCreateExecuteBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--muted2);
  border-color: var(--border);
}

#punishCreateExecuteBtn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.player-profile {
  padding: 6px 8px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.drawer-top .left b {
  font-size: 15px;
  font-weight: 600;
}

.drawer-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
}

.drawer-sec {
  margin-top: 16px;
}

.drawer-sec h3 {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.drawer-sec .box {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Scrollable history sections in drawer */
.drawer-sec .box.scrollable {
  max-height: 200px;
  overflow-y: auto;
}

/* Custom scrollbar for drawer boxes */
.drawer-sec .box.scrollable::-webkit-scrollbar {
  width: 6px;
}

.drawer-sec .box.scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.drawer-sec .box.scrollable::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.drawer-sec .box.scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.drawer-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: background var(--transition);
}

.drawer-row.watchlist-row {
  align-items: center;
}

.drawer-row:last-child {
  border-bottom: none;
}

.drawer-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.drawer-row .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.drawer-row .meta b {
  font-size: 13px;
  font-weight: 600;
}

.drawer-row .meta small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== TOASTS ===== */
#toastContainer {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  cursor: pointer;
  transition: all var(--transition);
}

.toast:hover {
  transform: translateX(-4px);
  border-color: var(--border-light);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.exit {
  animation: toastOut 0.28s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 14px;
}

.toast.ok .toast-icon {
  background: rgba(var(--ok-rgb), 0.15);
  color: var(--ok);
}

.toast.warn .toast-icon {
  background: rgba(var(--warn-rgb), 0.15);
  color: var(--warn);
}

.toast.bad .toast-icon {
  background: rgba(var(--bad-rgb), 0.15);
  color: var(--bad);
}

.toast.info .toast-icon {
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary-light);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-content b {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.toast-content small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
}

.toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.toast-click-hint {
  display: block;
  font-size: 10px;
  color: var(--primary-light);
  margin-top: 4px;
  opacity: 0.8;
}

.toast:hover .toast-click-hint {
  opacity: 1;
  text-decoration: underline;
}

/* ===== ALERT TOASTS (Priority Notifications - AlertBar Style) ===== */
#alertToastContainer {
  position: fixed;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100% - 24px);
  pointer-events: none;
}

/* Position variants */
#alertToastContainer.top-right { top: 12px; right: 12px; }
#alertToastContainer.top-left { top: 12px; left: 12px; }
#alertToastContainer.bottom-right { bottom: 12px; right: 12px; }
#alertToastContainer.bottom-left { bottom: 12px; left: 12px; }

/* AlertBar-style toast (matches watchlist alert bar) */
.alert-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid rgba(var(--warn-rgb), 0.4);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--warn-rgb), 0.1);
  backdrop-filter: blur(12px);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.alert-toast.show {
  transform: translateX(0);
}

.alert-toast.exit {
  transform: translateX(120%);
}

/* Left-side animations for left-positioned containers */
#alertToastContainer.top-left .alert-toast,
#alertToastContainer.bottom-left .alert-toast {
  transform: translateX(-120%);
}

#alertToastContainer.top-left .alert-toast.show,
#alertToastContainer.bottom-left .alert-toast.show {
  transform: translateX(0);
}

#alertToastContainer.top-left .alert-toast.exit,
#alertToastContainer.bottom-left .alert-toast.exit {
  transform: translateX(-120%);
}

/* Alert toast left section */
.alert-toast-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Alert toast avatar */
.alert-toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Alert toast icon */
.alert-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(var(--warn-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warn);
  flex-shrink: 0;
  font-size: 14px;
}

/* Alert toast text */
.alert-toast-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.alert-toast-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-toast-player {
  font-size: 11px;
  color: var(--warn);
  font-weight: 500;
}

.alert-toast-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-vl-badge {
  background: rgba(255, 71, 87, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--bad);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.alert-vl-value {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.alert-vl-value.vl-increased {
  transform: scale(1.3);
  color: #ff6b6b;
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

/* Alert toast actions */
.alert-toast-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.alert-toast-actions .mini {
  padding: 6px 10px;
  font-size: 11px;
}

/* Progress bar for auto-dismiss */
.alert-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--warn);
  opacity: 0.6;
  animation: alertProgress linear forwards;
}

@keyframes alertProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ===== ALERT TYPE COLORS ===== */
/* Ban - Red */
.alert-toast.ban {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
}
.alert-toast.ban .alert-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.alert-toast.ban .alert-toast-player { color: #ef4444; }
.alert-toast.ban .alert-toast-progress { background: #ef4444; }

/* Kick - Orange */
.alert-toast.kick {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(249, 115, 22, 0.1);
}
.alert-toast.kick .alert-toast-icon {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}
.alert-toast.kick .alert-toast-player { color: #f97316; }
.alert-toast.kick .alert-toast-progress { background: #f97316; }

/* Mute - Yellow */
.alert-toast.mute {
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(234, 179, 8, 0.1);
}
.alert-toast.mute .alert-toast-icon {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}
.alert-toast.mute .alert-toast-player { color: #eab308; }
.alert-toast.mute .alert-toast-progress { background: #eab308; }

/* Warn - Cyan */
.alert-toast.warn {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 182, 212, 0.1);
}
.alert-toast.warn .alert-toast-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}
.alert-toast.warn .alert-toast-player { color: #06b6d4; }
.alert-toast.warn .alert-toast-progress { background: #06b6d4; }

/* Pardon - Green */
.alert-toast.pardon {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(34, 197, 94, 0.1);
}
.alert-toast.pardon .alert-toast-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.alert-toast.pardon .alert-toast-player { color: #22c55e; }
.alert-toast.pardon .alert-toast-progress { background: #22c55e; }

/* Anticheat - Red */
.alert-toast.anticheat {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
}
.alert-toast.anticheat .alert-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.alert-toast.anticheat .alert-toast-player { color: #ef4444; }
.alert-toast.anticheat .alert-toast-progress { background: #ef4444; }

/* Automod - Orange */
.alert-toast.automod {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(249, 115, 22, 0.1);
}
.alert-toast.automod .alert-toast-icon {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}
.alert-toast.automod .alert-toast-player { color: #f97316; }
.alert-toast.automod .alert-toast-progress { background: #f97316; }

/* Command - Gray */
.alert-toast.command {
  border-color: rgba(107, 114, 128, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(107, 114, 128, 0.1);
}
.alert-toast.command .alert-toast-icon {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}
.alert-toast.command .alert-toast-player { color: #6b7280; }
.alert-toast.command .alert-toast-progress { background: #6b7280; }

/* Nickname - Purple */
.alert-toast.nickname {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(168, 85, 247, 0.1);
}
.alert-toast.nickname .alert-toast-icon {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}
.alert-toast.nickname .alert-toast-player { color: #a855f7; }
.alert-toast.nickname .alert-toast-progress { background: #a855f7; }

/* Watchlist - Yellow */
.alert-toast.watchlist {
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(234, 179, 8, 0.1);
}
.alert-toast.watchlist .alert-toast-icon {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}
.alert-toast.watchlist .alert-toast-player { color: #eab308; }
.alert-toast.watchlist .alert-toast-progress { background: #eab308; }

/* Staff Chat - Cyan */
.alert-toast.staffchat {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 182, 212, 0.1);
}
.alert-toast.staffchat .alert-toast-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}
.alert-toast.staffchat .alert-toast-player { color: #06b6d4; }
.alert-toast.staffchat .alert-toast-progress { background: #06b6d4; }

/* Lag - Red */
.alert-toast.lag {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
}
.alert-toast.lag .alert-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.alert-toast.lag .alert-toast-player { color: #ef4444; }
.alert-toast.lag .alert-toast-progress { background: #ef4444; }

/* Punishments (legacy) - Red */
.alert-toast.punishments {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
}
.alert-toast.punishments .alert-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.alert-toast.punishments .alert-toast-player { color: #ef4444; }
.alert-toast.punishments .alert-toast-progress { background: #ef4444; }

/* ===== ALERT DETAIL MODAL ===== */
.alert-detail-section {
  margin-bottom: 16px;
}

.alert-detail-section:last-child {
  margin-bottom: 0;
}

.alert-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.alert-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.alert-detail-row:last-child {
  border-bottom: none;
}

.alert-detail-label {
  color: var(--muted);
  font-size: 13px;
}

.alert-detail-value {
  color: var(--text);
  font-size: 13px;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

/* ===== CHECKLIST ANIMATIONS ===== */
.checklist-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  transform: translateX(4px);
}

.checklist-item .checklist-checkbox {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Only animate checkbox when actively clicking (not on re-render) */
.checklist-item.checking .checklist-checkbox {
  animation: checkboxPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Only animate checkmark when actively clicking */
.checklist-item.checking .checklist-checkmark {
  animation: checkmarkDraw 0.3s ease-out forwards;
}

.checklist-item .checklist-text {
  transition: all 0.3s ease;
}

/* Glow animation only on active click */
.checklist-item.checking {
  animation: itemComplete 0.5s ease-out;
}

@keyframes checkboxPop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(0.9);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkmarkDraw {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-45deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes strikethrough {
  0% {
    text-decoration-color: transparent;
  }
  100% {
    text-decoration: line-through;
    text-decoration-color: var(--good);
  }
}

@keyframes itemComplete {
  0% {
    background: rgba(0, 0, 0, 0.2);
  }
  30% {
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  }
  100% {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: none;
  }
}

/* Unchecking animation */
.checklist-item.unchecking {
  animation: itemUncomplete 0.3s ease-out;
}

@keyframes itemUncomplete {
  0% {
    background: rgba(34, 197, 94, 0.2);
  }
  100% {
    background: rgba(0, 0, 0, 0.2);
  }
}

/* ===== SPLIT LAYOUT ===== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
  .top-profile {
    min-width: 0;
    padding: 6px;
  }
  .profile-sub {
    display: none;
  }
}

.block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ===== AUTH OVERLAY ===== */
.authOverlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6, 10, 18, 0.98), rgba(3, 5, 8, 0.99));
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.authOverlay.hide {
  opacity: 0;
  pointer-events: none;
}

.authBox {
  width: min(420px, 90vw);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.9), rgba(10, 14, 22, 0.95));
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.authBox .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px auto;
}

.authBox .logo i {
  font-size: 24px;
}

.authBox .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.authBox h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.authBox p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.authBox .input {
  margin-bottom: 14px;
}

.authBox .btn {
  width: 100%;
  justify-content: center;
}

/* Auth Sections */
.auth-section {
  margin-bottom: 20px;
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.auth-hint code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary-light);
}

.auth-row {
  display: flex;
  gap: 10px;
}

.auth-row .input {
  margin-bottom: 0;
}

.code-input {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  text-transform: uppercase;
  padding: 16px 20px;
}

.code-input::placeholder {
  letter-spacing: 8px;
  color: var(--muted);
}

.auth-error {
  background: rgba(var(--bad-rgb), 0.1);
  border: 1px solid rgba(var(--bad-rgb), 0.3);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
  margin-top: 8px;
}

.auth-status.ok {
  color: var(--ok);
}

.auth-status.error {
  color: var(--error);
}

.auth-status.pending {
  color: var(--warn);
}

/* Auth Status Area (new centered status display) */
.auth-status-area {
  padding: 30px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-spinner-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
}

.auth-spinner-wrap .spinner {
  width: 100%;
  height: 100%;
  border-width: 3px;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

/* Animated Success Checkmark */
.auth-success-check {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.checkmark-svg {
  width: 100%;
  height: 100%;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--ok);
  fill: none;
}

.checkmark-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Success state animations */
.auth-status-area.success .spinner {
  opacity: 0;
}

.auth-status-area.success .auth-success-check {
  opacity: 1;
  animation: checkmarkScaleIn 0.3s ease forwards;
}

.auth-status-area.success .checkmark-circle {
  animation: checkmarkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.auth-status-area.success .checkmark-check {
  animation: checkmarkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

@keyframes checkmarkStroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes checkmarkScaleIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.auth-status-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-status-sub {
  font-size: 13px;
  color: var(--muted);
}

.auth-status-area.error .spinner {
  display: none;
}

.auth-status-area.error .auth-status-text {
  color: var(--bad);
}

.auth-status-area.success .auth-status-text {
  color: var(--ok);
}

/* Manual Auth Section */
.auth-manual {
  animation: fadeSlideIn 0.3s ease;
  text-align: left;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Access Denied Overlay */
.accessDeniedOverlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6, 10, 18, 0.98), rgba(3, 5, 8, 0.99));
  z-index: 7000;
  display: none;
  align-items: center;
  justify-content: center;
}

.accessDeniedOverlay.show {
  display: flex;
}

.accessDeniedBox {
  width: min(420px, 90vw);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--bad-rgb), 0.3);
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.9), rgba(10, 14, 22, 0.95));
  box-shadow: 0 0 60px rgba(var(--bad-rgb), 0.1);
  text-align: center;
}

.accessDeniedBox .logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px auto;
  opacity: 0.6;
  filter: grayscale(50%);
}

.accessDeniedBox .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.accessDeniedBox h2 {
  font-size: 24px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 12px;
}

.accessDeniedBox p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.accessDeniedBox .auth-hint {
  margin-bottom: 0;
}

/* Connecting Overlay */
.connectOverlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.9);
  z-index: 6500;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.connectOverlay.show {
  display: flex;
}

.connectBox {
  text-align: center;
}

.connectBox .spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
  margin: 0 auto 20px auto;
}

.connectBox p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== STAFF CHAT ===== */
.staffchat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.staffchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.staffchat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  gap: 12px;
}

.staffchat-empty i {
  font-size: 48px;
  opacity: 0.3;
}

.staffchat-empty p {
  font-size: 13px;
}

.staffchat-message {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.staffchat-message.self {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.staffchat-message.web {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.staffchat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.staffchat-content {
  flex: 1;
  min-width: 0;
}

.staffchat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.staffchat-sender {
  font-weight: 600;
  font-size: 13px;
}

.staffchat-time {
  font-size: 11px;
  color: var(--muted);
}

.staffchat-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.staffchat-badge.game {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.staffchat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.staffchat-loading i {
  font-size: 14px;
}

.staffchat-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.staffchat-load-more:hover {
  opacity: 1;
}

.staffchat-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.staffchat-date-divider::before,
.staffchat-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.staffchat-text {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-word;
}

.staffchat-input {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.staffchat-input .input {
  flex: 1;
  margin: 0;
}

.staffchat-input .btn {
  padding: 0 16px;
}

/* Staff List */
.staff-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.staff-member:last-child {
  margin-bottom: 0;
}

.staff-meta {
  flex: 1;
  min-width: 0;
}

.staff-name {
  font-weight: 600;
  font-size: 13px;
}

.staff-role {
  font-size: 11px;
  color: var(--muted);
}

.staff-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.staff-status.away {
  background: var(--warn);
}

.staff-status.offline {
  background: var(--muted);
}

/* ===== AI PANEL ===== */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  box-shadow: 0 8px 32px var(--primary-glow);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 4500;
  transition: all var(--transition);
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px var(--primary-glow);
}

.fab i {
  color: white;
  font-size: 20px;
}

.testerPanel {
  position: fixed;
  top: 90px;
  right: 24px;
  width: min(420px, 92vw);
  max-height: 70vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  z-index: 4700;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.testerPanel.show {
  display: flex;
  animation: fadeUp 0.2s ease;
}

.testerTop {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.testerBody {
  padding: 16px;
  overflow: auto;
}

.rules-embed {
  overflow: hidden;
}

/* ===== LIVE LOGS ===== */
.logsBox {
  height: calc(100vh - 280px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}

.logitem {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.logitem:hover {
  background: rgba(255, 255, 255, 0.02);
}

.logitem:last-child {
  border-bottom: none;
}

.logleft {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.logleft b {
  font-size: 13px;
  font-weight: 600;
}

.logleft small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.logright {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pill.info {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-light);
}

.pill.warn {
  background: rgba(var(--warn-rgb), 0.12);
  color: var(--warn);
}

.pill.err {
  background: rgba(var(--bad-rgb), 0.12);
  color: var(--bad);
}

.pill.mx {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-light);
}

/* ===== ACTIVITY LOG ===== */
.activity-log-box {
  height: calc(100vh - 280px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}

.activity-log-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.activity-log-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.activity-log-item:last-child {
  border-bottom: none;
}

.activity-log-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.activity-log-left b {
  font-size: 13px;
  font-weight: 600;
}

.activity-log-left small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-log-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Activity type badges */
.activity-type {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.activity-type.chat { background: rgba(var(--primary-rgb), 0.15); color: var(--primary-light); }
.activity-type.command { background: rgba(var(--accent-rgb), 0.15); color: var(--accent-light); }
.activity-type.ban { background: rgba(var(--bad-rgb), 0.15); color: var(--bad); }
.activity-type.mute { background: rgba(var(--warn-rgb), 0.15); color: var(--warn); }
.activity-type.warn { background: rgba(255, 200, 50, 0.15); color: #ffc832; }
.activity-type.kick { background: rgba(255, 150, 50, 0.15); color: #ff9632; }
.activity-type.automod { background: rgba(var(--bad-rgb), 0.15); color: var(--bad); }
.activity-type.session { background: rgba(var(--ok-rgb), 0.15); color: var(--ok); }
.activity-type.nick { background: rgba(var(--primary-rgb), 0.15); color: var(--primary-light); }

/* Search suggestions dropdown */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}

.search-suggestion {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

.search-suggestion i {
  color: var(--primary-light);
  width: 20px;
  text-align: center;
}

.search-suggestion .suggestion-text {
  flex: 1;
}

.search-suggestion .suggestion-text b {
  color: var(--primary-light);
}

.search-suggestion .suggestion-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Activity search filter highlighting */
.activity-search {
  position: relative;
}

.activity-search .filter-highlight-overlay {
  position: absolute;
  left: 42px;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  white-space: pre;
  font-family: var(--font);
  font-size: 13px;
  color: transparent;
  overflow: hidden;
}

.activity-search .filter-highlight-overlay .filter-keyword {
  color: var(--primary-light);
  font-weight: 500;
}

.activity-search .filter-highlight-overlay .filter-value {
  color: var(--text);
}

.activity-search .filter-highlight-overlay .filter-invalid {
  color: var(--bad);
  text-decoration: underline wavy var(--bad);
}

.activity-search input.has-filters {
  color: transparent;
  caret-color: var(--text);
}

/* ===== CHECK TOGGLES ===== */
.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.check-toggle .check-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: grid;
  place-items: center;
  color: transparent;
  background: rgba(255, 255, 255, 0.04);
  transition: all var(--transition);
}

.check-toggle.on {
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--text);
  box-shadow: 0 0 12px var(--primary-glow);
}

.check-toggle.on .check-icon {
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.2);
}

/* ===== SERVER STATUS ===== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  position: relative;
  min-height: 100px;
  box-sizing: border-box;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card .stat-icon.tps {
  background: linear-gradient(135deg, rgba(var(--ok-rgb), 0.2), rgba(var(--ok-rgb), 0.05));
  color: var(--ok);
  border: 1px solid rgba(var(--ok-rgb), 0.3);
}

.stat-card .stat-icon.memory {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0.05));
  color: var(--primary-light);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.stat-card .stat-icon.cpu {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.05));
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.stat-card .stat-icon.players {
  background: linear-gradient(135deg, rgba(var(--warn-rgb), 0.2), rgba(var(--warn-rgb), 0.05));
  color: var(--warn);
  border: 1px solid rgba(var(--warn-rgb), 0.3);
}

.stat-card .stat-info {
  flex: 1;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-trend {
  font-size: 16px;
  color: var(--muted);
}

.stat-card .stat-trend.up { color: var(--ok); }
.stat-card .stat-trend.down { color: var(--bad); }

.stat-card .stat-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.stat-card .stat-progress .progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
}

.stat-card .stat-progress .progress-bar.warn {
  background: var(--warn);
}

.stat-card .stat-progress .progress-bar.bad {
  background: var(--bad);
}

/* TPS Graph */
.tps-graph-container {
  position: relative;
  height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
}

.tps-graph-container canvas {
  width: 100%;
  height: 100%;
}

.tps-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tps-legend i {
  font-size: 8px;
  margin-right: 4px;
}

.tps-legend .tps-good i { color: var(--ok); }
.tps-legend .tps-warn i { color: var(--warn); }
.tps-legend .tps-bad i { color: var(--bad); }

/* World Stats */
.world-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.world-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.world-stat-item .world-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--accent-rgb), 0.1));
  display: grid;
  place-items: center;
  color: var(--primary-light);
}

.world-stat-item .world-icon.nether {
  background: linear-gradient(135deg, rgba(var(--bad-rgb), 0.15), rgba(var(--warn-rgb), 0.1));
  color: var(--bad);
}

.world-stat-item .world-icon.end {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--primary-light-rgb), 0.1));
  color: var(--accent-light);
}

.world-stat-item .world-info {
  flex: 1;
}

.world-stat-item .world-name {
  font-weight: 600;
  font-size: 14px;
}

.world-stat-item .world-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.world-stat-item .world-players {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.world-stat-item .world-players i {
  color: var(--muted);
}

/* Laggy Chunks */
.laggy-chunks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.laggy-chunk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(var(--bad-rgb), 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--bad-rgb), 0.2);
}

.laggy-chunk-item .chunk-coords {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--bad);
  background: rgba(var(--bad-rgb), 0.15);
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 140px;
}

.laggy-chunk-item .chunk-world {
  flex: 1;
  font-weight: 500;
}

.laggy-chunk-item .chunk-reason {
  font-size: 12px;
  color: var(--text-secondary);
}

.laggy-chunk-item .chunk-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.laggy-chunk-item .chunk-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.laggy-chunk-item .chunk-stat i {
  color: var(--muted);
}

/* Status Alerts */
.status-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.status-alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warn);
}

.status-alert-item.low-tps {
  border-left-color: var(--bad);
  background: rgba(var(--bad-rgb), 0.08);
}

.status-alert-item .alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(var(--warn-rgb), 0.15);
  color: var(--warn);
}

.status-alert-item.low-tps .alert-icon {
  background: rgba(var(--bad-rgb), 0.15);
  color: var(--bad);
}

.status-alert-item .alert-content {
  flex: 1;
}

.status-alert-item .alert-message {
  font-size: 13px;
  font-weight: 500;
}

.status-alert-item .alert-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Lag Machines */
.lag-machines-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.lag-machine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(var(--warn-rgb), 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--warn-rgb), 0.2);
}

.lag-machine-item .player-avatar {
  width: 40px;
  height: 40px;
}

.lag-machine-item .player-info {
  flex: 1;
}

.lag-machine-item .player-name {
  font-weight: 600;
  font-size: 14px;
}

.lag-machine-item .player-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.lag-machine-item .player-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lag-machine-item .player-stats i {
  color: var(--warn);
  font-size: 10px;
}

.lag-machine-item .actions {
  display: flex;
  gap: 6px;
}

/* Empty state */
.empty-state.small {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state.small i {
  font-size: 24px;
  margin-bottom: 8px;
}

.empty-state.small p {
  font-size: 13px;
}

.world-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-secondary);
}

/* Player Status List */
.player-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.player-status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.player-status-item:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--border-light);
}

.player-status-item .player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.player-status-item .player-info {
  flex: 1;
  min-width: 0;
}

.player-status-item .player-name {
  font-weight: 600;
  font-size: 13px;
}

.player-status-item .player-location {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-status-item .player-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.player-status-item .player-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-status-item .player-stats .ping {
  font-family: var(--font-mono);
  font-size: 11px;
}

.player-status-item .player-stats .health,
.player-status-item .player-stats .food {
  color: var(--text-secondary);
}

.player-status-item .player-stats i {
  font-size: 10px;
}

/* ===== CONTEXT MENU ===== */
.context-menu {
  position: fixed;
  z-index: 9500;
  min-width: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface), var(--bg1));
  box-shadow: var(--shadow-lg);
  display: none;
  padding: 8px;
}

.context-menu.show {
  display: block;
  animation: fadeUp 0.16s ease;
}

.context-title {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.context-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-light);
}

.context-item.bad {
  color: var(--bad);
}

/* ===== CONNECT OVERLAY ===== */
.connect-overlay {
  backdrop-filter: blur(18px);
}

.connect-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.95), rgba(8, 12, 20, 0.95));
  box-shadow: var(--shadow-lg);
  min-width: 280px;
}

.connect-title {
  font-size: 14px;
  font-weight: 600;
}

.connect-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--primary-light);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== DISCONNECT OVERLAY ===== */
.disconnectOverlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.85);
  backdrop-filter: blur(20px);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.disconnectOverlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.disconnectBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 60px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--bad-rgb), 0.3);
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.95), rgba(10, 14, 22, 0.98));
  box-shadow: 0 0 80px rgba(var(--bad-rgb), 0.15);
  text-align: center;
  max-width: 420px;
}

.disconnectIcon {
  position: relative;
  width: 100px;
  height: 100px;
}

.disconnectIcon .logo-bg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(var(--bad-rgb), 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(var(--bad-rgb), 0.2);
}

.disconnectIcon .logo-bg img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: grayscale(30%) brightness(0.8);
}

.disconnectIcon .x-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 3px solid var(--bg1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--bad-rgb), 0.4);
}

.disconnectIcon .x-badge i {
  color: white;
  font-size: 14px;
}

.disconnectBox h2 {
  font-size: 26px;
  font-weight: 700;
  color: #ef4444;
  margin: 0;
}

.disconnectBox .server-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -8px;
}

.disconnectBox .server-name span {
  color: var(--text);
  font-weight: 600;
}

.disconnectBox p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 300px;
}

.disconnectBox .btn {
  margin-top: 8px;
  min-width: 160px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large screens (1400px+) - default styles apply */

/* Medium-large screens (1200-1400px) */
@media (max-width: 1400px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gsearch {
    width: min(460px, 45vw);
  }
}

/* Medium screens (1000-1200px) */
@media (max-width: 1200px) {
  .sidebar {
    width: 240px;
    min-width: 220px;
  }

  .sb-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  .stat b {
    font-size: 24px;
  }

  .content {
    padding: 20px 20px 50px 20px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Small-medium screens (800-1000px) */
@media (max-width: 1000px) {
  .sidebar {
    width: 220px;
    min-width: 200px;
  }

  .sb-head {
    padding: 16px;
  }

  .logo {
    width: 36px;
    height: 36px;
  }

  .brand b {
    font-size: 14px;
  }

  .sb-scroll {
    padding: 12px 10px 0 10px;
  }

  .sb-item {
    padding: 9px 10px;
    font-size: 12.5px;
  }

  .sb-item i {
    font-size: 13px;
  }

  .topbar {
    height: 64px;
    padding: 0 16px;
    gap: 12px;
  }

  .gsearch-container {
    max-width: 400px;
  }

  .gsearch input {
    padding: 10px 12px 10px 38px;
    font-size: 12px;
  }

  .chip {
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-profile {
    padding: 5px 8px;
  }

  .profile-avatar {
    width: 30px;
    height: 30px;
  }

  .profile-name {
    font-size: 12px;
  }

  .content {
    padding: 16px 16px 40px 16px;
  }

  .page-title h1 {
    font-size: 20px;
  }

  .page-title p {
    font-size: 12px;
  }

  .panel.pad {
    padding: 16px;
  }

  .stat {
    padding: 14px;
  }

  .stat b {
    font-size: 22px;
  }

  .stat small {
    font-size: 9px;
  }

  .card {
    padding: 14px;
  }

  .card h3 {
    font-size: 13px;
  }

  .card p {
    font-size: 12px;
  }

  th, td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .badge {
    padding: 5px 8px;
    font-size: 10px;
  }

  .drawer {
    width: min(480px, 94vw);
  }

  .modal {
    width: min(880px, 94vw);
  }

  .punish-modal {
    width: min(780px, 94vw);
  }
}

/* Tablet / Small screens (600-800px) */
@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    width: 260px;
    z-index: 5000;
    transition: left 0.3s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebarToggle {
    display: flex !important;
  }

  .main {
    width: 100%;
  }

  .topbar {
    padding: 0 12px;
    gap: 10px;
  }

  .gsearch-container {
    flex: 1 1 auto;
    max-width: 300px;
  }

  .top-actions {
    gap: 6px;
  }

  .chip {
    padding: 5px 8px;
    font-size: 10px;
  }

  #timeChip {
    display: none;
  }

  /* Hide rank badge on small screens */
  .rank-badge-container {
    display: none;
  }

  .top-profile {
    padding: 4px 6px;
  }

  .profile-meta {
    display: none;
  }

  .profile-chevron {
    display: none;
  }

  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .grid.cols-2wide {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-group {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-btn {
    min-width: 70px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .left,
  .toolbar .right {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar .right {
    margin-top: 10px;
  }

  .drawer {
    width: 100%;
  }

  .modal {
    width: 96vw;
    max-height: 90vh;
  }

  .punish-modal {
    width: 96vw;
  }

  .modal-body {
    padding: 16px;
  }

  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  #toastContainer {
    right: 12px;
    top: 12px;
    max-width: calc(100vw - 24px);
  }

  .toast {
    padding: 12px;
  }

  .disconnectBox {
    padding: 36px 32px;
  }

  .disconnectIcon {
    width: 80px;
    height: 80px;
  }

  .disconnectIcon .logo-bg img {
    width: 48px;
    height: 48px;
  }

  .disconnectIcon .x-badge {
    width: 30px;
    height: 30px;
  }

  .disconnectBox h2 {
    font-size: 22px;
  }
}

/* Mobile / Extra small screens (<600px) */
@media (max-width: 600px) {
  .topbar {
    height: 56px;
    gap: 8px;
  }

  .gsearch-container {
    max-width: 200px;
  }

  .gsearch input {
    padding: 8px 10px 8px 34px;
    font-size: 11px;
  }

  .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  #publishBtn span {
    display: none;
  }

  .content {
    padding: 12px 12px 30px 12px;
  }

  .page-title h1 {
    font-size: 18px;
  }

  .panel.pad {
    padding: 12px;
  }

  .stat {
    padding: 12px;
  }

  .stat b {
    font-size: 20px;
  }

  .card {
    padding: 12px;
  }

  th, td {
    padding: 8px 10px;
    font-size: 11px;
  }

  .staffchat-container {
    height: 400px;
  }

  .fab {
    width: 48px;
    height: 48px;
    right: 12px;
    bottom: 12px;
  }

  .testerPanel {
    width: calc(100vw - 24px);
    right: 12px;
  }

  /* Mobile-specific improvements */
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .authBox {
    padding: 24px 20px;
    max-width: 340px;
  }

  .authBox h2 {
    font-size: 20px;
  }

  .auth-spinner-wrap {
    width: 56px;
    height: 56px;
  }

  .auth-status-text {
    font-size: 14px;
  }

  .auth-status-sub {
    font-size: 11px;
  }

  .input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .chip {
    padding: 4px 8px;
    font-size: 10px;
  }

  .top-actions {
    gap: 4px;
  }

  .top-profile {
    display: none;
  }

  /* Better touch targets on mobile */
  .btn {
    min-height: 40px;
    padding: 10px 14px;
  }

  .nav-item {
    padding: 12px 14px;
  }

  .drawer {
    width: 100%;
    max-width: 100%;
  }

  .drawer-body {
    padding: 16px;
  }

  /* Table scrolling on mobile - scrollbars hidden */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .table-wrap::-webkit-scrollbar {
    display: none;
  }

  table {
    min-width: 500px;
  }

  /* Replay viewer mobile */
  .replay-canvas-container {
    aspect-ratio: 4 / 3;
  }

  .replay-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .replay-controls .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Player drawer on mobile */
  .player-drawer-avatar {
    width: 48px;
    height: 48px;
  }

  .player-drawer-name {
    font-size: 16px;
  }

  /* Settings on mobile */
  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .setting-row .input,
  .setting-row select {
    width: 100%;
  }
}

/* Extra small screens (<400px) */
@media (max-width: 400px) {
  .topbar {
    height: 50px;
    padding: 0 8px;
    gap: 6px;
  }

  .gsearch-container {
    max-width: 120px;
  }

  .gsearch input {
    padding: 6px 8px 6px 30px;
    font-size: 10px;
  }

  .gsearch i {
    left: 10px;
    font-size: 12px;
  }

  .content {
    padding: 8px 8px 24px 8px;
  }

  .page-title h1 {
    font-size: 16px;
  }

  .page-title p {
    font-size: 11px;
  }

  .panel.pad {
    padding: 10px;
  }

  .authBox {
    padding: 20px 16px;
    margin: 16px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .stat b {
    font-size: 18px;
  }

  .stat small {
    font-size: 10px;
  }
}

/* Sidebar toggle button (hidden by default, shown on tablet/mobile) */
.sidebarToggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebarToggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

/* Sidebar overlay for mobile */
.sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4999;
  display: none;
  backdrop-filter: blur(4px);
}

.sidebarOverlay.show {
  display: block;
}

/* Alert bar slide-down - positioned top-right, non-obtrusive */
.alertBar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 8500;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
  width: calc(100% - 24px);
}

.alertBar.show {
  transform: translateX(0);
}

.alertBar-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid rgba(var(--warn-rgb), 0.4);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--warn-rgb), 0.1);
  backdrop-filter: blur(12px);
}

.alertBar-content.anticheat {
  border-color: rgba(var(--bad-rgb), 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--bad-rgb), 0.1);
}

.alertBar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.alertBar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.alertBar-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(var(--warn-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warn);
  flex-shrink: 0;
  font-size: 14px;
}

.alertBar-content.anticheat .alertBar-icon {
  background: rgba(var(--bad-rgb), 0.15);
  color: var(--bad);
}

.alertBar-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.alertBar-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alertBar-player {
  font-size: 11px;
  color: var(--warn);
  font-weight: 500;
}

.alertBar-content.anticheat .alertBar-player {
  color: var(--bad);
}

.alertBar-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alertBar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.alertBar-actions .mini {
  padding: 6px 10px;
  font-size: 11px;
}

/* Player Settings Card in Configuration */
.settings-category {
  margin-bottom: 24px;
}

.settings-category-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.settings-row:hover {
  border-color: var(--border-light);
}

.settings-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-row-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.settings-row-icon.blue { background: rgba(var(--primary-rgb), 0.15); color: var(--primary-light); }
.settings-row-icon.yellow { background: rgba(var(--warn-rgb), 0.15); color: var(--warn); }
.settings-row-icon.red { background: rgba(var(--bad-rgb), 0.15); color: var(--bad); }
.settings-row-icon.green { background: rgba(var(--ok-rgb), 0.15); color: var(--ok); }
.settings-row-icon.purple { background: rgba(var(--accent-rgb), 0.15); color: var(--accent-light); }

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-row-title {
  font-size: 13px;
  font-weight: 600;
}

.settings-row-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Radio group for settings */
.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.radio-btn:hover {
  border-color: var(--border-light);
}

.radio-btn.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary-light);
}

.radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.radio-btn.active .radio-dot {
  border-color: var(--primary-light);
}

.radio-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: all var(--transition);
}

.radio-btn.active .radio-dot::after {
  background: var(--primary-light);
}

/* ============================================
   Replay Viewer Styles
   ============================================ */

.replay-viewer-card {
  display: flex;
  flex-direction: column;
}

.replay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.replay-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.replay-header-left h3 {
  margin: 0;
}

.replay-header-right {
  display: flex;
  gap: 8px;
}

.replay-canvas-container {
  position: relative;
  background: var(--bg0);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
}

#replayCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.replay-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.replay-overlay.hidden {
  display: none;
}

.replay-overlay-content {
  text-align: center;
  color: var(--text-secondary);
}

.replay-overlay-content i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.replay-overlay-content p {
  margin: 0;
  font-size: 14px;
}

.replay-controls {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.replay-timeline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.timeline-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary-light);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--primary-light-rgb), 0.4);
  transition: transform 0.15s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.timeline-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary-light);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(var(--primary-light-rgb), 0.4);
}

.replay-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 90px;
  text-align: right;
}

.replay-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.replay-buttons .btn.primary {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.replay-buttons .btn.primary i {
  font-size: 18px;
}

.replay-info-panel {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.replay-info-header {
  margin-bottom: 12px;
}

.replay-info-header h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.replay-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.replay-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.replay-info-item .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.replay-info-item .value {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text);
}

/* Replay List Items */
.replay-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.replay-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.replay-item.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.5);
}

.replay-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.replay-item-icon.anticheat {
  background: linear-gradient(135deg, var(--bad), #dc2626);
  color: white;
}

.replay-item-icon.watchlist {
  background: linear-gradient(135deg, var(--warn), #d97706);
  color: white;
}

.replay-item-icon.manual {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.replay-item-icon.automod {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: white;
}

.replay-item-meta {
  flex: 1;
  min-width: 0;
}

.replay-item-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replay-item-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.replay-item-duration {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* Event Timeline */
.replay-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  background: var(--surface2);
  margin-bottom: 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  transition: all var(--transition);
}

.replay-event:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-left-color: var(--primary-light);
}

.replay-event-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 50px;
}

.replay-event-content {
  flex: 1;
}

.replay-event-type {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.replay-event-type.chat { color: var(--primary-light); }
.replay-event-type.command { color: var(--accent-light); }
.replay-event-type.damage { color: var(--bad); }
.replay-event-type.block { color: var(--ok); }

.replay-event-data {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
  .replay-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .replay-info-grid {
    grid-template-columns: 1fr;
  }

  .replay-buttons {
    flex-wrap: wrap;
  }
}

/* ============================================
   Pagination Controls
   ============================================ */

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.pag-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.pag-info b {
  color: var(--text);
}

.pag-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pag-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all var(--transition);
}

.pag-dropdown:hover {
  border-color: var(--border-light);
  background: var(--surface3);
}

.pag-dropdown i {
  font-size: 10px;
  color: var(--muted);
  transition: transform var(--transition);
}

.pag-dropdown.open i {
  transform: rotate(180deg);
}

.pag-dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  min-width: 60px;
}

.pag-dropdown.open .pag-dropdown-menu {
  display: block;
}

.pag-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.pag-dropdown-item:hover {
  background: var(--surface3);
}

.pag-dropdown-item.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.pag-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.pag-btn:hover:not(:disabled) {
  background: var(--surface3);
  border-color: var(--border-light);
}

.pag-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pag-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.pag-num:hover {
  background: var(--surface2);
  color: var(--text);
}

.pag-num.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pag-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 600px) {
  .pagination-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pag-info {
    text-align: center;
  }

  .pag-size {
    justify-content: center;
  }

  .pag-nav {
    justify-content: center;
  }
}

/* ============================================
   Global Search Dropdown
   ============================================ */

/* Note: .gsearch-container flex properties defined in topbar section */

.gsearch-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: linear-gradient(180deg, #101828 0%, #0a1018 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 9999;
  max-height: 450px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gsearch-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.gsearch-footer {
  padding: 8px 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
}

.gsearch-footer kbd {
  background: var(--bg1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border);
}

.gsearch-category {
  margin-bottom: 12px;
}

.gsearch-category:last-child {
  margin-bottom: 0;
}

.gsearch-category-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  margin-bottom: 4px;
}

.gsearch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.gsearch-item:hover,
.gsearch-item.selected {
  background: rgba(var(--primary-rgb), 0.12);
}

.gsearch-item.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.gsearch-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.gsearch-item-icon.player {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.gsearch-item-icon.case {
  background: linear-gradient(135deg, var(--warn), #d97706);
  color: white;
}

.gsearch-item-icon.template {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: white;
}

.gsearch-item-icon.page {
  background: linear-gradient(135deg, var(--ok), #059669);
  color: white;
}

.gsearch-item-icon.setting {
  background: linear-gradient(135deg, #6b7fa8, #4a5c7a);
  color: white;
}

.gsearch-item-content {
  flex: 1;
  min-width: 0;
}

.gsearch-item-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gsearch-item-title mark {
  background: rgba(var(--warn-rgb), 0.3);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.gsearch-item-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.gsearch-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.gsearch-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.gsearch-empty p {
  margin: 0;
  font-size: 14px;
}

.gsearch-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 10px;
  color: var(--text-secondary);
}

/* ===== ANTICHEAT CHECKS UI ===== */
.ac-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.ac-check-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: all var(--transition-fast);
}

.ac-check-item:hover {
  border-color: var(--border-light);
  background: var(--surface);
}

.ac-check-item.disabled {
  opacity: 0.5;
}

.ac-check-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ac-check-name {
  flex: 1;
  min-width: 0;
}

.ac-check-name b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.ac-check-desc {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-check-level select.input.small {
  padding: 4px 8px;
  font-size: 12px;
  min-width: 100px;
}

.ac-check-settings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ac-check-settings.hidden {
  display: none;
}

.ac-threshold {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ac-threshold .label {
  font-size: 12px;
  color: var(--text-secondary);
}

.ac-threshold .input.tiny {
  width: 60px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

/* Small input variant */
.input.small {
  padding: 6px 10px;
  font-size: 12px;
  height: auto;
}

.input.tiny {
  padding: 4px 6px;
  font-size: 12px;
  height: auto;
  width: 60px;
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading-state .spinner {
  width: 32px;
  height: 32px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-state.small {
  padding: 20px;
}

.empty-state i {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state.small i {
  font-size: 32px;
  margin-bottom: 12px;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Mini button variant for presets */
.btn.mini {
  padding: 6px 12px;
  font-size: 12px;
  gap: 6px;
}

/* ============================================
   Staff Notification Settings (In-Game Sync)
   ============================================ */

.setting-group {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.setting-group h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-group h4 i {
  color: var(--primary-light);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row span {
  color: var(--text-secondary);
  font-size: 13px;
}

.setting-row .input.small {
  width: auto;
  min-width: 120px;
  padding: 6px 10px;
  font-size: 12px;
}

.setting-row .input.tiny {
  width: 60px;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
}

.toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.toggles-row .check-toggle {
  flex: 0 0 auto;
}

.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  color: var(--text-secondary);
}

.check-toggle:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.check-toggle.on {
  background: rgba(var(--ok-rgb), 0.15);
  border-color: var(--ok);
  color: var(--ok);
}

.check-toggle .check-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.15s ease;
}

.check-toggle.on .check-icon {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* ===== Truncated Reason Cell ===== */
.reason-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.reason-cell:hover {
  color: var(--primary-light);
}

/* ===== Viewport Scaling ===== */
/* Scale down UI proportionally on smaller screens while maintaining layout */
@media (max-width: 1600px) and (min-width: 1201px) {
  html {
    font-size: 14px;
  }
}

@media (max-width: 1200px) and (min-width: 1001px) {
  html {
    font-size: 13px;
  }
}

@media (max-width: 1000px) and (min-width: 801px) {
  html {
    font-size: 12px;
  }

  .card {
    padding: 14px;
  }
}

/* Mobile-specific improvements */
@media (max-width: 800px) {
  html {
    font-size: 14px;
  }

  .main {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .modal {
    width: calc(100% - 24px);
    max-width: 100%;
    max-height: 90vh;
  }

  .modal-body {
    padding: 16px;
  }

  table {
    font-size: 12px;
  }

  .reason-cell {
    max-width: 120px;
  }

  .badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .btn.mini {
    padding: 4px 8px;
    font-size: 10px;
  }
}

@media (max-width: 600px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .punish-types {
    flex-direction: column;
    gap: 8px;
  }

  .punish-types .action-btn {
    width: 100%;
  }

  .quick-actions .btn {
    flex: 1 1 45%;
    min-width: 120px;
  }

  .reason-cell {
    max-width: 80px;
  }
}

/* ===== AUTO-SCALING IMPROVEMENTS ===== */

/* Fluid typography using clamp() for better scaling */
html {
  font-size: clamp(13px, 2.5vw, 16px);
}

/* Ensure tables are horizontally scrollable on small screens */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 600px;
}

/* Better scaling for data tables */
@media (max-width: 768px) {
  table {
    font-size: 0.85rem;
  }

  table th,
  table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  /* Stack table cells on very small screens */
  .table-stack td {
    display: block;
    text-align: left;
    border: none;
    position: relative;
    padding-left: 50%;
  }

  .table-stack td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    font-weight: 600;
    color: var(--text-secondary);
  }

  /* Punishment table improvements */
  .pun-table th:nth-child(4),
  .pun-table td:nth-child(4) {
    display: none; /* Hide less important columns */
  }
}

/* Touch-friendly targets for mobile */
@media (max-width: 600px) {
  .btn,
  .filter-btn,
  .nav-item,
  .action-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve tap targets in player list */
  .player-row {
    padding: 12px 10px;
  }

  /* Better card spacing */
  .card {
    padding: 14px;
  }

  /* Ensure inputs are not too small */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    min-height: 40px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* Very small screens - aggressive scaling */
@media (max-width: 360px) {
  html {
    font-size: 12px;
  }

  .topbar {
    height: 48px;
    padding: 0 6px;
  }

  .sidebar {
    width: 240px;
    left: -250px;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 12px;
  }

  .logo-text {
    font-size: 14px;
  }

  .gsearch {
    max-width: 120px;
  }

  .content {
    padding: 6px 6px 20px 6px;
  }

  .page-title h1 {
    font-size: 14px;
  }

  .stat b {
    font-size: 16px;
  }

  .modal,
  .punish-modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    max-height: 100vh;
  }

  .drawer {
    width: 100vw;
  }

  /* Hide non-essential elements */
  .badge:not(.badge-important),
  .stat-trend {
    display: none;
  }
}

/* Landscape mobile - adjust layout */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    padding-top: 10px;
  }

  .nav-section {
    padding: 6px 0;
  }

  .nav-item {
    padding: 8px 14px;
  }

  .topbar {
    height: 48px;
  }

  .modal {
    max-height: 95vh;
  }

  .modal-body {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* Ensure proper scaling on high-DPI mobile devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo img,
  .avatar img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print-friendly (hide unnecessary elements) */
@media print {
  .sidebar,
  .topbar,
  .sidebarToggle,
  .sidebarOverlay,
  #bgCanvas,
  .bg-aurora,
  .bg-lines,
  .bg-noise,
  .alertBar,
  #toastContainer {
    display: none !important;
  }

  .main {
    width: 100%;
  }

  body {
    background: white;
    color: black;
  }

  .card,
  .panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ===== INFO BOX ===== */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-box i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== DEBUG LOG CONTAINER ===== */
.debug-log-container {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 96%;
  pointer-events: none;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  max-height: 280px;
}

.debug-log-container:empty {
  display: none;
}

.debug-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 16px;
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  pointer-events: auto;
  border: none;
  background: transparent;
  animation: debugSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: bottom;
}

.debug-entry.fade-out {
  animation: debugSlideOut 0.2s ease-out forwards;
}

/* Slide in from bottom - pushes others up */
@keyframes debugSlideIn {
  0% {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  100% {
    opacity: 1;
    max-height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* Slide out - collapses and fades */
@keyframes debugSlideOut {
  0% {
    opacity: 1;
    max-height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  100% {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Debug entry elements */
.debug-entry .debug-icon {
  display: none;
}

.debug-entry .debug-time {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  flex-shrink: 0;
  font-weight: 500;
  min-width: 70px;
}

.debug-entry .debug-category,
.debug-entry .debug-cat {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.debug-entry .debug-message,
.debug-entry .debug-msg {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

/* Type-specific message colors */
.debug-entry.debug-info .debug-msg,
.debug-entry.debug-info .debug-message {
  color: rgba(180, 200, 255, 0.9);
}

.debug-entry.debug-success .debug-msg,
.debug-entry.debug-success .debug-message {
  color: #4ade80;
}

.debug-entry.debug-success .debug-cat {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.debug-entry.debug-warn .debug-msg,
.debug-entry.debug-warn .debug-message {
  color: #fbbf24;
}

.debug-entry.debug-warn .debug-cat {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.debug-entry.debug-error .debug-msg,
.debug-entry.debug-error .debug-message {
  color: #f87171;
}

.debug-entry.debug-error .debug-cat {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Hide debug container on print */
@media print {
  .debug-log-container {
    display: none !important;
  }
}

/* Mobile adjustments for debug log */
@media (max-width: 768px) {
  .debug-log-container {
    bottom: 8px;
    width: 98%;
    max-height: 200px;
    border-radius: 8px;
  }

  .debug-entry {
    padding: 6px 12px;
    font-size: 11px;
    gap: 8px;
  }

  .debug-entry .debug-time {
    min-width: 60px;
    font-size: 10px;
  }

  .debug-entry .debug-cat {
    font-size: 9px;
    padding: 2px 6px;
  }
}

/* ===== THEME CUSTOMIZATION ===== */

/* Theme color presets */
.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-preset {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.theme-preset:hover {
  border-color: var(--border-light);
  transform: scale(1.05);
}

.theme-preset.active {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.preset-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: transform var(--transition-fast);
}

.theme-preset.custom {
  position: relative;
  overflow: hidden;
}

.theme-preset.custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.theme-preset .custom-swatch {
  background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Background pattern buttons */
.pattern-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pattern-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
}

.pattern-btn:hover {
  border-color: var(--border-light);
  background: var(--surface);
}

.pattern-btn.active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.pattern-btn span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pattern-btn.active span {
  color: var(--primary-light);
}

.pattern-preview {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg0);
}

/* Pattern previews */
.pattern-preview.aurora {
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(var(--primary-rgb), 0.4), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(var(--accent-rgb), 0.3), transparent 50%),
    linear-gradient(180deg, #030508, #0a0a0e);
}

.pattern-preview.waves {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 4px,
      rgba(var(--primary-rgb), 0.15) 4px,
      rgba(var(--primary-rgb), 0.15) 8px
    ),
    linear-gradient(180deg, #030508, #0e0e12);
}

.pattern-preview.stars {
  background:
    radial-gradient(1px 1px at 10% 20%, white, transparent),
    radial-gradient(1px 1px at 30% 60%, white, transparent),
    radial-gradient(1px 1px at 50% 30%, white, transparent),
    radial-gradient(1px 1px at 70% 70%, white, transparent),
    radial-gradient(1px 1px at 90% 40%, white, transparent),
    radial-gradient(2px 2px at 25% 80%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 75% 15%, rgba(255,255,255,0.8), transparent),
    linear-gradient(180deg, #030508, #0e0e12);
}

.pattern-preview.grid {
  background:
    linear-gradient(rgba(var(--primary-rgb), 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px),
    linear-gradient(180deg, #030508, #0e0e12);
  background-size: 8px 8px, 8px 8px, 100% 100%;
}

.pattern-preview.circuits {
  background:
    linear-gradient(90deg, transparent 49%, rgba(var(--primary-rgb), 0.2) 49%, rgba(var(--primary-rgb), 0.2) 51%, transparent 51%),
    linear-gradient(transparent 49%, rgba(var(--primary-rgb), 0.2) 49%, rgba(var(--primary-rgb), 0.2) 51%, transparent 51%),
    radial-gradient(circle at 25% 25%, rgba(var(--primary-rgb), 0.3) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(var(--primary-rgb), 0.3) 2px, transparent 2px),
    linear-gradient(180deg, #030508, #0e0e12);
  background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 100% 100%;
}

.pattern-preview.hexagons {
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.2) 3px, transparent 3px),
    radial-gradient(circle at 0% 100%, rgba(var(--primary-rgb), 0.2) 3px, transparent 3px),
    radial-gradient(circle at 100% 100%, rgba(var(--primary-rgb), 0.2) 3px, transparent 3px),
    linear-gradient(180deg, #030508, #0e0e12);
  background-size: 16px 16px, 16px 16px, 16px 16px, 100% 100%;
}

.pattern-preview.particles {
  background:
    radial-gradient(circle at 15% 25%, rgba(var(--primary-rgb), 0.6) 1px, transparent 1px),
    radial-gradient(circle at 45% 65%, rgba(var(--accent-rgb), 0.6) 1px, transparent 1px),
    radial-gradient(circle at 75% 35%, rgba(var(--ok-rgb), 0.6) 1px, transparent 1px),
    radial-gradient(circle at 85% 85%, rgba(var(--primary-rgb), 0.4) 2px, transparent 2px),
    radial-gradient(circle at 25% 75%, rgba(var(--accent-rgb), 0.4) 2px, transparent 2px),
    linear-gradient(180deg, #030508, #0e0e12);
}

.pattern-preview.nebula {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(var(--accent-rgb), 0.4), transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(236, 72, 153, 0.3), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(var(--primary-rgb), 0.2), transparent 60%),
    linear-gradient(180deg, #030508, #0e0e12);
}

.pattern-preview.matrix {
  background:
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 2px,
      rgba(var(--ok-rgb), 0.1) 2px,
      rgba(var(--ok-rgb), 0.1) 4px
    ),
    linear-gradient(180deg, rgba(var(--ok-rgb), 0.2) 0%, transparent 100%),
    linear-gradient(180deg, #030508, #0e0e12);
}

.pattern-preview.rain {
  background:
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 8px,
      rgba(var(--primary-rgb), 0.15) 8px,
      rgba(var(--primary-rgb), 0.15) 10px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 4px,
      transparent 12px,
      rgba(var(--primary-rgb), 0.1) 12px,
      rgba(var(--primary-rgb), 0.1) 14px
    ),
    linear-gradient(180deg, #030508, #0e0e12);
  background-size: 3px 100%, 7px 100%, 100% 100%;
}

.pattern-preview.geometric {
  background:
    linear-gradient(45deg, rgba(var(--primary-rgb), 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(var(--primary-rgb), 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(var(--primary-rgb), 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(var(--primary-rgb), 0.1) 75%),
    linear-gradient(180deg, #030508, #0e0e12);
  background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 100% 100%;
}

.pattern-preview.gradient {
  background: linear-gradient(135deg, #030508, rgba(var(--primary-rgb), 0.15), #030508);
}

.pattern-preview.minimal {
  background: linear-gradient(180deg, #030508, #0a0a0e);
}

/* ===== SIDEBAR VERSION ===== */
.sb-version {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ===== UPDATE BANNER ===== */
.updateBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.updateBanner.show {
  transform: translateY(0);
}

.updateBanner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(var(--ok-rgb), 0.15), rgba(var(--primary-rgb), 0.15));
  border-bottom: 1px solid rgba(var(--ok-rgb), 0.3);
  backdrop-filter: blur(12px);
}

.updateBanner-content > i {
  font-size: 20px;
  color: var(--ok);
}

.updateBanner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.updateBanner-text .update-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.updateBanner-text .update-version {
  font-size: 11px;
  color: var(--ok);
  font-weight: 500;
}

.updateBanner-text .update-notes {
  font-size: 11px;
  color: var(--text-secondary);
}

.updateBanner-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   Changelog Modal Styles
   ============================================ */

.changelog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: changelogFadeIn 0.3s ease;
}

@keyframes changelogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.changelog-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: changelogSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes changelogSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.changelog-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.changelog-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.changelog-header-icon .changelog-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.changelog-header-text {
  flex: 1;
}

.changelog-header-text h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.changelog-header-text .changelog-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.changelog-header-text .changelog-version {
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.changelog-header-text .changelog-date {
  color: var(--muted);
}

.changelog-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.changelog-body::-webkit-scrollbar {
  width: 8px;
}

.changelog-body::-webkit-scrollbar-track {
  background: transparent;
}

.changelog-body::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.changelog-body::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.changelog-section {
  margin-bottom: 24px;
}

.changelog-section:last-child {
  margin-bottom: 0;
}

.changelog-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.changelog-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.changelog-section-icon.new {
  background: rgba(16, 185, 129, 0.15);
  color: var(--ok);
}

.changelog-section-icon.improved {
  background: rgba(45, 122, 237, 0.15);
  color: var(--primary);
}

.changelog-section-icon.fixed {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

.changelog-section-icon.technical {
  background: rgba(124, 92, 255, 0.15);
  color: var(--accent);
}

.changelog-section-icon.permissions {
  background: rgba(239, 68, 68, 0.15);
  color: var(--bad);
}

.changelog-section-icon.config {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.changelog-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.changelog-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog-items li {
  position: relative;
  padding: 8px 0 8px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

.changelog-items li:last-child {
  border-bottom: none;
}

.changelog-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.changelog-items li strong {
  color: var(--text);
  font-weight: 600;
}

.changelog-items li code {
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--primary-light);
  font-family: 'JetBrains Mono', monospace;
}

.changelog-footer {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.changelog-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.changelog-pagination-dots {
  display: flex;
  gap: 6px;
}

.changelog-pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.changelog-pagination-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.changelog-pagination-dot:hover:not(.active) {
  background: var(--muted);
}

.changelog-actions {
  display: flex;
  gap: 12px;
}

.changelog-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.changelog-btn-secondary {
  background: var(--bg2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.changelog-btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.changelog-btn-primary {
  background: var(--primary);
  color: white;
}

.changelog-btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Multiple changelogs navigation */
.changelog-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.changelog-nav-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.changelog-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
