/* INVESTEP AI TRADING LAB - ESTILOS FUTURISTAS GLASSMORPHISM */
:root {
  --bg-deep: #0a0e17;
  --bg-card: rgba(16, 24, 39, 0.75);
  --bg-card-hover: rgba(22, 33, 54, 0.85);
  --border-glass: rgba(56, 189, 248, 0.18);
  --border-focus: #38bdf8;
  
  --neon-blue: #00e5ff;
  --neon-purple: #bd00ff;
  --neon-green: #00ff66;
  --neon-red: #ff3366;
  --neon-amber: #ffaa00;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(189, 0, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.top-nav {
  height: 56px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #000;
  font-size: 16px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  background: linear-gradient(90deg, #fff, var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 7px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--neon-blue);
  border-radius: 4px;
  font-weight: 600;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-pill:hover, .btn-pill.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.file-upload-btn {
  position: relative;
  overflow: hidden;
}

.file-upload-btn input[type="file"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* APP MAIN CONTAINER */
.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* LEFT COLUMN: CHART & REPLAY */
.chart-viewport {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chart-header {
  height: 48px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(16, 24, 39, 0.4);
}

.chart-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-family: var(--font-mono);
}

.ohlc-val span {
  color: var(--text-dim);
  font-size: 11px;
}

.canvas-wrapper {
  flex: 1;
  position: relative;
  background: #080c14;
}

#tradingChartContainer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* FLOATING INDICATOR HUD */
.chart-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  color: var(--text-dim);
}

.hud-val {
  font-weight: 600;
}

/* REPLAY CONTROLS BAR */
.replay-bar {
  height: 60px;
  background: rgba(13, 20, 33, 0.95);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--neon-blue);
  color: #fff;
}

.ctrl-btn.play-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--neon-blue), #0099ff);
  color: #000;
  font-weight: 800;
  border: none;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}

.ctrl-btn.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

.progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.slider-track {
  width: 100%;
  accent-color: var(--neon-blue);
  cursor: pointer;
}

.speed-selector {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  overflow: hidden;
}

.speed-opt {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}

.speed-opt.active {
  background: var(--neon-blue);
  color: #000;
}

/* RIGHT COLUMN: REASONING & OPTIONS PANEL */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-panel::-webkit-scrollbar {
  width: 5px;
}
.sidebar-panel::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.2);
  border-radius: 4px;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s;
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signal-banner {
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid;
}

.signal-banner.neutral {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.signal-banner.call {
  background: rgba(0, 255, 102, 0.12);
  border-color: rgba(0, 255, 102, 0.4);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.15);
}

.signal-banner.put {
  background: rgba(255, 51, 102, 0.12);
  border-color: rgba(255, 51, 102, 0.4);
  color: var(--neon-red);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.15);
}

.signal-banner.fractura {
  background: rgba(255, 170, 0, 0.15);
  border-color: rgba(255, 170, 0, 0.5);
  color: var(--neon-amber);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 170, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); }
}

.signal-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.signal-sub {
  font-size: 11px;
  opacity: 0.85;
}

/* CHECKLIST PROFESOR */
.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  font-size: 11.5px;
}

.check-item-label {
  color: var(--text-muted);
}

.check-status {
  font-family: var(--font-mono);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.badge-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.badge-green { background: rgba(0, 255, 102, 0.15); color: var(--neon-green); border: 1px solid rgba(0, 255, 102, 0.3); }
.badge-red { background: rgba(255, 51, 102, 0.15); color: var(--neon-red); border: 1px solid rgba(255, 51, 102, 0.3); }
.badge-orange { background: rgba(255, 170, 0, 0.15); color: var(--neon-amber); border: 1px solid rgba(255, 170, 0, 0.3); }
.badge-purple { background: rgba(189, 0, 255, 0.15); color: var(--neon-purple); border: 1px solid rgba(189, 0, 255, 0.3); }
.badge-cyan { background: rgba(0, 229, 255, 0.15); color: var(--neon-blue); border: 1px solid rgba(0, 229, 255, 0.3); }
.badge-gray { background: rgba(148, 163, 184, 0.1); color: var(--text-dim); border: 1px solid rgba(148, 163, 184, 0.2); }

/* REASONING TEXT NARRATOR */
.narrative-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--neon-blue);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  font-style: italic;
}

/* OPTIONS SELECTOR CARD */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.opt-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.opt-box .lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.opt-box .val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-blue);
}

.spread-warning {
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: var(--neon-amber);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* STRATEGY DRAWER MODAL */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 800px;
  max-width: 90vw;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
}

.modal-radar-content {
  width: 1400px !important;
  max-width: 96vw !important;
  max-height: 88vh !important;
  padding: 24px 28px !important;
}

.radar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
  text-align: left;
}

.radar-table th {
  padding: 12px 10px;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
  background: rgba(16, 24, 39, 0.4);
}

.radar-table td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.radar-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.radar-actions-cell .btn-pill {
  padding: 4px 10px;
  font-size: 10.5px;
  white-space: nowrap;
}

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

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}
.close-btn:hover { color: #fff; }

.strategy-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.strat-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strat-card h4 {
  font-size: 13px;
  color: var(--neon-blue);
}

.strat-card p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.radar-row:hover {
  background: rgba(0, 229, 255, 0.08) !important;
}

.radar-row td {
  transition: background 0.15s ease;
}

/* TIER QUALITY BADGES & FILTERS (CO-APRENDIZAJE) */
.badge-platino {
  background: rgba(189, 0, 255, 0.18);
  color: #e879f9;
  border: 1px solid rgba(189, 0, 255, 0.45);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.2);
}

.badge-oro {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-filtrada {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.radar-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
}

.radar-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.radar-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.radar-tab-btn.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* SNIPER 1M MODAL & BREAKDOWN */
.sniper-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sniper-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sniper-stat-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.6), rgba(8, 12, 20, 0.8));
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.sniper-timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.sniper-timeline-table th {
  padding: 10px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.sniper-timeline-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sniper-optimal-row {
  background: rgba(0, 230, 118, 0.16) !important;
  border-left: 4px solid var(--neon-green) !important;
  box-shadow: inset 0 0 14px rgba(0, 230, 118, 0.12);
}

.sniper-optimal-row td {
  color: #00e676 !important;
  font-weight: 700;
}

/* ESTILOS DE DOCK ALPACA PAPER TRADING */
.alpaca-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.alpaca-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
  font-weight: 600;
}

.alpaca-status-indicator.interactive {
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  user-select: none;
}

.alpaca-status-indicator.interactive:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.alpaca-status-indicator.is-real {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.alpaca-status-indicator.is-real .status-dot {
  background-color: #ef4444 !important;
  box-shadow: 0 0 8px #ef4444 !important;
}

.env-switch-badge {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

.status-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: none;
}

@keyframes pulse-dot {
  0% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.6; transform: scale(0.95); }
}

.alpaca-equity {
  color: var(--text-dim);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 8px;
}

.alpaca-equity strong {
  color: #fff;
}

.btn-paper-buy {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
  font-weight: 700 !important;
  transition: all 0.2s ease;
}

.btn-paper-buy:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* SELECTOR DE MODO: MANUAL VS AUTOMATICO */
.mode-toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 2px;
  gap: 2px;
  margin: 0 4px;
}

.btn-mode {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-mode:hover {
  color: #fff;
}

.btn-mode.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.btn-mode.active[data-mode="auto"] {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   WIDGET HOLOGRAFICO INVESTEP COPILOT IA / MODO PROFESOR (HUD EN EL GRAFICO)
   ========================================================================== */
.copilot-holo-card {
  position: absolute;
  top: 12px;
  right: 70px;
  width: 360px;
  max-width: calc(100% - 90px);
  z-index: 25;
  background: rgba(9, 14, 26, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 20px rgba(56, 189, 248, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.copilot-holo-card.minimized {
  width: 250px;
}

.copilot-holo-card.minimized .copilot-holo-body {
  display: none;
}

.copilot-holo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.copilot-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
  animation: copilotPulse 1.8s infinite;
}

@keyframes copilotPulse {
  0%   { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #00e5ff; }
  50%  { transform: scale(1.2); opacity: 1.0; box-shadow: 0 0 12px #00e5ff, 0 0 20px rgba(0, 229, 255, 0.5); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #00e5ff; }
}

.copilot-holo-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
  font-family: var(--font-mono);
}

.copilot-mode-label {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--neon-blue);
  font-family: var(--font-mono);
}

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

.copilot-btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.copilot-btn-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.copilot-btn-tool.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.copilot-min-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.copilot-min-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.copilot-holo-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copilot-status-row {
  display: flex;
  gap: 6px;
}

.copilot-indicator-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #cbd5e1;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pill-dot.green  { background: #00e676; box-shadow: 0 0 6px #00e676; }
.pill-dot.yellow { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.pill-dot.red    { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.pill-dot.cyan   { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }

.copilot-voice-bubble {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.copilot-voice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #34d399;
  font-family: var(--font-mono);
}

.copilot-voice-tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.copilot-advice-text {
  font-size: 11.5px;
  line-height: 1.45;
  color: #f1f5f9;
  font-style: italic;
  margin: 0;
}

.copilot-position-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.copilot-pos-ticker {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.copilot-pos-entry {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.copilot-pnl-badge {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.copilot-pnl-badge span {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #00e676;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
  line-height: 1.1;
}

.copilot-pnl-badge small {
  font-size: 8.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.copilot-targets-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.target-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.milestone-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.milestone-label {
  font-size: 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: var(--font-sans);
}

.target-milestone.reached .milestone-badge {
  color: #00e676;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
  font-weight: 800;
}

.target-milestone.reached .milestone-label {
  color: #34d399;
}

.target-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.copilot-pos-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.copilot-shield-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 8px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.copilot-shield-tag.locked {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.copilot-btn-exit {
  border-color: #ef4444;
  color: #f87171;
  font-weight: 700;
  font-size: 10px;
  padding: 3px 10px;
}

.copilot-btn-exit:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}






/* CONMUTADOR DE TIMEFRAME 15M MARCO VS 1M SNIPER */
#timeframeSwitchGroup {
  display: inline-flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#tf15mBtn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

#tf1mBtn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}


/* ==========================================================================
   MINI-VENTANITA FLOTANTE DE POSICIONES ACTIVAS (HUD EN ESQUINA DEL GRÁFICO)
   ========================================================================== */
.floating-positions-hud {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 290px;
  background: rgba(13, 17, 28, 0.94);
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(12px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  overflow: hidden;
}

.floating-positions-hud.minimized .f-hud-body,
.floating-positions-hud.minimized .f-hud-footer {
  display: none !important;
}

.f-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.f-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #fff;
  letter-spacing: 0.5px;
}

.live-dot.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px #10b981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.f-hud-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.f-hud-btn-mini {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.f-hud-btn-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.f-hud-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f-pos-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.f-pos-card.profit {
  border-left: 3px solid #10b981;
}

.f-pos-card.loss {
  border-left: 3px solid #ef4444;
}

.f-pos-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.f-pos-ticker {
  font-weight: 800;
  font-size: 12px;
  color: #fff;
}

.f-pos-side {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.f-pos-side.call { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.f-pos-side.put { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.f-pos-pnl {
  font-weight: 800;
  font-size: 12px;
}
.f-pos-pnl.pos { color: #34d399; }
.f-pos-pnl.neg { color: #f87171; }

.f-pos-row-details {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
}

.f-pos-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-f-sell-single {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-f-sell-single:hover {
  background: #dc2626;
  color: #fff;
}

.f-hud-footer {
  padding: 6px 10px 8px 10px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-emergency-sell-all {
  width: 100%;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-weight: 800;
  font-size: 10.5px;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-emergency-sell-all:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.6);
}

/* ==========================================================================
   ESTILOS DEL MODAL LANZADOR DE MISIÓN AUTOMÁTICA
   ========================================================================== */
.launcher-modal-card {
  width: 820px !important;
  max-width: 95vw !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: #0b101b !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.15) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.launcher-header {
  padding: 16px 20px !important;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.4), rgba(15, 23, 42, 0.8)) !important;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.launcher-icon {
  font-size: 26px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.launcher-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.launcher-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launcher-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 2px;
}

/* 1. ENTORNO */
.env-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.env-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.2s;
}

.env-card input {
  margin-top: 3px;
}

.env-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.4);
}

.env-card.active {
  border-color: var(--neon-blue);
  background: rgba(30, 58, 138, 0.25);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.env-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 3px;
}
.paper-badge { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.real-badge { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.env-content p {
  margin: 3px 0 0 0;
  font-size: 11px;
  color: var(--text-dim);
}

/* 2. TICKERS */
.btn-micro-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-micro-action:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: var(--neon-blue);
}

.ticker-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ticker-check-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #e2e8f0;
  transition: all 0.2s;
}
.ticker-check-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
}
.ticker-check-item input:checked + span {
  color: #fff;
}

/* 3. MODOS DE CAPITAL */
.capital-mode-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-mode-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.2s;
}

.cap-mode-card input {
  margin-top: 3px;
}

.cap-mode-card.active {
  border-color: #3b82f6;
  background: rgba(30, 58, 138, 0.2);
}

.cap-mode-card p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: var(--text-dim);
}

/* 4. LÍMITES */
.limits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.limit-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.limit-box label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.limit-box input,
.limit-box select {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.limit-box small {
  font-size: 10px;
  color: var(--text-dim);
}

/* FOOTER */
.launcher-footer {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-launcher-cancel {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-launcher-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-launcher-start {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 9px 22px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-launcher-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}
