/* ============================================================================
   Quantum Sniper — Trading Hub v4.5 Desktop Edition (Web Port)
   Diseño 100% IDÉNTICO al software de escritorio original (CustomTkinter FinTech Dark)
   Colores, Componentes, Tarjetas, Tablas y Disposición idénticos a app_gui.py
   ============================================================================ */

:root {
  --bg-primary: #0B0F19;        /* Fondo principal oscuro profundo */
  --card-bg: #161F30;           /* Fondo de tarjetas y paneles */
  --card-border: #22314E;       /* Bordes sutiles de paneles */
  --card-inner: #0D1525;        /* Subpaneles interiores */
  --card-row-dark: #090E17;     /* Filas oscuras de switches */
  --card-badge-row: #0F172A;    /* Fila de badges */
  
  --text-primary: #FFFFFF;      /* Texto blanco brillante */
  --text-muted: #8B9BB4;        /* Texto secundario gris azulado */
  --text-dim: #64748B;          /* Texto tenue */
  --text-normal: #E2E8F0;

  --btn-start: #10B981;         /* Verde Esmeralda Neón (Iniciar) */
  --btn-start-hover: #059669;
  --btn-panic: #EF4444;         /* Rojo Carmesí Pánico (Cerrar Todo) */
  --btn-panic-hover: #DC2626;
  --accent-blue: #3B82F6;       /* Azul Eléctrico para detalles */
  --accent-blue-hover: #2563EB;
  --btn-test: #F59E0B;          /* Ámbar Test */
  --btn-test-hover: #D97706;
  --btn-retrain: #475569;       /* Gris Reentrenar */
  --btn-retrain-hover: #334155;

  --font-sans: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Consolas', 'JetBrains Mono', monospace;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

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

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.4;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  user-select: none;
}

#authenticatedAppView {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* =========================================================================
   ENCABEZADO SUPERIOR QUANTUM (FINTECH INSTITUCIONAL PRO)
   ========================================================================= */
.desktop-header {
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  padding: 12px 18px 10px 18px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.desktop-header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0; /* IMPEDIR QUE LOS BOTONES DE LA DERECHA APLASTEN EL TÍTULO */
  min-width: max-content;
}

.desktop-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
  flex-shrink: 0;
}

.desktop-title {
  font-size: 14px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: 0.4px;
  line-height: 1.2;
  white-space: nowrap; /* NUNCA QUEBRARSE EN 5 RENGLONES */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.desktop-subtitle {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
  letter-spacing: 0.2px;
}

.desktop-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

/* MT5 Status Badge */
.status-badge-btn {
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
}
.status-badge-btn.online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34D399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.status-badge-btn.cloud-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(52, 211, 153, 0.6);
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}
.status-badge-btn.offline {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #F87171;
}

/* Master Switch (SISTEMA ACTIVO) */
.master-switch-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #111827;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid #1E293B;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
}
.master-switch-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: 0.4px;
}

/* CustomTkinter Switch */
.ctk-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}
.ctk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ctk-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.2s;
  border-radius: 18px;
}
.ctk-switch-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: 0.2s;
  border-radius: 50%;
}
.ctk-switch input:checked + .ctk-switch-slider {
  background-color: #10B981;
}
.ctk-switch input:checked + .ctk-switch-slider:before {
  transform: translateX(14px);
}
.ctk-switch.switch-purple input:checked + .ctk-switch-slider {
  background-color: #8B5CF6;
}
.ctk-switch.switch-red input:checked + .ctk-switch-slider {
  background-color: #EF4444;
}

/* Header Buttons */
.btn-guide-header {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-guide-header:hover {
  background: #2563EB;
  border-color: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.btn-lang-header {
  background: #1E293B;
  color: #FFFFFF;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-lang-header:hover {
  background: #334155;
  border-color: #475569;
}

.header-token-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0B132B;
  border: 1px solid #1E293B;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}
.header-token-box:hover {
  border-color: rgba(56, 189, 248, 0.4);
}
.header-token-box .tok-lbl {
  order: 1;
  color: #94A3B8;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.header-token-box code {
  order: 2;
  font-family: var(--font-mono);
  color: #38BDF8;
  font-weight: 700;
  font-size: 11px;
  background: rgba(14, 165, 233, 0.12);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.header-token-box code:hover {
  background: rgba(14, 165, 233, 0.22);
  color: #7DD3FC;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}
.header-token-top {
  display: contents;
}
.header-token-actions {
  order: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-tok-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}
.btn-tok-action:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-rebind-mt5 {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
}
.btn-rebind-mt5:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: #3B82F6;
  color: #FFFFFF;
}

.header-token-box code.token-masked {
  letter-spacing: 2.5px;
  font-family: monospace, -apple-system, sans-serif;
  color: #38BDF8;
  font-size: 13px;
  user-select: none;
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}

.btn-tok-toggle {
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  color: #38BDF8 !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
}

.btn-tok-toggle:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3) !important;
}

/* Toast Global de Privacidad */
.quantum-toast-global {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34D399;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65), 0 0 15px rgba(16, 185, 129, 0.25);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(12px);
}
.quantum-toast-global.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.btn-download-top {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-download-top:hover {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #38BDF8;
}

.btn-video-top {
  background: rgba(0, 245, 155, 0.1);
  border: 1px solid rgba(0, 245, 155, 0.35);
  color: #00F59B;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-video-top:hover {
  background: #00F59B;
  color: #000000;
  box-shadow: 0 0 14px rgba(0, 245, 155, 0.5);
  transform: translateY(-1px);
}

.btn-diag-top, .btn-network-top {
  background: #161F30;
  border: 1px solid #22314E;
  color: #94A3B8;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-diag-top:hover, .btn-network-top:hover {
  background: #1E293B;
  color: #F8FAFC;
  border-color: #38BDF8;
}

.btn-logout-top {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-logout-top:hover {
  background: #EF4444;
  color: #FFF;
}

/* =========================================================================
   BARRA DE PESTAÑAS (SEGMENTED BUTTON DE CustomTkinter)
   ========================================================================= */
.desktop-tabview-nav {
  display: flex;
  background: #0B0F19;
  padding: 4px 20px 0 20px;
  gap: 4px;
  border-bottom: 1px solid #1E293B;
}

.desktop-tab-btn {
  background: #1E293B;
  color: #F8FAFC;
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.desktop-tab-btn:hover {
  background: #2D3748;
}
.desktop-tab-btn.active {
  background: #2563EB;
  color: #FFFFFF;
}

.desktop-tab-content {
  display: none;
  padding: 10px 20px 20px 20px;
  background: #0B0F19;
}
.desktop-tab-content.active {
  display: block;
}

/* =========================================================================
   PESTAÑA 1: CENTRO DE MANDO & IA (5 TARJETAS VERTICALES EXACTAS)
   ========================================================================= */
.ctrl-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tarjeta Base CustomTkinter */
.ctk-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

/* TARJETA 1: CEREBRO & ARBITRAJE */
.ai-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ai-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-title-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #60A5FA;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-provider-select {
  background: #0D1525;
  border: 1px solid #1E293B;
  color: #F8FAFC;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  outline: none;
}

.ai-subpanel {
  background: var(--card-inner);
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 8px;
}

.ai-offline-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-status-item {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ai-status-green { color: #10B981; }
.ai-status-cyan { color: #38BDF8; }

.btn-ctk-blue {
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.btn-ctk-blue:hover { background: #1D4ED8; }

.ai-nvidia-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ctk-entry {
  background: #090E17;
  border: 1px solid #1E293B;
  color: #FFF;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  flex: 1;
  min-width: 180px;
  outline: none;
}
.btn-ctk-sm {
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: #FFF;
}
.btn-indigo { background: #6366F1; }
.btn-indigo:hover { background: #4F46E5; }
.btn-green { background: #059669; }
.btn-green:hover { background: #047857; }
.btn-purple { background: #8B5CF6; }
.btn-purple:hover { background: #7C3AED; }

/* Fila 4: Interruptores de los 5 Algoritmos Base */
.bot-toggles-row {
  background: var(--card-row-dark);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.bot-toggle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #E2E8F0;
}

/* Fila 5: Badges de Permisos en Vivo */
.bot-badges-row {
  background: var(--card-badge-row);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  text-align: center;
}
.bot-perm-badge {
  font-size: 10px;
  font-weight: 700;
  color: #10B981;
}

/* TARJETA 2: POTENCIADOR DE ALTO RIESGO */
.booster-caution-card {
  background: #181111;
  border: 1px solid #DC2626;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.booster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.booster-title {
  font-size: 12px;
  font-weight: 800;
  color: #F87171;
  display: flex;
  align-items: center;
  gap: 6px;
}
.booster-caution-badge {
  background: #7F1D1D;
  color: #FECACA;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.booster-warn-box {
  background: #2A0F0F;
  border: 1px solid #991B1B;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 10px;
  color: #FCA5A5;
  line-height: 1.4;
  margin-bottom: 6px;
}
.booster-switches-row {
  background: #100808;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}
.booster-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #FCA5A5;
}
.booster-status-row {
  background: #0F172A;
  border-radius: var(--radius-md);
  padding: 6px 12px;
}
.booster-status-text {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  margin-bottom: 2px;
}
.booster-reason-text {
  font-size: 10px;
  color: #CBD5E1;
}

/* TARJETA 3: GESTIÓN DE RIESGO Y PROTECCIÓN DE CAPITAL */
.risk-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.risk-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.risk-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.risk-metric-box {
  background: #0F172A;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  text-align: center;
}
.risk-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.risk-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.risk-advice-box {
  background: #1E293B;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  line-height: 1.45;
}

/* ==========================================================================
   PANEL DE DIAGNÓSTICO DE RIESGO Y COSECHA DE RETIRO SEGURO (50/50)
   ========================================================================== */
.risk-harvest-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.8) 100%);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.harvest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}
.harvest-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.harvest-icon {
  font-size: 22px;
}
.harvest-title {
  font-size: 13px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: 0.3px;
}
.harvest-subtitle {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 1px;
}
.harvest-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pulse-dot-green {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10B981;
}
.harvest-body-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
}
.harvest-col-card {
  background: rgba(9, 14, 23, 0.65);
  border: 1px solid #1E293B;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-col-title {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
}
.h-col-amount {
  font-size: 22px;
  font-weight: 900;
  color: #10B981;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}
.h-col-detail {
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.4;
}
.h-col-recommendation {
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-size: 10.5px;
  color: #6EE7B7;
  line-height: 1.35;
}
/* Desglose Semanal del Protocolo Cosecha 50/50 */
.harvest-breakdown-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 4px 0 6px 0;
}
.h-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94A3B8;
}
.h-breakdown-row strong {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #F8FAFC;
}
.h-breakdown-total {
  border-top: 1px dashed rgba(71, 85, 105, 0.6);
  padding-top: 5px;
  margin-top: 2px;
}
.h-breakdown-total span {
  font-weight: 700;
  color: #E2E8F0;
}
.h-breakdown-total strong {
  font-size: 13px;
  font-weight: 800;
}

/* Botón de Confirmación / Toggle Cosecha */
.btn-harvest-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.3) 100%);
  border: 1px solid #10B981;
  color: #6EE7B7;
  transition: all 0.2s ease;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.btn-harvest-toggle:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(5, 150, 105, 0.45) 100%);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.btn-harvest-toggle.harvest-is-done {
  background: rgba(30, 41, 59, 0.8);
  border-color: #475569;
  color: #94A3B8;
}
.btn-harvest-toggle.harvest-is-done:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: #64748B;
  color: #F8FAFC;
  box-shadow: none;
}
.btn-harvest-toggle.harvest-is-auto {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
  color: #34D399;
  cursor: default;
  pointer-events: none;
}
.risk-health-indicators {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.r-indicator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.r-indicator-row:last-child {
  border-bottom: none;
}
.r-ind-label {
  color: #94A3B8;
  font-weight: 600;
}
.r-ind-val {
  font-weight: 800;
  font-family: var(--font-mono);
}

/* ==========================================================================
   SELECTOR DE CONTROL OPERATIVO (CONSERVADOR / NORMAL / AGRESIVO / INSANO)
   ========================================================================== */
.operating-mode-card {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.operating-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 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: 700;
  color: #F8FAFC;
}
.operating-mode-desc {
  font-size: 11px;
  color: #94A3B8;
}
.mode-selector-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 6, 23, 0.85);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #1E293B;
}
.mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}
.mode-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.05);
}
.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}
.dot-amber {
  background: #F59E0B;
  box-shadow: 0 0 6px #F59E0B;
}
.dot-fire {
  background: #EF4444;
  box-shadow: 0 0 6px #EF4444;
}
.dot-purple {
  background: #A855F7;
  box-shadow: 0 0 8px #A855F7;
}
.dot-insane {
  background: #EC4899;
  box-shadow: 0 0 10px #EC4899, 0 0 16px #F43F5E;
}
.mode-btn.active[data-mode="conservative"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
  color: #34D399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}
.mode-btn.active[data-mode="normal"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
  color: #FBBF24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}
.mode-btn.active[data-mode="aggressive"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
  border-color: #EF4444;
  color: #FCA5A5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}
.mode-btn.active[data-mode="very_aggressive"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
  border-color: #A855F7;
  color: #D8B4FE;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}
.mode-btn.active[data-mode="insane"] {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(244, 63, 94, 0.3));
  border-color: #F43F5E;
  color: #FECDD3;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.5), 0 0 8px rgba(236, 72, 153, 0.4);
  animation: pulse-insane 2s infinite ease-in-out;
}
@keyframes pulse-insane {
  0% { box-shadow: 0 0 12px rgba(244, 63, 94, 0.4); }
  50% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.7), 0 0 8px rgba(236, 72, 153, 0.6); }
  100% { box-shadow: 0 0 12px rgba(244, 63, 94, 0.4); }
}

.mode-status-desc {
  font-size: 11px;
  color: #E2E8F0;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 6px;
  border-left: 3px solid #EF4444;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

#modeMultiplierBadge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* TARJETA 4: CENTRO DE ACCIONES */
.action-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.btn-action-start {
  background: var(--btn-start);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-action-start:hover { background: var(--btn-start-hover); }

.btn-action-test {
  background: var(--btn-test);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-action-test:hover { background: var(--btn-test-hover); }

.btn-action-panic {
  background: var(--btn-panic);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-action-panic:hover { background: var(--btn-panic-hover); }

.btn-action-retrain {
  width: 100%;
  background: var(--btn-retrain);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-action-retrain:hover { background: var(--btn-retrain-hover); }

/* TARJETA 5: REGISTRO DE ACTIVIDAD */
.console-card {
  display: flex;
  flex-direction: column;
}
.console-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.console-box {
  background: #0D1321;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px;
  height: 130px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #E2E8F0;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}
.log-line {
  line-height: 1.4;
  word-break: break-all;
}
.log-line.success { color: #34D399; }
.log-line.warn { color: #FBBF24; }
.log-line.error { color: #F87171; }

/* =========================================================================
   PESTAÑA 2: OPERACIONES & WIN RATE (CANVAS VECTORIAL / TABLAS COMPACTAS)
   ========================================================================= */
.trades-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.trades-sec-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.trades-sec-title.blue { color: #60A5FA; }
.trades-sec-title.green { color: #10B981; }
.trades-sec-title.amber { color: #F59E0B; }

.desktop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.desktop-table th {
  background: #0F172A;
  color: #94A3B8;
  font-weight: 700;
  padding: 6px 10px;
  text-align: center;
  border: 1px solid #1E293B;
}
.desktop-table th:first-child { text-align: left; }

.desktop-table td {
  padding: 6px 10px;
  text-align: center;
  border: 1px solid #1E293B;
  font-family: var(--font-mono);
}
.desktop-table td:first-child {
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 700;
}
.desktop-table tbody tr:nth-child(odd) { background: #1E293B; }
.desktop-table tbody tr:nth-child(even) { background: #172033; }
.desktop-table tbody tr:hover { background: #22314E; }

.btn-close-single {
  background: #7F1D1D;
  border: 1px solid #991B1B;
  color: #F87171;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-close-single:hover {
  background: #991B1B;
  border-color: #EF4444;
  color: #FFF;
}

.table-empty-row {
  padding: 16px;
  text-align: center;
  color: #64748B;
  font-size: 11px;
}

/* =========================================================================
   PESTAÑA 3: GRÁFICOS EN VIVO (3 GRÁFICOS SIMULTÁNEOS)
   ========================================================================= */
.live-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  height: calc(100vh - 170px);
  min-height: 520px;
}
@media (max-width: 1080px) {
  .live-charts-grid { grid-template-columns: 1fr; height: auto; }
}

.single-chart-card {
  background: #111827;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chart-card-header {
  padding: 8px 12px;
  border-bottom: 1px solid #1E293B;
  background: #0E1420;
}
.chart-header-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chart-pair-title {
  font-size: 12px;
  font-weight: 700;
}
.chart-pair-price {
  font-size: 13px;
  font-weight: 800;
  color: #F8FAFC;
  font-family: var(--font-mono);
}
.chart-header-row2 {
  font-size: 9px;
  color: #94A3B8;
  margin-top: 2px;
}
.chart-iframe-container,
.quantum-chart-wrapper {
  flex: 1;
  min-height: 420px;
  height: 440px;
  background: #0B0F19;
  position: relative;
  overflow: hidden;
}
.chart-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.chart-header-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-left: 8px;
  display: none;
}
.chart-header-badge.visible {
  display: inline-flex;
  align-items: center;
}
.chart-header-badge.negative {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.chart-tf-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: #1E293B;
  color: #94A3B8;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* =========================================================================
   PESTAÑA 4: CHAT IA COPILOTO (IDÉNTICO A chat_tab.py)
   ========================================================================= */
.copilot-tab-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 170px);
  min-height: 520px;
  background: #0B0F19;
  border-radius: var(--radius-md);
}
.copilot-header {
  padding: 8px 16px;
  border-bottom: 1px solid #1E293B;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.copilot-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.copilot-h-title {
  font-size: 13px;
  font-weight: 700;
  color: #60A5FA;
}
.copilot-mode-tag {
  font-size: 10px;
  color: #8B9BB4;
}
.copilot-feed {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
}
.chat-msg.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg.ai-msg {
  align-self: flex-start;
}
.msg-avatar {
  font-size: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1E293B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
}
.user-msg .msg-bubble {
  background: #1D4ED8;
  color: #F8FAFC;
}
.ai-msg .msg-bubble {
  background: #1E293B;
  color: #E2E8F0;
  border: 1px solid #334155;
}

.copilot-chips-row {
  display: flex;
  gap: 6px;
  padding: 6px 14px;
  overflow-x: auto;
}
.chip-btn {
  background: #1E293B;
  border: 1px solid #334155;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chip-btn:hover {
  background: #334155;
  color: #FFF;
}
.copilot-input-bar {
  padding: 8px 14px 12px 14px;
  display: flex;
  gap: 8px;
}
.copilot-input {
  flex: 1;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #FFF;
  font-size: 12px;
  outline: none;
}
.btn-copilot-send {
  background: #2563EB;
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn-copilot-send:hover { background: #1D4ED8; }

/* =========================================================================
   PANTALLA DE LOGIN / ACTIVACIÓN (IDÉNTICA A login_screen.py)
   ========================================================================= */
#authGateView {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #0B0F19;
  padding: 20px;
  padding-top: max(24px, env(safe-area-inset-top, 24px));
}

.desktop-login-card {
  width: 520px;
  max-width: 95%;
  background: #0B0F19;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-header-wrap {
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-logo-img {
  max-width: 280px;
  width: 85%;
  height: auto;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.35));
}
.login-header-title {
  font-size: 24px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: 0.5px;
}
.login-header-subtitle {
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
}

.login-neon-separator {
  width: 420px;
  max-width: 90%;
  height: 2px;
  background-color: #1E3A8A;
  margin: 10px 0 20px 0;
}

.login-form-card {
  background: #161F30;
  border: 1px solid #22314E;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
}
.login-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 6px;
}
.login-card-desc {
  font-size: 11px;
  color: #8B9BB4;
  line-height: 1.4;
  margin-bottom: 16px;
}

.login-input-key {
  width: 100%;
  height: 48px;
  background: #0D1321;
  border: 2px solid #3B82F6;
  border-radius: 10px;
  color: #F8FAFC;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.login-input-key:focus {
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.btn-activate-license {
  width: 100%;
  height: 44px;
  background: #3B82F6;
  color: #FFF;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-activate-license:hover { background: #2563EB; }

.login-status-msg {
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
  min-height: 20px;
}
.login-status-msg.error { color: #EF4444; }
.login-status-msg.info { color: #3B82F6; }

.login-hwid-box {
  background: #0D1321;
  border-radius: 10px;
  padding: 10px 15px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #475569;
  text-align: center;
  margin-top: 14px;
}

.login-footer-lbl {
  font-size: 10px;
  color: #334155;
  margin-top: 18px;
  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 DE DISEÑO RESPONSIVE Y ADAPTATIVO (DESKTOPS, LAPTOPS & TABLETS)
   ========================================================================= */

@media (max-width: 1400px) {
  .desktop-header {
    padding: 8px 14px;
    gap: 10px;
  }
  .desktop-title {
    font-size: 13.5px;
  }
  .desktop-subtitle {
    max-width: 320px;
  }
  .status-badge-btn, .master-switch-wrap, .btn-guide-header, .btn-download-top, .btn-video-top, .btn-diag-top, .btn-network-top {
    padding: 4px 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 1180px) {
  .desktop-header {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 8px;
  }
  .desktop-header-left {
    flex: 0 0 auto;
  }
  .desktop-subtitle {
    display: none; /* Ocultar subtítulo largo para garantizar que el título nunca se aplaste */
  }
  .desktop-header-right {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 5px;
  }
}

@media (max-width: 992px) {
  .desktop-header {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px;
    gap: 8px;
  }
  .desktop-header-left {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .desktop-title {
    font-size: 13px;
    white-space: nowrap;
  }
  .desktop-subtitle {
    display: none;
  }
  .desktop-header-right {
    width: 100%;
    justify-content: flex-start;
    gap: 5px;
  }
}

/* =========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN SYSTEM (<= 768px & <= 480px)
   Institutional FinTech Dark Mobile Port
   ========================================================================= */

@media (max-width: 768px) {
  /* Prevent horizontal overflow globally */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  #authenticatedAppView {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* --- PANTALLA DE ACCESO / ACTIVACIÓN (AUTH GATE) --- */
  #authGateView {
    padding: 16px 12px;
  }
  .desktop-login-card {
    width: 100%;
    max-width: 440px;
  }
  .login-form-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .login-header-title {
    font-size: 20px;
  }
  .login-logo-img {
    max-width: 240px;
  }
  .login-card-title {
    font-size: 15px;
  }
  .login-neon-separator {
    width: 100%;
    margin: 8px 0 16px 0;
  }
  .login-input-key {
    height: 44px;
    font-size: 14px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
  }
  .btn-activate-license {
    height: 44px;
    font-size: 13px;
  }

  /* --- ENCABEZADO PRINCIPAL RESPONSIVE --- */
  .desktop-header {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 10px !important;
    gap: 6px !important;
    position: sticky;
    top: 0;
    z-index: 200;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .desktop-header-left {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

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

  .header-logo-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .desktop-title {
    font-size: 12px !important;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 240px;
  }

  .desktop-subtitle {
    display: none !important;
  }

  .desktop-header-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .status-badge-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 8px;
  }

  .master-switch-wrap {
    padding: 4px 10px;
    border-radius: 8px;
  }

  .master-switch-lbl {
    font-size: 10.5px;
    font-weight: 700;
  }

  /* RESPONSIVE FULL-WIDTH LUXURY LICENSE TOKEN BAR ON MOBILE */
  .header-token-box {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    order: 3 !important;
    margin: 6px 0 4px 0 !important;
    padding: 10px 14px !important;
    height: auto !important;
    min-height: auto !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    background: linear-gradient(135deg, rgba(11, 19, 43, 0.98), rgba(15, 23, 42, 0.98)) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(56, 189, 248, 0.06) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .header-token-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .header-token-box .tok-lbl {
    font-size: 11px !important;
    color: #94A3B8 !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .header-token-box .tok-icon {
    font-size: 13px !important;
    line-height: 1 !important;
  }

  .header-token-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .header-token-actions .btn-tok-action {
    padding: 4px 10px !important;
    height: 26px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #F8FAFC !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
  }

  .header-token-actions .btn-tok-action:hover,
  .header-token-actions .btn-tok-action:active {
    background: rgba(56, 189, 248, 0.28) !important;
    border-color: #38BDF8 !important;
    color: #FFFFFF !important;
  }

  .header-token-box code {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-family: var(--font-mono), monospace !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #38BDF8 !important;
    letter-spacing: 1px !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    padding: 8px 12px !important;
    background: rgba(14, 165, 233, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    user-select: all !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45) !important;
    transition: all 0.2s ease !important;
  }

  .header-token-box code:hover,
  .header-token-box code:active {
    background: rgba(14, 165, 233, 0.2) !important;
    border-color: #38BDF8 !important;
    color: #7DD3FC !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3), inset 0 2px 6px rgba(0, 0, 0, 0.45) !important;
  }

  .header-token-box code.token-masked {
    letter-spacing: 3.5px !important;
    font-size: 15px !important;
    user-select: none !important;
  }

  /* RESPONSIVE OPERATING RISK MODES ON MOBILE */
  .operating-mode-card {
    padding: 12px 10px !important;
    gap: 10px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .operating-mode-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .operating-mode-title-wrap {
    gap: 8px !important;
  }

  .operating-mode-title {
    font-size: 12.5px !important;
  }

  .operating-mode-desc {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }

  .mode-selector-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 6px !important;
    background: rgba(2, 6, 23, 0.95) !important;
    border-radius: 10px !important;
    border: 1px solid #1E293B !important;
  }

  .mode-btn {
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  #btnModeInsane {
    grid-column: span 2 !important;
  }

  .mode-status-desc {
    padding: 8px 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }

  #modeMultiplierBadge {
    align-self: flex-start !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  /* BOTÓN GUÍA DE USUARIO DESTACADO Y VISIBLE */
  .btn-guide-header {
    background: #2563EB !important;
    color: #FFFFFF !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border: 1px solid #3B82F6 !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
  }

  .btn-lang-header {
    background: #1E293B !important;
    color: #F8FAFC !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid #334155 !important;
  }

  .btn-download-top,
  .btn-diag-top,
  .btn-network-top {
    padding: 5px 10px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .btn-logout-top {
    padding: 5px 10px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 8px;
    margin-left: auto;
  }

  /* --- NAVEGACIÓN DE 4 PESTAÑAS (CUADRÍCULA 2X2 100% VISIBLE EN MÓVIL) --- */
  .desktop-tabview-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    background: #0B0F19 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .desktop-tab-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    border-radius: 8px !important;
    margin: 0 !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .desktop-tab-btn.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border-color: #3B82F6 !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4) !important;
  }

  .desktop-tab-content {
    padding: 8px 10px 24px 10px;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* --- PESTAÑA 1: CENTRO DE MANDO & IA --- */
  .ctrl-scroll-container {
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ctk-card,
  .booster-caution-card,
  .risk-card,
  .action-card,
  .console-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 12px;
    border-radius: 12px;
  }

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

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

  .ai-provider-select {
    width: 100%;
    min-width: 0 !important;
  }

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

  .btn-ctk-blue {
    width: 100%;
    text-align: center;
    padding: 8px;
  }

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

  .ai-nvidia-row .ctk-entry {
    width: 100%;
  }

  /* Grid de 5 Bots: 2 columnas limpias sin solapamiento de switches */
  .bot-toggles-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    padding: 8px 10px;
  }

  .bot-toggle-item {
    font-size: 10px;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bot-badges-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
    padding: 6px 8px;
  }

  .bot-perm-badge {
    font-size: 9.5px;
  }

  /* Tarjeta de Booster */
  .booster-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .booster-switches-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .booster-switch-item {
    font-size: 10.5px;
  }

  /* Tarjeta de Gestión de Riesgo (KPI Grid) */
  .risk-metrics-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .risk-metric-box {
    padding: 6px 8px;
  }

  .risk-lbl {
    font-size: 9px;
  }

  .risk-val {
    font-size: 13px !important;
  }

  .risk-advice-box {
    font-size: 10px;
    padding: 6px 8px;
  }

  /* Tarjeta Centro de Acciones (Botones Grandes Apilados) */
  .action-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .btn-action-start,
  .btn-action-test,
  .btn-action-panic {
    width: 100%;
    padding: 12px 14px !important;
    font-size: 12.5px !important;
    justify-content: center;
  }

  .btn-action-retrain {
    padding: 10px;
    font-size: 11px;
  }

  /* Terminal de Registro */
  .console-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .console-tools {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .btn-console-tool {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .console-box {
    height: 110px;
    font-size: 10px;
  }

  /* --- PESTAÑA 2: OPERACIONES & WIN RATE (TABLAS) --- */
  .trades-section-wrap {
    gap: 12px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .trades-section-wrap > div {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .trades-section-wrap div[style*="overflow-x: auto"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
  }

  .desktop-table {
    min-width: 520px;
    font-size: 10px;
  }

  .desktop-table th,
  .desktop-table td {
    padding: 5px 6px;
  }

  /* --- PESTAÑA 3: GRÁFICOS EN VIVO --- */
  .live-charts-grid {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 12px;
  }

  .single-chart-card {
    height: 380px;
  }

  .chart-iframe-container {
    height: 320px;
  }

  /* --- PESTAÑA 4: CHAT IA COPILOTO --- */
  .copilot-tab-container {
    height: calc(100vh - 170px);
    min-height: 450px;
  }

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

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

  .copilot-header > div:last-child .btn-ctk-sm {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
  }

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

  .copilot-chips-row::-webkit-scrollbar {
    display: none;
  }

  .chip-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 10.5px;
    padding: 5px 10px;
  }

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

  .copilot-input {
    font-size: 12px;
    padding: 8px 10px;
  }

  .btn-copilot-send {
    padding: 0 14px;
    font-size: 13px;
  }

  /* --- MODALES RESPONSIVE (PANTALLA COMPLETA TOUCH) --- */
  .hub-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 16px !important;
    margin: 10px auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 14px !important;
  }

  .guide-modal-window {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 14px !important;
  }

  .guide-modal-header {
    padding: 12px 14px !important;
  }

  .guide-modal-body {
    padding: 14px !important;
  }

  .guide-main-heading {
    font-size: 15px !important;
  }

  .guide-section-block {
    padding: 10px !important;
  }

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

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

  .traffic-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .traffic-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
  }

  .traffic-filters::-webkit-scrollbar {
    display: none;
  }

  .traffic-filter-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .bot-toggles-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  .bot-toggle-item {
    font-size: 9.5px;
  }
  .header-token-box {
    padding: 9px 12px !important;
    margin: 4px 0 !important;
    height: auto !important;
    min-height: auto !important;
  }
  .header-token-box code {
    font-size: 12.5px !important;
    letter-spacing: 0.8px !important;
    padding: 7px 10px !important;
    min-height: 34px !important;
  }
}

/* ==========================================================================
   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 (RÉPLICA VECTORIAL live_charts.py)
   ========================================================================= */
.live-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

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

.single-chart-card {
  background: #111827;
  border: 1px solid #1E293B;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.single-chart-card:hover {
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.chart-card-header {
  padding: 12px 16px;
  background: #161F30;
  border-bottom: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.chart-tf-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.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: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

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

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

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

.chart-header-row2 {
  font-size: 11px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quantum-chart-wrapper {
  width: 100%;
  height: 480px;
  position: relative;
  background: #0B0F19;
}

/* =========================================================================
   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 {
    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;
  }
}


