/* ==========================================
   NexusAI — Premium Dashboard Design v2
   Glow effects, rainbow gradients, SVG icons,
   rotating trail borders, bigger elements
   ========================================== */

@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');

/* ==========================================
   CSS Custom Properties for animations
   ========================================== */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@property --rainbow-pos {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

/* ==========================================
   Design Tokens
   ========================================== */
:root {
  --bg-root: #050505;
  --bg-sidebar: #0a0a0a;
  --bg-main: #0d0d0d;
  --bg-card: #111111;
  --bg-card-hover: #181818;
  --bg-input: #141414;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(168, 85, 247, 0.08);

  --border: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(168, 85, 247, 0.3);

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #6a6a6a;
  --text-dim: #444444;

  --accent: #a855f7;
  --accent-hover: #9333ea;
  --accent-muted: rgba(168, 85, 247, 0.12);
  --accent-glow: rgba(168, 85, 247, 0.35);

  --green: #22c55e;
  --green-muted: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-muted: rgba(239, 68, 68, 0.12);
  --blue: #3b82f6;
  --blue-muted: rgba(59, 130, 246, 0.12);
  --purple: #a855f7;
  --purple-muted: rgba(168, 85, 247, 0.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --topbar-height: 56px;

  --transition: 180ms ease;
  --transition-slow: 350ms ease;
}

/* ==========================================
   Keyframes
   ========================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rainbow {
  0% { --rainbow-pos: 0%; }
  100% { --rainbow-pos: 200%; }
}
@keyframes rotateTrail {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.15); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.3); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-muted); color: var(--text-primary); }

/* ==========================================
   SVG Icon System
   ========================================== */
.icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

.icon-filled { fill: currentColor; stroke: none; }

/* ==========================================
   Pages Control
   ========================================== */
.page { display: none; position: relative; z-index: 1; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

/* ==========================================
   Buttons (bigger)
   ========================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  white-space: nowrap; position: relative;
}

.btn-accent {
  background: var(--accent); color: #000;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.3);
}
.btn-accent:hover {
  background: var(--accent-hover); transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(168, 85, 247, 0.45);
}

.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-card);
}
.btn-outline:hover {
  border-color: var(--border-hover); background: var(--bg-hover);
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

.btn-danger {
  background: var(--red-muted); color: var(--red);
  border: 1px solid rgba(239,68,68,0.18);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.btn-ghost {
  background: transparent; color: var(--text-muted); border: none;
}
.btn-ghost:hover { color: var(--text-primary); }

/* ==========================================
   LANDING PAGE
   ========================================== */

/* --- Navbar --- */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.landing-nav .nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; position: relative;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 1.25rem; color: var(--text-primary);
  cursor: pointer; letter-spacing: -0.03em;
}

.brand-icon {
  width: 32px; height: 32px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.3));
}

.brand-beta {
  font-size: 0.6rem; font-weight: 700; color: var(--accent);
  background: var(--accent-muted); padding: 2px 8px;
  border-radius: var(--radius-full); margin-left: 2px;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.nav-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
}

.nav-actions { display: flex; align-items: center; gap: 6px; }

.nav-btn {
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  border: none; cursor: pointer; transition: all var(--transition);
}
.nav-btn-ghost { background: transparent; color: var(--text-secondary); }
.nav-btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-btn-primary { background: var(--accent); color: #000; }
.nav-btn-primary:hover { background: var(--accent-hover); }

/* --- Hero --- */
.hero {
  text-align: center; padding: 160px 28px 100px;
  max-width: 800px; margin: 0 auto;
  position: relative;
}

/* Background glow orb behind hero */
.hero::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
  pointer-events: none; z-index: -1;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 18px; background: var(--accent-muted);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: var(--radius-full); font-size: 0.88rem;
  font-weight: 500; color: var(--accent); margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 900; letter-spacing: -0.05em;
  line-height: 1.1; margin-bottom: 22px;
}

/* Orange animated gradient text */
.hero .grad {
  background: linear-gradient(
    90deg,
    #a855f7, #fbbf24, #9333ea, #a855f7, #fcd34d, #7e22ce, #a855f7, #fbbf24
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow-slide 4s linear infinite;
}

@keyframes rainbow-slide {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero p {
  font-size: 1.15rem; color: var(--text-secondary);
  line-height: 1.75; margin-bottom: 40px;
  max-width: 600px; margin-left: auto; margin-right: auto;
}

.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Code Preview --- */
.code-preview {
  max-width: 620px; margin: 56px auto 0;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius); overflow: hidden;
  text-align: left;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-slow);
}
.code-preview:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(168, 85, 247, 0.06);
}

.code-top {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.code-top span { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ef4444; } .dot-y { background: #a855f7; } .dot-g { background: #22c55e; }

.code-preview pre {
  padding: 22px; font-family: var(--font-mono);
  font-size: 0.88rem; line-height: 1.95; color: var(--text-secondary);
  overflow-x: auto;
}
.ck { color: #fbbf24; } .cs { color: #86efac; } .cc { color: var(--text-dim); }

/* --- Features --- */
.section { padding: 88px 28px; max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.section-head p { color: var(--text-secondary); font-size: 1.08rem; }

.feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px;
}

.feat-card {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 28px;
  transition: all var(--transition-slow);
  position: relative; overflow: hidden;
}
.feat-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.04), transparent 60%);
  opacity: 0; transition: opacity var(--transition-slow);
}
.feat-card:hover {
  border-color: var(--border-hover); background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(168, 85, 247, 0.05);
}
.feat-card:hover::before { opacity: 1; }

.feat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-muted); display: flex; align-items: center;
  justify-content: center; margin-bottom: 16px;
  color: var(--accent); position: relative; z-index: 1;
}

.feat-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; position: relative; z-index: 1; }
.feat-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; position: relative; z-index: 1; }

/* --- Pricing with rotating trail border --- */
.price-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px; max-width: 1300px; margin: 0 auto;
}

.price-card {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 32px; text-align: center;
  position: relative; transition: all var(--transition-slow);
}
.price-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* Popular card — rotating orange trail border + glow */
.price-card.pop {
  border: none;
  background: var(--bg-card);
  position: relative;
  z-index: 0;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.12), 0 0 60px rgba(168, 85, 247, 0.06);
}
.price-card.pop::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(from var(--angle), transparent 15%, var(--accent) 40%, #fbbf24 50%, var(--accent) 60%, transparent 85%);
  animation: rotateTrail 3s linear infinite;
  z-index: -2;
}
.price-card.pop::after {
  content: '';
  position: absolute; inset: 2px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  z-index: -1;
}
.price-card.pop:hover {
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.22), 0 0 80px rgba(168, 85, 247, 0.1), 0 16px 48px rgba(0, 0, 0, 0.35);
}
.price-card.pop:hover::before {
  filter: brightness(1.4);
  animation-duration: 1.5s;
}

.pop-label {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; background: var(--accent);
  color: #000; font-size: 0.72rem; font-weight: 700;
  border-radius: var(--radius-full); text-transform: uppercase;
  letter-spacing: 0.05em; z-index: 2;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
}

.price-name { font-weight: 700; font-size: 1.08rem; margin-bottom: 10px; position: relative; z-index: 2; }
.price-val {
  font-size: 2.8rem; font-weight: 900; letter-spacing: -0.04em;
  position: relative; z-index: 2;
}
.price-val small { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.price-list {
  list-style: none; text-align: left; margin: 24px 0;
  position: relative; z-index: 2;
}
.price-list li {
  padding: 7px 0; font-size: 0.9rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 10px;
}
.price-list li::before {
  content: '';
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  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='%23a855f7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

.price-card .btn { position: relative; z-index: 2; }

/* --- Landing Footer --- */
.landing-footer {
  text-align: center; padding: 36px 28px;
  border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.85rem;
}
.landing-footer a { color: var(--text-muted); margin: 0 8px; }

/* ==========================================
   AUTH PAGES
   ========================================== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 28px;
}

.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.auth-box h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}

.field input, .field select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font); font-size: 0.95rem;
  outline: none; transition: all var(--transition);
}
.field input:focus, .field select:focus {
  border-color: var(--accent); background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--accent-muted), 0 0 16px rgba(168, 85, 247, 0.08);
}
.field input::placeholder { color: var(--text-dim); }

.auth-sep {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0; color: var(--text-dim); font-size: 0.85rem;
}
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-alt { text-align: center; font-size: 0.9rem; color: var(--text-muted); }

/* ==========================================
   DASHBOARD LAYOUT — Sidebar + Main
   ========================================== */
.app-layout { display: flex; min-height: 100vh; }

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

.sidebar-brand {
  padding: 22px 20px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.12rem; color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-section { padding: 0 12px; margin-bottom: 6px; }

.sidebar-label {
  padding: 10px 12px 5px; font-size: 0.68rem; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.92rem; font-weight: 450;
  cursor: pointer; transition: all var(--transition);
  border: none; background: none; width: 100%; text-align: left;
  font-family: var(--font);
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-link.active {
  color: var(--accent); background: var(--bg-active);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-link .s-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: currentColor;
}

.sidebar-bottom {
  margin-top: auto; padding: 14px; border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px;
  border-radius: var(--radius-sm); transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-hover); }

.user-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #9333ea);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem; color: #000; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-menu-btn {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 6px; transition: all var(--transition);
  border-radius: var(--radius-sm);
}
.user-menu-btn:hover { color: var(--red); background: var(--red-muted); }

/* --- Main Content --- */
.main-area {
  flex: 1; margin-left: var(--sidebar-width);
  display: flex; flex-direction: column; min-height: 100vh;
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(10, 10, 10, 0.65);
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-toggle {
  display: none; background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 6px;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-secondary); font-family: var(--font);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); display: flex; align-items: center; gap: 8px;
}
.topbar-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-hover); }

/* --- Content --- */
.content {
  flex: 1; padding: 32px 32px 48px;
  background: rgba(13, 13, 13, 0.6);
}

.content-footer {
  padding: 22px 32px; border-top: 1px solid var(--border);
  text-align: center; color: var(--text-dim); font-size: 0.8rem;
  background: rgba(10, 10, 10, 0.7);
}
.content-footer a { color: var(--text-muted); margin: 0 6px; }

/* --- Page Header --- */
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px;
}
.page-header p { color: var(--text-muted); font-size: 0.95rem; margin-top: 5px; }

/* ==========================================
   STAT CARDS — bigger + glow hover
   ========================================== */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 22px 24px;
  transition: all var(--transition-slow); position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.03), transparent 60%);
  opacity: 0; transition: opacity var(--transition-slow);
  pointer-events: none;
}
.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 20px rgba(168, 85, 247, 0.08);
}
.stat-card:hover::before { opacity: 1; }

.stat-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; position: relative; z-index: 1;
}

.stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

.stat-badge {
  font-size: 0.68rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-full); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-badge.green { background: var(--green-muted); color: var(--green); }
.stat-badge.amber { background: var(--accent-muted); color: var(--accent); }

.stat-val {
  font-size: 2rem; font-weight: 900; letter-spacing: -0.03em;
  line-height: 1.2; position: relative; z-index: 1;
}

.stat-icon {
  position: absolute; top: 18px; right: 18px;
  color: var(--text-dim); z-index: 1;
}

/* ==========================================
   SECTION BLOCKS
   ========================================== */
.block { margin-bottom: 28px; }

.block-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.block-title { font-size: 1.12rem; font-weight: 700; }
.block-sub { font-size: 0.82rem; color: var(--text-dim); font-weight: 400; }

/* ==========================================
   ANNOUNCEMENT CARDS
   ========================================== */
.announce-list { display: flex; flex-direction: column; gap: 12px; }

.announce-card {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: all var(--transition-slow);
}
.announce-card:hover {
  border-color: var(--border-hover); transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.announce-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-muted); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

.announce-body { flex: 1; min-width: 0; }
.announce-body h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 5px; }
.announce-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.announce-date { font-size: 0.72rem; color: var(--text-dim); margin-top: 7px; }

.announce-badge {
  font-size: 0.68rem; font-weight: 600; padding: 4px 12px;
  border-radius: var(--radius-full); background: var(--green-muted);
  color: var(--green); flex-shrink: 0; margin-top: 2px;
}

/* ==========================================
   CONNECTION BOX
   ========================================== */
.conn-box {
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 24px; margin-bottom: 28px;
  position: relative; overflow: hidden;
}
.conn-box::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.04), transparent 70%);
  pointer-events: none;
}

.conn-box h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 1;
}

.conn-row {
  display: flex; align-items: center; gap: 14px; padding: 8px 0;
  position: relative; z-index: 1;
}

.conn-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; width: 110px; flex-shrink: 0; }

.conn-val {
  font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--accent); background: var(--bg-input);
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); flex: 1;
}

.copy-btn {
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; padding: 6px 8px;
  border-radius: var(--radius-sm); transition: all var(--transition); flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(168, 85, 247, 0.1); }

/* ==========================================
   KEY LIST
   ========================================== */
.key-list { display: flex; flex-direction: column; gap: 10px; }

.key-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-card);
  border: 1px solid var(--border-card); border-radius: var(--radius);
  transition: all var(--transition-slow); gap: 14px;
}
.key-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.key-meta { min-width: 0; }
.key-name { font-weight: 600; font-size: 0.95rem; }
.key-prefix { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; }
.key-date { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }
.key-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ==========================================
   TABLES
   ========================================== */
.table-wrap {
  overflow-x: auto; background: var(--bg-card);
  border: 1px solid var(--border-card); border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; }

th {
  padding: 12px 18px; text-align: left;
  font-size: 0.72rem; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 18px; font-size: 0.88rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-green { background: var(--green-muted); color: var(--green); }
.badge-red { background: var(--red-muted); color: var(--red); }
.badge-amber { background: var(--accent-muted); color: var(--accent); }
.badge-blue { background: var(--blue-muted); color: var(--blue); }

/* ==========================================
   CHART
   ========================================== */
.chart-area {
  height: 200px; background: var(--bg-card);
  border: 1px solid var(--border-card); border-radius: var(--radius);
  display: flex; align-items: flex-end; padding: 20px 16px;
  gap: 5px; position: relative;
}

.chart-bar {
  flex: 1; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--accent), rgba(168, 85, 247, 0.25));
  transition: all 0.4s ease; min-height: 3px; position: relative;
}
.chart-bar:hover {
  background: linear-gradient(to top, var(--accent-hover), rgba(217, 119, 6, 0.5));
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.chart-label {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 0.65rem; color: var(--text-dim); white-space: nowrap;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 28px;
}
.modal-bg.open { display: flex; }

.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); max-width: 460px; width: 100%;
  padding: 32px; animation: slideUp 0.25s ease;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal-box h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ==========================================
   TOAST
   ========================================== */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-card);
  color: var(--text-primary); font-size: 0.88rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease; max-width: 380px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-ico { margin-bottom: 14px; opacity: 0.3; color: var(--text-dim); }
.empty h4 { font-size: 1.02rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty p { font-size: 0.88rem; max-width: 320px; margin: 0 auto 18px; }

/* ==========================================
   UTILITIES
   ========================================== */
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
}
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; }

.inline-select {
  padding: 6px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font); font-size: 0.82rem;
  outline: none; cursor: pointer;
}
.inline-select:focus { border-color: var(--accent); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .topbar-toggle { display: block; }
  .content { padding: 22px 18px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .feat-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; max-width: 340px; }
  .conn-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .conn-label { width: auto; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* --- Model Badges in Dashboard --- */
.model-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.model-badge:hover {
  background: var(--border);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ==========================================
   SUPPORT BOT WIDGET (Glassmorphism & animations)
   ========================================== */
.support-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: var(--font);
}

.support-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.support-trigger:hover {
  transform: scale(1.08) rotate(5deg);
  background: var(--accent-hover);
  box-shadow: 0 6px 32px rgba(168, 85, 247, 0.5);
}

.support-chat-container {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 410px;
  height: 520px;
  background: rgba(17, 17, 17, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease;
}

.support-chat-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-bot-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-bot-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-muted);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.support-bot-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.support-bot-status {
  font-size: 0.68rem;
  color: var(--green);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.support-bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.support-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.support-close-btn:hover {
  color: var(--text-primary);
}

.support-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.support-message.user-msg {
  align-self: flex-end;
}

.support-message.bot-msg {
  align-self: flex-start;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.user-msg .msg-bubble {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 2px;
  font-weight: 500;
}

.bot-msg .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

.support-chat-input-area {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

#support-chat-input {
  flex: 1;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
}
#support-chat-input:focus {
  border-color: var(--accent);
}

.support-send-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.support-send-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.3s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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

@media (max-width: 480px) {
  .support-chat-container {
    width: calc(100vw - 48px);
    height: 400px;
    bottom: 64px;
  }
}

/* Bullet Items & Markdown formatting in Chat Bubbles */
.msg-bubble strong {
  color: #fff;
  font-weight: 700;
}

.msg-bubble code {
  font-family: var(--font-mono);
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.bullet-item {
  margin: 6px 0;
  padding-left: 4px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Suggestion Pills block */
.support-suggestions {
  display: flex;
  gap: 8px;
  padding: 10px 16px 8px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border);
}
.support-suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion-pill {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.suggestion-pill:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Premium Header and container tweaks */
.support-chat-header {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(0, 0, 0, 0.2)) !important;
  border-bottom: 1px solid rgba(168, 85, 247, 0.15) !important;
}

.support-chat-container {
  border-color: rgba(168, 85, 247, 0.2) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.04) !important;
}

/* Messages custom scrollbars */
.support-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.support-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.support-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
}
.support-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.3);
}

/* Floating Plan Card Styles */
@keyframes floatPlan {
  0% { transform: translateY(-8px); }
  50% { transform: translateY(-18px); }
  100% { transform: translateY(-8px); }
}

.price-card.plan-active {
  transform: translateY(-8px);
  border-color: var(--accent) !important;
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.16), 0 0 24px rgba(168, 85, 247, 0.08) !important;
  animation: floatPlan 4s ease-in-out infinite;
}

.price-card.plan-active:hover {
  animation-play-state: paused;
  transform: translateY(-20px);
  box-shadow: 0 20px 48px rgba(168, 85, 247, 0.25), 0 0 32px rgba(168, 85, 247, 0.12) !important;
}

.price-badge-current {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #050505;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
  z-index: 10;
  text-transform: uppercase;
}
