/* ============================================================================
   Quantum Sniper — Trading Hub v10.0 Luxury Institutional FinTech Edition
   Obsidian Slate Architecture • Cyan Sapphire • Champagne Gold • Tabular Precision
   ============================================================================ */

:root {
  --bg-primary: #050811;
  --bg-obsidian: #060A13;
  --card-bg: rgba(13, 20, 36, 0.88);
  --card-bg-solid: #0D1424;
  --card-elevated: rgba(17, 26, 46, 0.92);
  --card-border: rgba(148, 163, 184, 0.13);
  --card-border-accent: rgba(56, 189, 248, 0.28);
  --card-inner: rgba(8, 13, 25, 0.78);
  --card-row-dark: #070C17;
  --card-badge-row: #0B1222;

  --text-primary: #F8FAFC;
  --text-normal: #E2E8F0;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --cyan-primary: #38BDF8;
  --cyan-electric: #0EA5E9;
  --accent-blue: #3B82F6;
  --accent-blue-hover: #2563EB;
  --gold-primary: #D4AF37;
  --gold-light: #F7E7A9;

  --btn-start: #10B981;
  --btn-start-hover: #059669;
  --btn-panic: #EF4444;
  --btn-panic-hover: #DC2626;
  --btn-test: #F59E0B;
  --btn-test-hover: #D97706;
  --btn-retrain: #334155;
  --btn-retrain-hover: #475569;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --container-max: 1360px;
}

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

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.45;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  user-select: none;
  position: relative;
}

/* Layered Obsidian Architectural Background Texture (GPU Light, Zero Scroll Lag) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 55% at 12% -4%, rgba(14, 165, 233, 0.145), transparent 62%),
    radial-gradient(ellipse 60% 45% at 90% 4%, rgba(212, 175, 55, 0.075), transparent 58%),
    radial-gradient(ellipse 75% 50% at 50% 105%, rgba(37, 99, 235, 0.10), transparent 65%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  background-size: 44px 44px, 44px 44px, 160px 160px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.68) 65%, rgba(0,0,0,0.42) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.68) 65%, rgba(0,0,0,0.42) 100%);
}

/* Custom Luxury Dark Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 10, 19, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

#authenticatedAppView {
  display: none;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  padding-bottom: 36px;
}
#authenticatedAppView.authenticated {
  display: block;
  animation: qAppReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes qAppReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Numeric Tabular Discipline */
.risk-val,
.h-col-amount,
.h-breakdown-row strong,
.r-ind-val,
.chart-pair-price,
#modeMultiplierBadge,
.desktop-table td {
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   TIER 1: STICKY COMMAND HEADER (CLEAN SINGLE-ROW DESKTOP & COMPACT MOBILE)
   ========================================================================= */
.desktop-header {
  position: sticky;
  top: 0;
  z-index: 250;
  width: 100%;
  background: rgba(6, 10, 19, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(56, 189, 248, 0.08);
}

.desktop-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.desktop-header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}

.desktop-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}

.desktop-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-mobile {
  display: none;
}

.dt-pro-tag {
  color: var(--cyan-primary);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.desktop-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.mt5-status-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Status Pill Buttons */
.status-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.status-badge-btn.online {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.38);
  color: #34D399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.14);
}

.status-badge-btn.offline {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
  color: #FCA5A5;
}

/* Master Switch (SISTEMA ACTIVO) */
.master-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.master-switch-wrap:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(17, 28, 48, 0.95);
}

.master-switch-lbl {
  font-size: 11px;
  font-weight: 800;
  color: #E2E8F0;
  letter-spacing: 0.04em;
}

.autopilot-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(139, 92, 246, 0.09);
  border: 1px solid rgba(139, 92, 246, 0.32);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.autopilot-toggle-wrap:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.52);
}

.lbl-autopilot {
  font-size: 11.5px;
  font-weight: 700;
  color: #DDD6FE;
}

.daily-loss-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

/* Bulletproof Stadium Pill Switch (Zero Aspect Distortion) */
.ctk-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  min-width: 42px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 42px;
  cursor: pointer;
  vertical-align: middle;
}

.ctk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ctk-switch-slider {
  position: absolute;
  inset: 0;
  background: #1B253B;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
  transition: background-color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.ctk-switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: linear-gradient(145deg, #F8FAFC, #CBD5E1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.24s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.24s ease;
}

.ctk-switch input:checked + .ctk-switch-slider {
  background: linear-gradient(135deg, #059669, #10B981);
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.ctk-switch input:checked + .ctk-switch-slider::before {
  transform: translateX(20px);
  background: #FFFFFF;
}

.ctk-switch.switch-purple input:checked + .ctk-switch-slider {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  border-color: rgba(167, 139, 250, 0.75);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.ctk-switch.switch-red input:checked + .ctk-switch-slider {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.ctk-switch:hover .ctk-switch-slider {
  border-color: rgba(56, 189, 248, 0.55);
}

/* Header Action Buttons */
.btn-lang-header,
.btn-logout-top {
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-lang-header {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #E2E8F0;
}
.btn-lang-header:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #FFFFFF;
  background: rgba(30, 41, 59, 0.9);
}

.btn-logout-top {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30);
  color: #FCA5A5;
}
.btn-logout-top:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #FFFFFF;
}

/* =========================================================================
   TIER 2: TERMINAL UTILITY RIBBON (LICENSE CAPSULE & QUICK TOOLS)
   ========================================================================= */
.terminal-utility-bar {
  width: calc(100% - 40px);
  max-width: var(--container-max);
  margin: 12px auto 0;
  padding: 8px 12px;
  background: rgba(11, 17, 32, 0.78);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-token-box {
  display: inline-flex;
  align-items: center;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  padding: 5px 10px;
}

.header-token-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tok-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.header-token-box code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 6px;
  padding: 3px 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
}

.header-token-box code.token-masked {
  color: var(--text-dim);
  letter-spacing: 2px;
}

.header-token-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-tok-action {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #E2E8F0;
  border-radius: 6px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}
.btn-tok-action:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
  background: rgba(56, 189, 248, 0.15);
}

.utility-actions-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.btn-quick-guide-header,
.btn-guide-header,
.btn-download-top,
.btn-video-top,
.btn-diag-top,
.btn-network-top {
  height: 31px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-quick-guide-header {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(212, 175, 55, 0.42);
  color: var(--gold-light);
}
.btn-quick-guide-header:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.26), rgba(245, 158, 11, 0.2));
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.btn-guide-header {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #E2E8F0;
}
.btn-guide-header:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
}

.btn-download-top {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #7DD3FC;
}
.btn-download-top:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: var(--cyan-primary);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-apk-top {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.34);
  color: #6EE7B7;
}
.btn-apk-top:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10B981;
  color: #FFFFFF;
}

/* Hide APK download button inside native Android App WebView */
body.is-android-app .btn-apk-top {
  display: none !important;
}

.btn-video-top {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.34);
  color: #DDD6FE;
}
.btn-video-top:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: #A78BFA;
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* =========================================================================
   TOAST GLOBAL DE PRIVACIDAD & DYNAMIC ISLAND LOADER (ZERO HEADER OVERLAP)
   ========================================================================= */
.quantum-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(8, 13, 25, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #E2E8F0;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 18px rgba(16, 185, 129, 0.18);
  z-index: 1200;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.quantum-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.quantum-action-loader {
  position: fixed;
  top: auto;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.95);
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(7, 11, 22, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.78), 0 0 24px rgba(56, 189, 248, 0.24);
  color: #F8FAFC;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease;
}

.quantum-action-loader.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.quantum-action-loader.success {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(16, 185, 129, 0.28);
}

.quantum-action-loader.error {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(239, 68, 68, 0.28);
}

.qal-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38BDF8;
  border-radius: 50%;
  animation: qalSpin 0.68s linear infinite;
  flex-shrink: 0;
}

.quantum-action-loader.success .qal-spinner,
.quantum-action-loader.error .qal-spinner {
  display: none;
}

.qal-check-icon {
  display: none;
  color: #10B981;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}
.quantum-action-loader.success .qal-check-icon {
  display: inline-block;
}
.quantum-action-loader.error .qal-check-icon {
  display: inline-block;
  color: #EF4444;
}
.quantum-action-loader.error .qal-check-icon::before {
  content: "✕";
}
.quantum-action-loader.error .qal-check-icon {
  font-size: 0;
}
.quantum-action-loader.error .qal-check-icon::before {
  font-size: 13px;
}

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

/* =========================================================================
   BARRA DE 4 PESTAÑAS (FLOATING SEGMENTED COMMAND DOCK)
   ========================================================================= */
.desktop-tabview-nav {
  width: calc(100% - 40px);
  max-width: var(--container-max);
  margin: 12px auto 0;
  padding: 5px;
  background: rgba(9, 14, 27, 0.86);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.desktop-tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.desktop-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.035);
}

.desktop-tab-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.20), rgba(37, 99, 235, 0.26));
  border-color: rgba(56, 189, 248, 0.42);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* =========================================================================
   CONTENIDO PRINCIPAL & CONTENEDORES CENTRADOS
   ========================================================================= */
.desktop-tab-content {
  display: none;
  width: calc(100% - 40px);
  max-width: var(--container-max);
  margin: 14px auto 0;
}

.desktop-tab-content.active {
  display: block;
  animation: qTabEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ctrl-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Unified Luxury Obsidian Card */
.ctk-card,
.risk-card,
.action-card,
.console-card,
.table-luxury-card {
  background: linear-gradient(165deg, rgba(14, 22, 40, 0.88) 0%, rgba(8, 13, 25, 0.94) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

/* =========================================================================
   TARJETA 1: CEREBRO IA & MATRIZ DE 5 ALGORITMOS
   ========================================================================= */
.ai-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-title-lbl {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #E2E8F0;
}

.ai-provider-select {
  background: rgba(7, 11, 22, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #F8FAFC;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-provider-select:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.ai-subpanel {
  background: var(--card-inner);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ai-offline-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ai-status-item {
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-status-green { color: #34D399; }
.ai-status-cyan { color: #38BDF8; }

.btn-ctk-blue {
  background: linear-gradient(135deg, #0EA5E9, #2563EB);
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}
.btn-ctk-blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
}

.ai-nvidia-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ctk-entry {
  flex: 1 1 240px;
  background: #060A13;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #F8FAFC;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  outline: none;
}
.ctk-entry:focus {
  border-color: var(--cyan-primary);
}

.btn-ctk-sm {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #F8FAFC;
  background: rgba(30, 41, 59, 0.8);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-ctk-sm:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ctk-sm.btn-indigo { background: rgba(79, 70, 229, 0.24); border-color: rgba(129, 140, 248, 0.4); color: #C7D2FE; }
.btn-ctk-sm.btn-green { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.45); color: #6EE7B7; }
.btn-ctk-sm.btn-purple { background: rgba(139, 92, 246, 0.24); border-color: rgba(167, 139, 250, 0.45); color: #DDD6FE; }

/* 9-Card Responsive Bot Switch Matrix (Suite 2026) */
.bot-toggles-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.bot-badge-247 {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #34D399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-radius: 999px;
  vertical-align: middle;
}

.bot-toggle-item {
  background: rgba(7, 12, 24, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.bot-toggle-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
  background: rgba(11, 18, 34, 0.94);
}

.bot-toggle-item.is-active {
  border-color: rgba(16, 185, 129, 0.36);
  background: linear-gradient(170deg, rgba(16, 185, 129, 0.08) 0%, rgba(7, 12, 24, 0.92) 70%);
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.14);
}

.bot-toggle-item.is-inactive {
  opacity: 0.72;
  border-color: rgba(148, 163, 184, 0.1);
}

.bot-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.bot-toggle-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #F1F5F9;
  line-height: 1.25;
  min-width: 0;
}

.bot-card-footer {
  display: flex;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.bot-perm-badge {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   TARJETA 3: GESTIÓN DE RIESGO & COSECHA 50/50
   ========================================================================= */
.risk-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #E2E8F0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.risk-metrics-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.risk-metric-box {
  background: rgba(7, 12, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
  padding: 13px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.risk-metric-box.risk-metric-hero {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.14) 0%, rgba(212, 175, 55, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(167, 243, 208, 0.16);
}

.risk-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.risk-metric-hero .risk-lbl {
  color: #6EE7B7;
}

.risk-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
}
.risk-metric-hero .risk-val {
  font-size: 20px;
  color: #34D399;
}

/* MÓDULO COSECHA 50/50 */
.risk-harvest-panel {
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.harvest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.harvest-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.harvest-icon {
  font-size: 20px;
}

.harvest-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #F8FAFC;
}

.harvest-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.harvest-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  font-size: 11px;
  font-weight: 800;
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.harvest-body-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.harvest-col-card {
  background: rgba(12, 19, 35, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.h-col-title {
  font-size: 12px;
  font-weight: 700;
  color: #E2E8F0;
}

.h-col-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #34D399 0%, #F7E7A9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.harvest-breakdown-box {
  background: rgba(6, 10, 19, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.h-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.h-breakdown-row strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  flex-shrink: 0;
}

.h-breakdown-total {
  padding-top: 7px;
  margin-top: 2px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
  color: #E2E8F0;
}

.h-col-detail,
.h-col-recommendation {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.48;
}

.h-col-recommendation {
  background: rgba(212, 175, 55, 0.07);
  border-left: 3px solid rgba(212, 175, 55, 0.65);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  color: #FDE68A;
}

.btn-harvest-toggle {
  width: 100%;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.38);
  border-radius: 10px;
  color: #6EE7B7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: auto;
  transition: all 0.2s ease;
}
.btn-harvest-toggle:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10B981;
  color: #FFFFFF;
}

.risk-health-indicators {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.r-indicator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(6, 10, 19, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 9px;
  font-size: 11.5px;
}

.r-ind-label {
  color: var(--text-muted);
}

.r-ind-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #F8FAFC;
  text-align: right;
  white-space: nowrap;
}

.risk-advice-box {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #BAE6FD;
  margin-top: 12px !important;
}

/* SELECTOR DE MODO OPERATIVO */
.operating-mode-card {
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 16px;
}

.operating-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.operating-mode-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operating-mode-icon {
  font-size: 20px;
}

.operating-mode-title {
  font-size: 13px;
  font-weight: 800;
  color: #F8FAFC;
}

.operating-mode-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.mode-selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(5, 8, 17, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 5px;
}

.mode-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.mode-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}
.mode-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(37, 99, 235, 0.28));
  border-color: rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.16);
}

.mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: #10B981; }
.dot-amber { background: #F59E0B; }
.dot-fire { background: #F97316; }
.dot-purple { background: #A855F7; }
.dot-insane { background: #EF4444; }
.dot-cyan { background: #38BDF8; }

.mode-status-desc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(6, 10, 19, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.09);
  border-radius: 10px;
  font-size: 12px;
  color: #CBD5E1;
}

#modeMultiplierBadge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cyan-primary);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.custom-type-tab {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.custom-type-tab.active {
  background: rgba(6, 182, 212, 0.22);
  color: #67E8F9;
}

.btn-custom-chip,
.btn-custom-chip-lot {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #CBD5E1;
  padding: 5px 10px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-custom-chip:hover,
.btn-custom-chip-lot:hover {
  border-color: var(--cyan-primary);
  color: #FFFFFF;
}

.risk-circuit-breaker-card {
  background: rgba(7, 12, 24, 0.72) !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
  border-radius: 12px !important;
}

/* =========================================================================
   TARJETA 4: CENTRO DE ACCIONES (LUXURY SCULPTED CTAS)
   ========================================================================= */
.action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.btn-action-start,
.btn-action-test,
.btn-action-panic,
.btn-action-retrain {
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-action-start {
  height: 50px;
  padding: 0 20px;
  font-size: 13px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  border-color: rgba(52, 211, 153, 0.48);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-action-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-action-start.is-system-active {
  background: linear-gradient(135deg, #047857 0%, #059669 55%, #0D9488 100%);
  border-color: rgba(110, 231, 183, 0.55);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-action-panic {
  height: 50px;
  padding: 0 20px;
  font-size: 13px;
  color: #FEE2E2;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.92), rgba(220, 38, 38, 0.88));
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-action-panic:hover {
  transform: translateY(-2px);
  color: #FFFFFF;
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.35);
}

.btn-action-retrain {
  height: 44px;
  width: 100%;
  font-size: 12.5px;
  color: #E2E8F0;
  background: rgba(23, 33, 56, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-action-retrain:hover {
  background: rgba(30, 44, 74, 0.95);
  border-color: rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* =========================================================================
   TARJETA 5: CONSOLA EN TIEMPO REAL (TERMINAL ENCAPSULADA)
   ========================================================================= */
.console-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.console-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #CBD5E1;
}

.console-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-console-tool {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #CBD5E1;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.btn-console-tool:hover {
  border-color: var(--cyan-primary);
  color: #FFFFFF;
}

.console-box {
  background: #050912;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  height: 170px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.55);
}

.log-line {
  padding: 1.5px 0;
  color: #94A3B8;
  word-break: break-word;
}
.log-line.info { color: #93C5FD; }
.log-line.success { color: #34D399; }
.log-line.warn { color: #FBBF24; }
.log-line.error { color: #F87171; }

/* =========================================================================
   PESTAÑA 2: OPERACIONES & WIN RATE (LUXURY DATA TABLES)
   ========================================================================= */
.trades-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trades-sec-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 12px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trades-sec-title.blue { color: #60A5FA; }
.trades-sec-title.green { color: #34D399; }
.trades-sec-title.amber { color: #FBBF24; }

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 8, 17, 0.72);
  -webkit-overflow-scrolling: touch;
}

.desktop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.desktop-table th {
  background: rgba(15, 23, 42, 0.94);
  color: #94A3B8;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  white-space: nowrap;
}
.desktop-table th:first-child { text-align: left; }

.desktop-table td {
  padding: 10px 12px;
  text-align: center;
  color: #E2E8F0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  white-space: nowrap;
}
.desktop-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.desktop-table tbody tr:nth-child(odd) {
  background: rgba(13, 20, 36, 0.65);
}
.desktop-table tbody tr:nth-child(even) {
  background: rgba(9, 14, 27, 0.75);
}
.desktop-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.table-empty-row {
  text-align: center !important;
  color: var(--text-dim) !important;
  font-style: italic;
  padding: 22px 14px !important;
}

/* =========================================================================
   PESTAÑA 4: CHAT IA COPILOTO (BOUNDED LUXURY VIEWPORT HEIGHT)
   ========================================================================= */
.copilot-tab-container {
  background: linear-gradient(165deg, rgba(14, 22, 40, 0.90) 0%, rgba(8, 13, 25, 0.95) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  height: clamp(380px, calc(100vh - 340px), 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(7, 12, 24, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.copilot-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.copilot-h-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: 0.04em;
}

.copilot-mode-tag {
  font-size: 11px;
  font-weight: 700;
  color: #34D399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}

.copilot-feed {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 85%;
}
.chat-msg.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(37, 99, 235, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.msg-bubble {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #E2E8F0;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-msg.user-msg .msg-bubble {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(37, 99, 235, 0.28));
  border-color: rgba(56, 189, 248, 0.42);
  color: #FFFFFF;
}

.copilot-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(6, 10, 19, 0.65);
  flex-wrap: wrap;
  max-width: 100%;
}

.chip-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #CBD5E1;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip-btn:hover {
  border-color: var(--cyan-primary);
  color: #FFFFFF;
  background: rgba(56, 189, 248, 0.12);
}

.copilot-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(7, 12, 24, 0.92);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.copilot-input {
  flex: 1 1 auto;
  min-width: 0;
  background: #050811;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: #F8FAFC;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}
.copilot-input:focus {
  border-color: var(--cyan-primary);
}

.btn-copilot-send {
  background: linear-gradient(135deg, #0EA5E9, #2563EB);
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-copilot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}

/* =========================================================================
   PANTALLA DE LOGIN / ACTIVACIÓN (LUXURY OBSIDIAN GATEWAY)
   ========================================================================= */
#authGateView {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: max(24px, env(safe-area-inset-top, 24px)) 20px 28px;
  animation: qAppReveal 0.4s ease;
}

.desktop-login-card {
  width: 480px;
  max-width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-top-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.btn-auth-lang {
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #E2E8F0;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-header-wrap {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo-img {
  max-width: 260px;
  width: 82%;
  height: auto;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
  filter: drop-shadow(0 6px 26px rgba(56, 189, 248, 0.28));
}

.login-header-subtitle {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #94A3B8;
}

.login-neon-separator {
  width: 82%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.55), rgba(212, 175, 55, 0.45), transparent);
  margin: 14px 0 22px 0;
}

.login-form-card {
  background: linear-gradient(165deg, rgba(16, 25, 45, 0.92) 0%, rgba(8, 13, 25, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-xl);
  padding: 28px 26px;
  width: 100%;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(14, 165, 233, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.login-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #F8FAFC;
  margin-bottom: 8px;
}

.login-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.login-input-key {
  width: 100%;
  height: 50px;
  background: #060A13;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  color: #F8FAFC;
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 700;
  text-align: center;
  outline: none;
  margin-bottom: 16px;
  letter-spacing: 0.09em;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}
.login-input-key:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.btn-activate-license {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 55%, #1D4ED8 100%);
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: all 0.22s ease;
}
.btn-activate-license:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-status-msg {
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
  min-height: 18px;
}
.login-status-msg.error { color: #F87171; }
.login-status-msg.info { color: #38BDF8; }

.login-hwid-box {
  background: rgba(6, 10, 19, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 16px;
}

.login-footer-lbl {
  font-size: 10.5px;
  color: #475569;
  margin-top: 20px;
  text-align: center;
}

/* =========================================================================
   MODAL GUÍA OFICIAL DEL USUARIO QUANTUM (LUXURY FINTECH DESIGN)
   ========================================================================= */
.guide-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.luxury-guide-window {
  width: 960px;
  max-width: 96%;
  max-height: 90vh;
  background: #0B111E;
  border: 1px solid #1E2D4A;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.12);
  animation: guideModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes guideModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.guide-modal-header {
  padding: 16px 24px;
  background: #0E1728;
  border-bottom: 1px solid #1E293B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.guide-modal-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #F8FAFC;
}
.guide-lang-switch {
  display: inline-flex;
  align-items: center;
  background: #090E17;
  border: 1px solid #1E2D4A;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.btn-guide-lang {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-guide-lang:hover {
  color: #FFFFFF;
}
.btn-guide-lang.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}
.guide-close-btn {
  background: #1E293B;
  border: 1px solid #334155;
  color: #94A3B8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.guide-close-btn:hover {
  background: #EF4444;
  border-color: #DC2626;
  color: #FFFFFF;
}

.guide-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: #CBD5E1;
  font-size: 13px;
  line-height: 1.6;
}

/* Custom Sleek Scrollbar for Guide */
.guide-modal-body::-webkit-scrollbar {
  width: 6px;
}
.guide-modal-body::-webkit-scrollbar-track {
  background: #0B111E;
}
.guide-modal-body::-webkit-scrollbar-thumb {
  background: #1E2D4A;
  border-radius: 3px;
}
.guide-modal-body::-webkit-scrollbar-thumb:hover {
  background: #38BDF8;
}

/* Video Tutorial Banner */
.guide-video-banner {
  background: linear-gradient(135deg, rgba(14, 28, 54, 0.95) 0%, rgba(10, 18, 38, 0.98) 100%);
  border: 1px solid #1E3A8A;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(59, 130, 246, 0.1);
}
.guide-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.video-badge {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #EF4444;
  color: #FCA5A5;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.video-duration {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 700;
  background: #1E293B;
  padding: 3px 8px;
  border-radius: 6px;
}
.guide-video-title {
  font-size: 16px;
  font-weight: 800;
  color: #F8FAFC;
  margin-bottom: 6px;
}
.guide-video-desc {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 16px;
  line-height: 1.5;
}
.guide-video-frame-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1E3A8A;
  background: #000;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
}
.guide-video-frame-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.btn-yt-external {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1E293B;
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-yt-external:hover {
  background: #DC2626;
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Sections */
.guide-card-section {
  background: #101726;
  border: 1px solid #1E293B;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.guide-card-section:hover {
  border-color: #2D3E5F;
}
.guide-sec-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.guide-sec-h2 {
  font-size: 15px;
  font-weight: 800;
  color: #F8FAFC;
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.guide-lead-text {
  font-size: 13px;
  color: #E2E8F0;
  margin-bottom: 12px;
  line-height: 1.6;
}
.guide-body-text {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* Quote Box */
.guide-quote-box {
  display: flex;
  gap: 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #F59E0B;
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin: 14px 0;
}
.quote-icon {
  font-size: 20px;
  line-height: 1;
}
.quote-text {
  font-size: 12px;
  color: #FDE68A;
  line-height: 1.5;
}

/* Pillars Grid */
.guide-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 768px) {
  .guide-pillars-grid { grid-template-columns: 1fr; }
}
.pillar-card {
  background: #141E30;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.pillar-card:hover {
  transform: translateY(-2px);
  border-color: #38BDF8;
}
.pillar-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.pillar-title {
  font-size: 12px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 4px;
}
.pillar-desc {
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.4;
}

/* Flow Diagrams */
.guide-flow-diagram {
  background: #090E17;
  border: 1px solid #1A2436;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0 20px 0;
}
.diagram-root-node {
  background: #1E293B;
  border: 1px solid #334155;
  color: #60A5FA;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 8px;
  text-align: center;
  max-width: 260px;
  margin: 0 auto;
}
.diagram-connector-down {
  width: 2px;
  height: 16px;
  background: #334155;
  margin: 0 auto;
}
.diagram-branch-grid {
  display: grid;
  gap: 12px;
}
.flow-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.flow-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 768px) {
  .flow-grid-3, .flow-grid-5 { grid-template-columns: 1fr; }
}
.flow-node-card {
  background: #121A2B;
  border: 1px solid #1E2B42;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.node-title {
  font-size: 11px;
  font-weight: 800;
  color: #F8FAFC;
}
.node-sub {
  font-size: 10px;
  color: #38BDF8;
  margin-top: 2px;
}
.node-flow-arrow {
  color: #64748B;
  font-size: 11px;
  margin: 6px 0;
}
.node-flow-result {
  font-size: 10px;
  color: #94A3B8;
  background: #0A0F1A;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px dashed #1E293B;
}

/* Bots Grid */
.guide-bots-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-bot-card {
  background: #141E30;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 14px 16px;
}
.bot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.bot-name {
  font-size: 13px;
  font-weight: 800;
  color: #F8FAFC;
}
.bot-badge-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.bot-tag-cyan { background: rgba(56, 189, 248, 0.15); color: #38BDF8; border: 1px solid #38BDF8; }
.bot-tag-gold { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border: 1px solid #F59E0B; }
.bot-tag-blue { background: rgba(59, 130, 246, 0.15); color: #60A5FA; border: 1px solid #60A5FA; }

.bot-desc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.bot-desc-item {
  color: #CBD5E1;
  line-height: 1.4;
}

/* Callout Box */
.guide-callout-box {
  display: flex;
  gap: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.callout-icon { font-size: 20px; line-height: 1; }
.callout-content { font-size: 12px; color: #BAE6FD; line-height: 1.5; }

/* Risk Modes Grid */
.risk-modes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.risk-mode-card {
  border-radius: 10px;
  padding: 12px 16px;
  background: #141E30;
  border-left: 4px solid #334155;
}
.risk-mode-card.risk-green { border-left-color: #10B981; }
.risk-mode-card.risk-yellow { border-left-color: #F59E0B; background: rgba(245, 158, 11, 0.04); }
.risk-mode-card.risk-orange { border-left-color: #FB923C; }
.risk-mode-card.risk-red { border-left-color: #EF4444; }
.risk-mode-card.risk-purple { border-left-color: #A855F7; }

.risk-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.risk-title {
  font-size: 12px;
  font-weight: 800;
  color: #F8FAFC;
}
.risk-mult-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.risk-green .risk-mult-badge { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.risk-yellow .risk-mult-badge { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.risk-orange .risk-mult-badge { background: rgba(251, 146, 60, 0.2); color: #FB923C; }
.risk-red .risk-mult-badge { background: rgba(239, 68, 68, 0.2); color: #F87171; }
.risk-purple .risk-mult-badge { background: rgba(168, 85, 247, 0.2); color: #C084FC; }

.risk-for-who {
  font-size: 11px;
  color: #CBD5E1;
  margin-bottom: 4px;
}
.risk-behavior {
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.4;
}

/* Warning Card */
.guide-warn-card {
  display: flex;
  gap: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0 20px 0;
}
.warn-icon { font-size: 20px; line-height: 1; }
.warn-content { font-size: 11px; color: #FCA5A5; line-height: 1.5; }

/* Shields Grid */
.shields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 768px) {
  .shields-grid { grid-template-columns: 1fr; }
}
.shield-card {
  background: #0E1624;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 14px;
}
.shield-icon { font-size: 22px; margin-bottom: 6px; }
.shield-title { font-size: 12px; font-weight: 800; color: #38BDF8; margin-bottom: 6px; }
.shield-desc { font-size: 11px; color: #94A3B8; line-height: 1.45; }

/* Harvest Flow */
.harvest-flow-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0A0F1A;
  border: 1px solid #1E2B42;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0 20px 0;
  gap: 8px;
}
@media (max-width: 768px) {
  .harvest-flow-card { flex-direction: column; text-align: center; }
}
.harvest-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.h-step-badge {
  font-size: 9px;
  font-weight: 800;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.h-step-title {
  font-size: 11px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 2px;
}
.h-step-sub {
  font-size: 10px;
  color: #94A3B8;
}
.harvest-arrow {
  color: #10B981;
  font-size: 16px;
  font-weight: 800;
}
@media (max-width: 768px) {
  .harvest-arrow { transform: rotate(90deg); margin: 6px 0; }
}

/* Phases Grid */
.harvest-phases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 768px) {
  .harvest-phases-grid { grid-template-columns: 1fr; }
}
.phase-card {
  background: #141E30;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #1E2D4A;
}
.phase-card.phase-green { border-top: 4px solid #10B981; }
.phase-card.phase-blue { border-top: 4px solid #3B82F6; }
.phase-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.phase-title { font-size: 13px; font-weight: 800; color: #F8FAFC; }
.phase-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1E293B;
  color: #94A3B8;
}
.phase-desc { font-size: 12px; color: #CBD5E1; line-height: 1.5; margin-bottom: 10px; }
.phase-list {
  padding-left: 18px;
  margin: 0 0 10px 0;
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.6;
}
.phase-free-roll-box {
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed #10B981;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  color: #A7F3D0;
  line-height: 1.4;
}

/* Commandments */
.commandments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cmd-card {
  background: #141E30;
  border-left: 4px solid #EF4444;
  border-radius: 8px;
  padding: 12px 16px;
}
.cmd-title { font-size: 12px; font-weight: 800; color: #FCA5A5; margin-bottom: 4px; }
.cmd-body { font-size: 11px; color: #CBD5E1; line-height: 1.5; }
.cmd-exception {
  margin-top: 6px;
  font-size: 10px;
  color: #94A3B8;
  border-top: 1px dashed #1E293B;
  padding-top: 4px;
}

/* Routine Schedule */
.routine-schedule-card {
  background: #0E1624;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  overflow: hidden;
}
.routine-row {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid #1E293B;
  align-items: center;
  gap: 16px;
}
.routine-row:last-child { border-bottom: none; }
.routine-row.highlight-routine {
  background: rgba(16, 185, 129, 0.08);
}
.routine-time {
  width: 140px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #F8FAFC;
}
.routine-time small { color: #94A3B8; font-weight: 600; }
.routine-task {
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.45;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-card {
  background: #141E30;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 12px 16px;
}
.faq-q {
  font-size: 12px;
  font-weight: 800;
  color: #38BDF8;
  margin-bottom: 4px;
}
.faq-a {
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.5;
}

/* Official Footer */
.guide-official-footer {
  text-align: center;
  font-size: 11px;
  color: #64748B;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #1E293B;
}

/* Bottom Action */
.guide-modal-actions {
  padding: 14px 24px;
  background: #0E1728;
  border-top: 1px solid #1E293B;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.btn-guide-close-bottom {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}
.btn-guide-close-bottom:hover {
  background: #1E40AF;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

/* Modal Token Cambio */
.hub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.hub-modal-card {
  background: #161F30;
  border: 1px solid #22314E;
  border-radius: 14px;
  padding: 24px;
  max-width: 460px;
  width: 90%;
}

/* View State Management */
#authenticatedAppView {
  display: none;
}
#authenticatedAppView.authenticated {
  display: block;
}

/* =========================================================================
   CENTRO DE DIAGNÓSTICO & DEBUG CUÁNTICO (ESTILOS FINTECH PROFESIONALES)
   ========================================================================= */

/* Botón Diagnóstico en Header */
.btn-diag-top {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #c7d2fe;
  border: 1px solid #4338ca;
  border-radius: 15px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-diag-top:hover {
  background: #3730a3;
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Header de la consola con herramientas */
.console-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}
.console-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-console-tool {
  background: #1E293B;
  color: #94A3B8;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-console-tool:hover {
  background: #334155;
  color: #F8FAFC;
  border-color: #64748B;
}
.debug-toggle-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #818CF8;
  cursor: pointer;
}
.debug-toggle-lbl input {
  accent-color: #6366F1;
  cursor: pointer;
}

/* Modal de Diagnóstico */
.diag-modal-card {
  max-width: 720px;
  width: 95%;
  max-height: 88vh;
  overflow-y: auto;
  background: #101726;
  border: 1px solid #283548;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
}
.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid #1E293B;
  padding-bottom: 10px;
}
.diag-close-btn {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.diag-close-btn:hover {
  color: #FFFFFF;
}

/* Banner de Estado Global */
.diag-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.banner-pending {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid #475569;
  color: #CBD5E1;
}
.banner-pass {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #34D399;
}
.banner-warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #F59E0B;
  color: #FBBF24;
}
.banner-fail {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #F87171;
}

/* Grid de Chequeos */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.diag-item {
  background: #162032;
  border: 1px solid #23324A;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s ease;
}
.diag-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.diag-item-title {
  font-size: 11px;
  font-weight: 700;
  color: #F1F5F9;
}
.diag-item-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.badge-pending {
  background: #334155;
  color: #94A3B8;
}
.badge-pass {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
}
.badge-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid #F59E0B;
}
.badge-fail {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border: 1px solid #EF4444;
}
.diag-item-desc {
  font-size: 10px;
  color: #94A3B8;
  line-height: 1.4;
}

/* Detalle Técnico */
.diag-details-wrap {
  margin-bottom: 14px;
}
.diag-details-title {
  font-size: 10px;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 4px;
}
.diag-details-box {
  background: #090E17;
  border: 1px solid #1A2436;
  border-radius: 6px;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #A5B4FC;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Acciones del Modal */
.diag-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-diag-action {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-diag-run {
  background: #4F46E5;
  color: #FFFFFF;
}
.btn-diag-run:hover {
  background: #4338CA;
}
.btn-diag-copy {
  background: #1E293B;
  color: #CBD5E1;
  border: 1px solid #334155;
}
.btn-diag-copy:hover {
  background: #334155;
  color: #FFFFFF;
}
.btn-diag-close {
  background: transparent;
  color: #94A3B8;
  border: 1px solid #334155;
}
.btn-diag-close:hover {
  background: #1E293B;
  color: #FFFFFF;
}

/* =========================================================================
   MONITOR DE COMUNICACIONES EN VIVO (WEB ⇄ API ⇄ VPS)
   ========================================================================= */

/* Botón Tráfico en Header */
.btn-network-top {
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
  color: #bae6fd;
  border: 1px solid #0284c7;
  border-radius: 15px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-network-top:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Modal de Tráfico Ancho */
.traffic-modal-card {
  max-width: 960px;
  width: 96%;
  max-height: 90vh;
  overflow-y: auto;
  background: #0B111E;
  border: 1px solid #1E2D4A;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(14, 165, 233, 0.15);
}

/* Barra de Píldoras de Enlaces */
.traffic-status-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.traffic-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.pill-green {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid #059669;
  color: #6EE7B7;
}
.pill-green .pill-dot { background: #10B981; }
.pill-cyan {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid #0284c7;
  color: #7DD3FC;
}
.pill-cyan .pill-dot { background: #38BDF8; }
.pill-purple {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid #7c3aed;
  color: #C4B5FD;
}
.pill-purple .pill-dot { background: #8B5CF6; }

/* Barra de Controles y Filtros */
.traffic-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
  background: #111827;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #1F2937;
}
.traffic-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.traffic-filter-btn {
  background: #1F2937;
  color: #9CA3AF;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.traffic-filter-btn.active, .traffic-filter-btn:hover {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #38BDF8;
}

/* Tabla de Tráfico */
.traffic-table-wrap {
  overflow-x: auto;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #1E293B;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #090E17;
}
.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.traffic-table th {
  background: #0F172A;
  color: #94A3B8;
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #1E293B;
}
.traffic-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #161F30;
}
.traffic-row-selected {
  background: rgba(14, 165, 233, 0.15) !important;
}

/* Inspector de Payload */
.traffic-inspector-wrap {
  background: #0D1524;
  border: 1px solid #1E2E4A;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.traffic-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* =========================================================================
   SISTEMA RESPONSIVE LUXURY ARCHITECTURE (DESKTOP / TABLET / MOBILE)
   Zero Header Bloat • Symmetry Enforced • Zero Horizontal Overflow
   ========================================================================= */

@media (max-width: 1180px) {
  .desktop-subtitle {
    display: none;
  }
  .bot-toggles-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .risk-metrics-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .desktop-header-inner {
    padding: 8px 14px;
    gap: 10px;
  }
  .bot-toggles-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .harvest-body-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  /* Auth Gate Mobile */
  #authGateView {
    padding: max(20px, env(safe-area-inset-top, 20px)) 14px 24px;
  }
  .login-logo-img {
    max-width: 220px;
  }
  .login-form-card {
    padding: 22px 18px;
  }

  /* Slim 2-Row Mobile Command Grid (< 86px total height, ZERO clipped badges) */
  .desktop-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    gap: 7px 6px;
  }

  .desktop-header-left,
  .desktop-header-right {
    display: contents;
  }

  .desktop-title-wrap {
    grid-row: 1;
    grid-column: 1 / 2;
    gap: 7px;
    min-width: 0;
  }

  .header-logo-icon {
    width: 22px;
    height: 22px;
  }

  .desktop-title {
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  .dt-full {
    display: none;
  }

  .dt-mobile {
    display: inline;
  }

  .desktop-subtitle {
    display: none;
  }

  #btnLangToggle {
    grid-row: 1;
    grid-column: 2 / 3;
    justify-self: end;
  }

  #btnHubLogout {
    grid-row: 1;
    grid-column: 3 / 4;
    justify-self: end;
  }

  .mt5-status-wrapper {
    grid-row: 2;
    grid-column: 1 / 2;
    min-width: 0;
    justify-self: start;
    max-width: 100%;
  }

  .status-badge-btn {
    height: 29px;
    padding: 0 10px;
    font-size: 10.5px;
    justify-content: flex-start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .master-switch-wrap {
    grid-row: 2;
    grid-column: 2 / 4;
    justify-self: end;
    height: 29px;
    padding: 0 9px;
    gap: 6px;
    flex: 0 0 auto;
  }

  .master-switch-lbl {
    font-size: 10px;
  }

  .btn-lang-header,
  .btn-logout-top {
    height: 27px;
    padding: 0 8px;
    font-size: 10px;
    gap: 4px;
    flex: 0 0 auto;
  }

  /* Action Loader docks at thumb reach at bottom-center with zero obstruction */
  .quantum-action-loader {
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
    padding: 8px 16px;
    font-size: 12px;
  }

  /* Utility Bar Mobile */
  .terminal-utility-bar {
    width: calc(100% - 24px);
    margin: 10px auto 0;
    padding: 10px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .header-token-box {
    width: 100%;
    justify-content: space-between;
    padding: 7px 10px;
  }

  .header-token-top {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .header-token-box code {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.4px;
    padding: 4px 6px;
  }

  .header-token-box code.token-masked {
    letter-spacing: 0.6px;
  }

  .utility-actions-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .btn-quick-guide-header,
  .btn-guide-header,
  .btn-download-top,
  .btn-video-top {
    width: 100%;
    justify-content: center;
    height: 34px;
    font-size: 11px;
    padding: 0 8px;
  }

  .btn-video-top {
    grid-column: 1 / -1;
  }

  /* Tab Dock Mobile */
  .desktop-tabview-nav {
    width: calc(100% - 24px);
    margin: 10px auto 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .desktop-tab-btn {
    padding: 9px 8px;
    font-size: 11.5px;
  }

  .desktop-tab-content {
    width: calc(100% - 24px);
    margin: 10px auto 0;
  }

  .ctk-card,
  .risk-card,
  .action-card,
  .console-card,
  .table-luxury-card {
    padding: 14px;
    border-radius: 14px;
  }

  .ai-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .ai-header-left {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .ai-provider-select {
    width: 100%;
  }

  .autopilot-toggle-wrap {
    justify-content: space-between;
    width: 100%;
    padding: 7px 12px;
  }

  .ai-offline-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .btn-ctk-blue {
    width: 100%;
  }

  /* Bot Matrix Single-Column Tactile Cards */
  .bot-toggles-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bot-toggle-item {
    padding: 11px 12px;
    gap: 8px;
  }

  /* Balanced Mobile Hero KPI + 2x2 Grid (Zero Orphan Cell) */
  .risk-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .risk-metric-box {
    padding: 11px 10px;
  }

  .risk-metric-box.risk-metric-hero {
    grid-column: 1 / -1;
    order: -1;
  }

  .risk-val {
    font-size: 16px;
  }

  .risk-harvest-panel {
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .harvest-col-card {
    padding: 12px;
    min-width: 0;
    max-width: 100%;
  }

  .h-col-amount {
    font-size: 22px;
  }

  .h-breakdown-row {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .r-indicator-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .r-ind-val {
    white-space: normal;
    text-align: left;
    word-break: break-word;
    font-size: 11px;
  }

  /* Balanced 2x3 Mode Selector Grid on Mobile */
  .operating-mode-card {
    padding: 12px;
  }

  .operating-mode-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mode-selector-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
  }

  .mode-btn {
    justify-content: center;
    padding: 8px 6px;
    font-size: 11px;
  }

  /* Action Grid Mobile */
  .action-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .btn-action-start,
  .btn-action-panic {
    height: 46px;
    font-size: 12px;
  }

  .btn-action-retrain {
    height: 42px;
    font-size: 12px;
  }

  .console-box {
    height: 150px;
    font-size: 10.5px;
  }

  /* Trades Tables Mobile */
  .desktop-table {
    min-width: 540px;
    font-size: 11px;
  }
  .desktop-table th,
  .desktop-table td {
    padding: 8px 8px;
  }

  /* Chat Copiloto Mobile */
  .copilot-tab-container {
    height: clamp(440px, calc(100vh - 235px), 580px);
  }

  .copilot-header {
    flex-direction: column;
    align-items: stretch;
    padding: 11px 12px;
    gap: 8px;
  }

  .copilot-header > div:last-child {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .copilot-header > div:last-child .btn-ctk-sm {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .copilot-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 12px;
    gap: 6px;
  }
  .copilot-chips-row::-webkit-scrollbar {
    display: none;
  }

  .chip-btn {
    flex: 0 0 auto;
    font-size: 11px;
    padding: 5px 10px;
  }

  .copilot-input-bar {
    padding: 10px 12px;
    gap: 8px;
  }

  .diag-modal-card,
  .traffic-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    padding: 12px !important;
  }
}

@media (max-width: 420px) {
  .desktop-title {
    font-size: 11.5px;
    letter-spacing: 0.03em;
  }
  .utility-actions-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .btn-tok-text {
    display: none;
  }
}

/* ==========================================================================
   HISTORIAL COMPLETO DE OPERACIONES: PAGINACIÓN, BÚSQUEDA Y FILTROS
   ========================================================================== */
.trades-sec-title-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-record-count {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FBBF24;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
}

.history-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-filter-select,
.history-search-input {
  background: #0B0F19;
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  outline: none;
  transition: all 0.2s ease-in-out;
}

.history-search-input {
  width: 170px;
}

.history-filter-select:focus,
.history-search-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.table-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #1E293B;
  border-radius: 6px;
  font-size: 11.5px;
  color: #94A3B8;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
}

.pagination-info strong {
  color: #F8FAFC;
  font-family: var(--font-mono);
  font-weight: 700;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-select {
  background: #0B0F19;
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pg-num-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pg-btn {
  background: #1E293B;
  border: 1px solid #334155;
  color: #E2E8F0;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
}

.pg-btn:hover:not(:disabled) {
  background: #2563EB;
  border-color: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.pg-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #0F172A;
  border-color: #1E293B;
  color: #64748B;
}

.pg-btn.active {
  background: #3B82F6;
  border-color: #60A5FA;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.pg-ellipsis {
  padding: 0 4px;
  color: #64748B;
  font-size: 11px;
  user-select: none;
}

@media (max-width: 768px) {
  .trades-sec-title-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-toolbar {
    width: 100%;
  }
  .history-search-input {
    flex: 1;
    width: auto;
  }
  .table-pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .pagination-controls {
    justify-content: space-between;
  }
}

/* =========================================================================
   PESTAÑA 3: GRÁFICOS INTERACTIVOS EN VIVO (LUXURY OBSIDIAN VIEWPORTS)
   ========================================================================= */
.live-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  width: 100%;
}

@media (max-width: 1180px) {
  .live-charts-grid {
    grid-template-columns: 1fr;
  }
}

.single-chart-card {
  background: linear-gradient(165deg, rgba(14, 22, 40, 0.90) 0%, rgba(7, 11, 22, 0.96) 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.single-chart-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
}

.chart-card-header {
  padding: 12px 16px;
  background: rgba(11, 17, 32, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-header-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chart-pair-title {
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.chart-tf-pill {
  background: rgba(255, 255, 255, 0.07);
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.chart-header-badge {
  display: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.18);
}

.chart-header-badge.visible {
  display: inline-flex;
  align-items: center;
}

.chart-header-badge.negative {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.18);
}

.chart-pair-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: #F59E0B;
  letter-spacing: 0.04em;
}

.chart-header-row2 {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quantum-chart-wrapper {
  width: 100%;
  height: clamp(360px, 50vh, 480px);
  position: relative;
  background: #060A13;
}

@media (max-width: 768px) {
  .quantum-chart-wrapper {
    height: 320px;
  }
}

/* =========================================================================
   SISTEMA DE NOTIFICACIONES DE ALTA DOPAMINA (LUXURY GREEN & GOLD)
   ========================================================================= */
.dopamine-win-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 999999;
  width: 92%;
  max-width: 440px;
  background: linear-gradient(135deg, rgba(8, 14, 24, 0.98) 0%, rgba(13, 31, 23, 0.98) 50%, rgba(28, 22, 9, 0.98) 100%);
  border: 2px solid #00FF87;
  border-radius: 18px;
  box-shadow: 0 0 35px rgba(0, 255, 135, 0.45), 0 0 70px rgba(245, 158, 11, 0.25), inset 0 0 20px rgba(0, 255, 135, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

.dopamine-win-container.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dopamine-win-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dopamine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, rgba(0, 255, 135, 0.2), rgba(255, 215, 0, 0.2));
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  animation: dopamineBadgeGlow 2s infinite alternate;
}

@keyframes dopamineBadgeGlow {
  0% { box-shadow: 0 0 8px rgba(0, 255, 135, 0.4); border-color: rgba(0, 255, 135, 0.6); }
  100% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.7); border-color: rgba(255, 215, 0, 0.9); }
}

.dopamine-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94A3B8;
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dopamine-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

.dopamine-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 10px 0;
}

.dopamine-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35) 0%, rgba(0, 255, 135, 0.15) 100%);
  border: 1.5px solid #FFD700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
  animation: dopamineCoinBounce 1.2s infinite ease-in-out;
}

@keyframes dopamineCoinBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.06); }
}

.dopamine-text-wrap {
  flex: 1;
  min-width: 0;
}

.dopamine-profit-val {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, #00FF87 0%, #70FFAF 30%, #FFD700 70%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(0, 255, 135, 0.6));
}

.dopamine-subtext {
  font-size: 11.5px;
  color: #CBD5E1;
  margin-top: 3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dopamine-subtext strong {
  color: #00FF87;
}

.dopamine-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.dopamine-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00FF87, #FFD700);
  width: 100%;
  box-shadow: 0 0 10px #00FF87;
  transition: width linear;
}

/* Partículas de monedas de oro y destellos esmeralda */
.dopamine-particle {
  position: fixed;
  pointer-events: none;
  z-index: 1000000;
  font-size: 22px;
  animation: dopamineParticleFly 1.8s ease-out forwards;
}

@keyframes dopamineParticleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6) rotate(0deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.3) rotate(var(--rot));
  }
}

/* =========================================================================
   SOPORTE NATIVO APPLE iOS (IPHONE / IPAD / DYNAMIC ISLAND / NOTCH)
   ========================================================================= */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .desktop-header-inner {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
}

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

.btn-ios-header:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px);
}

/* =========================================================================
   BANNER PUBLICITARIO INTELIGENTE: MIGRACIÓN A SERVIDOR CLOUD 24/7
   ========================================================================= */
.qs-vps-ad-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(20, 30, 50, 0.92) 50%, rgba(11, 16, 29, 0.98) 100%);
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 14px;
  margin: 10px 14px 6px;
  padding: 12px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 22px rgba(0, 212, 255, 0.15), 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.3s ease;
}
.qs-vps-ad-glow {
  position: absolute;
  top: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.22) 0%, transparent 70%);
  pointer-events: none;
}
.qs-vps-ad-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.qs-vps-ad-content {
  flex: 1;
  min-width: 0;
}
.qs-vps-ad-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.qs-vps-ad-badge {
  font-size: 10px;
  font-weight: 800;
  background: #EF4444;
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  transition: all 0.3s ease;
}
.qs-vps-ad-cloud-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 0.3px;
}
.qs-vps-ad-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.qs-vps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}
.qs-vps-dot:hover {
  background: rgba(0, 212, 255, 0.6);
}
.qs-vps-dot.active {
  background: #00D4FF;
  width: 18px;
  border-radius: 4px;
  box-shadow: 0 0 8px #00D4FF;
}
.qs-vps-ad-headline {
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 4px;
  line-height: 1.35;
  transition: opacity 0.25s ease;
}
.qs-vps-ad-benefit {
  font-size: 11.5px;
  color: #94A3B8;
  margin: 0;
  line-height: 1.42;
  transition: opacity 0.25s ease;
}
.qs-vps-ad-benefit strong {
  color: #FACC15;
}
.qs-vps-ad-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.qs-vps-ad-nav-arrows {
  display: flex;
  gap: 4px;
}
.qs-vps-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94A3B8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.qs-vps-nav-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  color: #00D4FF;
  border-color: #00D4FF;
}
.qs-vps-cta-btn {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #6d28d9 100%);
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 8px;
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}
.qs-vps-cta-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #7c3aed 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

/* Barra Activa (Verde Ultra-Tecnológica) */
.qs-vps-active-bar {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.22) 100%);
  border: 1px solid rgba(16, 185, 129, 0.38);
  border-radius: 10px;
  margin: 8px 14px 6px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: #34D399;
  min-height: 42px;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.qs-vps-active-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.qs-vps-live-dot {
  width: 8px;
  min-width: 8px;
  max-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  display: inline-block;
  flex-shrink: 0;
}
#qsVpsActiveText {
  color: #d1fae5;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
#qsVpsActiveText strong {
  color: #34D399;
  font-weight: 700;
}
.qs-vps-manage-btn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6EE7B7;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.qs-vps-manage-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #ffffff;
  border-color: #34D399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Estado Desconectado de la Barra VPS (Sincronización Total con MT5) */
.qs-vps-active-bar.offline {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(127, 29, 29, 0.25) 100%) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15) !important;
}
.qs-vps-active-bar.offline .qs-vps-live-dot {
  background: #EF4444 !important;
  box-shadow: 0 0 10px #EF4444 !important;
}
.qs-vps-active-bar.offline #qsVpsActiveText {
  color: #fecaca !important;
}
.qs-vps-active-bar.offline #qsVpsActiveText strong {
  color: #f87171 !important;
}
.qs-vps-active-bar.offline .qs-vps-manage-btn {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
}
.qs-vps-active-bar.offline .qs-vps-manage-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* Estado de Configuración / Enlace de la Barra VPS (Advertencia / En Progreso Suave) */
.qs-vps-active-bar.warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(180, 83, 9, 0.25) 100%) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15) !important;
}
.qs-vps-active-bar.warning .qs-vps-live-dot {
  background: #F59E0B !important;
  box-shadow: 0 0 10px #F59E0B !important;
  animation: pulse 1.2s infinite;
}
.qs-vps-active-bar.warning #qsVpsActiveText {
  color: #fef3c7 !important;
}
.qs-vps-active-bar.warning #qsVpsActiveText strong {
  color: #fbbf24 !important;
}
.qs-vps-active-bar.warning .qs-vps-manage-btn {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fde68a !important;
}
.qs-vps-active-bar.warning .qs-vps-manage-btn:hover {
  background: rgba(245, 158, 11, 0.35) !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
}


/* Modal VPS de Adquisición y Pago */
.qs-vps-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(4, 8, 16, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: none; /* Oculto por defecto */
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999999 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}
.qs-vps-modal-backdrop.is-open {
  display: flex !important;
}
.qs-vps-pricing-card {
  background: linear-gradient(165deg, #0d1527 0%, #0b101d 100%) !important;
  border: 1px solid rgba(0, 212, 255, 0.35) !important;
  border-radius: 20px !important;
  max-width: 480px !important;
  width: 100% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 18px 22px !important;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.18), 0 25px 50px rgba(0, 0, 0, 0.9) !important;
  color: #fff !important;
  box-sizing: border-box !important;
  position: relative !important;
  text-align: left !important;
  /* Scrollbar personalizado oscuro y fino (elimina la barra blanca de Windows) */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.4) rgba(10, 16, 29, 0.8);
}
.qs-vps-pricing-card::-webkit-scrollbar {
  width: 6px;
}
.qs-vps-pricing-card::-webkit-scrollbar-track {
  background: rgba(10, 16, 29, 0.7);
  border-radius: 8px;
}
.qs-vps-pricing-card::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.35);
  border-radius: 8px;
}
.qs-vps-pricing-card::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.7);
}
.qs-vps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.qs-vps-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.qs-vps-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.qs-vps-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.qs-vps-modal-benefits {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  padding: 6px 10px;
}
.qs-vps-benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.qs-benefit-ico {
  font-size: 13px;
  margin-top: 1px;
}
.qs-vps-benefit-item strong {
  font-size: 11.5px;
  color: #FACC15;
  display: block;
}
.qs-vps-benefit-item p {
  font-size: 10.5px;
  color: #CBD5E1;
  margin: 0;
  line-height: 1.3;
}
.qs-vps-section-lbl {
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}
.qs-vps-plans-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}
.qs-vps-plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.qs-vps-plan-option:hover {
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.06);
}
.qs-vps-plan-option.selected {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}
.qs-plan-info {
  display: flex;
  flex-direction: column;
}
.qs-plan-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qs-plan-badge {
  font-size: 9.5px;
  font-weight: 800;
  background: #22c55e;
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
}
.qs-plan-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.qs-plan-price {
  font-size: 17px;
  font-weight: 800;
  color: #00d4ff;
}
.qs-btn-pay-vps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #6d28d9 100%);
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 12px;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  text-align: center;
}
.qs-btn-pay-vps:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #7c3aed 100%);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.qs-link-toggle-paid {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.qs-link-toggle-paid:hover {
  color: #7dd3fc;
}
.qs-vps-form-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qs-vps-input-group label {
  font-size: 11px;
  color: #CBD5E1;
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}
.qs-vps-security-note {
  font-size: 10px;
  color: #64748B;
  margin: 10px 0 0;
  text-align: center;
}
.btn-vps-submit {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 12px 16px !important;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #6d28d9 100%) !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s ease !important;
}
.btn-vps-submit:hover {
  transform: translateY(-1px) !important;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #7c3aed 100%) !important;
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.55) !important;
}

@media (max-width: 768px) {
  .qs-vps-ad-banner {
    padding: 10px 12px;
    margin: 6px 8px 4px;
    border-radius: 12px;
  }
  .qs-vps-ad-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .qs-vps-ad-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .qs-vps-ad-nav-arrows {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }
  .qs-vps-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .qs-vps-cta-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qs-vps-cta-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}



/* =========================================================================
   GUÍA DE INICIO RÁPIDA (INTERACTIVA & DUMMY-PROOF)
   ========================================================================= */
.btn-quick-guide-header {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(249, 115, 22, 0.18));
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #FDE047;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}
.btn-quick-guide-header:hover {
  background: linear-gradient(135deg, #EAB308, #F97316);
  border-color: #FDE047;
  color: #0F172A;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.6);
  transform: translateY(-1px);
}

.quick-guide-window {
  width: 820px;
  max-width: 95%;
  max-height: 92vh;
  background: #0B111E;
  border: 1px solid #1E2D4A;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.18);
  animation: guideModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-guide-header {
  padding: 16px 24px;
  background: #0E1728;
  border-bottom: 1px solid #1E293B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.qg-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #FDE047;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.qg-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: -0.2px;
}

.qg-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94A3B8;
}

.qg-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qg-step-counter {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #38BDF8;
}

.quick-guide-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-guide-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #EF4444;
}

.qg-stepper-container {
  background: #090E1A;
  border-bottom: 1px solid #1A263D;
  padding: 10px 24px 12px;
  flex-shrink: 0;
}

.qg-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.qg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8, #818CF8, #C084FC);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.qg-stepper-tabs {
  display: flex;
  gap: 8px;
}

.qg-step-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #64748B;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qg-step-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #CBD5E1;
}

.qg-step-tab.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38BDF8;
  color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.qg-step-tab.completed {
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.3);
}

.quick-guide-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.qg-slide-badge {
  font-size: 10px;
  font-weight: 800;
  color: #38BDF8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.qg-slide-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
}

.qg-slide-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #94A3B8;
}

.qg-license-card {
  background: #0E1729;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.qg-lic-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.qg-lic-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748B;
}

.qg-lic-status {
  font-size: 10px;
  font-weight: 700;
  color: #10B981;
}

.qg-lic-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #070B14;
  border: 1px solid #1A263D;
  border-radius: 8px;
  padding: 8px 12px;
}

.qg-lic-box code {
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 1px;
}

.qg-btn-copy {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38BDF8;
  color: #38BDF8;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.qg-btn-copy:hover {
  background: #38BDF8;
  color: #0B111E;
}

.qg-copy-feedback {
  margin-top: 6px;
  font-size: 11px;
  color: #10B981;
  font-weight: 600;
}

.qg-dummy-callout {
  display: flex;
  gap: 12px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
}

.qg-dummy-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.qg-dummy-text {
  font-size: 12px;
  line-height: 1.5;
  color: #E2E8F0;
}

.qg-dummy-text strong {
  display: block;
  color: #FDE047;
  margin-bottom: 2px;
}

/* Slide 2: Options Grid */
.qg-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.qg-option-card {
  background: #0E1729;
  border: 1px solid #1E2D4A;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.qg-option-card.highlight {
  border-color: #38BDF8;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, #0E1729 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.qg-opt-tag {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
}

.qg-opt-tag.secondary {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.qg-opt-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.qg-opt-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: #F8FAFC;
}

.qg-opt-desc {
  font-size: 11px;
  line-height: 1.45;
  color: #94A3B8;
  margin: 0 0 12px;
  flex: 1;
}

.qg-opt-features {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.qg-opt-features li {
  font-size: 11px;
  color: #CBD5E1;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qg-opt-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  display: inline-block;
  transition: all 0.2s ease;
}

.qg-opt-btn.primary {
  background: linear-gradient(135deg, #0284C7, #2563EB);
  border: 1px solid #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.qg-opt-btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.qg-opt-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F8FAFC;
}
.qg-opt-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.qg-opt-btn.text {
  background: transparent;
  border: none;
  color: #38BDF8;
  margin-top: 4px;
}
.qg-opt-btn.text:hover {
  text-decoration: underline;
}

.qg-mini-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.qg-mstep {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #CBD5E1;
}

.qg-mstep span:first-child {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 9px;
}

/* Slide 3: Risk Grid */
.qg-risk-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-risk-card {
  background: #0E1729;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 12px 14px;
}

.qg-risk-card.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.05);
}

.qg-risk-card.emergency {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.qg-risk-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.qg-risk-icon {
  font-size: 18px;
}

.qg-risk-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
}

.qg-risk-sub {
  font-size: 10px;
  color: #94A3B8;
}

.qg-risk-card p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #94A3B8;
  padding-left: 28px;
}

/* Slide 4: Golden Rules */
.qg-golden-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-grule-item {
  display: flex;
  gap: 12px;
  background: #0E1729;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 12px 14px;
}

.qg-grule-item.highlight {
  border-color: #F59E0B;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #0E1729 100%);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}

.qg-grule-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.qg-grule-item.highlight .qg-grule-num {
  background: #F59E0B;
  color: #0B111E;
}

.qg-grule-content h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
}

.qg-grule-content p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #94A3B8;
}

.qg-final-cta-wrap {
  margin-top: 18px;
  text-align: center;
}

.qg-btn-finish {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: 1px solid #34D399;
  color: #FFFFFF;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}
.qg-btn-finish:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.6);
}

/* Footer / Stepper controls */
.quick-guide-footer {
  padding: 14px 24px;
  background: #0E1728;
  border-top: 1px solid #1E293B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.qg-dont-show-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #64748B;
  cursor: pointer;
  user-select: none;
}
.qg-dont-show-label input {
  cursor: pointer;
  accent-color: #38BDF8;
}
.qg-dont-show-label:hover {
  color: #94A3B8;
}

.qg-nav-buttons {
  display: flex;
  gap: 8px;
}

.qg-btn-nav {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  transition: all 0.15s ease;
}
.qg-btn-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
}
.qg-btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qg-btn-nav.primary {
  background: linear-gradient(135deg, #0284C7, #2563EB);
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.qg-btn-nav.primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Responsiveness */
@media (max-width: 768px) {
  .quick-guide-window {
    width: 100%;
    max-height: 96vh;
    border-radius: 16px;
  }
  .quick-guide-header {
    padding: 12px 16px;
  }
  .qg-title {
    font-size: 14px;
  }
  .qg-stepper-container {
    padding: 8px 16px 10px;
  }
  .qg-step-tab {
    padding: 5px 4px;
    font-size: 10px;
  }
  .qg-step-tab .qg-step-label {
    display: none;
  }
  .qg-options-grid {
    grid-template-columns: 1fr;
  }
  .quick-guide-body {
    padding: 16px;
  }
  .quick-guide-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }
  .qg-nav-buttons {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
  }
  .qg-btn-nav {
    text-align: center;
  }
}

/* Align VPS Banners with Architectural Luxury Grid */
.qs-vps-ad-banner,
.qs-vps-active-bar {
  width: calc(100% - 40px) !important;
  max-width: var(--container-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 12px !important;
}
@media (max-width: 768px) {
  .qs-vps-ad-banner,
  .qs-vps-active-bar {
    width: calc(100% - 24px) !important;
  }
}
