/* ============================================================
   SPARTAN BROKERS · tema claro/oscuro + botones comunes
   Se carga en todas las paginas publicas y de analisis.
   ============================================================ */
:root{color-scheme:light}

html[data-theme="dark"]{
  --bg:#0f1216; --bg2:#14181d; --panel:#171c22; --panel2:#1d232a;
  --ink:#f4efe3; --text:#ded8ca; --muted:#a8a191; --muted2:#7f796b;
  --line:#272d34; --line2:#363d46;
  --gold:#d6b04a; --gold2:#c9a227; --gold3:#e6cb7c; --goldsoft:#241f11;
  --crimson:#c2595d; --up:#35b97a; --down:#e05f52;
  --sh1:0 10px 28px rgba(0,0,0,.42); --sh2:0 22px 52px rgba(0,0,0,.58);
  color-scheme:dark;
}

html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] ::selection{background:rgba(214,176,74,.28)}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#12161a}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#2c333b;border-color:#12161a}

/* ---- superficies ---- */
html[data-theme="dark"] .logo-chip,
html[data-theme="dark"] .live-chip,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .sem-card,
html[data-theme="dark"] .precio-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .faq-q,
html[data-theme="dark"] .info-mini,
html[data-theme="dark"] .sem-bar,
html[data-theme="dark"] .sem-stat,
html[data-theme="dark"] .mes-chip,
html[data-theme="dark"] .tipo-chip,
html[data-theme="dark"] .op-kpi,
html[data-theme="dark"] .sblib-card,
html[data-theme="dark"] .an-card,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .sem-que-card,
html[data-theme="dark"] .cal-celda,
html[data-theme="dark"] .aviso-riesgo{background:var(--panel)!important;border-color:var(--line)!important;color:var(--text)!important}

html[data-theme="dark"] .sblib-card,
html[data-theme="dark"] .precio-card{background:linear-gradient(165deg,#1a2027,#151a20)!important}
html[data-theme="dark"] .sec-alt,
html[data-theme="dark"] .sp-analisis{background:linear-gradient(180deg,#12161b,#0f1216)!important}
html[data-theme="dark"] .sp-semanas,
html[data-theme="dark"] .sp-dias,
html[data-theme="dark"] .sp-libros{background:transparent!important}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .card .n,
html[data-theme="dark"] .sem-anio,
html[data-theme="dark"] .precio-num,
html[data-theme="dark"] .sblib-card h3,
html[data-theme="dark"] .an-card h3{color:var(--ink)!important}

html[data-theme="dark"] .btn-mini,
html[data-theme="dark"] .sem-link,
html[data-theme="dark"] .an-go{color:var(--gold3)!important}
html[data-theme="dark"] .mes-chip{background:var(--panel2)!important}
html[data-theme="dark"] .mes-chip.on,
html[data-theme="dark"] .tipo-chip.on{background:var(--goldsoft)!important;border-color:var(--gold)!important;color:var(--gold3)!important}

/* ---- boton de tema (arriba) ---- */
.sb-theme-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 auto;
  border-radius:12px;border:1px solid var(--line2);background:var(--panel);color:var(--gold);cursor:pointer;
  font-size:15px;transition:transform .25s,border-color .25s,background .25s;pointer-events:auto;box-shadow:var(--sh1);padding:0}
.sb-theme-btn:hover{transform:translateY(-2px);border-color:var(--gold3)}
.sb-theme-btn svg{display:block}
.sb-theme-btn.fixed{position:fixed;top:14px;right:16px;z-index:96}
html[data-theme="dark"] .sb-theme-btn{background:var(--panel2)}

/* ---- boton volver arriba (derecha) ---- */
#toTop{position:fixed;right:16px;bottom:26px;z-index:110;width:46px;height:46px;border-radius:13px;
  border:1px solid rgba(169,129,27,.45);background:var(--panel);color:var(--gold);cursor:pointer;
  opacity:0;pointer-events:none;transition:.3s;font-size:15px;box-shadow:var(--sh1);display:grid;place-items:center;padding:0}
#toTop.show{opacity:1;pointer-events:auto}
#toTop:hover{background:linear-gradient(135deg,var(--gold3),var(--gold));color:#fff;transform:translateY(-3px)}
#toTop svg{display:block}
