/* ============================================
   Discord Auto Advertiser — Premium Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --bg-deep: #0a0a0a;
  --bg-surface: rgba(255, 255, 255, 0.025);
  --bg-surface-hover: rgba(255, 255, 255, 0.045);
  --glass: rgba(20, 20, 20, 0.65);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --accent-rgb: 255, 255, 255;
  --accent-hover: #cccccc;
  --accent-glow: rgba(255, 255, 255, 0.15);
  --green: #57F287;
  --green-rgb: 87, 242, 135;
  --red: #ED4245;
  --red-rgb: 237, 66, 69;
  --yellow: #FEE75C;
  --yellow-rgb: 254, 231, 92;
  --orange: #F47B67;
  --orange-rgb: 244, 123, 103;
  --pink: #EB459E;
  --pink-rgb: 235, 69, 158;
  --purple: #9B59B6;
  --purple-rgb: 155, 89, 182;
  --blue: #3498DB;
  --blue-rgb: 52, 152, 219;
  --text-primary: #F2F3F5;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.28);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus: rgba(255, 255, 255, 0.15);
  --sidebar-w: 260px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg-deep);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: rgba(88, 101, 242, 0.35); }

/* ── Animated Background ── */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, #050505 0%, #111111 30%, #1a1a1a 60%, #050505 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  will-change: transform;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
  top: -10%; left: -10%;
  animation: orbFloat1 25s ease-in-out infinite;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(200, 200, 200, 0.05), transparent 70%);
  bottom: -15%; right: -10%;
  animation: orbFloat2 30s ease-in-out infinite;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(150, 150, 150, 0.05), transparent 70%);
  top: 40%; left: 50%;
  animation: orbFloat3 20s ease-in-out infinite;
}

.mesh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(120px, 80px) scale(1.1); }
  66% { transform: translate(-60px, 150px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-100px, -80px) scale(1.15); }
  66% { transform: translate(80px, -120px) scale(0.9); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-150px, 60px) scale(1.2); }
}

/* ================================================================
   AUTH SCREEN
   ================================================================ */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-lg), 0 0 100px rgba(var(--accent-rgb), 0.06);
  animation: cardAppear 0.7s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--purple), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s ease infinite;
}

.auth-glow {
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12), transparent 70%);
  pointer-events: none;
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.35);
  animation: logoFloat 6s ease-in-out infinite;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 20%, rgba(var(--accent-rgb), 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.auth-tab:hover { color: var(--text-primary); }

.auth-tab.active {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  opacity: 0.7;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.25s;
  flex-shrink: 0;
  z-index: 10;
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent);
}

.input-wrapper input[type="text"],
.input-wrapper input[type="password"],
.input-wrapper input[type="number"],
.input-wrapper input[type="url"],
.input-wrapper textarea {
  padding-left: 44px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.3s var(--ease-out);
}

/* Chrome Autofill fix for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:hover, textarea:hover, select:hover {
  border-color: rgba(255,255,255,0.15);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus), 0 0 24px rgba(var(--accent-rgb), 0.08);
  background: rgba(255,255,255,0.06);
}

input.validated {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.2) !important;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* Image Upload Area */
.image-upload-area {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 70px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s;
}

.image-upload-area:hover {
  border-color: var(--glass-border-hover);
}

.image-preview-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-thumb {
  position: relative;
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: all 0.2s var(--ease-out);
  cursor: default;
}

.image-thumb:hover {
  border-color: var(--glass-border-hover);
  transform: scale(1.05);
}

.image-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb .image-delete {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.image-thumb:hover .image-delete {
  opacity: 1;
}

.image-thumb .image-delete svg {
  color: var(--red);
  width: 18px; height: 18px;
}

.image-add-btn {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}

.image-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
  transform: scale(1.05);
}

select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

select option { background: #0a0a1a; color: var(--text-primary); }

.input-with-action {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-with-action .input-wrapper { flex: 1; }
.input-with-action .btn { flex-shrink: 0; }

.input-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.token-status {
  font-size: 0.8rem;
  margin-top: 4px;
}

.token-valid { color: var(--green); }

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  outline: none;
  border: none;
  padding: 0;
  margin-top: 8px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.5);
  transition: transform 0.15s var(--ease-spring);
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.slider-current {
  color: var(--accent);
  font-weight: 600;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-info { flex: 1; }

.toggle-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  text-transform: none;
  letter-spacing: 0;
}

.toggle-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.toggle-switch {
  position: relative;
  width: 48px; height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-switch .toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.toggle-switch .toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.4);
  filter: brightness(1.1);
}

.btn-accent {
  background: var(--accent);
  color: #000;
  box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.2);
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #2ecc71);
  color: #050510;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(var(--green-rgb), 0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(var(--green-rgb), 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #c0392b);
  color: #fff;
  box-shadow: 0 4px 20px rgba(var(--red-rgb), 0.25);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(var(--red-rgb), 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.btn-xs { padding: 6px 12px; font-size: 0.72rem; border-radius: var(--radius-sm); }
.btn-sm { padding: 9px 18px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ================================================================
   DASHBOARD LAYOUT
   ================================================================ */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(8, 8, 24, 0.9);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.4s var(--ease-out);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--glass-border);
}

.logo-small {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
  flex-shrink: 0;
}

.sidebar-title h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-badge {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info { min-width: 0; }

.user-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.status-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s;
}

.status-pip.active {
  background: var(--green);
  box-shadow: 0 0 8px rgba(var(--green-rgb), 0.6);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}

/* Mobile */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  width: 44px; height: 44px;
  background: rgba(8,8,24,0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
}

.sidebar-overlay.active { display: block; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  min-height: 100vh;
}

/* ================================================================
   CONTENT SECTIONS
   ================================================================ */
.content-section {
  display: none;
  animation: fadeSlideIn 0.4s var(--ease-out);
}

.content-section.active { display: block; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ================================================================
   STATS GRID
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  border-radius: 0 0 4px 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover { border-color: var(--glass-border-hover); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }

.stat-accent::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.stat-green::before { background: linear-gradient(90deg, transparent, var(--green), transparent); }
.stat-purple::before { background: linear-gradient(90deg, transparent, var(--purple), transparent); }
.stat-orange::before { background: linear-gradient(90deg, transparent, var(--orange), transparent); }

.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrap svg { width: 20px; height: 20px; }

.stat-accent .stat-icon-wrap { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.stat-green .stat-icon-wrap { background: rgba(var(--green-rgb), 0.12); color: var(--green); }
.stat-purple .stat-icon-wrap { background: rgba(var(--purple-rgb), 0.12); color: var(--purple); }
.stat-orange .stat-icon-wrap { background: rgba(var(--orange-rgb), 0.12); color: var(--orange); }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================================================
   QUICK STATUS CARD
   ================================================================ */
.quick-status-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.quick-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.engine-indicator {
  width: 44px; height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.engine-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.08);
  transition: all 0.4s;
}

.engine-core {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.4s;
}

.engine-indicator.active .engine-ring {
  border-color: rgba(var(--green-rgb), 0.3);
  animation: pulseRing 2s ease-in-out infinite;
}

.engine-indicator.active .engine-core {
  background: var(--green);
  box-shadow: 0 0 16px rgba(var(--green-rgb), 0.5);
}

.quick-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.quick-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ================================================================
   RECENT ACTIVITY (mini-log)
   ================================================================ */
.recent-activity-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-header-row h3 {
  font-size: 0.88rem;
  font-weight: 700;
}

.mini-log {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 0;
}

.mini-log .log-entry {
  padding: 5px 20px;
}

.log-empty-mini {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ================================================================
   CONFIG GRID
   ================================================================ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.config-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.config-card:hover {
  border-color: var(--glass-border-hover);
}

.config-card.full-width { grid-column: 1 / -1; }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg { width: 16px; height: 16px; }

.card-icon.accent { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.card-icon.blue { background: rgba(var(--blue-rgb), 0.12); color: var(--blue); }
.card-icon.green { background: rgba(var(--green-rgb), 0.12); color: var(--green); }
.card-icon.yellow { background: rgba(var(--yellow-rgb), 0.12); color: var(--yellow); }
.card-icon.pink { background: rgba(var(--pink-rgb), 0.12); color: var(--pink); }
.card-icon.purple { background: rgba(var(--purple-rgb), 0.12); color: var(--purple); }
.card-icon.orange { background: rgba(var(--orange-rgb), 0.12); color: var(--orange); }

.card-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.save-bar {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

/* ── Channel Tags ── */
.channel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
  min-height: 36px;
}

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-hover);
  animation: tagPop 0.25s var(--ease-spring);
}

.remove-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.remove-tag:hover {
  background: rgba(var(--red-rgb), 0.3);
  color: var(--red);
}

/* ================================================================
   CONTROL CENTER
   ================================================================ */
.control-panel {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.control-panel::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Power Button */
.power-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.power-btn {
  position: relative;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--ease-out);
  margin-bottom: 20px;
}

.power-btn:hover { transform: scale(1.05); }
.power-btn:active { transform: scale(0.98); }

.power-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  transition: all 0.4s;
}

.power-ring-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
}

.power-icon {
  width: 36px; height: 36px;
  color: var(--text-secondary);
  transition: color 0.4s;
  position: relative;
  z-index: 1;
}

.power-btn.active .power-ring {
  border-color: rgba(var(--green-rgb), 0.4);
  box-shadow: 0 0 30px rgba(var(--green-rgb), 0.15);
}

.power-btn.active .power-ring-glow {
  opacity: 1;
  box-shadow: 0 0 50px rgba(var(--green-rgb), 0.2);
}

.power-btn.active .power-icon {
  color: var(--green);
  filter: drop-shadow(0 0 8px rgba(var(--green-rgb), 0.5));
}

.power-btn.active {
  background: rgba(var(--green-rgb), 0.05);
}

.power-label {
  font-size: 1.2rem;
  font-weight: 700;
}

.power-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.control-uptime {
  margin-bottom: 36px;
}

.uptime-display {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.uptime-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 4px;
}

.control-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}

.control-stat {
  text-align: center;
  padding: 0 28px;
}

.control-stat-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.control-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.control-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.06);
}

/* ================================================================
   ACTIVITY LOG
   ================================================================ */
.log-card {
  background: rgba(5, 5, 15, 0.5);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.log-container {
  max-height: 500px;
  overflow-y: auto;
  padding: 12px 0;
  scroll-behavior: smooth;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding: 6px 24px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  animation: logSlide 0.3s var(--ease-out);
  transition: background 0.15s;
}

.log-entry:hover { background: rgba(255,255,255,0.02); }

.log-entry.level-success .log-message { color: var(--green); }
.log-entry.level-error .log-message { color: var(--red); }
.log-entry.level-warning .log-message { color: var(--yellow); }

.log-time {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.log-message {
  color: var(--text-secondary);
  word-break: break-word;
}

.log-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.log-empty p { font-size: 0.85rem; }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  padding: 14px 18px;
  background: rgba(12, 12, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  position: relative;
  overflow: hidden;
  min-width: 280px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(120%);
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.fade-out {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 100%;
  animation: toastProgress 4s linear forwards;
}

.toast-success::after { background: var(--green); }
.toast-error::after { background: var(--red); }
.toast-info::after { background: var(--accent); }

.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon { color: var(--red); }
.toast-info .toast-icon { color: var(--accent); }

/* ================================================================
   KEYFRAMES
   ================================================================ */
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--green-rgb), 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(var(--green-rgb), 0); }
}

@keyframes logSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tagPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.45); }
* { scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), 0.25) transparent; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .config-grid { grid-template-columns: 1fr; }
  .main-content { padding: 24px 28px; }
  .control-stats { gap: 0; }
  .control-stat { padding: 0 20px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open { transform: translateX(0); }

  .mobile-menu-btn { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: 72px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 16px 14px; gap: 10px; }
  .stat-icon-wrap { width: 36px; height: 36px; }
  .stat-icon-wrap svg { width: 16px; height: 16px; }
  .stat-value { font-size: 1.15rem; }

  .config-grid { grid-template-columns: 1fr; gap: 14px; }
  .config-card { padding: 18px; }

  .control-panel { padding: 32px 20px; }
  .uptime-display { font-size: 2rem; }
  .power-btn { width: 100px; height: 100px; }
  .power-icon { width: 28px; height: 28px; }

  .control-stats { flex-wrap: wrap; gap: 16px; }
  .control-divider { display: none; }
  .control-stat { padding: 8px 16px; }

  .quick-status-card { flex-direction: column; align-items: stretch; }
  .quick-left { justify-content: center; }

  .toast-container { left: 16px; right: 16px; max-width: none; }
  .toast { min-width: 0; width: 100%; }

  .section-title { font-size: 1.3rem; }
  .section-header { flex-direction: column; gap: 8px; }

  .auth-card { padding: 36px 24px 28px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .control-panel { padding: 24px 16px; }
  .uptime-display { font-size: 1.6rem; }
}
