/* ============================================================
   SPARTAN BROKERS · sistema visual 2026
   Capa de diseño que se carga al final. Solo cambia tipografía,
   color, superficies, bordes y sombras. No altera estructura.
   ============================================================ */

@font-face{font-family:'SB Display';src:url('/assets/fonts/display-serif-regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'SB Display';src:url('/assets/fonts/display-serif-italic.woff2') format('woff2');font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:'SB Sans';src:url('/assets/fonts/ui-sans.woff2') format('woff2');font-weight:400 800;font-style:normal;font-display:swap}

/* ---------- tokens ---------- */
:root{
  --sb-bg:#f6f2e9; --sb-bg-2:#fdfaf3; --sb-surface:#ffffff; --sb-surface-2:#faf6ec;
  --sb-ink:#14120d; --sb-text:#2b2820; --sb-muted:#6f695c; --sb-line:#e6ddca; --sb-line-2:#d6c9ae;
  --sb-gold:#a67c17; --sb-gold-2:#c9a227; --sb-gold-3:#e6c878; --sb-gold-soft:#f8efd8;
  --sb-up:#17795a; --sb-down:#b23b2e;
  --sb-display:'SB Display',Georgia,'Times New Roman',serif;
  --sb-ui:'SB Sans','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --sb-mono:'JetBrains Mono',ui-monospace,Consolas,monospace;
  --sb-r:18px; --sb-r-sm:12px;
  --sb-shadow:0 1px 2px rgba(60,48,20,.04),0 12px 32px -12px rgba(60,48,20,.14);
  --sb-shadow-lg:0 2px 4px rgba(60,48,20,.05),0 28px 60px -20px rgba(60,48,20,.22);
  --sb-ring:0 0 0 3px rgba(201,162,39,.28);
  /* compatibilidad con las hojas antiguas */
  --bg:var(--sb-bg); --bg2:var(--sb-bg-2); --panel:var(--sb-surface); --panel2:var(--sb-surface-2);
  --ink:var(--sb-ink); --text:var(--sb-text); --muted:var(--sb-muted); --line:var(--sb-line); --line2:var(--sb-line-2);
  --gold:var(--sb-gold); --gold2:var(--sb-gold-2); --gold3:var(--sb-gold-3); --goldsoft:var(--sb-gold-soft);
  --up:var(--sb-up); --down:var(--sb-down);
  --head:var(--sb-display); --body:var(--sb-ui); --mono:var(--sb-mono);
  color-scheme:light;
}
html[data-theme="dark"]{
  --sb-bg:#0b0d10; --sb-bg-2:#111419; --sb-surface:#14181e; --sb-surface-2:#1a1f26;
  --sb-ink:#f7f2e7; --sb-text:#d7d1c3; --sb-muted:#9b9588; --sb-line:#252b33; --sb-line-2:#333a44;
  --sb-gold:#d9b45c; --sb-gold-2:#c9a227; --sb-gold-3:#efd693; --sb-gold-soft:#242013;
  --sb-up:#3ec08b; --sb-down:#e2685a;
  --sb-shadow:0 1px 2px rgba(0,0,0,.5),0 14px 36px -14px rgba(0,0,0,.65);
  --sb-shadow-lg:0 2px 6px rgba(0,0,0,.55),0 30px 64px -22px rgba(0,0,0,.75);
  --bg:var(--sb-bg); --bg2:var(--sb-bg-2); --panel:var(--sb-surface); --panel2:var(--sb-surface-2);
  --ink:var(--sb-ink); --text:var(--sb-text); --muted:var(--sb-muted); --line:var(--sb-line); --line2:var(--sb-line-2);
  --gold:var(--sb-gold); --gold2:var(--sb-gold-2); --gold3:var(--sb-gold-3); --goldsoft:var(--sb-gold-soft);
  --up:var(--sb-up); --down:var(--sb-down);
  --head:var(--sb-display); --body:var(--sb-ui); --mono:var(--sb-mono);
  color-scheme:dark;
}

/* ---------- base ---------- */
html{scroll-behavior:smooth}
body{font-family:var(--sb-ui)!important;color:var(--sb-text)!important;background:var(--sb-bg)!important;
  background-image:radial-gradient(900px 520px at 12% -6%,rgba(201,162,39,.10),transparent 60%),
                   radial-gradient(760px 460px at 92% 0%,rgba(166,124,23,.07),transparent 62%)!important;
  background-attachment:fixed!important;-webkit-font-smoothing:antialiased;font-size:15px;line-height:1.65;letter-spacing:.005em}
html[data-theme="dark"] body{background-image:radial-gradient(900px 520px at 12% -6%,rgba(201,162,39,.10),transparent 60%),
                   radial-gradient(760px 460px at 92% 0%,rgba(217,180,92,.05),transparent 62%)!important}
::selection{background:rgba(201,162,39,.35)!important;color:inherit}
a{color:var(--sb-gold)!important}

/* ---------- tipografía ---------- */
h1,h2,h3,h4,.h2,.sec-head h2,.sblib-head h2,.sem-head h2,.hero h1,.hero h2{
  font-family:var(--sb-display)!important;font-weight:400!important;letter-spacing:-.015em!important;
  color:var(--sb-ink)!important;line-height:1.08!important;text-transform:none!important
}
h1,.hero h1{font-size:clamp(34px,5.2vw,64px)!important}
h2,.h2{font-size:clamp(26px,3.4vw,42px)!important;font-weight:400!important}
h3{font-size:clamp(19px,2.2vw,26px)!important}
.sec-kicker,.kicker,.badge-enc{font-family:var(--sb-ui)!important;font-weight:800!important;letter-spacing:.22em!important;
  text-transform:uppercase!important;font-size:10.5px!important;color:var(--sb-gold)!important}
.sec-desc,p.sub{font-family:var(--sb-ui)!important;color:var(--sb-muted)!important;font-size:15px!important;line-height:1.75!important}
.mono,.big,.bignum,.precio-num,.sem-stat b,.foot-num,.tick b{font-family:var(--sb-mono)!important;font-variant-numeric:tabular-nums}
.mono,.big,.bignum{letter-spacing:-.02em}

/* ---------- navegación ---------- */
.topbar,nav.top{background:rgba(246,242,233,.82)!important;backdrop-filter:saturate(140%) blur(16px);-webkit-backdrop-filter:saturate(140%) blur(16px);
  border-bottom:1px solid var(--sb-line)!important;box-shadow:0 1px 0 rgba(20,18,13,.03)}
html[data-theme="dark"] .topbar,html[data-theme="dark"] nav.top{background:rgba(11,13,16,.82)!important}
.logo-chip,.foot-logo{border-radius:999px!important;border:1px solid var(--sb-line-2)!important;background:var(--sb-surface)!important;
  color:var(--sb-ink)!important;font-family:var(--sb-ui)!important;font-weight:800!important;letter-spacing:.12em!important;box-shadow:var(--sb-shadow)}
.logo-chip i,.logo-chip b{color:var(--sb-gold)!important}
nav.top a.nl{border-radius:999px!important;font-family:var(--sb-ui)!important;font-weight:600!important;color:var(--sb-muted)!important}
nav.top a.nl:hover{color:var(--sb-ink)!important;background:var(--sb-surface-2)!important}
nav.top a.star{background:var(--sb-gold-soft)!important;border:1px solid var(--sb-gold)!important;color:var(--sb-gold)!important}
.live-chip{border-radius:999px!important;border:1px solid var(--sb-line-2)!important;background:var(--sb-surface)!important;
  color:var(--sb-muted)!important;font-family:var(--sb-ui)!important;font-weight:700!important;letter-spacing:.1em!important}
.live-chip .dot{background:var(--sb-up)!important;box-shadow:0 0 0 4px rgba(23,121,90,.15)!important}

/* ---------- superficies ---------- */
.panel,.panel-soft,.card,.sem-card,.precio-card,.faq-item,.info-mini,.op-kpi,.sblib-card,.an-card,
.sem-bar,.cal-celda,.tt,.toast,.day-card,.key-card,.sem-que-card,.aviso-riesgo,
.analysis .panel,.analysis .panel-soft{
  background:var(--sb-surface)!important;border:1px solid var(--sb-line)!important;border-radius:var(--sb-r)!important;
  box-shadow:var(--sb-shadow)!important;color:var(--sb-text)!important
}
.precio-card,.sblib-card{background:linear-gradient(165deg,var(--sb-surface),var(--sb-surface-2))!important}
.card:hover,.an-card:hover,.sem-card:hover,.sblib-card:hover{box-shadow:var(--sb-shadow-lg)!important;border-color:var(--sb-line-2)!important}
.hr{background:var(--sb-line)!important;height:1px!important}
.sec-alt{background:linear-gradient(180deg,var(--sb-bg-2),var(--sb-bg))!important}

/* ---------- chips y botones ---------- */
.chip,.mes-chip,.tipo-chip,.badge-a,.badge-n,.badge-b,.an-chip,.chip-vio,.chip-up,.chip-down,.chip-flat,.chip-acc{
  border-radius:999px!important;font-family:var(--sb-ui)!important;font-weight:800!important;letter-spacing:.03em!important;
  border:1px solid var(--sb-line)!important;background:var(--sb-surface-2)!important;color:var(--sb-muted)!important
}
.chip-up,.badge-a{background:rgba(23,121,90,.10)!important;border-color:rgba(23,121,90,.28)!important;color:var(--sb-up)!important}
.chip-down,.badge-b{background:rgba(178,59,46,.09)!important;border-color:rgba(178,59,46,.26)!important;color:var(--sb-down)!important}
.chip-flat,.chip-acc,.badge-n{background:var(--sb-gold-soft)!important;border-color:rgba(201,162,39,.35)!important;color:var(--sb-gold)!important}
.chip-vio{background:#f4effc!important;border-color:#e8dcc0!important;color:#8a6a1f!important}
html[data-theme="dark"] .chip-vio{background:#241f11!important;border-color:#3a3218!important;color:#d8b45c!important}
.mes-chip.on,.tipo-chip.on{background:var(--sb-gold)!important;border-color:var(--sb-gold)!important;color:#fff!important}
html[data-theme="dark"] .mes-chip.on,html[data-theme="dark"] .tipo-chip.on{color:#14120d!important}

.btn,.btn-mini,.sem-link,.sem-nav,.sem-hoy{
  border-radius:999px!important;border:1px solid var(--sb-line-2)!important;background:var(--sb-surface)!important;
  color:var(--sb-ink)!important;font-family:var(--sb-ui)!important;font-weight:700!important;box-shadow:none!important;transition:all .22s ease!important
}
.btn:hover,.btn-mini:hover,.sem-link:hover,.sem-nav:hover,.sem-hoy:hover{border-color:var(--sb-gold)!important;color:var(--sb-gold)!important;transform:translateY(-1px)}
.btn-on{background:var(--sb-gold-soft)!important;border-color:var(--sb-gold)!important;color:var(--sb-gold)!important}
.btn-gold{background:linear-gradient(135deg,var(--sb-gold-2),var(--sb-gold))!important;color:#fff!important;border:none!important;
  box-shadow:0 10px 24px -10px rgba(166,124,23,.6)!important}

/* ---------- tablas ---------- */
table{border-collapse:separate!important;border-spacing:0!important;font-family:var(--sb-ui)!important}
table th{font-family:var(--sb-ui)!important;font-size:10.5px!important;font-weight:800!important;letter-spacing:.12em!important;
  text-transform:uppercase!important;color:var(--sb-muted)!important;background:var(--sb-surface-2)!important;border-color:var(--sb-line)!important}
table td{border-color:var(--sb-line)!important;color:var(--sb-text)!important;font-size:13px!important}
table tbody tr:hover td{background:var(--sb-surface-2)!important}
.up{color:var(--sb-up)!important}.down{color:var(--sb-down)!important}.flat{color:var(--sb-gold)!important}

/* ---------- formularios ---------- */
input,select,textarea{font-family:var(--sb-ui)!important;border-radius:var(--sb-r-sm)!important;border:1px solid var(--sb-line-2)!important;
  background:var(--sb-surface)!important;color:var(--sb-ink)!important}
input:focus,select:focus,textarea:focus{outline:none!important;box-shadow:var(--sb-ring)!important;border-color:var(--sb-gold)!important}

/* ---------- cabecera de sección / hero ---------- */
.hero{background:linear-gradient(180deg,var(--sb-bg-2),var(--sb-bg))!important;border-bottom:1px solid var(--sb-line)!important}
.hero-inner{position:relative}
.week-badge{border-radius:999px!important;background:var(--sb-surface)!important;border:1px solid var(--sb-line-2)!important;
  color:var(--sb-muted)!important;font-family:var(--sb-ui)!important;font-weight:700!important;letter-spacing:.12em!important;font-size:10.5px!important}
.hero-sub{color:var(--sb-muted)!important;font-size:16px!important;line-height:1.8!important}
.accent,.grad{background:linear-gradient(92deg,var(--sb-gold-2),var(--sb-gold))!important;-webkit-background-clip:text!important;
  background-clip:text!important;color:transparent!important}

/* ---------- análisis ---------- */
.analysis .h2,.analysis h1,.analysis h2{font-family:var(--sb-display)!important;font-weight:400!important}
.analysis .kpi,.analysis .bignum{font-family:var(--sb-mono)!important}
.analysis .bar-track{background:var(--sb-surface-2)!important;border-radius:99px!important}
.analysis .lvl .panel-soft{background:var(--sb-surface-2)!important;border-radius:var(--sb-r-sm)!important}

/* ---------- dow30 (tailwind) ---------- */
html:not([data-theme="dark"]) .text-white{color:var(--sb-ink)!important}
html:not([data-theme="dark"]) .text-slate-200,html:not([data-theme="dark"]) .text-slate-300{color:var(--sb-text)!important}
html:not([data-theme="dark"]) .text-slate-400,html:not([data-theme="dark"]) .text-slate-500{color:var(--sb-muted)!important}
html[data-theme="dark"] .text-white{color:var(--sb-ink)!important}
html[data-theme="dark"] .text-slate-200,html[data-theme="dark"] .text-slate-300{color:var(--sb-text)!important}
html[data-theme="dark"] .text-slate-400,html[data-theme="dark"] .text-slate-500{color:var(--sb-muted)!important}
html:not([data-theme="dark"]) .bg-\[\#070b12\],html:not([data-theme="dark"]) .bg-bg{background:var(--sb-bg)!important}
html[data-theme="dark"] .bg-\[\#070b12\],html[data-theme="dark"] .bg-bg{background:var(--sb-bg)!important}
html:not([data-theme="dark"]) header{border-color:var(--sb-line)!important}

/* ---------- pie ---------- */
.sb-foot{background:linear-gradient(170deg,#14120c,#0a0906)!important;border-top:1px solid rgba(201,162,39,.3)!important}
.sb-foot h4{font-family:var(--sb-ui)!important;letter-spacing:.18em!important;font-size:11px!important}

/* ---------- botones flotantes ---------- */
#toTop,.sb-theme-btn{border-radius:14px!important;border:1px solid var(--sb-line-2)!important;background:var(--sb-surface)!important;
  color:var(--sb-gold)!important;box-shadow:var(--sb-shadow)!important}
#toTop:hover,.sb-theme-btn:hover{background:linear-gradient(135deg,var(--sb-gold-2),var(--sb-gold))!important;color:#fff!important;
  border-color:var(--sb-gold)!important;transform:translateY(-2px)}

/* ---------- paginas con su propio conmutador (radar semanal) ---------- */
body.dark{--sb-bg:#0b0d10;--sb-bg-2:#111419;--sb-surface:#14181e;--sb-surface-2:#1a1f26;
  --sb-ink:#f7f2e7;--sb-text:#d7d1c3;--sb-muted:#9b9588;--sb-line:#252b33;--sb-line-2:#333a44;
  --sb-gold:#d9b45c;--sb-gold-soft:#242013;background:#0b0d10!important;color:#d7d1c3!important}
body.dark h1,body.dark h2,body.dark h3,body.dark h4{color:#f7f2e7!important}
body.dark .panel,body.dark .card,body.dark .day-card,body.dark .key-card,body.dark .cal-tab,
body.dark .sem-que-card,body.dark .hero{background:#14181e!important;border-color:#252b33!important;color:#d7d1c3!important}
body.dark .mute,body.dark .dim,body.dark .sec-desc{color:#9b9588!important}

/* ---------- botones "leer el libro" (tarjetas de la biblioteca) ---------- */
.sblib-cta,
.sblib-card.a-blue .sblib-cta,
.sblib-card.a-violet .sblib-cta{
  background:transparent!important;border:1px solid var(--sb-gold)!important;color:var(--sb-gold)!important;
  border-radius:999px!important;box-shadow:none!important;font-family:var(--sb-ui)!important;
  font-weight:800!important;letter-spacing:.03em!important;transition:all .25s ease!important
}
.sblib-cta:hover,
.sblib-card.a-blue .sblib-cta:hover,
.sblib-card.a-violet .sblib-cta:hover{
  background:linear-gradient(135deg,var(--sb-gold-2),var(--sb-gold))!important;color:#fff!important;
  border-color:transparent!important;transform:translateY(-2px)!important;box-shadow:0 12px 26px -12px rgba(166,124,23,.65)!important;filter:none!important
}
.sblib-card.a-blue .sblib-kick,.sblib-card.a-violet .sblib-kick,
.sblib-card.a-blue .sblib-sub,.sblib-card.a-violet .sblib-sub,
.sblib-card.a-blue .sblib-list li i,.sblib-card.a-violet .sblib-list li i{
  color:var(--sb-gold)!important;border-color:rgba(201,162,39,.4)!important;background:var(--sb-gold-soft)!important
}
.sblib-card.a-blue::before,.sblib-card.a-violet::before{
  background:linear-gradient(90deg,transparent,var(--sb-gold-2),transparent)!important
}
/* ---------- pie: tono claro integrado ---------- */
html:not([data-theme="dark"]) footer:not(.sb-foot),
html:not([data-theme="dark"]) .sb-foot{
  background:linear-gradient(180deg,#f5efdd,#ece3cb)!important;
  color:#4a4436!important;border-top:1px solid var(--sb-line-2)!important
}
html:not([data-theme="dark"]) footer:not(.sb-foot)::before,
html:not([data-theme="dark"]) .sb-foot::before{background:radial-gradient(600px 280px at 15% 0%,rgba(201,162,39,.18),transparent 62%)!important}
html:not([data-theme="dark"]) .foot-grid h4,
html:not([data-theme="dark"]) .sb-foot h4{color:var(--sb-gold)!important}
html:not([data-theme="dark"]) .foot-grid a{color:#5c5546!important}
html:not([data-theme="dark"]) .foot-grid a:hover{color:var(--sb-gold)!important}
html:not([data-theme="dark"]) .foot-brand{color:#5c5546!important}
html:not([data-theme="dark"]) .foot-logo{background:#fff!important;color:#14120d!important;border-color:var(--sb-line-2)!important}
html:not([data-theme="dark"]) .foot-logo i,html:not([data-theme="dark"]) .foot-logo b{color:var(--sb-gold)!important}
html:not([data-theme="dark"]) .social{background:#fff!important;color:#6f6957!important;border-color:var(--sb-line-2)!important}
html:not([data-theme="dark"]) .social:hover{background:linear-gradient(135deg,var(--sb-gold-2),var(--sb-gold))!important;color:#fff!important;border-color:var(--sb-gold)!important}
html:not([data-theme="dark"]) .foot-bottom{color:#7a7466!important;border-top-color:var(--sb-line-2)!important}
html:not([data-theme="dark"]) .sb-foot .social{background:#fff!important;color:#6f6957!important;border-color:var(--sb-line-2)!important}
html:not([data-theme="dark"]) .sb-foot .social:hover{background:linear-gradient(135deg,var(--sb-gold-2),var(--sb-gold))!important;color:#fff!important}

/* oscuro: pie un escalon por encima del fondo, no negro */
html[data-theme="dark"] footer:not(.sb-foot),
html[data-theme="dark"] .sb-foot{background:linear-gradient(180deg,#181d24,#13171c)!important;border-top:1px solid #2a313a!important;color:#cfc9bb!important}
html[data-theme="dark"] .foot-grid h4,html[data-theme="dark"] .sb-foot h4{color:var(--sb-gold-3)!important}
html[data-theme="dark"] .foot-grid a,html[data-theme="dark"] .sb-foot a{color:#c9c3b5!important}
html[data-theme="dark"] .foot-grid a:hover,html[data-theme="dark"] .sb-foot a:hover{color:var(--sb-gold-3)!important}
html[data-theme="dark"] .foot-brand{color:#b3ada0!important}
html[data-theme="dark"] .foot-bottom{color:#a49e90!important;border-top-color:#2a313a!important}
html[data-theme="dark"] .foot-logo{background:#1d232b!important;color:#f3eee2!important;border-color:#333b45!important}
html[data-theme="dark"] .social,html[data-theme="dark"] .sb-foot .social{background:#1d232b!important;color:#cfc9bb!important;border-color:#333b45!important}
body.dark footer:not(.sb-foot),body.dark .sb-foot{background:linear-gradient(180deg,#181d24,#13171c)!important;border-top-color:#2a313a!important;color:#cfc9bb!important}
/* ===== oscuro: superficies claras atenuadas y textos mas claros ===== */
html[data-theme="dark"] body{color:#e8e2d5!important}
html[data-theme="dark"] .mute,html[data-theme="dark"] .dim,html[data-theme="dark"] .t10,html[data-theme="dark"] .t11,
html[data-theme="dark"] small,html[data-theme="dark"] .sec-desc,html[data-theme="dark"] p.sub,
html[data-theme="dark"] .foot-bottom,html[data-theme="dark"] .text-slate-400,html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .foot-brand,html[data-theme="dark"] .foot-grid a{color:#bab4a6!important}

html[data-theme="dark"] .op-panel,html[data-theme="dark"] .op-col,html[data-theme="dark"] .op-charts,
html[data-theme="dark"] .op-kpi,html[data-theme="dark"] .sem-card,html[data-theme="dark"] .precio-card,
html[data-theme="dark"] .faq-item,html[data-theme="dark"] .faq-a,html[data-theme="dark"] .info-mini,
html[data-theme="dark"] .sblib-card,html[data-theme="dark"] .sblib-chip,html[data-theme="dark"] .an-card,
html[data-theme="dark"] .card,html[data-theme="dark"] .sem-bar,html[data-theme="dark"] .sem-stat,
html[data-theme="dark"] .cal-celda,html[data-theme="dark"] .cal-tab,html[data-theme="dark"] .day-card,
html[data-theme="dark"] .key-card,html[data-theme="dark"] .rt-row,html[data-theme="dark"] table,
html[data-theme="dark"] thead,html[data-theme="dark"] tbody,html[data-theme="dark"] tr,
html[data-theme="dark"] th,html[data-theme="dark"] td{background-color:#14181e!important;background-image:none!important;border-color:#252b33!important;color:#e2dccf!important}
html[data-theme="dark"] th{background-color:#1a1f26!important;color:#bab4a6!important}
html[data-theme="dark"] td{color:#e2dccf!important}
html[data-theme="dark"] tr:hover td{background-color:#1a1f26!important}
html[data-theme="dark"] tr.cu td{background-color:rgba(23,121,90,.14)!important}
html[data-theme="dark"] tr.cd td{background-color:rgba(178,59,46,.14)!important}
html[data-theme="dark"] .op-panel b,html[data-theme="dark"] .op-res b,html[data-theme="dark"] .op-panel .precio-num{color:#f3eee2!important}
html[data-theme="dark"] .op-panel svg text{fill:#cfc9bb!important}
html[data-theme="dark"] .op-panel svg line{stroke:#39414b!important}
html[data-theme="dark"] .sblib-chip{color:#bab4a6!important}
html[data-theme="dark"] .precio-card,html[data-theme="dark"] .sblib-card{background-image:linear-gradient(165deg,#171c23,#12161b)!important}
/* banner flotante antiguo: fuera */
.spartan-banner{display:none!important;pointer-events:none!important;transform:translateY(110%)!important}
