
/* ==========================================================
   IdeasBo.win - Sistema global de tema
   Oscuro por defecto / Claro opcional
   NO modifica SQL ni la base de datos.
   ========================================================== */

:root{
  --ib-theme-bg:#050809;
  --ib-theme-surface:#0d1517;
  --ib-theme-surface-2:#111a1c;
  --ib-theme-border:#2b373a;
  --ib-theme-text:#f3f5f4;
  --ib-theme-muted:#aeb7b9;
  --ib-theme-input:#172024;
  --ib-theme-sidebar:#071417;
  --ib-theme-sidebar-text:#e8e9e8;
  --ib-theme-sidebar-muted:#aeb5b7;
  --ib-theme-topbar:rgba(8,16,19,.92);
  --ib-theme-shadow:rgba(0,0,0,.30);
}

/* =========================
   MODO OSCURO
   ========================= */
html:not(.ib-theme-light) body{
  background:var(--ib-theme-bg) !important;
  color:var(--ib-theme-text) !important;
}

/* =========================
   MODO CLARO
   ========================= */
html.ib-theme-light{
  --ib-theme-bg:#f4f6f5;
  --ib-theme-surface:#ffffff;
  --ib-theme-surface-2:#f8faf9;
  --ib-theme-border:#d6ddde;
  --ib-theme-text:#1d2529;
  --ib-theme-muted:#5d696d;
  --ib-theme-input:#ffffff;
  --ib-theme-sidebar:#ffffff;
  --ib-theme-sidebar-text:#1d2529;
  --ib-theme-sidebar-muted:#647074;
  --ib-theme-topbar:rgba(255,255,255,.94);
  --ib-theme-shadow:rgba(30,45,50,.12);
}

html.ib-theme-light body{
  background:var(--ib-theme-bg) !important;
  color:var(--ib-theme-text) !important;
}

/* =========================
   SIDEBAR — ESTA ES LA PARTE
   QUE DEBE CAMBIAR DE COLOR
   ========================= */

html.ib-theme-light .sidebar{
  background:linear-gradient(180deg,#ffffff 0%,#f3f6f5 100%) !important;
  border-right:1px solid #d6ddde !important;
  box-shadow:8px 0 28px rgba(20,35,40,.06) !important;
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .brand{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .brand strong{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .brand small{
  color:#667174 !important;
}

html.ib-theme-light .sidebar .side-nav a{
  color:#263136 !important;
  background:transparent !important;
}

html.ib-theme-light .sidebar .side-nav a:hover{
  background:#edf1f0 !important;
  color:#8a6a0a !important;
}

html.ib-theme-light .sidebar .side-nav a.active{
  background:linear-gradient(90deg,#d5aa18,#bd920e) !important;
  color:#111 !important;
  box-shadow:0 4px 12px rgba(190,145,15,.18) !important;
}

html.ib-theme-light .sidebar .side-nav a.active .nav-symbol{
  color:#111 !important;
}

html.ib-theme-light .sidebar .mobile-close{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .side-divider{
  background:#d8dede !important;
}

html.ib-theme-light .sidebar .economia-side h3,
html.ib-theme-light .sidebar .eco-heading h3{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .eco-heading span{
  color:#687477 !important;
}

html.ib-theme-light .sidebar .economia-card{
  background:#ffffff !important;
  border-color:#cfd8d9 !important;
  color:#1d2529 !important;
  box-shadow:0 5px 16px rgba(20,35,40,.06) !important;
}

html.ib-theme-light .sidebar .economia-card .eco-title strong{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .economia-card .eco-title small,
html.ib-theme-light .sidebar .economia-card .eco-meta,
html.ib-theme-light .sidebar .economia-card .eco-pair small{
  color:#697578 !important;
}

html.ib-theme-light .sidebar .economia-card .eco-value,
html.ib-theme-light .sidebar .economia-card .eco-pair b{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .eco-calculator{
  background:#ffffff !important;
  color:#8a6a0a !important;
  border-color:#d6ddde !important;
}

html.ib-theme-light .sidebar .side-join{
  background:linear-gradient(145deg,#ffffff,#f4f7f6) !important;
  border-color:#c9a227 !important;
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .side-join h3{
  color:#1d2529 !important;
}

html.ib-theme-light .sidebar .side-join p{
  color:#5d696d !important;
}

/* =========================
   TOPBAR
   ========================= */
html.ib-theme-light .topbar{
  background:var(--ib-theme-topbar) !important;
  border-bottom-color:#d6ddde !important;
  box-shadow:0 3px 18px rgba(20,35,40,.05) !important;
}

html.ib-theme-light .top-actions a{
  color:#1d2529 !important;
}

html.ib-theme-light .top-actions .admin-link{
  border-left-color:#cfd7d8 !important;
}

html.ib-theme-light .search-wrap input{
  background:#ffffff !important;
  color:#1d2529 !important;
  border-color:#cfd8d9 !important;
}

html.ib-theme-light .search-wrap input::placeholder{
  color:#7b8789 !important;
}

html.ib-theme-light .hamburger,
html.ib-theme-light .mobile-brand{
  color:#1d2529 !important;
}

/* =========================
   CONTENIDO PRINCIPAL
   ========================= */
html.ib-theme-light .content{
  background:radial-gradient(circle at 75% 4%,#ffffff 0,#f5f7f6 45%,#edf1f0 100%) !important;
}

html.ib-theme-light .hero h1,
html.ib-theme-light .section h2,
html.ib-theme-light .join-banner h2,
html.ib-theme-light .calculator-card h2,
html.ib-theme-light .info-panel h2{
  color:#1d2529 !important;
}

html.ib-theme-light .hero p,
html.ib-theme-light .section-head p,
html.ib-theme-light .info-panel p,
html.ib-theme-light .calculator-card p{
  color:#697578 !important;
}

html.ib-theme-light .hero-visual{
  background:radial-gradient(circle at 50% 20%,#e8efec 0,#dfe8e5 45%,#cfd9d6 100%) !important;
  border-color:#ccd5d6 !important;
}

html.ib-theme-light .visual-card{
  background:linear-gradient(145deg,#ffffff,#edf2f1) !important;
  border-color:#cdd6d7 !important;
  box-shadow:0 25px 60px rgba(20,35,40,.14) !important;
  color:#1d2529 !important;
}

html.ib-theme-light .visual-card p{
  color:#1d2529 !important;
}

/* =========================
   TARJETAS
   ========================= */
html.ib-theme-light .service-card,
html.ib-theme-light .store-card,
html.ib-theme-light .live-card,
html.ib-theme-light .info-panel,
html.ib-theme-light .calculator-card,
html.ib-theme-light .empty-state,
html.ib-theme-light .join-banner{
  background:#ffffff !important;
  border-color:#d2dadb !important;
  color:#1d2529 !important;
  box-shadow:0 8px 24px rgba(20,35,40,.07) !important;
}

html.ib-theme-light .service-card{
  background:linear-gradient(145deg,#ffffff,#f6f8f7) !important;
}

html.ib-theme-light .service-card strong,
html.ib-theme-light .store-meta h3,
html.ib-theme-light .live-info strong{
  color:#1d2529 !important;
}

html.ib-theme-light .service-card small,
html.ib-theme-light .store-meta p,
html.ib-theme-light .live-info span{
  color:#657174 !important;
}

html.ib-theme-light .store-image,
html.ib-theme-light .live-image{
  background:#eef2f1 !important;
}

html.ib-theme-light .footer{
  border-top-color:#d6ddde !important;
  background:#edf1f0 !important;
  color:#667174 !important;
}

/* =========================
   FORMULARIOS Y MÓDULOS
   ========================= */
html.ib-theme-light .module-hero,
html.ib-theme-light .module-store-card,
html.ib-theme-light .live-module-card,
html.ib-theme-light .module-empty,
html.ib-theme-light .service-module-card,
html.ib-theme-light .entrepreneur-card,
html.ib-theme-light .offer-card,
html.ib-theme-light .category-card,
html.ib-theme-light .article-card,
html.ib-theme-light .history-item{
  background:#ffffff !important;
  border-color:#d2dadb !important;
  color:#1d2529 !important;
  box-shadow:0 7px 22px rgba(20,35,40,.06) !important;
}

html.ib-theme-light .module-hero{
  background:linear-gradient(135deg,#ffffff,#eef3f1) !important;
}

html.ib-theme-light .module-hero h1,
html.ib-theme-light .module-section-head h2,
html.ib-theme-light .module-store-body h3,
html.ib-theme-light .live-module-body h3,
html.ib-theme-light .entrepreneur-card h3,
html.ib-theme-light .offer-card h3,
html.ib-theme-light .category-card h3,
html.ib-theme-light .article-card h3{
  color:#1d2529 !important;
}

html.ib-theme-light .module-hero p,
html.ib-theme-light .module-section-head p,
html.ib-theme-light .module-store-body p,
html.ib-theme-light .live-module-body p,
html.ib-theme-light .entrepreneur-card p,
html.ib-theme-light .offer-card p,
html.ib-theme-light .category-card p,
html.ib-theme-light .article-card p{
  color:#687477 !important;
}

html.ib-theme-light input,
html.ib-theme-light select,
html.ib-theme-light textarea,
html.ib-theme-light .search-module input{
  background:#ffffff !important;
  color:#1d2529 !important;
  border-color:#cbd5d6 !important;
}

/* =========================
   BOTÓN DEL TEMA
   ========================= */
.ideasbo-theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:82px;
  height:34px;
  padding:0 11px;
  border:1px solid #465154;
  border-radius:999px;
  background:#11191b;
  color:#f3f5f4;
  cursor:pointer;
  font:700 11px Arial,sans-serif;
  transition:.2s ease;
}

.ideasbo-theme-toggle:hover{
  border-color:#e4c45b;
  color:#e4c45b;
}

html.ib-theme-light .ideasbo-theme-toggle{
  background:#ffffff !important;
  border-color:#cbd4d5 !important;
  color:#1d2529 !important;
}

html.ib-theme-light .ideasbo-theme-toggle:hover{
  border-color:#c9a227 !important;
  color:#8a6a0a !important;
}

@media(max-width:820px){
  .ideasbo-theme-toggle{
    min-width:38px;
    width:38px;
    padding:0;
  }
  .ideasbo-theme-toggle .theme-label{
    display:none;
  }
}

html,html body,html input,html select,html textarea,html button{font-family:Arial,Helvetica,sans-serif !important;}


/* Botón de tema fijo inferior derecho: se conserva además del botón superior. */
.ideasbo-theme-toggle--floating{
  position:fixed !important;
  right:22px !important;
  bottom:18px !important;
  z-index:9999 !important;
  min-width:104px !important;
  height:38px !important;
  padding:0 14px !important;
  background:#11191b !important;
  color:#f3f5f4 !important;
  border:1px solid #465154 !important;
  box-shadow:0 8px 24px rgba(0,0,0,.22) !important;
}
html.ib-theme-light .ideasbo-theme-toggle--floating{
  background:#ffffff !important;
  color:#1d2529 !important;
  border-color:#cbd4d5 !important;
  box-shadow:0 8px 24px rgba(30,45,50,.16) !important;
}
.ideasbo-theme-toggle--floating:hover{
  transform:translateY(-1px);
  border-color:#c9a227 !important;
}
@media(max-width:820px){
  .ideasbo-theme-toggle--floating{
    right:12px !important;
    bottom:12px !important;
    min-width:92px !important;
    height:36px !important;
  }
  .ideasbo-theme-toggle--floating .theme-label{display:inline !important;}
}


/* ==========================================================
   CORRECCION DEFINITIVA SIDEBAR
   El tema se aplica por atributo en HTML y BODY para evitar
   conflictos de especificidad con portal.css/modules.css.
   ========================================================== */
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar,
html.ib-theme-light body .portal-shell > aside.sidebar,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar{
  background:linear-gradient(180deg,#ffffff 0%,#f3f6f5 100%) !important;
  background-color:#ffffff !important;
  border-right-color:#d5dddd !important;
  color:#1d2529 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .brand,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-nav a,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .brand,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-nav a{
  color:#1d2529 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .brand small,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-join p,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card small,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .brand small,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-join p,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card small{
  color:#647074 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-nav a:hover,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-nav a:hover{
  background:#edf1f0 !important;
  color:#8a6a0a !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-nav a.active,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-nav a.active{
  background:linear-gradient(90deg,#d5aa18,#bd920e) !important;
  color:#111111 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-divider,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-divider{
  background:#d8dede !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-side h3,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .eco-heading h3,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-side h3,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .eco-heading h3{
  color:#1d2529 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .eco-heading span,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .eco-heading span{
  color:#687477 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card{
  background:#ffffff !important;
  background-color:#ffffff !important;
  border-color:#cfd8d9 !important;
  color:#1d2529 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-title strong,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-value,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-pair b,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-title strong,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-value,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-pair b{
  color:#1d2529 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-meta,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-pair small,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-meta,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-pair small{
  color:#697578 !important;
}

html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .side-join,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .side-join{
  background:linear-gradient(145deg,#ffffff,#f4f7f6) !important;
  border-color:#c9a227 !important;
  color:#1d2529 !important;
}

/* Modo oscuro explicito, para que el cambio sea simetrico. */
html[data-ideasbo-theme="dark"] body .portal-shell > aside.sidebar,
body[data-ideasbo-theme="dark"] .portal-shell > aside.sidebar{
  background:linear-gradient(180deg,#071417,#091012) !important;
  background-color:#071417 !important;
  border-right-color:#1e292b !important;
  color:#e8e9e8 !important;
}

/* =========================================================
   FASE 4.3 - ECONOMIA EN MODO CLARO
   Los bloques Compra/Venta conservaban fondo oscuro mientras
   el texto cambiaba a oscuro, haciendo ilegibles los valores.
   ========================================================= */
html.ib-theme-light .portal-shell > aside.sidebar .economia-card .eco-pair > div,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-pair > div,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-pair > div{
  background:#f3f6f5 !important;
  border:1px solid #d6dede !important;
  box-shadow:none !important;
}

html.ib-theme-light .portal-shell > aside.sidebar .economia-card .eco-pair b,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-pair b,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-pair b{
  color:#172126 !important;
  opacity:1 !important;
  visibility:visible !important;
  -webkit-text-fill-color:#172126 !important;
}

html.ib-theme-light .portal-shell > aside.sidebar .economia-card .eco-pair small,
html[data-ideasbo-theme="light"] body .portal-shell > aside.sidebar .economia-card .eco-pair small,
body[data-ideasbo-theme="light"] .portal-shell > aside.sidebar .economia-card .eco-pair small{
  color:#687477 !important;
}
