/* ═══════════════════════════════════════════════════════════════
   AI TRADING SAAS — DESIGN SYSTEM
   Premium dark-mode trading dashboard
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Core palette */
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #111827;
  --bg-card:       rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-glass:      rgba(15, 23, 42, 0.6);
  --bg-input:      rgba(30, 41, 59, 0.5);
  --bg-sidebar:    rgba(10, 14, 26, 0.95);

  /* Accents */
  --accent-blue:     #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-cyan:     #06b6d4;
  --accent-purple:   #8b5cf6;
  --accent-green:    #10b981;
  --accent-green-dim:rgba(16, 185, 129, 0.15);
  --accent-red:      #ef4444;
  --accent-red-dim:  rgba(239, 68, 68, 0.15);
  --accent-amber:    #f59e0b;
  --accent-amber-dim:rgba(245, 158, 11, 0.15);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-card:  linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.04) 100%);
  --gradient-glow:  radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.15) 0%, transparent 60%);
  --gradient-green: linear-gradient(135deg, #10b981, #059669);
  --gradient-red:   linear-gradient(135deg, #ef4444, #dc2626);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-dim:       #475569;

  /* Borders */
  --border-subtle:  rgba(148, 163, 184, 0.08);
  --border-default: rgba(148, 163, 184, 0.12);
  --border-active:  rgba(59, 130, 246, 0.4);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow:0 0 40px rgba(59,130,246,0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl:48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Fonts */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading:'Space Grotesk', 'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Background ambient glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6,182,212,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-blue); text-decoration: none; transition: color var(--duration-fast) var(--ease-smooth); }
a:hover { color: var(--accent-cyan); }

img { max-width: 100%; height: auto; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }
.text-amber { color: var(--accent-amber); }

/* ── Layout ──────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(20px);
  transition: transform var(--duration-slow) var(--ease-smooth);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(59,130,246,0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

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

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-smooth);
}

.user-pill:hover { background: rgba(255,255,255,0.04); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: white;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

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

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(10,14,26,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.page-content {
  padding: var(--space-xl);
  max-width: 1400px;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: all var(--duration-normal) var(--ease-smooth);
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-body { padding: var(--space-lg); }
.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.1);
}

/* Stat cards */
.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: var(--space-md);
}

.stat-icon.blue   { background: var(--accent-blue-dim);  color: var(--accent-blue);  }
.stat-icon.green  { background: var(--accent-green-dim); color: var(--accent-green); }
.stat-icon.red    { background: var(--accent-red-dim);   color: var(--accent-red);   }
.stat-icon.amber  { background: var(--accent-amber-dim); color: var(--accent-amber); }
.stat-icon.purple { background: rgba(139,92,246,0.15);   color: var(--accent-purple);}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }

/* ── Grid System ─────────────────────────────────────────────── */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--duration-fast) var(--ease-smooth);
}

.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}

.btn-primary:hover { box-shadow: 0 4px 20px rgba(59,130,246,0.4); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-success {
  background: var(--gradient-green);
  color: white;
  box-shadow: 0 2px 12px rgba(16,185,129,0.3);
}

.btn-danger {
  background: var(--gradient-red);
  color: white;
  box-shadow: 0 2px 12px rgba(239,68,68,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

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

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: all var(--duration-fast) var(--ease-smooth);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

.form-input::placeholder { color: var(--text-dim); }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.75rem;
  color: var(--accent-red);
  margin-top: var(--space-xs);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
}

.toggle input:checked + .toggle-slider::after {
  left: calc(100% - 19px);
  background: var(--accent-blue);
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-blue   { background: var(--accent-blue-dim);  color: var(--accent-blue);  }
.badge-green  { background: var(--accent-green-dim); color: var(--accent-green); }
.badge-red    { background: var(--accent-red-dim);   color: var(--accent-red);   }
.badge-amber  { background: var(--accent-amber-dim); color: var(--accent-amber); }
.badge-purple { background: rgba(139,92,246,0.15);   color: var(--accent-purple);}

/* ── Tables ──────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

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

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

tr:hover td { background: rgba(59,130,246,0.03); }
tr:last-child td { border-bottom: none; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--duration-normal) var(--ease-smooth);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: var(--space-lg); }

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 400px;
  animation: toast-slide-in 0.3s var(--ease-smooth);
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error   { border-left: 3px solid var(--accent-red);   }
.toast-warning { border-left: 3px solid var(--accent-amber); }
.toast-info    { border-left: 3px solid var(--accent-blue);  }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Loading States ──────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border-default);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(148,163,184,0.08) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* ── Status Indicators ───────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online  { background: var(--accent-green);  box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.status-dot.offline { background: var(--text-dim); }
.status-dot.warning { background: var(--accent-amber); box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.status-dot.error   { background: var(--accent-red);   box-shadow: 0 0 8px rgba(239,68,68,0.5);  }

.pulse {
  animation: pulse-anim 2s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── Position Card ───────────────────────────────────────────── */
.position-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.position-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.position-symbol {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
}

.position-pnl {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
}

.position-meta {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-md);
}

.position-meta-item {
  display: flex;
  flex-direction: column;
}

.position-meta-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.position-meta-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Exchange Logos ───────────────────────────────────────────── */
.exchange-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  z-index: 1;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-lg);
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.375rem;
  color: white;
}

.auth-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a { font-weight: 600; }

/* ── Landing Page ────────────────────────────────────────────── */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  z-index: 100;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--space-xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-blue);
  margin-bottom: var(--space-xl);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-2xl);
}

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

.hero-stats {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-subtle);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Features section */
.section {
  padding: 80px var(--space-xl);
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.section-header p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-lg);
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Pricing */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
}

.pricing-card.popular {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.pricing-card.popular::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

.pricing-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.pricing-price {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--space-lg);
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-xl);
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
}

/* Exchanges section */
.exchange-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.exchange-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  min-width: 160px;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.exchange-logo:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
}

.exchange-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.exchange-logo-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Strategy Card ───────────────────────────────────────────── */
.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.strategy-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.strategy-card.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(16,185,129,0.1);
}

.strategy-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.strategy-description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

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

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

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: var(--space-md);
  }

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

  .hero h1 { font-size: 2rem; }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .landing-nav {
    padding: 0 var(--space-md);
  }

  .topbar {
    padding: 0 var(--space-md);
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .modal {
    width: 95%;
    margin: var(--space-md);
  }

  .position-meta {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* ── Utility Animations ──────────────────────────────────────── */
.fade-in {
  animation: fade-in 0.5s var(--ease-smooth);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.slide-in-left {
  animation: slide-in-left 0.4s var(--ease-smooth);
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Chart Container ─────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

/* ── Tab Navigation ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: none;
  background: transparent;
}

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

.tab.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

/* ── Misc Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
