/* =========================================================
   FIX TAB — light mode
   I tab hanno sfondo scuro inline (rgb(20,20,20) / rgb(15,15,15))
   e testo bianco inline — vanno schiariti
   ========================================================= */

#theme-root.light .tab,
#theme-root.light .tab--selected,
#theme-root.light [class*="tab"] {
  background-color: #e2e8f0 !important;
  color: #0b1727 !important;
  border-color: #cbd5e1 !important;
}

#theme-root.light .tab--selected,
#theme-root.light [class*="tab"][aria-selected="true"] {
  background-color: #ffffff !important;
  color: #0b1727 !important;
  border-bottom-color: #ffffff !important;
}

#theme-root.light .tab span,
#theme-root.light [class*="tab"] span {
  color: #0b1727 !important;
}

/* Tab container */
#theme-root.light .tab-parent,
#theme-root.light .tab-container,
#theme-root.light [id*="tabs"] {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

/* =========================================================
   FIX GLOBALE — tabelle html.Table (studio_drawdown e altri)
   Il selettore in theme.css copre solo #portfolio-root
   Qui estendiamo a tutte le tabelle HTML nel sito
   ========================================================= */

#theme-root.light table {
  color: #0b1727 !important;
  background: transparent;
}
#theme-root.light table th {
  color: #0b1727 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  background-color: #f1f5f9 !important;
}
#theme-root.light table td {
  color: #0b1727 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* =========================================================
   FIX KPI box — studio_drawdown stats container
   I div con backgroundColor #1e1e1e e #1a1a1a
   vengono già catturati dal CSS globale in light_mode.css
   ma il testo interno inline 'color: white' va overridato
   ========================================================= */

#theme-root.light [style*="#1e1e1e"] h4,
#theme-root.light [style*="#1e1e1e"] p,
#theme-root.light [style*="#1a1a1a"] h4,
#theme-root.light [style*="#1a1a1a"] p {
  color: #0b1727 !important;
}

/* Colori semantici KPI: mantieni leggibili anche in light */
#theme-root.light [style*="color: cyan"] ,
#theme-root.light [style*="color:cyan"] {
  color: #0284c7 !important;
}
#theme-root.light [style*="color: #ff6b6b"],
#theme-root.light [style*="color: #ff0000"],
#theme-root.light [style*="color: red"] {
  color: #dc2626 !important;
}
#theme-root.light [style*="color: #51cf66"],
#theme-root.light [style*="color: green"] {
  color: #16a34a !important;
}
#theme-root.light [style*="color: orange"] {
  color: #d97706 !important;
}
#theme-root.light [style*="color: #888"],
#theme-root.light [style*="color: #aaa"] {
  color: #64748b !important;
}
