/* ══════════════════════════════════════════════════════
   OBSIDIAN PULSE DESIGN SYSTEM
   SorosPrime Trading Bot
   ══════════════════════════════════════════════════════ */

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

/* ── CSS Variables ──────────────────────────────────── */
:root {
  /* Core Colors */
  --bg-deepest: #010308;
  --bg-deep: #050b18;
  --bg-surface: #0a1128;
  --bg-elevated: #121d3e;
  --bg-card: rgba(10, 17, 40, 0.55);
  
  /* Accent Colors */
  --emerald: #00f58a;
  --emerald-glow: rgba(0, 245, 138, 0.25);
  --emerald-dim: #009c58;
  --cyan: #00d2ff;
  --cyan-glow: rgba(0, 210, 255, 0.25);
  --cyan-dim: #0087a3;
  --red: #ff3366;
  --red-glow: rgba(255, 51, 102, 0.25);
  --amber: #ffd700;
  --amber-glow: rgba(255, 215, 0, 0.25);
  --purple: #8e2de2;
  --purple-glow: rgba(142, 45, 226, 0.25);
  
  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #475569;
  --text-bright: #ffffff;
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-active: rgba(0, 210, 255, 0.3);
  
  /* Glassmorphism */
  --glass-bg: rgba(10, 17, 40, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 24px;
  
  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 100px;
  
  /* Shadows */
  --shadow-glow-emerald: 0 0 20px rgba(0, 245, 138, 0.3);
  --shadow-glow-cyan: 0 0 20px rgba(0, 210, 255, 0.3);
  --shadow-glow-red: 0 0 20px rgba(255, 51, 102, 0.3);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-elevated: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}


/* ── Keyframe Animations ────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

/* ── Reset & Base ──────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deepest);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { color: var(--text-secondary); }

a {
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--emerald);
  text-shadow: 0 0 8px var(--emerald-glow);
}

/* ── Background Effects ─────────────────────────────── */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(ellipse 60% 50% at 50% -20%, rgba(0, 210, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 50%, rgba(0, 245, 138, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(142, 45, 226, 0.08) 0%, transparent 50%),
    var(--bg-deepest);
  animation: bgPulse 10s infinite alternate;
}

@keyframes bgPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ── Glass Cards ─────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

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

.glass-card-static {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #7ee8a0);
  color: var(--bg-deepest);
  box-shadow: 0 4px 16px rgba(164, 255, 185, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(164, 255, 185, 0.4);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #e05550);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 113, 104, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 113, 104, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), #00b8d4);
  color: var(--bg-deepest);
  box-shadow: 0 4px 16px rgba(0, 227, 253, 0.3);
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 227, 253, 0.4);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

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

/* ── Inputs ──────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
}

.input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

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

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-success {
  background: var(--emerald-glow);
  color: var(--emerald);
  border: 1px solid rgba(164, 255, 185, 0.2);
}

.badge-danger {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(255, 113, 104, 0.2);
}

.badge-info {
  background: var(--cyan-glow);
  color: var(--cyan);
  border: 1px solid rgba(0, 227, 253, 0.2);
}

.badge-warning {
  background: var(--amber-glow);
  color: var(--amber);
  border: 1px solid rgba(255, 200, 87, 0.2);
}

.badge-demo {
  background: var(--purple-glow);
  color: var(--purple);
  border: 1px solid rgba(177, 140, 254, 0.2);
}

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

.status-dot.online {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse-dot 2s infinite;
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.status-dot.connecting {
  background: var(--amber);
  animation: pulse-dot 1s infinite;
}

/* ── Navigation / Header ─────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(4, 9, 17, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-bright);
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.stat-value.positive { color: var(--emerald); }
.stat-value.negative { color: var(--red); }
.stat-value.neutral { color: var(--cyan); }

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── Trade History Table ─────────────────────────────── */
.trade-table {
  width: 100%;
  border-collapse: collapse;
}

.trade-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.trade-table td {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(136, 153, 184, 0.05);
  font-family: var(--font-mono);
}

.trade-table tr:hover {
  background: rgba(0, 227, 253, 0.03);
}

.trade-table .win { color: var(--emerald); }
.trade-table .loss { color: var(--red); }

/* ── Activity Log ────────────────────────────────────── */
.log-container {
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

.log-container::-webkit-scrollbar {
  width: 4px;
}

.log-container::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.log-entry {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-bottom: 1px solid rgba(136, 153, 184, 0.04);
  animation: fadeSlideIn 0.3s ease;
}

.log-time {
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-msg { flex: 1; word-break: break-word; }
.log-msg.info { color: var(--text-secondary); }
.log-msg.success { color: var(--emerald); }
.log-msg.warn { color: var(--amber); }
.log-msg.error { color: var(--red); }

/* ── Toggle Switch ───────────────────────────────────── */
.toggle-group {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.toggle-option {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-dim);
  border: none;
  background: none;
}

.toggle-option.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.toggle-option.demo.active {
  color: var(--purple);
}

.toggle-option.real.active {
  color: var(--emerald);
}

/* ── Toast Notifications ─────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  animation: slideInRight 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: var(--shadow-elevated);
}

.toast-success {
  background: rgba(164, 255, 185, 0.1);
  border: 1px solid rgba(164, 255, 185, 0.2);
  color: var(--emerald);
}

.toast-error {
  background: rgba(255, 113, 104, 0.1);
  border: 1px solid rgba(255, 113, 104, 0.2);
  color: var(--red);
}

.toast-info {
  background: rgba(0, 227, 253, 0.1);
  border: 1px solid rgba(0, 227, 253, 0.2);
  color: var(--cyan);
}

/* ── Loading / Spinner ───────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 20px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  animation: pulse 2s ease infinite;
}

/* ── Layout Utilities ────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  padding: 32px 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Animations ──────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

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

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

@keyframes fadeSlideIn {
  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 slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(164, 255, 185, 0.2); }
  50% { box-shadow: 0 0 40px rgba(164, 255, 185, 0.4); }
}

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

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

.animate-slide-up {
  animation: slideUp 0.6s ease both;
}

.animate-slide-up-delay-1 { animation-delay: 0.1s; }
.animate-slide-up-delay-2 { animation-delay: 0.2s; }
.animate-slide-up-delay-3 { animation-delay: 0.3s; }
.animate-slide-up-delay-4 { animation-delay: 0.4s; }

/* ── Hero Section ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 227, 253, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 4s ease infinite;
  pointer-events: none;
}

.hero h1 {
  background: linear-gradient(135deg, var(--text-bright), var(--cyan), var(--emerald));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Features Grid ───────────────────────────────────── */
.features-section {
  padding: 80px 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  padding: 32px;
  text-align: center;
}

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

.feature-icon.emerald { background: var(--emerald-glow); }
.feature-icon.cyan { background: var(--cyan-glow); }
.feature-icon.purple { background: var(--purple-glow); }
.feature-icon.amber { background: var(--amber-glow); }

.feature-card h3 {
  margin-bottom: 8px;
  color: var(--text-bright);
}

/* ── Login Page ──────────────────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 36px;
  text-align: center;
}

.login-card h2 {
  margin-bottom: 12px;
}

.login-card p {
  margin-bottom: 32px;
}

.deriv-btn {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  margin-bottom: 24px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Bot Selection ───────────────────────────────────── */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 40px auto;
}

.bot-card {
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.bot-card.featured {
  border-color: var(--emerald-dim);
  box-shadow: var(--shadow-glow-emerald);
}

.bot-card.featured::before {
  content: '★ RECOMENDADO';
  position: absolute;
  top: 16px;
  right: -32px;
  background: var(--emerald);
  color: var(--bg-deepest);
  padding: 4px 40px;
  font-size: 0.65rem;
  font-weight: 700;
  transform: rotate(45deg);
  letter-spacing: 0.1em;
}

.bot-card h3 {
  margin-bottom: 8px;
}

.bot-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}

.bot-param {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.bot-param-label { color: var(--text-dim); }
.bot-param-value { color: var(--cyan); font-family: var(--font-mono); }

/* ── Dashboard Layout ────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  padding: 24px;
  min-height: calc(100vh - 72px);
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ── Bot Controls ────────────────────────────────────── */
.bot-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* ── Virtual Trading Toggle Row ─────────────────────── */
.virtual-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.virtual-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.virtual-badge {
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.virtual-badge.demo {
  background: rgba(164, 255, 185, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(164, 255, 185, 0.25);
}

.virtual-badge.real {
  background: rgba(255, 113, 104, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 113, 104, 0.25);
}

/* ── Toggle Switch ───────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: 0.3s ease;
  border: 1px solid var(--border-subtle);
}

.slider.round { border-radius: 99px; }
.slider.round::before { border-radius: 50%; }

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s ease;
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  border-color: var(--emerald);
  box-shadow: 0 0 12px rgba(164, 255, 185, 0.3);
}

input:checked + .slider::before {
  transform: translateX(22px);
}

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Risk Management Section ─────────────────────────── */
.risk-section {
  margin-top: 16px;
}

.risk-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* ── TP/SL Grid & Cards ──────────────────────────────── */
.tpsl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tpsl-live {
  margin-top: 10px;
}

.tpsl-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  background: var(--bg-surface);
}

.tpsl-card.tp {
  border-color: rgba(164, 255, 185, 0.3);
  background: rgba(164, 255, 185, 0.04);
}

.tpsl-card.sl {
  border-color: rgba(255, 113, 104, 0.3);
  background: rgba(255, 113, 104, 0.04);
}

.tpsl-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.tpsl-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.tpsl-currency {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.tpsl-currency.tp { color: var(--emerald); }
.tpsl-currency.sl { color: var(--red); }

.tpsl-input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid !important;
  border-radius: 0 !important;
  padding: 2px 0 !important;
  font-weight: 700;
  font-size: 1rem;
}

.tpsl-input.tp {
  color: var(--emerald) !important;
  border-bottom-color: rgba(164, 255, 185, 0.4) !important;
}

.tpsl-input.sl {
  color: var(--red) !important;
  border-bottom-color: rgba(255, 113, 104, 0.4) !important;
}

.tpsl-input:focus {
  box-shadow: none !important;
  outline: none;
}

.tpsl-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

.tpsl-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.tpsl-value.tp { color: var(--emerald); }
.tpsl-value.sl { color: var(--red); }

/* ── Balance Display ─────────────────────────────────── */
.balance-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.balance-value.positive { color: var(--emerald); }
.balance-value.negative { color: var(--red); }
.balance-value.neutral  { color: var(--text-primary); }

/* ── Live Tick Display ───────────────────────────────── */
.tick-display {
  text-align: center;
  padding: 16px 0 8px;
}

.tick-price {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.tick-digit-row {
  font-size: 0.85rem;
  margin-top: 8px;
  color: var(--text-secondary);
}

.tick-last-digit {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.tick-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ── Virtual Loss Dots ───────────────────────────────── */
.virtual-loss-box {
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: 8px;
}

.virtual-loss-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.virtual-loss-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.loss-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.loss-dot.empty {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.loss-dot.filled {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  border: 1px solid var(--red);
}

.virtual-loss-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Account Info ─────────────────────────────────────── */
.account-info-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
  line-height: 1.8;
}

/* ── Log Panel ────────────────────────────────────────── */
.log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.log-clear-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
}

/* ── Real Account Confirmation Modal ─────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 9, 17, 0.8);
  backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-elevated);
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--amber);
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.modal-params {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-param {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal-param-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

.modal-param-val.tp { color: var(--emerald); }
.modal-param-val.sl { color: var(--red); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}


/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
  
  .bots-grid {
    grid-template-columns: 1fr;
  }
  
  .config-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard {
    padding: 16px;
    gap: 16px;
  }
  
  .panel {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .config-grid {
    grid-template-columns: 1fr;
  }
  
  .bot-params {
    grid-template-columns: 1fr;
  }
}

/* ── Text Color Utilities ───────────────────────────────── */
.text-green { color: var(--emerald) !important; }
.text-red   { color: var(--red)     !important; }
.text-cyan  { color: var(--cyan)    !important; }

/* ── Tick Flash Animation ───────────────────────────────── */
@keyframes tickFlash {
  0%   { opacity: 1; }
  20%  { opacity: 0.3; }
  100% { opacity: 1; }
}
.tick-flash { animation: tickFlash 0.3s ease-out; }

/* ── Bot Analysis Box (inside Live Tick panel) ──────────── */
.tick-analysis-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 227, 253, 0.04);
  border: 1px solid rgba(0, 227, 253, 0.12);
  border-radius: var(--radius-sm);
}

.tick-analysis-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}

.tick-analysis-row {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-family: var(--font-mono);
  transition: color 0.3s ease;
}

/* ── Virtual Trade Table Rows ───────────────────────────── */
.trade-row-virtual {
  opacity: 0.55;
  font-size: 0.76rem;
  background: transparent !important;
}

.trade-row-virtual td {
  border-bottom: 1px solid rgba(136, 153, 184, 0.06);
  padding: 5px 8px;
  font-style: italic;
}

.trade-row-win td { background: rgba(164, 255, 185, 0.04); }
.trade-row-loss td { background: rgba(255, 113, 104, 0.04); }

.cell-win     { color: var(--emerald); font-weight: 600; }
.cell-loss    { color: var(--red);     font-weight: 600; }
.cell-win-dim { color: #4a8a5a;        font-weight: 500; }
.cell-loss-dim{ color: #8a4a4a;        font-weight: 500; }
.cell-dim     { color: var(--text-dim); }
.cell-mono    { font-family: var(--font-mono); }

/* ── VL Filter badge ────────────────────────────────────── */
.virtual-badge.real {
  background: rgba(255, 113, 104, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 113, 104, 0.3);
}
