/* ============================================================================
   VAPIH INVESTMENTS — Design System
   Premium dark monitoring dashboard
   ============================================================================ */

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

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #060b18;
  --bg-secondary: #0c1225;
  --bg-tertiary: #111a33;
  --bg-card: rgba(13, 20, 42, 0.75);
  --bg-card-hover: rgba(20, 30, 60, 0.85);
  --bg-input: rgba(15, 22, 45, 0.9);
  --bg-sidebar: rgba(8, 12, 28, 0.92);
  --bg-overlay: rgba(4, 6, 14, 0.8);

  /* Borders */
  --border-subtle: rgba(99, 130, 255, 0.06);
  --border-default: rgba(99, 130, 255, 0.1);
  --border-active: rgba(99, 130, 255, 0.25);
  --border-accent: rgba(59, 130, 246, 0.4);

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-purple: #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.15);
  --accent-cyan: #06b6d4;
  --accent-cyan-dim: rgba(6, 182, 212, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.12);
  --accent-rose: #ef4444;
  --accent-rose-dim: rgba(239, 68, 68, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);
  --accent-gold: #fbbf24;

  /* Text */
  --text-primary: #e8edf5;
  --text-secondary: #8694b2;
  --text-tertiary: #4a5578;
  --text-inverse: #060b18;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
  --gradient-card: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(139, 92, 246, 0.03));
  --gradient-text: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.15);
  --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.15);

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ── 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: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes borderGlow {
  0%, 100% { border-color: rgba(59, 130, 246, 0.15); }
  50% { border-color: rgba(139, 92, 246, 0.3); }
}

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

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(0.9); }
  66% { transform: translate(25px, -35px) scale(1.1); }
}

/* ── Utility Classes ───────────────────────────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', monospace; }
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-profit { color: var(--accent-emerald); }
.text-loss { color: var(--accent-rose); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.animate-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ── Loading Skeleton ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, rgba(30, 40, 70, 0.6) 50%, var(--bg-tertiary) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 16px; width: 60%; margin-bottom: 8px; }
.skeleton-heading { height: 28px; width: 40%; margin-bottom: 12px; }
.skeleton-value { height: 36px; width: 50%; }

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
#login-view {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Background orbs */
.login-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}

.login-orb-1 {
  top: -15%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: rgba(59, 130, 246, 0.2);
  animation: orbFloat1 20s ease-in-out infinite;
}

.login-orb-2 {
  bottom: -15%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: rgba(139, 92, 246, 0.15);
  animation: orbFloat2 25s ease-in-out infinite;
}

.login-orb-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: rgba(6, 182, 212, 0.08);
  animation: orbFloat1 30s ease-in-out infinite reverse;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 10;
  animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 29px;
  background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(139,92,246,0.2), rgba(6,182,212,0.3));
  z-index: -1;
  opacity: 0.4;
  animation: borderGlow 6s ease-in-out infinite;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
  animation: float 6s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,0.15);
}

.login-logo svg {
  width: 36px;
  height: 36px;
  color: white;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* ── Form Elements ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-base);
  outline: none;
}

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

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

.form-input.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
  text-align: center;
}

.form-error {
  color: var(--accent-rose);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

.form-error.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn:hover::after {
  transform: translateX(100%);
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-active);
}

.btn-danger {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.login-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  color: var(--accent-blue);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
  background: none;
  border: none;
  font-family: inherit;
}

.login-link:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

.login-step { display: none; }
.login-step.active { display: block; animation: fadeIn 0.4s ease; }

.otp-info {
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.82rem;
  color: var(--accent-blue);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

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

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition-base);
  animation: slideInLeft 0.5s ease;
}

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

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.sidebar-logo svg {
  width: 22px;
  height: 22px;
  color: white;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  text-decoration: none;
  border: 1px solid transparent;
}

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

.nav-item.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
}

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

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

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

.user-role {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-logout {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  color: var(--accent-rose);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.12);
}

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

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 11, 24, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.65rem;
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-emerald);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-btn {
  padding: 0.45rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.refresh-btn svg {
  width: 14px;
  height: 14px;
}

.refresh-btn.refreshing svg {
  animation: spin 0.8s linear infinite;
}

.last-update {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Page Content ──────────────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.5rem 2rem 2rem;
}

/* ── Stats Grid ────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-base);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.blue { background: var(--accent-blue-dim); color: var(--accent-blue); }
.stat-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }
.stat-icon.cyan { background: var(--accent-cyan-dim); color: var(--accent-cyan); }
.stat-icon.emerald { background: var(--accent-emerald-dim); color: var(--accent-emerald); }
.stat-icon.amber { background: var(--accent-amber-dim); color: var(--accent-amber); }
.stat-icon.rose { background: var(--accent-rose-dim); color: var(--accent-rose); }

.stat-change {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.stat-change.positive {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.stat-change.negative {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
  animation: countUp 0.5s ease;
}

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

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

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

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.card-body {
  padding: 1.25rem;
}

.card-body.no-padding {
  padding: 0;
}

/* ── Data Table ────────────────────────────────────────────────────────────── */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Side Badge ────────────────────────────────────────────────────────────── */
.side-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.side-badge.long {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.side-badge.short {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.side-badge.buy {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.side-badge.sell {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

/* ── Chart Container ───────────────────────────────────────────────────────── */
.chart-container {
  margin-bottom: 1.5rem;
}

.chart-canvas {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-canvas svg {
  width: 100%;
  height: 100%;
}

.chart-period-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.chart-tab {
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
}

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

/* ── PnL Grid ──────────────────────────────────────────────────────────────── */
.pnl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.pnl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.pnl-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.pnl-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.pnl-percent {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.15rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Report Preview ────────────────────────────────────────────────────────── */
.report-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.7;
  max-height: 500px;
  overflow-y: auto;
}

.report-section {
  margin-bottom: 1rem;
}

.report-section-title {
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.report-row:last-child {
  border-bottom: none;
}

.report-label {
  color: var(--text-secondary);
}

.report-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.report-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.report-status {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ── Staff List ────────────────────────────────────────────────────────────── */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.staff-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-base);
}

.staff-card:hover {
  border-color: var(--border-default);
}

.staff-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

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

.staff-email {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-role-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.staff-role-badge.owner {
  background: var(--accent-amber-dim);
  color: var(--accent-gold);
}

.staff-role-badge.staff {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

.staff-status {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.staff-status.active {
  color: var(--accent-emerald);
}

.staff-status.pending {
  color: var(--accent-amber);
}

/* ── Add Staff Form ────────────────────────────────────────────────────────── */
.add-staff-form {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.add-staff-form .form-input {
  flex: 1;
}

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ── Toast / Notification ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.toast.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-rose);
}

.toast.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

.toast-fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ── Trade Timeline ────────────────────────────────────────────────────────── */
.trade-timeline {
  position: relative;
  padding-left: 24px;
}

.trade-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}

.trade-item {
  position: relative;
  padding: 1rem 0 1rem 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.trade-item:last-child {
  border-bottom: none;
}

.trade-dot {
  position: absolute;
  left: -20px;
  top: 1.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.trade-dot.buy { background: var(--accent-emerald); }
.trade-dot.sell { background: var(--accent-rose); }

.trade-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.35rem;
}

.trade-symbol {
  font-weight: 700;
  font-size: 0.95rem;
}

.trade-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

.trade-details {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
}

.trade-detail-item {
  display: flex;
  gap: 4px;
}

.trade-detail-label {
  color: var(--text-tertiary);
}

.trade-detail-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* ── Filter Bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-input {
  padding: 0.45rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-base);
  min-width: 200px;
}

.filter-input:focus {
  border-color: var(--accent-blue);
}

/* ── Mobile Responsive ─────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

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

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

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    z-index: 100;
    padding: 0.5rem;
    gap: 4px;
    justify-content: space-around;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.62rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: none;
    border: none;
    font-family: inherit;
  }

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

  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .page-content {
    padding: 1rem 1rem 5rem;
  }

  .page-header {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pnl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }
}

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge.active-badge {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

.no-data-row td {
  text-align: center;
  padding: 2rem !important;
  color: var(--text-tertiary);
  font-style: italic;
}
