:root {
  --bg-0: #0a0a0c;
  --bg-1: #111114;
  --bg-2: #18181c;
  --bg-3: #1f1f25;
  --bg-4: #282830;
  --bg-5: #32323c;
  --border: #2a2a32;
  --border-h: #3a3a45;
  --border-f: #58586a;
  --text-1: #f0f0f5;
  --text-2: #a0a0b0;
  --text-3: #606070;
  --text-4: #404050;
  --accent: #f6821f;
  --accent-d: #e07010;
  --accent-g: rgba(246,130,31,.1);
  --blue: #3b82f6;
  --blue-d: #2563eb;
  --blue-g: rgba(59,130,246,.08);
  --green: #10b981;
  --green-d: #059669;
  --green-g: rgba(16,185,129,.08);
  --red: #ef4444;
  --red-d: #dc2626;
  --red-g: rgba(239,68,68,.08);
  --yellow: #f59e0b;
  --yellow-g: rgba(245,158,11,.08);
  --purple: #8b5cf6;
  --purple-g: rgba(139,92,246,.08);
  --cyan: #06b6d4;
  --cyan-g: rgba(6,182,212,.08);
  --orange: #f97316;
  --orange-g: rgba(249,115,22,.08);
  --r: 6px;
  --r2: 10px;
  --r3: 14px;
  --r4: 20px;
  --sh: 0 1px 3px rgba(0,0,0,.4);
  --sh2: 0 4px 16px rgba(0,0,0,.5);
  --sh3: 0 8px 32px rgba(0,0,0,.6);
  --tr: 180ms cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.5;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes toastIn { from { transform: translateY(20px) scale(.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 4px var(--accent); } 50% { box-shadow: 0 0 16px var(--accent), 0 0 32px rgba(246,130,31,.15); } }

.anim-fade { animation: fadeIn .35s ease both; }
.anim-d1 { animation-delay: .05s; } .anim-d2 { animation-delay: .1s; } .anim-d3 { animation-delay: .15s; }
.anim-d4 { animation-delay: .2s; } .anim-d5 { animation-delay: .25s; } .anim-d6 { animation-delay: .3s; }

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-0);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.05) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes gridMove {
  from { transform: translateY(0); }
  to { transform: translateY(60px); }
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 40px 32px;
  text-align: center;
  animation: fadeIn .4s ease;
  box-shadow: var(--sh3);
}
.login-logo-img {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 3px solid var(--border);
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), #ff9a44);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  box-shadow: 0 4px 24px rgba(246,130,31,.3);
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.login-card .subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 28px;
  line-height: 1.5;
}
.login-card .features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}
.login-card .feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.login-card .feature-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-g);
  color: var(--accent);
}
.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--r2);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #5865F2;
  color: #fff;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
}
.btn-discord:hover {
  background: #4752C4;
  box-shadow: 0 4px 20px rgba(88,101,242,.4);
  transform: translateY(-1px);
}
.btn-discord:active { transform: translateY(0) scale(.98); }
.btn-discord svg { flex-shrink: 0; }

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

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-head {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #ff9a44);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.sidebar-brand h1 { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sidebar-brand span { font-size: 10px; color: var(--text-3); font-weight: 500; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 10px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--tr);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  user-select: none;
}
.sidebar-item:hover { background: var(--bg-3); color: var(--text-2); }
.sidebar-item.active { background: var(--accent-g); color: var(--accent); }
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar-icon { width: 16px; height: 16px; opacity: .6; display: flex; align-items: center; justify-content: center; }
.sidebar-item.active .sidebar-icon { opacity: 1; }
.sidebar-foot { padding: 8px; border-top: 1px solid var(--border); }
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  transition: all .3s;
  flex-shrink: 0;
}
.status-dot.live { background: var(--green); animation: pulse 2s infinite; }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
}
.sidebar-backdrop.open { opacity: 1; visibility: visible; }

/* ===== MAIN ===== */
.main { flex: 1; margin-left: 240px; min-height: 100vh; }

/* ===== TOPBAR ===== */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,12,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r);
  transition: all var(--tr);
}
.mobile-menu:hover { background: var(--bg-3); color: var(--text-1); }
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--tr);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.user-pill:hover { border-color: var(--border-h); color: var(--text-1); }
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== CONTENT ===== */
.content { padding: 24px; max-width: 1400px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  transition: border-color var(--tr);
}
.card:hover { border-color: var(--border-h); }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-head h2 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-1);
}
.card-head h2 svg { color: var(--text-3); }
.card-body { padding: 18px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px;
  transition: all var(--tr);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--tr);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.stat-card:hover::after { opacity: 1; }
.stat-card:hover { border-color: var(--border-h); transform: translateY(-2px); box-shadow: var(--sh2); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.stat-icon.blue { background: var(--blue-g); color: var(--blue); }
.stat-icon.green { background: var(--green-g); color: var(--green); }
.stat-icon.yellow { background: var(--yellow-g); color: var(--yellow); }
.stat-icon.purple { background: var(--purple-g); color: var(--purple); }
.stat-icon.red { background: var(--red-g); color: var(--red); }
.stat-icon.orange { background: var(--orange-g); color: var(--orange); }
.stat-icon.cyan { background: var(--cyan-g); color: var(--cyan); }
.stat-icon.accent { background: var(--accent-g); color: var(--accent); }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
  animation: countUp .4s ease;
}
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-d); box-shadow: 0 0 20px rgba(246,130,31,.2); }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: var(--green-d); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--red-g); border-color: var(--red); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-1); border-color: var(--border-h); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; border-radius: 5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ===== INPUTS ===== */
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { font-size: 11px; font-weight: 500; color: var(--text-2); }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: all var(--tr);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-g);
}
input::placeholder { color: var(--text-4); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  transition: background var(--tr);
}
tr:hover td { background: rgba(255,255,255,.012); }
tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge-green { background: var(--green-g); color: var(--green); }
.badge-red { background: var(--red-g); color: var(--red); }
.badge-yellow { background: var(--yellow-g); color: var(--yellow); }
.badge-blue { background: var(--blue-g); color: var(--blue); }
.badge-purple { background: var(--purple-g); color: var(--purple); }
.badge-orange { background: var(--orange-g); color: var(--orange); }
.badge-cyan { background: var(--cyan-g); color: var(--cyan); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green .badge-dot { animation: pulse 2s infinite; }

/* ===== API KEY DISPLAY ===== */
.key-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  transition: all var(--tr);
}
.key-display:hover { border-color: var(--accent); color: var(--text-1); }
.key-display .copy-btn {
  cursor: pointer;
  color: var(--text-4);
  transition: color var(--tr);
  padding: 2px;
  border-radius: 4px;
  display: flex;
}
.key-display .copy-btn:hover { color: var(--accent); background: var(--accent-g); }

/* ===== CHARTS ===== */
.chart-container { position: relative; height: 160px; display: flex; align-items: flex-end; gap: 3px; padding-top: 24px; }
.chart-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .5s cubic-bezier(.4,0,.2,1);
  position: relative;
  cursor: default;
  animation: barGrow .6s ease both;
  transform-origin: bottom;
}
.chart-bar:hover { background: #ff9a44; filter: brightness(1.1); }
.chart-bar::after {
  content: attr(data-val);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity var(--tr);
  font-family: var(--mono);
}
.chart-bar:hover::after { opacity: 1; }
.chart-labels { display: flex; gap: 3px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 8px; color: var(--text-4); font-family: var(--mono); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-svg { width: 90px; height: 90px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ===== PROGRESS ===== */
.progress { height: 4px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 2px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ===== LOGS ===== */
.log-stream { max-height: 480px; overflow-y: auto; font-family: var(--mono); }
.log-entry {
  padding: 7px 14px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 75px 50px 80px 1fr;
  gap: 10px;
  transition: background var(--tr);
  align-items: baseline;
}
.log-entry:hover { background: rgba(255,255,255,.012); }
.log-time { color: var(--text-4); white-space: nowrap; }
.log-level { font-weight: 600; }
.log-level.INFO { color: var(--blue); }
.log-level.WARN { color: var(--yellow); }
.log-level.ERROR { color: var(--red); }
.log-level.DEBUG { color: var(--purple); }
.log-category { color: var(--green); white-space: nowrap; }
.log-message { color: var(--text-2); word-break: break-word; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-3);
  border-radius: var(--r);
  padding: 3px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  padding: 7px 14px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--tr);
  border: none;
  text-align: center;
}
.tab:hover { color: var(--text-2); }
.tab.active { background: var(--bg-2); color: var(--text-1); box-shadow: var(--sh); }

/* ===== PANELS / DETAIL ===== */
.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 105;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
}
.detail-backdrop.open { opacity: 1; visibility: visible; }
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 110;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.detail-panel.open { transform: translateX(0); }
.detail-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-head h3 { font-size: 15px; font-weight: 600; }
.detail-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r);
  transition: all var(--tr);
  display: flex;
}
.detail-close:hover { background: var(--bg-3); color: var(--text-1); }
.detail-body { flex: 1; overflow-y: auto; padding: 18px; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  width: 100%;
  max-width: 460px;
  transform: scale(.96) translateY(8px);
  transition: transform .2s;
  box-shadow: var(--sh3);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .3s;
  box-shadow: var(--sh3);
  min-width: 220px;
}
.toast-success { background: var(--bg-3); border: 1px solid var(--green); color: var(--green); }
.toast-error { background: var(--bg-3); border: 1px solid var(--red); color: var(--red); }
.toast-info { background: var(--bg-3); border: 1px solid var(--blue); color: var(--blue); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  background: var(--bg-3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}
.empty-state h3 { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.empty-state p { font-size: 12px; }

/* ===== SETTINGS ===== */
.settings-hero {
  position: relative;
  border-radius: var(--r3);
  overflow: hidden;
  margin-bottom: 20px;
  padding: 32px 28px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.settings-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246,130,31,.08) 0%, rgba(139,92,246,.06) 50%, rgba(59,130,246,.06) 100%);
  animation: heroShimmer 8s ease-in-out infinite alternate;
}
@keyframes heroShimmer {
  0% { opacity: .6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}
.settings-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 1;
}
.settings-avatar-ring {
  position: relative;
  flex-shrink: 0;
}
.settings-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-2);
  overflow: hidden;
  border: 3px solid var(--border);
  transition: transform .3s, border-color .3s;
}
.settings-avatar:hover { transform: scale(1.05); border-color: var(--accent); }
.settings-avatar img { width: 100%; height: 100%; object-fit: cover; }
.settings-avatar-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg-2);
  animation: pulse 2s infinite;
}
.settings-hero-info { flex: 1; }
.settings-hero-info h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 2px; }
.settings-hero-info p { font-size: 12px; color: var(--text-3); }
.settings-hero-badge { flex-shrink: 0; }

.settings-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.settings-stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--tr);
}
.settings-stat-card:hover { border-color: var(--border-h); transform: translateY(-2px); box-shadow: var(--sh2); }
.settings-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-stat-icon.blue { background: var(--blue-g); color: var(--blue); }
.settings-stat-icon.green { background: var(--green-g); color: var(--green); }
.settings-stat-icon.purple { background: var(--purple-g); color: var(--purple); }
.settings-stat-info { display: flex; flex-direction: column; gap: 2px; }
.settings-stat-val { font-size: 18px; font-weight: 800; letter-spacing: -.3px; line-height: 1; }
.settings-stat-lbl { font-size: 11px; color: var(--text-3); }

.settings-card { transition: all .3s; }
.settings-card:hover { border-color: var(--border-h); }

.settings-list { display: flex; flex-direction: column; }
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--tr);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: rgba(255,255,255,.01); }
.settings-item-left { display: flex; align-items: center; gap: 10px; }
.settings-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.settings-item-label { font-size: 13px; color: var(--text-2); }
.settings-item-value { font-size: 13px; color: var(--text-1); }

.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.settings-pref {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all var(--tr);
}
.settings-pref:hover { border-color: var(--border-h); transform: translateY(-2px); box-shadow: var(--sh2); }
.settings-pref-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-pref-icon.green { background: var(--green-g); color: var(--green); }
.settings-pref-icon.blue { background: var(--blue-g); color: var(--blue); }
.settings-pref-icon.purple { background: var(--purple-g); color: var(--purple); }
.settings-pref-title { font-size: 12px; font-weight: 600; color: var(--text-1); }
.settings-pref-val { font-size: 11px; color: var(--text-3); }

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.settings-action-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.settings-action-info p { font-size: 12px; color: var(--text-3); }

@media (max-width: 768px) {
  .settings-hero-content { flex-direction: column; text-align: center; }
  .settings-stats-row { grid-template-columns: 1fr; }
  .settings-grid-3 { grid-template-columns: 1fr; }
  .settings-actions { flex-direction: column; text-align: center; }
}

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 6px; } .gap-3 { gap: 10px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 6px; } .mt-3 { margin-top: 10px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 6px; } .mb-3 { margin-bottom: 10px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 11px; }
.text-xs { font-size: 10px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-h); }

/* ===== DOCS ===== */
.docs-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246,130,31,.06) 0%, rgba(59,130,246,.04) 100%);
}
.docs-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-g);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.docs-hero h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; position: relative; z-index: 1; }
.docs-hero p { font-size: 13px; color: var(--text-3); position: relative; z-index: 1; }

.docs-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.docs-nav-btn {
  padding: 8px 16px;
  border-radius: var(--r);
  background: transparent;
  color: var(--text-3);
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
}
.docs-nav-btn:hover { color: var(--text-2); background: var(--bg-3); }
.docs-nav-btn.active { background: var(--accent); color: #fff; }

.docs-section { animation: fadeIn .3s ease; }
.docs-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.2px; }
.docs-section > p { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.docs-section h3 { font-size: 15px; font-weight: 600; margin: 20px 0 10px; color: var(--text-1); }
.docs-section h4 { font-size: 12px; font-weight: 600; margin: 12px 0 6px; color: var(--text-2); }

.docs-step {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 12px;
  transition: all var(--tr);
}
.docs-step:hover { border-color: var(--border-h); }
.docs-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.docs-step-content { flex: 1; }
.docs-step-content h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.docs-step-content p { font-size: 12px; color: var(--text-3); margin: 0; }

.docs-endpoint {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px;
  margin-bottom: 12px;
  transition: all var(--tr);
}
.docs-endpoint:hover { border-color: var(--border-h); }
.docs-endpoint-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.docs-method {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: .5px;
}
.docs-method.get { background: var(--green-g); color: var(--green); }
.docs-method.post { background: var(--blue-g); color: var(--blue); }
.docs-url { font-family: var(--mono); font-size: 13px; color: var(--text-1); font-weight: 500; }
.docs-endpoint > p { font-size: 12px; color: var(--text-3); margin: 0; }

.docs-code {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin: 8px 0;
}
.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.docs-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--tr);
}
.docs-copy:hover { color: var(--accent); border-color: var(--accent); }
.docs-code pre {
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  overflow-x: auto;
  line-height: 1.6;
  margin: 0;
}

.docs-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--blue-g);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--r);
  margin: 12px 0;
  font-size: 12px;
  color: var(--text-2);
}
.docs-info-box.warning {
  background: var(--yellow-g);
  border-color: rgba(245,158,11,.2);
}
.docs-info-icon { color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.docs-info-box.warning .docs-info-icon { color: var(--yellow); }

.docs-table { overflow-x: auto; margin: 12px 0; }
.docs-table table { width: 100%; border-collapse: collapse; }
.docs-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.docs-table td {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.docs-table td code { color: var(--accent); font-family: var(--mono); font-size: 11px; }

.docs-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-3);
  border-radius: var(--r);
  padding: 3px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.docs-tab {
  padding: 6px 14px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
}
.docs-tab:hover { color: var(--text-2); }
.docs-tab.active { background: var(--bg-2); color: var(--text-1); box-shadow: var(--sh); }

.docs-example { display: none; }
.docs-example.active { display: block; animation: fadeIn .25s ease; }

@media (max-width: 768px) {
  .docs-hero { flex-direction: column; text-align: center; }
  .docs-nav { flex-wrap: nowrap; }
  .docs-step { flex-direction: column; align-items: center; text-align: center; }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .login-page { padding: 16px; }
  .login-card { width: 100%; max-width: 340px; padding: 28px 20px; }
  .login-logo-img { width: 60px; height: 60px; }
  .login-card h1 { font-size: 22px; }
  .btn-discord { padding: 12px 20px; font-size: 13px; }
  .features { gap: 10px; }
  .feature-item { font-size: 12px; padding: 6px 0; }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--sh3);
    z-index: 200;
    overflow: hidden;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-nav { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .sidebar-backdrop { z-index: 199; }

  .main { margin-left: 0; }

  .mobile-menu { display: flex; }

  .topbar { padding: 0 12px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar-title { font-size: 14px; }

  .content { padding: 12px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 10px; }

  .card { margin-bottom: 10px; }
  .card-head { padding: 12px 14px; }
  .card-head h2 { font-size: 12px; }
  .card-body { padding: 12px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 500px; }
  th { padding: 8px 10px; font-size: 9px; }
  td { padding: 8px 10px; font-size: 11px; }

  .key-display { font-size: 10px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .key-display .mono { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .flex.gap-2 { gap: 4px; }
  .btn-xs { padding: 3px 6px; font-size: 9px; }

  .detail-panel { width: 100%; border-radius: 0; }
  .detail-body { padding: 14px; }

  .log-entry { grid-template-columns: 50px 1fr; gap: 4px; }
  .log-entry .log-time { font-size: 9px; }
  .log-entry .log-category { display: none; }
  .log-entry .log-message { font-size: 10px; }

  .modal { width: calc(100% - 24px); max-width: 400px; margin: 12px; }

  .settings-hero-content { flex-direction: column; text-align: center; gap: 14px; }
  .settings-stats-row { grid-template-columns: 1fr; }
  .settings-grid-3 { grid-template-columns: 1fr; }
  .settings-actions { flex-direction: column; text-align: center; gap: 12px; }

  .docs-hero { flex-direction: column; text-align: center; padding: 20px 16px; gap: 12px; }
  .docs-hero-icon { width: 44px; height: 44px; }
  .docs-hero h1 { font-size: 18px; }
  .docs-hero p { font-size: 12px; }
  .docs-nav { gap: 2px; padding: 3px; }
  .docs-nav-btn { padding: 6px 10px; font-size: 11px; }
  .docs-step { flex-direction: column; align-items: center; text-align: center; padding: 14px; }
  .docs-step-content h3 { font-size: 13px; }
  .docs-code pre { font-size: 10px; padding: 10px 12px; }
  .docs-endpoint { padding: 14px; }
  .docs-url { font-size: 11px; }
  .docs-table { overflow-x: auto; }

  .donut-wrap { flex-direction: column; }
  .donut-svg { max-width: 180px; margin: 0 auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 10px; }
  .stat-value { font-size: 20px; }

  .topbar-right .btn-ghost span { display: none; }

  .input-group input { font-size: 16px; }

  .settings-hero-info h1 { font-size: 18px; }
}

@media (max-width: 380px) {
  .login-page { padding: 10px; }
  .login-card { padding: 22px 14px; max-width: 300px; }
  .login-logo-img { width: 50px; height: 50px; }
  .login-card h1 { font-size: 19px; }
  .btn-discord { padding: 10px 16px; font-size: 12px; }
  .feature-item { font-size: 11px; gap: 4px; }

  .sidebar { width: 220px; }

  .topbar { height: 46px; padding: 0 8px; }
  .topbar-title { font-size: 13px; }
  .topbar-right .btn-ghost span { display: none; }
  .user-pill span { display: none; }
  .user-pill { padding: 4px; }
  .mobile-menu { padding: 4px; }

  .content { padding: 8px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
  .stat-card { padding: 10px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 9px; }
  .stat-icon { width: 26px; height: 26px; font-size: 11px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 8px; }

  .card { margin-bottom: 8px; }
  .card-head { padding: 10px 12px; }
  .card-head h2 { font-size: 11px; }
  .card-body { padding: 10px; }

  .table-wrap { overflow-x: auto; }
  table { min-width: 420px; }
  th { padding: 6px 8px; font-size: 8px; }
  td { padding: 6px 8px; font-size: 10px; }

  .btn { padding: 7px 12px; font-size: 11px; }
  .btn-sm { padding: 4px 8px; font-size: 10px; }
  .btn-xs { padding: 2px 5px; font-size: 8px; }

  .key-display { font-size: 9px; max-width: 140px; padding: 3px 7px; }
  .key-display .mono { max-width: 100px; }

  .flex.gap-2 { gap: 3px; }

  .detail-panel { width: 100%; border-radius: 0; }
  .detail-body { padding: 10px; }
  .detail-head h3 { font-size: 13px; }

  .modal { width: calc(100% - 16px); max-width: 340px; margin: 8px; }
  .modal-head { padding: 14px 16px; }
  .modal-head h3 { font-size: 13px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 10px 16px; }

  .settings-hero { padding: 18px 14px; }
  .settings-hero-info h1 { font-size: 16px; }
  .settings-avatar { width: 56px; height: 56px; font-size: 20px; }
  .settings-stat-card { padding: 12px; gap: 10px; }
  .settings-stat-icon { width: 32px; height: 32px; }
  .settings-stat-val { font-size: 16px; }
  .settings-item { flex-direction: column; align-items: flex-start; gap: 8px; }

  .settings-pref { padding: 12px; }
  .settings-pref-icon { width: 34px; height: 34px; }
  .settings-pref-title { font-size: 11px; }

  .docs-hero { padding: 16px 12px; gap: 10px; }
  .docs-hero-icon { width: 36px; height: 36px; }
  .docs-hero h1 { font-size: 16px; }
  .docs-hero p { font-size: 11px; }
  .docs-nav-btn { padding: 5px 8px; font-size: 10px; }
  .docs-step { padding: 10px; gap: 10px; }
  .docs-step-num { width: 28px; height: 28px; font-size: 12px; }
  .docs-step-content h3 { font-size: 12px; }
  .docs-step-content p { font-size: 11px; }
  .docs-url { font-size: 10px; }
  .docs-code pre { font-size: 9px; padding: 8px 10px; }
  .docs-endpoint { padding: 10px; }

  .log-entry { padding: 5px 8px; }
  .log-entry .log-time { font-size: 8px; }
  .log-entry .log-message { font-size: 9px; }

  .tabs { padding: 2px; }
  .tab { padding: 5px 8px; font-size: 11px; }

  .toast-container { bottom: 10px; right: 10px; left: 10px; }
  .toast { min-width: auto; width: 100%; font-size: 11px; padding: 10px 12px; }

  .empty-state { padding: 28px 14px; }
  .empty-icon { width: 40px; height: 40px; }
  .empty-state h3 { font-size: 12px; }
  .empty-state p { font-size: 11px; }

  .chart-container { height: 120px; }
  .chart-labels span { font-size: 7px; }

  .donut-svg { max-width: 140px; }
}

@supports (-webkit-touch-callout: none) {
  .sidebar { -webkit-overflow-scrolling: touch; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
