/* ============================================================
   Xingchen Network - Main Styles
   ============================================================ */

/* === Variables === */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --bg-dark: #0a0a0f;
  --bg-sidebar: #0f0f17;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --bg-input: #1a1a25;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient-1: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
#app { opacity: 1; transition: opacity 0.15s ease; }

/* === Loading Spinner === */
.spinner, .spinner-sm {
  display: inline-block;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner { width: 24px; height: 24px; }
.spinner-sm { width: 16px; height: 16px; vertical-align: middle; margin-right: 0.5rem; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gradient-1); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }
.btn-success { background: rgba(34,197,94,0.1); color: var(--success); }
.btn-success:hover:not(:disabled) { background: rgba(34,197,94,0.2); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-glow { position: relative; }
.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-1);
  border-radius: inherit;
  filter: blur(12px);
  opacity: 0.4;
  z-index: -1;
  transition: opacity 0.3s;
}
.btn-glow:hover::before { opacity: 0.7; }

/* === Forms === */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; }
.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.form-check input { margin-top: 0.25rem; }
.form-check a { color: var(--primary); }
.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.85rem; }
.form-check-inline { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); cursor: pointer; }
.form-options a { color: var(--primary); }
.error-msg { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--danger); padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1rem; display: none; }
.success-msg { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: var(--success); padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1rem; display: none; }
.field-error { color: var(--danger); font-size: 0.75rem; margin-top: 0.25rem; }

/* === Auth Layout === */
.auth-layout { display: flex; min-height: 100vh; }
.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59,130,246,0.15), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(139,92,246,0.08), transparent 50%);
}
.brand { position: relative; z-index: 1; text-align: center; margin-bottom: 2rem; }
.brand-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}
.brand h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.brand p { color: var(--text-secondary); font-size: 1.1rem; }
.auth-right {
  width: 480px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  overflow-y: auto;
}
.form-header { margin-bottom: 2rem; }
.form-header h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.form-header p { color: var(--text-muted); font-size: 0.9rem; }
.form-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-footer a { color: var(--primary); font-weight: 500; }
.divider-text { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: var(--text-muted); font-size: 0.8rem; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.quick-btns { display: grid; gap: 0.75rem; }
.back-link { position: absolute; top: 2rem; left: 2rem; color: var(--text-muted); font-size: 0.9rem; z-index: 10; }
.back-link:hover { color: var(--text-primary); }
.feature-list { list-style: none; position: relative; z-index: 1; }
.feature-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; color: var(--text-secondary); }
.feature-list li span { color: var(--success); }

/* === Navigation === */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.top-nav.scrolled {
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
  padding: 0.75rem 2rem;
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo-link { display: flex; align-items: center; gap: 0.75rem; }
.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gradient-1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.logo-link:hover .logo-mark { transform: scale(1.08) rotate(-3deg); box-shadow: 0 0 20px rgba(59,130,246,0.4); }
.logo-label { font-size: 1.15rem; font-weight: 600; }
.nav-links { display: flex; gap: 2rem; align-items: center; font-size: 0.9rem; }
.nav-links a:not(.btn) { color: var(--text-secondary); transition: color 0.2s; position: relative; }
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-1);
  transition: width 0.3s;
  border-radius: 1px;
}
.nav-links a:not(.btn):hover { color: var(--text-primary); }
.nav-links a:not(.btn):hover::after { width: 100%; }

/* === Hero === */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
}
.hero-orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(59,130,246,0.25), transparent 70%); top: -15%; left: -10%; }
.hero-orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(139,92,246,0.2), transparent 70%); top: 20%; right: -10%; animation-delay: -7s; }
.hero-orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(6,182,212,0.15), transparent 70%); bottom: -10%; left: 30%; animation-delay: -14s; }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}
.hero-content { max-width: 900px; text-align: center; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}
.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 8px var(--success);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #38bdf8);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
}
.hero-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.stat-item { text-align: center; transition: transform 0.3s; }
.stat-item:hover { transform: translateY(-4px); }
.stat-val { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-lbl { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.375rem; }
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: opacity 0.3s;
}
.scroll-mouse { width: 24px; height: 38px; border: 2px solid var(--text-muted); border-radius: 12px; position: relative; }
.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollAnim 2s ease-in-out infinite;
}

/* === Sections === */
.section { padding: 7rem 2rem; }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 4rem; }
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  display: inline-block;
  padding: 0.375rem 1rem;
  background: rgba(59,130,246,0.08);
  border-radius: 100px;
  border: 1px solid rgba(59,130,246,0.15);
}
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.section-desc { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; }

/* === Features === */
.features-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card {
  background: rgba(18,18,26,0.6);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.feature-card:hover {
  background: rgba(26,26,37,0.8);
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 40px rgba(59,130,246,0.1);
}
.feature-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover .feature-card-glow { opacity: 1; }
.feature-icon-wrap {
  width: 52px;
  height: 52px;
  background: rgba(59,130,246,0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all 0.4s;
}
.feature-card:hover .feature-icon-wrap {
  background: rgba(59,130,246,0.15);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(59,130,246,0.2);
}
.feature-icon { font-size: 1.5rem; }
.feature-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* === Map === */
.map-section { background: linear-gradient(180deg, var(--bg-dark), rgba(59,130,246,0.03) 50%, var(--bg-dark)); }
.map-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.map-visual { position: relative; aspect-ratio: 1; border-radius: 24px; overflow: hidden; }
.map-ring { position: absolute; border: 1px solid rgba(59,130,246,0.1); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.map-ring-1 { width: 60%; height: 60%; animation: ringPulse 4s ease-in-out infinite; }
.map-ring-2 { width: 80%; height: 80%; animation: ringPulse 4s ease-in-out infinite 1s; }
.map-ring-3 { width: 100%; height: 100%; animation: ringPulse 4s ease-in-out infinite 2s; }
.map-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3), transparent);
  top: 50%;
  left: 0;
  right: 0;
  transform-origin: left center;
}
.map-line-1 { transform: rotate(15deg); animation: lineGlow 3s ease-in-out infinite; }
.map-line-2 { transform: rotate(-20deg); animation: lineGlow 3s ease-in-out infinite 1s; }
.map-line-3 { transform: rotate(35deg); animation: lineGlow 3s ease-in-out infinite 2s; }
.map-dots { position: relative; width: 100%; height: 100%; }
.map-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(59,130,246,0.6), 0 0 40px rgba(59,130,246,0.3);
  animation: dotPulse 2s ease-in-out infinite;
}
.map-dot::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 50%;
  animation: ripple 2s infinite;
}
.map-dot::after {
  content: '';
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 50%;
  animation: ripple 2s infinite 0.5s;
}
.map-content h3 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.map-content p { color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.7; }
.region-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.region-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  transition: all 0.3s;
}
.region-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(59,130,246,0.2); transform: translateX(4px); }
.region-latency { margin-left: auto; color: var(--success); font-size: 0.8rem; font-weight: 600; font-family: 'SF Mono', Consolas, monospace; }

/* === Pricing === */
.pricing-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.pricing-card {
  background: rgba(18,18,26,0.6);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  backdrop-filter: blur(10px);
}
.pricing-card:hover { transform: translateY(-8px); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.pricing-card.featured {
  border-color: rgba(59,130,246,0.4);
  background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(18,18,26,0.6));
}
.pricing-card.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-1);
  color: #fff;
  padding: 0.3rem 1.25rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.pricing-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.pricing-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pricing-price { display: flex; align-items: baseline; gap: 0.25rem; margin-bottom: 2rem; }
.pricing-currency { font-size: 1.25rem; font-weight: 600; color: var(--text-secondary); }
.pricing-amount { font-size: 3.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.pricing-period { font-size: 0.9rem; color: var(--text-muted); }
.pricing-features { list-style: none; margin-bottom: 2rem; }
.pricing-features li { padding: 0.5rem 0; font-size: 0.9rem; color: var(--text-secondary); }
.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 600; }
.pricing-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s;
}
.pricing-btn-primary {
  background: var(--gradient-1);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.pricing-btn-primary:hover { box-shadow: 0 8px 30px rgba(59,130,246,0.4); transform: translateY(-2px); }
.pricing-btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.pricing-btn-secondary:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }

/* === CTA === */
.cta-section { padding: 6rem 2rem; text-align: center; }
.cta-box {
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 28px;
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
}
.cta-box h2 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.cta-box p { color: var(--text-secondary); margin-bottom: 2rem; font-size: 1.1rem; }

/* === Footer === */
.site-footer { border-top: 1px solid var(--border); padding: 4rem 2rem 2rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; line-height: 1.6; }
.footer-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 1.25rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s, padding-left 0.2s; }
.footer-links a:hover { color: var(--text-primary); padding-left: 4px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
  padding: 0.5rem 0.875rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.footer-social a:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: var(--primary); transform: translateY(-2px); }

/* === App Layout (Dashboard / Admin) === */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.nav-section { margin-bottom: 1.5rem; }
.nav-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 0.5rem; margin-bottom: 0.5rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-item.active { background: rgba(59,130,246,0.1); color: var(--primary); }
.nav-icon { width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 0.7rem; padding: 0.125rem 0.5rem; border-radius: 100px; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 8px; cursor: pointer; }
.user-info:hover { background: rgba(255,255,255,0.05); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8rem; }
.user-name { font-size: 0.85rem; font-weight: 500; }
.user-plan, .user-role { font-size: 0.7rem; color: var(--text-muted); }
.user-role { color: var(--warning); }
.main-content { flex: 1; margin-left: 240px; min-height: 100vh; }
.topbar {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 1.25rem; font-weight: 600; }
.topbar-actions { display: flex; gap: 0.75rem; align-items: center; }
.content-area { padding: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.stat-icon.blue { background: rgba(59,130,246,0.1); }
.stat-icon.green { background: rgba(34,197,94,0.1); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); }
.stat-icon.purple { background: rgba(139,92,246,0.1); }
.stat-icon.red { background: rgba(239,68,68,0.1); }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-change { font-size: 0.75rem; margin-top: 0.25rem; }
.stat-change.positive { color: var(--success); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-actions { display: flex; gap: 0.75rem; align-items: center; }
.card-body { padding: 1.5rem; }
.search-box { position: relative; }
.search-box input { padding: 0.5rem 1rem 0.5rem 2.25rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.85rem; width: 220px; }
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box::before { content: '🔍'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.8rem; }
.filter-select { padding: 0.5rem 0.75rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.85rem; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.875rem 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.proxy-name { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.proxy-address { font-family: 'SF Mono', Consolas, monospace; font-size: 0.85rem; color: var(--text-secondary); background: rgba(255,255,255,0.03); padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; position: relative; }
.proxy-address:hover { background: rgba(255,255,255,0.06); }
.status { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem; border-radius: 100px; font-size: 0.75rem; font-weight: 500; }
.status-online { background: rgba(34,197,94,0.1); color: var(--success); }
.status-offline { background: rgba(100,116,139,0.1); color: var(--text-muted); }
.status-error { background: rgba(239,68,68,0.1); color: var(--danger); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge { display: inline-flex; padding: 0.25rem 0.75rem; border-radius: 100px; font-size: 0.75rem; font-weight: 500; }
.badge-admin { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-user { background: rgba(59,130,246,0.1); color: var(--primary); }
.badge-active { background: rgba(34,197,94,0.1); color: var(--success); }
.badge-suspended { background: rgba(239,68,68,0.1); color: var(--danger); }
.actions { display: flex; gap: 0.375rem; }
.user-cell { display: flex; align-items: center; gap: 0.75rem; }
.user-cell-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.85rem; flex-shrink: 0; }
.user-cell-name { font-weight: 500; }
.user-cell-email { font-size: 0.8rem; color: var(--text-muted); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.pagination-info { font-size: 0.85rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 0.5rem; }
.page-btn { padding: 0.375rem 0.75rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 0.8rem; cursor: pointer; }
.page-btn:hover { background: rgba(255,255,255,0.08); }
.page-btn.active { background: var(--primary); border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chart-container { }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 0 1rem; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.chart-bar-val { font-size: 0.75rem; color: var(--text-muted); }
.chart-bar { width: 100%; background: var(--gradient-1); border-radius: 6px 6px 0 0; transition: height 0.5s; min-height: 4px; }
.chart-labels { display: flex; justify-content: space-between; padding: 0.75rem 1rem 0; font-size: 0.75rem; color: var(--text-muted); }

/* === Modal === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.5); }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.15s; }
.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* === Copy Tooltip === */
.copy-text { cursor: pointer; position: relative; }
.copy-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.copy-tooltip.show { opacity: 1; }
