/* ========================================
   BotSpace — Design System
   ======================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a5f;

  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;

  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;

  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;

  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic Tokens — Light */
  --surface: #ffffff;
  --surface-secondary: #f8fafc;
  --surface-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --divider: #f1f5f9;

  /* Brand Tokens */
  --primary: var(--blue-600);
  --primary-dark: var(--blue-700);
  --primary-darker: var(--blue-800);
  --primary-light: var(--blue-400);
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-glow: rgba(37, 99, 235, 0.15);
  --primary-gradient: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  --primary-gradient-deep: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 50%, var(--blue-800) 100%);

  --accent: var(--cyan-500);
  --accent-gradient: linear-gradient(135deg, var(--blue-600), var(--cyan-500));

  --success: var(--green-500);
  --warning: var(--amber-500);
  --danger: var(--red-500);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.08);
  --shadow-primary-sm: 0 2px 8px rgba(59, 130, 246, 0.3);
  --shadow-primary-md: 0 4px 14px rgba(37, 99, 235, 0.25);
  --shadow-primary-lg: 0 6px 20px rgba(37, 99, 235, 0.35);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in: cubic-bezier(0.55, 0.085, 0.68, 0.53);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-nav: 500;
  --z-modal: 1000;
  --z-toast: 2000;

  /* Layout */
  --content-max: 1200px;
  --content-wide: 1100px;
  --nav-height: 64px;
}

/* ---------- Dark Mode (disabled — always light) ---------- */

/* ---------- Reduce Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .scroll-track { animation: none !important; }
  .ann-card-body-scroll { animation: none !important; }
  .hero-decoration i { animation: none !important; }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

::selection { background: var(--primary-soft); color: var(--primary-darker); }

/* ========================================
   Landing Page
   ======================================== */

/* ---------- Typography ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
  letter-spacing: 0.3px;
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.25;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-base);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-primary-sm);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text-primary);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-base);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-lg { padding: 0.85rem 2rem; font-size: var(--text-lg); border-radius: var(--radius-md); }
.btn-full { width: 100%; justify-content: center; }
.btn-white { background: white; color: var(--primary); border: none; box-shadow: 0 4px 15px rgba(255,255,255,0.3); }
.btn-white:hover { background: #f0f4ff; color: var(--primary-dark); box-shadow: 0 6px 25px rgba(255,255,255,0.4); transform: translateY(-2px); }

/* ---------- Section Glow Backgrounds ---------- */
.section-glow { position: relative; }
.section-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}
.features-section.section-glow::before {
  background:
    radial-gradient(ellipse 700px 400px at 20% 30%, rgba(37,99,235,0.09), transparent 60%),
    radial-gradient(ellipse 600px 350px at 80% 70%, rgba(37,99,235,0.06), transparent 60%);
}
.testimonials-section.section-glow::before {
  background: radial-gradient(ellipse 650px 400px at 50% 50%, rgba(37,99,235,0.07), transparent 60%);
}

/* Announcement tag colors */
.tag-announcement { background: var(--blue-100); color: var(--blue-700); }
.tag-update { background: var(--green-50); color: var(--green-600); }
.tag-maintenance { background: var(--amber-50); color: var(--amber-600); }
.tag-info { background: var(--blue-100); color: var(--blue-700); }
.tag-success { background: var(--green-50); color: var(--green-600); }
.tag-warning { background: var(--amber-50); color: var(--amber-600); }
.tag-danger { background: var(--red-50); color: var(--red-600); }

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ---------- Nav ---------- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}
.nav-bar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}
.nav-logo i { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-base);
  transition: color var(--duration-fast);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links .btn-primary { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 20% 10%, rgba(37,99,235,0.12), transparent 65%),
    radial-gradient(ellipse 700px 450px at 80% 40%, rgba(37,99,235,0.08), transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 80%, rgba(6,182,212,0.07), transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 70%);
  pointer-events: none;
}

.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-decoration i {
  position: absolute;
  color: var(--primary);
  opacity: 0.07;
}
.hero-decoration i:nth-child(1) { top: 15%; left: 10%; font-size: 3rem; animation: float 6s var(--ease-in-out) infinite; }
.hero-decoration i:nth-child(2) { top: 25%; right: 12%; font-size: 2rem; animation: float 8s var(--ease-in-out) infinite 1s; }
.hero-decoration i:nth-child(3) { bottom: 30%; left: 5%; font-size: 2.5rem; animation: float 7s var(--ease-in-out) infinite 0.5s; }
.hero-decoration i:nth-child(4) { bottom: 20%; right: 8%; font-size: 1.8rem; animation: float 9s var(--ease-in-out) infinite 2s; }

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

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8) 4rem;
  position: relative;
  z-index: 1;
}

.hero-content .section-label { margin-bottom: var(--space-4); }

.hero h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  max-width: 780px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--cyan-500), var(--blue-400));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s var(--ease-in-out) infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero p {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 580px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: 3rem;
}

.hero-badges {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-secondary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast);
}
.hero-badge:hover { background: var(--primary-soft); color: var(--primary); }
.hero-badge i { color: var(--primary); width: 18px; height: 18px; }

/* ---------- Announcements ---------- */
.announcements-section {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-6);
}
.announcements-container {
  display: flex;
  gap: var(--space-6);
  align-items: stretch;
}

.ann-illustration {
  flex: 1;
  min-height: 220px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.ann-illustration-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.ann-illustration-icons {
  display: flex;
  gap: var(--space-3);
}

.ann-icon-bot {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--blue-600), var(--violet-600));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ann-icon-smile {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--green-600), #10b981);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ann-icon-pencil {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--amber-600), var(--amber-500));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}

.ann-illustration-title { font-weight: 700; font-size: var(--text-base); color: var(--text-primary); }
.ann-illustration-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }

.ann-illustration-tags { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: center; }

.ann-tag-pill {
  font-size: var(--text-xs);
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ann-card {
  width: 340px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal);
  display: flex;
  flex-direction: column;
}
.ann-card:hover { box-shadow: var(--shadow-md); }

.ann-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--surface);
}

.ann-card-title { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: var(--text-base); }
.ann-card-title i { color: var(--primary); }

.ann-card-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.ann-card-body { flex: 1; overflow: hidden; position: relative; }
.ann-card-body-scroll { animation: annScroll 20s linear infinite; }
.ann-card-body-scroll:hover { animation-play-state: paused; }

@keyframes annScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.ann-item { padding: 12px 18px; border-bottom: 1px solid var(--divider); }
.ann-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ann-tag { font-size: 0.6rem; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.ann-date { font-size: var(--text-xs); color: var(--text-tertiary); }
.ann-item-title { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }

.ann-card-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
  background: var(--surface);
}

.ann-view-all {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--duration-fast);
}
.ann-view-all:hover { gap: var(--space-2); }

/* ---------- Features ---------- */
.features-section {
  padding: var(--space-20) var(--space-8);
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: default;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.08);
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-4);
  background: var(--primary-soft);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-normal), background var(--duration-normal);
}
.feature-card:hover .feature-icon {
  transform: scale(1.08) rotate(-5deg);
  background: rgba(37, 99, 235, 0.12);
}
.feature-icon i { color: var(--primary); width: 24px; height: 24px; }

.feature-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.7;
}
.feature-desc span { display: block; }

/* ---------- Platform Progress ---------- */
.platform-section {
  padding: var(--space-16) var(--space-5);
  background: var(--surface);
}
.platform-grid { max-width: var(--content-wide); margin: 0 auto; }

.platform-grid-cards {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-10) 28px;
  position: relative;
  overflow: hidden;
}

.platform-glow-1 {
  position: absolute; top: -80px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
  pointer-events: none;
}
.platform-glow-2 {
  position: absolute; bottom: -100px; right: -40px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(124,58,237,0.06), transparent 70%);
  pointer-events: none;
}
.platform-glow-3 {
  position: absolute; top: 50%; left: 50%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.04), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.platform-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.platform-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}
.platform-card:hover {
  border-color: var(--blue-300);
  box-shadow: 0 8px 25px rgba(37,99,235,0.1);
  transform: translateY(-3px);
}
.platform-card-highlight { box-shadow: 0 0 0 2px rgba(37,99,235,0.15); border-color: transparent; }
.platform-card-highlight:hover { border-color: var(--blue-300); }
.platform-card-coming { border-style: dashed; }

.platform-card-visual {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.platform-card-visual i { width: 34px; height: 34px; }

.platform-visual-blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: var(--blue-600); }
.platform-visual-green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: var(--green-600); }
.platform-visual-amber { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: var(--amber-600); }

.platform-card-body { padding: 14px 16px 16px; }
.platform-card-tags { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

.platform-status-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.badge-live { background: #dcfce7; color: #16a34a; }
.badge-new { background: #dbeafe; color: var(--blue-600); }
.badge-coming { background: #fef3c7; color: var(--amber-600); }
.badge-dev { background: #f1f5f9; color: var(--gray-500); }

.platform-card-version { font-size: 10px; color: var(--text-tertiary); }
.platform-card-name { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-1); }
.platform-card-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- Comparison ---------- */
.comparison-section {
  padding: var(--space-12) var(--space-6);
  background: var(--surface-secondary);
}
.comparison-container { max-width: 960px; margin: 0 auto; display: flex; gap: var(--space-5); }
.comparison-card { flex: 1; border-radius: var(--radius-lg); padding: var(--space-9) 28px; text-align: center; }
.comparison-card-past { background: linear-gradient(135deg, #1e3a5f, #0c1e38); color: white; }
.comparison-card-now { background: linear-gradient(135deg, var(--blue-50), var(--blue-100)); border: 1px solid #bfdbfe; color: var(--text-primary); }
.comparison-emoji { font-size: 36px; margin-bottom: var(--space-2); }
.comparison-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.comparison-label-past { color: #93c5fd; }
.comparison-label-now { color: var(--primary); }
.comparison-title { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-3); }
.comparison-title-past { color: #bfdbfe; }
.comparison-title-now { color: var(--blue-800); }
.comparison-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.comparison-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; font-size: 11px; }
.comparison-item-past { background: rgba(255,255,255,0.05); color: #bfdbfe; }
.comparison-item-now { background: rgba(37,99,235,0.06); color: var(--gray-700); }
.comparison-item-icon { font-size: 12px; flex-shrink: 0; }
.comparison-item-icon-past { color: var(--red-500); }
.comparison-item-icon-now { color: var(--green-500); }
.comparison-footer { margin-top: 14px; font-size: 11px; padding: 8px; border-top: 1px solid; }
.comparison-footer-past { color: var(--gray-500); border-color: rgba(255,255,255,0.2); }
.comparison-footer-now { color: #3b82f6; border-color: #bfdbfe; }

/* ---------- Stats ---------- */
.stats-section {
  background: linear-gradient(135deg, #f0f4fe, #e8f0fe);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stats-section::before {
  content: '';
  position: absolute; top: -50%; left: -30%;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(37,99,235,0.04), transparent 60%);
  pointer-events: none;
}
.stats-section::after {
  content: '';
  position: absolute; bottom: -40%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.03), transparent 55%);
  pointer-events: none;
}
.stats-grid { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); position: relative; z-index: 1; }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px var(--space-4); text-align: center; box-shadow: var(--shadow-xs); border: 1px solid rgba(37,99,235,0.04); transition: all var(--duration-normal) var(--ease-out); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 44px; height: 44px; background: var(--primary-gradient); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-3); color: white; }
.stat-icon i { width: 22px; height: 22px; }
.stat-number { font-size: 30px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-suffix { font-size: var(--text-base); font-weight: 600; color: var(--primary); }
.stat-label { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); }

/* ---------- Testimonials ---------- */
.testimonials-section { padding: var(--space-20) var(--space-8); text-align: center; overflow: hidden; }
.scroll-section { margin-top: var(--space-6); position: relative; }
.scroll-track { display: flex; gap: var(--space-4); width: fit-content; }
.scroll-track:hover, .scroll-track.paused { animation-play-state: paused; }
.row-scroll-1 { animation: scrollLeft 40s linear infinite; margin-bottom: var(--space-4); }
.row-scroll-2 { animation: scrollRight 40s linear infinite; margin-left: -8rem; }

@keyframes scrollLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scrollRight { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

.testimonial-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); min-width: 260px; max-width: 300px; text-align: left; flex-shrink: 0; transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.testimonial-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.testimonial-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.testimonial-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 600; font-size: var(--text-sm); flex-shrink: 0; }
.testimonial-name { font-weight: 600; font-size: var(--text-base); color: var(--text-primary); }
.testimonial-role { font-size: var(--text-sm); color: var(--text-tertiary); }
.testimonial-text { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; font-style: italic; }

/* ---------- CTA ---------- */
.cta-section { padding: var(--space-12) var(--space-6); background: var(--surface-secondary); text-align: center; }
.cta-card { background: var(--surface); border-radius: var(--radius-2xl); padding: 52px 48px; text-align: center; position: relative; overflow: hidden; max-width: var(--content-wide); margin: 0 auto; }
.cta-glow { position: absolute; pointer-events: none; border-radius: 50%; }
.cta-glow-1 { top: -50px; left: -30px; width: 280px; height: 280px; background: radial-gradient(circle at 30% 40%, rgba(59,130,246,0.08), transparent 70%); }
.cta-glow-2 { top: -20px; right: -10px; width: 180px; height: 180px; background: radial-gradient(circle at 70% 30%, rgba(37,99,235,0.06), transparent 70%); }
.cta-glow-3 { top: 50%; right: -50px; width: 220px; height: 220px; background: radial-gradient(circle at 60% 50%, rgba(59,130,246,0.05), transparent 70%); transform: translateY(-50%); }
.cta-glow-4 { bottom: -30px; left: -20px; width: 200px; height: 200px; background: radial-gradient(circle at 40% 60%, rgba(37,99,235,0.06), transparent 70%); }
.cta-content { position: relative; z-index: 1; }
.cta-icon-box { width: 56px; height: 56px; background: var(--primary-gradient); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); color: white; box-shadow: var(--shadow-primary-md); }
.cta-icon-box i { width: 26px; height: 26px; }
.cta-card h2 { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-2); color: var(--text-primary); }
.cta-card p { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-5); }
.cta-btn { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--primary-gradient); color: white; padding: 14px 36px; border-radius: var(--radius-md); font-weight: 700; font-size: var(--text-lg); text-decoration: none; box-shadow: var(--shadow-primary-md); transition: all var(--duration-fast) var(--ease-out); border: none; cursor: pointer; }
.cta-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-lg); }
.cta-btn:active { transform: translateY(0); }

/* ---------- Footer ---------- */
.footer { background: var(--surface-secondary); border-top: 1px solid var(--border); padding: var(--space-12) var(--space-8) var(--space-8); }
.footer-container { max-width: var(--content-max); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.4fr; gap: var(--space-8); margin-bottom: var(--space-10); }
.footer-col h4 { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-4); text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-2); transition: color var(--duration-fast); }
.footer-col a:hover { color: var(--primary); }
.footer-brand-col .footer-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: var(--text-lg); color: var(--text-primary); margin-bottom: var(--space-2); }
.footer-brand-col .footer-brand i { color: var(--primary); }
.footer-tagline { font-size: var(--text-sm); color: var(--text-tertiary); line-height: 1.6; max-width: 260px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: var(--space-5); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-tertiary); }
.footer-hr { border: none; border-top: 1px dashed var(--border); margin: var(--space-2) 0; }
.footer-sponsor { color: #ec4899; }
.footer-sponsor:hover { color: #db2777; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay.active,
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-9) var(--space-10) var(--space-10);
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--ease-spring);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}
.modal-close:hover { background: var(--gray-100); color: var(--text-primary); }
.modal-close i { width: 18px; height: 18px; }

.modal-header-icon { width: 52px; height: 52px; background: var(--primary-gradient); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.modal-header-icon i { width: 24px; height: 24px; }
.modal-header-text h2 { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); margin: 0 0 2px; }
.modal-header-text p { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.modal-header-row { display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-6); }

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--gray-700); margin-bottom: 0.35rem; }

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  background: var(--surface);
  color: var(--text-primary);
  box-sizing: border-box;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input-group {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.form-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-input-group .form-input { flex: 1; border: none; box-shadow: none; }
.form-input-group .form-input:focus { box-shadow: none; }
.form-input-suffix { padding: 0.7rem 0.9rem 0.7rem 0; font-size: var(--text-base); color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }

.tos-row { display: flex; align-items: flex-start; gap: var(--space-2); margin-bottom: 1.1rem; font-size: var(--text-sm); color: var(--text-secondary); }
.tos-row input[type="checkbox"] { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--primary); flex-shrink: 0; }
.tos-row label { color: var(--text-secondary); }
.tos-row a { color: var(--primary); text-decoration: none; font-weight: 500; }
.tos-row a:hover { text-decoration: underline; }

.error-msg { color: var(--red-500); font-size: var(--text-sm); padding: var(--space-2) var(--space-3); background: rgba(239, 68, 68, 0.08); border-radius: var(--radius-sm); margin-bottom: var(--space-3); display: none; }

.modal-footer-text { text-align: center; font-size: var(--text-sm); color: var(--text-secondary); margin-top: 1.35rem; }
.modal-footer-text a { color: var(--primary); text-decoration: none; font-weight: 600; cursor: pointer; }
.modal-footer-text a:hover { text-decoration: underline; }

/* ---------- Auth pages ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 600px 400px at 30% 20%, rgba(37,99,235,0.08), transparent 60%), var(--surface); }
.auth-card { background: var(--surface); padding: var(--space-10); border-radius: var(--radius-lg); width: 100%; max-width: 400px; border: 1px solid var(--border); }
.auth-card h1 { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-1); color: var(--text-primary); }
.auth-card h2 { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-6); font-weight: 400; }

/* ---------- Responsive Landing ---------- */
@media (max-width: 1023px) {
  .hero h1 { font-size: var(--text-4xl); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 767px) {
  .section-title { font-size: var(--text-2xl); }
  .section-subtitle { font-size: var(--text-base); }
  .nav-inner { padding: 0 var(--space-4); }
  .nav-links { gap: var(--space-3); }
  .nav-links a { font-size: var(--text-sm); }
  .nav-links .btn-primary { padding: 0.5rem 1rem; font-size: var(--text-sm); }
  .hero { min-height: 70vh; }
  .hero h1 { font-size: var(--text-3xl); }
  .hero p { font-size: var(--text-lg); }
  .hero-actions { flex-direction: column; align-items: center; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-badges { gap: var(--space-4); flex-direction: column; align-items: center; }
  .announcements-container { flex-direction: column; }
  .ann-illustration { min-height: 120px; }
  .ann-card { width: 100%; }
  .features-section { padding: var(--space-12) var(--space-4); }
  .features-grid { grid-template-columns: 1fr; }
  .platform-cards-grid { grid-template-columns: 1fr 1fr; }
  .testimonials-section { padding: var(--space-12) var(--space-4); }
  .testimonial-card { min-width: 220px; }
  .comparison-container { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .cta-card { padding: var(--space-9) var(--space-6); }
  .cta-card h2 { font-size: var(--text-xl); }
  .footer-grid { grid-template-columns: 1fr 1fr; text-align: left; gap: var(--space-6) var(--space-8); }
  .footer-brand-col { grid-column: 1 / -1; display: block; text-align: center; margin-bottom: var(--space-2); }
  .footer-brand-col .footer-brand { justify-content: center; }
  .footer-tagline { max-width: none; text-align: center; margin: 0 auto; }
  .modal { margin: var(--space-4); padding: var(--space-6); }
}
@media (max-width: 480px) {
  .hero h1 { font-size: var(--text-2xl); }
  .platform-cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .footer-brand-col { margin-bottom: var(--space-2); }
}

/* ========================================
   Dashboard & Admin
   ======================================== */

.navbar { background: rgba(255,255,255,0.9); backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid var(--border); height: 56px; position: sticky; top: 0; z-index: 1030; }
.navbar-brand { font-weight: 700; font-size: 1.15rem; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.navbar-brand i { -webkit-text-fill-color: var(--primary); }

.app-layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar { width: 230px; background: var(--surface-secondary); border-right: 1px solid var(--border); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: var(--space-4) 0.6rem; flex-shrink: 0; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .nav-section { font-size: 0.68rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; padding: 0.5rem 0.8rem 0.3rem; opacity: 0.6; }
.sidebar .nav-link { display: flex; align-items: center; gap: 8px; padding: 0.5rem 0.8rem; color: var(--text-secondary); border-radius: var(--radius-sm); font-size: var(--text-base); transition: all var(--duration-fast); position: relative; }
.sidebar .nav-link:hover { background: var(--primary-soft); color: var(--text-primary); }
.sidebar .nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: var(--primary); border-radius: 0 3px 3px 0; }

#mobileSidebar { position: fixed; top: 0; left: -290px; width: 270px; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); z-index: 1055; transition: left 0.3s var(--ease-in-out); overflow-y: auto; padding: 1.2rem 0.8rem; box-shadow: var(--shadow-lg); }
#mobileSidebar::-webkit-scrollbar { display: none; }
#mobileSidebar.open { left: 0; }
#sidebarOverlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1054; }
#sidebarOverlay.open { display: block; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all var(--duration-normal); }
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.card-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: var(--text-sm); }
.card-body { padding: var(--space-4); }

.app-layout .stat-card { border-left: 3px solid var(--primary); }
.app-layout .stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.app-layout .stat-card .stat-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.app-layout .stat-card .stat-change { font-size: 0.75rem; margin-top: 2px; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table-wrap th { padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-secondary); border-bottom: 2px solid var(--border); }
.table-wrap td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: var(--surface-secondary); }

.badge { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 500; padding: 0.2em 0.65em; border-radius: var(--radius-full); line-height: 1.4; }
.badge-success { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-danger { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-info { background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(37,99,235,0.2); }
.badge-secondary { background: var(--gray-100); color: var(--text-secondary); border: 1px solid var(--border); }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }

.btn { display: inline-flex; align-items: center; gap: 4px; padding: 0.5rem 1rem; font-size: var(--text-sm); font-weight: 500; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); cursor: pointer; transition: all var(--duration-fast); }
.btn:hover { border-color: var(--border-hover); box-shadow: var(--shadow-xs); }
.btn:active { transform: scale(0.97); }
.app-layout .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.app-layout .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.app-layout .btn-success { background: #10b981; color: #fff; border-color: #10b981; }
.app-layout .btn-success:hover { background: var(--green-600); }
.app-layout .btn-danger { background: var(--red-500); color: #fff; border-color: var(--red-500); }
.app-layout .btn-danger:hover { background: var(--red-600); }
.app-layout .btn-warning { background: var(--amber-500); color: #fff; border-color: var(--amber-500); }
.app-layout .btn-warning:hover { background: var(--amber-600); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
.btn-ghost { border: none; background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text-primary); box-shadow: none; }

.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm); transition: all var(--duration-fast); background: var(--surface); color: var(--text-primary); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-label { font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 0.3rem; display: block; }
.form-select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm); background: var(--surface); }

.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 1.25rem; }
.tab { padding: 0.55rem 1.2rem; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); cursor: pointer; border: none; background: transparent; position: relative; transition: all var(--duration-fast); }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); }
.tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 1px; }

.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { font-size: 0.75rem; padding: 0.3rem 0.8rem; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all var(--duration-fast); user-select: none; }
.filter-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.filter-chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 500; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--text-sm); color: var(--text-secondary); }
.pagination .pages { display: flex; gap: 2px; }
.pagination .page-btn { padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: var(--text-sm); min-width: 32px; text-align: center; }
.pagination .page-btn:hover { border-color: var(--border-hover); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.progress { background: var(--gray-100); border-radius: var(--radius-full); height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius-full); transition: width 0.6s var(--ease-in-out); }
.progress-blue { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-green { background: linear-gradient(90deg, #059669, #34d399); }
.progress-yellow { background: linear-gradient(90deg, #d97706, #fbbf24); }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }
.pulse-dot.running { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); animation: pulse 2s infinite; }
.pulse-dot.stopped { background: var(--text-tertiary); }
.pulse-dot.error { background: var(--red-500); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.port-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.3rem 0.6rem; font-family: var(--font-mono); font-size: var(--text-sm); }
.port-copy { cursor: pointer; opacity: 0.5; transition: opacity var(--duration-fast); }
.port-copy:hover { opacity: 1; color: var(--primary); }

.app-layout .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1050; animation: fadeIn 0.2s ease; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.toggle { width: 36px; height: 20px; background: #d1d5db; border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background 200ms; flex-shrink: 0; }
.toggle.active { background: var(--primary); }
.toggle::after { content: ''; width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 200ms; }
.toggle.active::after { transform: translateX(16px); }

.toast-container { position: fixed; top: 72px; right: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 1rem; box-shadow: var(--shadow-lg); animation: slideInRight 0.3s var(--ease-spring); display: flex; align-items: flex-start; gap: 10px; font-size: var(--text-sm); border-left: 3px solid var(--primary); }
.toast.removing { animation: slideOutRight 0.25s ease forwards; }
.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: var(--red-500); }
.toast-warning { border-left-color: var(--amber-500); }

.empty-state { text-align: center; padding: var(--space-12) var(--space-6); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.3; }

.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
.skeleton-text { height: 14px; margin-bottom: var(--space-2); }
.skeleton-text:last-child { width: 60%; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

@media (max-width: 1023px) { .sidebar { width: 200px; } .card-body { padding: 0.875rem; } }
@media (max-width: 767px) { .sidebar { display: none !important; } .main-content { padding: 0.875rem !important; } .table-wrap { font-size: var(--text-sm); } .btn { font-size: var(--text-sm); } .toast-container { top: auto; bottom: 16px; right: 12px; left: 12px; max-width: none; } .pagination { flex-direction: column; align-items: flex-start; } }
@media (min-width: 768px) { #mobileMenuBtn { display: none !important; } }
@media (max-width: 480px) { .filter-bar { gap: 4px; } .filter-chip { font-size: 0.7rem; padding: 0.2rem 0.6rem; } }

.d-flex { display: flex; } .ms-auto { margin-left: auto; } .align-items-center { align-items: center; } .justify-content-between { justify-content: space-between; } .text-decoration-none { text-decoration: none; } .flex-column { flex-direction: column; } .flex-grow-1 { flex-grow: 1; } .flex-shrink-0 { flex-shrink: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .fw-bold { font-weight: 700; } .fw-semibold { font-weight: 600; } .text-center { text-align: center; } .text-secondary { color: var(--text-secondary); } .small { font-size: 0.85em; }

.modal-overlay-global { position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.modal-box-global { background: var(--surface); border-radius: 14px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: modalIn 0.2s ease; }
.modal-header-global { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.modal-title-global { font-weight: 700; font-size: var(--text-base); margin: 0; }
.modal-body-global { padding: var(--space-5); max-height: 60vh; overflow-y: auto; }
.modal-footer-global { display: flex; justify-content: flex-end; gap: 8px; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: 4px; color: var(--text-primary); }
.modal-field input, .modal-field select, .modal-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm); background: var(--surface); color: var(--text-primary); box-sizing: border-box; }
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.modal-field textarea { min-height: 100px; resize: vertical; font-family: inherit; }

.node-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); background: var(--surface); transition: box-shadow var(--duration-fast); }
.node-card:hover { box-shadow: var(--shadow-md); }
.node-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-3); }
.node-card-name { font-weight: 600; font-size: var(--text-base); }
.node-card-ip { font-size: var(--text-xs); color: var(--text-secondary); }
.resource-bar { height: 6px; background: var(--gray-100); border-radius: var(--radius-full); margin: 4px 0 8px; overflow: hidden; }
.resource-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.6s var(--ease-in-out); }
.resource-row { display: flex; justify-content: space-between; font-size: var(--text-xs); }
.resource-label { color: var(--text-secondary); }
.resource-value { font-weight: 600; color: var(--text-primary); }
.node-card-footer { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-secondary); }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #cbd5e1; transition: 0.2s; border-radius: 24px; }
.slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; transition: 0.2s; border-radius: 50%; }
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.tpl-tab { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); border-radius: var(--radius-sm); padding: 0.45rem 0.75rem; font-size: var(--text-sm); cursor: pointer; transition: all var(--duration-fast); }
.tpl-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }
.tpl-tab.active { color: var(--primary); border-color: rgba(37, 99, 235, 0.4); background: var(--primary-soft); font-weight: 600; }

.var-group-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.var-group-header { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; background: var(--surface-secondary); }
.var-group-body { padding: 0; }
.var-item { padding: 7px 12px; border-bottom: 1px solid var(--divider); font-size: var(--text-sm); }
.var-item:last-child { border-bottom: none; }
.var-item code { color: var(--primary); font-size: var(--text-sm); }
.var-item .var-desc { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 1px; }
.period-chip { border: 1px solid var(--border); padding: 6px 14px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; transition: all var(--duration-fast); user-select: none; }
.period-chip:hover { border-color: var(--border-hover); }
.period-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }
