/* ═══════════════════════════════════════════════════════════
   style.css — AI Trading Bot Dashboard
   Tema: dark industrial/terminal + accents precisos
   Fuentes: Syne (UI), JetBrains Mono (datos/código)
═══════════════════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d0f;
  --bg-2:        #121214;
  --bg-3:        #1a1a1e;
  --bg-4:        #222227;
  --border:      #2a2a30;
  --border-2:    #333340;

  --text:        #e8e8f0;
  --text-muted:  #7a7a90;
  --text-dim:    #4a4a60;

  --accent:      #bb86fc;
  --accent-dim:  rgba(187,134,252,0.12);
  --success:     #00e5a0;
  --success-dim: rgba(0,229,160,0.10);
  --danger:      #ff4d6d;
  --danger-dim:  rgba(255,77,109,0.10);
  --warning:     #f59e0b;

  --sidebar-w:   280px;
  --topbar-h:    56px;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);

  --font-ui:     'Syne', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Consolas', monospace;

  --transition:  0.22s ease;
}

html { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout Shell ───────────────────────────────────────── */
.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left var(--transition);
  z-index: 100;
  padding-bottom: 16px;
}

.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Nav */
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 12px 20px 6px;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  padding: 0 10px;
}

.nav-links li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.nav-links li:hover {
  background: var(--bg-3);
  color: var(--text);
}

.nav-links li.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-links li i {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.nav-links li span:not(.ws-status) { flex: 1; }

/* Config section */
.config-section {
  padding: 0 14px;
  margin-top: 4px;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 14px 0 5px;
}

.field-input, .field-select {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: border-color var(--transition);
  outline: none;
  appearance: none;
}

.field-input:focus, .field-select:focus { border-color: var(--accent); }

.field-input--sm { width: 160px; }

/* Watchlist */
.watchlist-container {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 10px;
  margin-bottom: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  border: 1px solid rgba(187,134,252,0.25);
  border-radius: 4px;
  padding: 2px 7px;
}

.tag__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.tag__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  width: auto;
  transition: color var(--transition);
}
.tag__remove:hover { color: var(--danger); }

.tag-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  padding: 4px 3px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.checkbox-text {
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 20px 4px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ops-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
}

.btn--primary {
  width: 100%;
  justify-content: center;
  background: var(--accent);
  color: #000;
  margin-top: 16px;
}

.btn--secondary {
  background: var(--bg-4);
  color: var(--text);
  border: 1px solid var(--border-2);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--warning { border-color: var(--warning); color: var(--warning); }

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn--sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── Main wrapper ───────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: auto;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background var(--transition);
}

.hamburger:hover span { background: var(--text); }

.topbar-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

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

/* ── Main content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* ── Views ──────────────────────────────────────────────── */
.view { display: none; animation: fadeIn 0.2s ease; }
.view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Métricas ───────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color var(--transition);
}

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

.metric-card h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.metric-card .value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.metric-card .value-unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.metric-card .sub-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Recomendación ──────────────────────────────────────── */
.recommendation-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 22px;
}

.rec-header { margin-bottom: 14px; }

.rec-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid;
  letter-spacing: 0.05em;
}

.rec-body {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.rec-body strong { color: var(--text); }

/* ── Charts ─────────────────────────────────────────────── */
.chart-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  overflow: hidden;
}

.chart-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.chart-card__header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-area {
  width: 100%;
  min-height: 380px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.table-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.table-card__header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  background: var(--bg-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--bg-4); color: var(--text); }

.ticker-cell strong {
  font-size: 0.88rem;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.pnl-bar {
  height: 2px;
  border-radius: 1px;
  margin-top: 4px;
  transition: width 0.4s ease;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

/* ── Terminal / Logs ────────────────────────────────────── */
.terminal {
  background: #080810;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: calc(100vh - var(--topbar-h) - 110px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.log-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #7a7a90;
  word-break: break-all;
  white-space: pre-wrap;
}

/* ── Historial ──────────────────────────────────────────── */
.history-block { margin-bottom: 36px; }

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

.history-block__header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

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

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pagination-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  flex: 1;
  text-align: center;
}

/* ── Status badges ──────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-badge--submitted { background: var(--accent-dim); color: var(--accent); }
.status-badge--filled    { background: var(--success-dim); color: var(--success); }
.status-badge--rejected  { background: var(--danger-dim); color: var(--danger); }
.status-badge--canceled  { background: rgba(100,100,100,0.15); color: var(--text-dim); }

.mode-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}

.mode-badge--live { background: var(--danger-dim); color: var(--danger); }
.mode-badge--dry  { background: var(--success-dim); color: var(--success); }

.ws-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: auto;
}

.ws-status--on  { color: var(--success); }
.ws-status--off { color: var(--text-dim); }

/* ── Colores semánticos ─────────────────────────────────── */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.mono         { font-family: var(--font-mono); }

/* ── Loading states ─────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  display: inline-block;
}

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

/* ── Empty view ─────────────────────────────────────────── */
.empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 12px;
}

.empty-view__icon { font-size: 3rem; opacity: 0.4; }

.empty-view h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-view p {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 340px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Auth Modal ─────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,16,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  width: 360px;
  text-align: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.auth-sub code {
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 6px;
  border-radius: 3px;
}

.input-group {
  position: relative;
  margin-bottom: 10px;
}

.input-group__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
}

.auth-input {
  width: 100%;
  padding: 12px 12px 12px 36px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  text-align: left;
}

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

.auth-error {
  color: var(--danger);
  font-size: 0.78rem;
  min-height: 18px;
  margin-bottom: 12px;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition);
}

.auth-btn:hover { opacity: 0.9; }

/* ── Toast System ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-width: 340px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(16px);
}

.toast--in  { animation: toastIn  0.22s ease forwards; }
.toast--out { animation: toastOut 0.18s ease forwards; }

.toast--error   { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast--success { border-left-color: var(--success); }

.toast__icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast__msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1;
  line-height: 1.5;
}

.toast__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 0;
  width: auto;
  flex-shrink: 0;
  line-height: 1;
}
.toast__close:hover { color: var(--text); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(16px); } }

/* ── Scrollbar styling ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Responsive (tablet) ────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar { position: absolute; height: 100%; }
  .sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

  .main-content { padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { width: 90%; padding: 28px 24px; }
}

/* ═══════════════════════════════════════════════════════════
   FASE 3 — Estilos nuevos
═══════════════════════════════════════════════════════════ */

/* ── Light mode (data-theme="light") ────────────────────── */
[data-theme="light"] {
  --bg:         #f0f0f5;
  --bg-2:       #ffffff;
  --bg-3:       #f7f7fa;
  --bg-4:       #eaeaef;
  --border:     #dcdce8;
  --border-2:   #c8c8d8;
  --text:       #111118;
  --text-muted: #55556a;
  --text-dim:   #9090a8;
  --accent-dim: rgba(120,60,220,0.10);
}

[data-theme="light"] .terminal { background: #1a1a24; }
[data-theme="light"] .log-line { color: #aaaacc; }
[data-theme="light"] .sidebar  { background: #ffffff; }
[data-theme="light"] .topbar   { background: #ffffff; }

/* ── Topbar: btn-icon (theme toggle) ─────────────────────── */
.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 9px;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition);
  color: var(--text-muted);
  width: auto;
}
.btn-icon:hover { background: var(--bg-4); border-color: var(--border-2); }

/* ── btn--inline (no full-width) ─────────────────────────── */
.btn--inline { width: auto; }

/* ── Nav badge (alertas activas) ─────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: auto;
}

/* ── field-select--sm ────────────────────────────────────── */
.field-select--sm { width: auto; min-width: 110px; }

/* ── chart-area--tall ────────────────────────────────────── */
.chart-area--tall { min-height: 460px; }

/* ── chart-hint / table-hint ─────────────────────────────── */
.chart-hint,
.table-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════
   COMPARAR TICKERS
═══════════════════════════════════════════════════════════ */
.compare-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.compare-controls__group { display: flex; flex-direction: column; gap: 8px; }
.compare-controls__group--right {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Picker de checkboxes de tickers */
.ticker-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticker-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ticker-checkbox input[type="checkbox"] {
  display: none;
}

.ticker-checkbox__label {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-4);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.ticker-checkbox input:checked + .ticker-checkbox__label {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.ticker-checkbox__label:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Punto de color en la tabla de comparación */
.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   ALERTAS DE PRECIO
═══════════════════════════════════════════════════════════ */
.alert-form-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 16px;
}

.alert-form-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.alert-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 130px;
}

.alert-form__field--wide { flex: 1; min-width: 200px; }

/* Fila de alerta disparada (atenúa la fila) */
.alert-row--triggered td { opacity: 0.45; }

/* Status badges para alertas */
.status-badge--active    { background: var(--success-dim); color: var(--success); }
.status-badge--triggered { background: rgba(100,100,100,0.12); color: var(--text-dim); }

/* alert-form — layout del formulario de alertas */
.alert-form { display: flex; flex-direction: column; gap: 0; }
