/* Final theme guardrails. Loaded last: logo palette and contrast must win over legacy dark-first CSS. */

/* Every TodoPorras logo uses the dark-theme palette, regardless of where the logo is rendered. */
html[data-tp-theme="dark"] img[src*="todoporras-logo.png"]{
  filter:url(#tpLogoDarkPalette)!important;
  box-shadow:none!important;
  outline:0!important;
}

/* Explicitly reset the public light palette. */
html[data-tp-theme="light"] .tp-public-landing{
  --navy:#082c63;
  --navy2:#061b3b;
  --green:#09ba5d;
  --green2:#17cc71;
  --ink:#071c38;
  --muted:#607087;
  --line:#dce5ed;
  --soft:#eef5f2;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-public-section-head h2,
html[data-tp-theme="light"] .tp-public-pool-main h3,
html[data-tp-theme="light"] .tp-public-pools-empty h3,
html[data-tp-theme="light"] .tp-public-bottom-cta h2{
  color:#061b3b!important;
  opacity:1!important;
}
html[data-tp-theme="light"] .tp-public-pool-card{
  background:linear-gradient(180deg,#fff,#fbfcfd)!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-public-pool-main p,
html[data-tp-theme="light"] .tp-public-pool-meta,
html[data-tp-theme="light"] .tp-public-section-head p,
html[data-tp-theme="light"] .tp-public-bottom-cta p{
  color:#607087!important;
  opacity:1!important;
}

/* Authenticated light theme: neutral surfaces and readable typography. */
html[data-tp-theme="light"] .tp-shell-v2,
html[data-tp-theme="light"] .tp-main-v2{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-metric,
html[data-tp-theme="light"] .tp-panel,
html[data-tp-theme="light"] .tp-pool-card,
html[data-tp-theme="light"] .tp-admin-pool-row,
html[data-tp-theme="light"] .tp-profile-card{
  background:#fff!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-action-row,
html[data-tp-theme="light"] .tp-economic>div,
html[data-tp-theme="light"] .tp-profile-stats>div,
html[data-tp-theme="light"] .tp-soft-note{
  background:#f3f7fb!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-page-head h1,
html[data-tp-theme="light"] .tp-section-head h2,
html[data-tp-theme="light"] .tp-panel h2,
html[data-tp-theme="light"] .tp-panel h3,
html[data-tp-theme="light"] .tp-community-admin-copy h3,
html[data-tp-theme="light"] .tp-community-heading h2,
html[data-tp-theme="light"] .tp-community-heading h3,
html[data-tp-theme="light"] .tp-metric strong,
html[data-tp-theme="light"] .tp-economic strong,
html[data-tp-theme="light"] .tp-action-row strong,
html[data-tp-theme="light"] .tp-admin-pool-main h3,
html[data-tp-theme="light"] .tp-pool-card h3,
html[data-tp-theme="light"] .tp-profile-card h2{
  color:#071c38!important;
  opacity:1!important;
}
html[data-tp-theme="light"] .tp-page-head p,
html[data-tp-theme="light"] .tp-section-head p,
html[data-tp-theme="light"] .tp-community-admin-copy p,
html[data-tp-theme="light"] .tp-admin-pool-main p,
html[data-tp-theme="light"] .tp-action-row small,
html[data-tp-theme="light"] .tp-economic span,
html[data-tp-theme="light"] .tp-metric span{
  color:#607087!important;
  opacity:1!important;
}
html[data-tp-theme="light"] .tp-community-admin-banner{
  background:linear-gradient(135deg,#eef7ff,#f8fbff)!important;
  border-color:#b8d3eb!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-admin-pool-row .tp-admin-stat strong{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-admin-pool-row .tp-admin-stat span{
  color:#607087!important;
}

/* Keep intentionally dark controls readable inside the light theme. */
html[data-tp-theme="light"] .tp-admin-pool-row .tp-btn,
html[data-tp-theme="light"] .tp-btn.primary{
  opacity:1;
}

/* Final brand rule: dark wordmark follows the logo palette exactly. */
html[data-tp-theme="dark"] .tp-stadium-wordmark,
html[data-tp-theme="dark"] .tp-public-brand>span,
html[data-tp-theme="dark"] .tp-public-brand-button>span,
html[data-tp-theme="dark"] .tp-brand-v2>span:last-child{
  color:#7fc8ff!important;
}
html[data-tp-theme="dark"] .tp-stadium-wordmark b,
html[data-tp-theme="dark"] .tp-public-brand>span b,
html[data-tp-theme="dark"] .tp-public-brand-button>span b,
html[data-tp-theme="dark"] .tp-brand-v2>span:last-child b{
  color:#62e8a8!important;
}

/* Public hero logo: no special disc, rings or orbit markers in either theme. */
.tp-public-logo-orbit{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.tp-public-logo-orbit:before{
  display:none!important;
  content:none!important;
}
.tp-public-logo-orbit .orbit{
  display:none!important;
}

/* Admin Inicio: remove remaining dark-first KPI surfaces in light mode. */
html[data-tp-theme="light"] .tp-stadium-admin-metrics>div{
  background:#fff!important;
  border-color:#dce5ed!important;
  box-shadow:0 10px 28px rgba(8,44,99,.045)!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-stadium-admin-metrics span,
html[data-tp-theme="light"] .tp-stadium-admin-metrics small{
  color:#607087!important;
}
html[data-tp-theme="light"] .tp-stadium-admin-metrics strong{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-stadium-admin-metrics .yellow strong{
  color:#a76a05!important;
}
html[data-tp-theme="light"] .tp-stadium-economic-panel{
  border-color:#dce5ed!important;
}

/* Libro de Porras: metrics and table must be native light surfaces. */
html[data-tp-theme="light"] .tp-ledger-loading,
html[data-tp-theme="light"] .tp-ledger-empty,
html[data-tp-theme="light"] .tp-ledger-metrics>div,
html[data-tp-theme="light"] .tp-ledger-table-wrap{
  background:#fff!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
  box-shadow:0 10px 28px rgba(8,44,99,.035)!important;
}
html[data-tp-theme="light"] .tp-ledger-metrics span,
html[data-tp-theme="light"] .tp-ledger-metrics small,
html[data-tp-theme="light"] .tp-ledger-main small,
html[data-tp-theme="light"] .tp-ledger-table td small,
html[data-tp-theme="light"] .tp-ledger-table th{
  color:#607087!important;
}
html[data-tp-theme="light"] .tp-ledger-metrics strong,
html[data-tp-theme="light"] .tp-ledger-table td,
html[data-tp-theme="light"] .tp-ledger-main strong{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-ledger-table thead th{
  background:#f3f7fb!important;
}
html[data-tp-theme="light"] .tp-ledger-table tbody tr,
html[data-tp-theme="light"] .tp-ledger-table tbody td{
  background:#fff!important;
}
html[data-tp-theme="light"] .tp-ledger-table th,
html[data-tp-theme="light"] .tp-ledger-table td{
  border-color:#e3eaf1!important;
}
html[data-tp-theme="light"] .tp-ledger-table .good,
html[data-tp-theme="light"] .tp-ledger-metrics .good{
  color:#078b47!important;
}
html[data-tp-theme="light"] .tp-ledger-table .bad,
html[data-tp-theme="light"] .tp-ledger-metrics .bad{
  color:#c43d4a!important;
}

/* Agenda: contacts inherit the light theme instead of the legacy dark row. */
html[data-tp-theme="light"] .tp-contact-row{
  background:#fff!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
  box-shadow:0 8px 22px rgba(8,44,99,.035)!important;
}
html[data-tp-theme="light"] .tp-contact-main strong{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-contact-main small,
html[data-tp-theme="light"] .tp-contact-help,
html[data-tp-theme="light"] .tp-contact-form-card label{
  color:#607087!important;
}
html[data-tp-theme="light"] .tp-contact-row-actions .tp-link-btn:not(.danger){
  color:#078b47!important;
}
html[data-tp-theme="light"] .tp-contact-row-actions .tp-link-btn.danger{
  color:#c43d4a!important;
}

/* Administrar porra: Stadium is dark-first, so the complete admin workspace needs an explicit light counterpart. */
html[data-tp-theme="light"] .tp-pool-admin-v3{color:#071c38!important}
html[data-tp-theme="light"] .tp-pool-admin-head{
  background:linear-gradient(135deg,#ffffff,#f7fbf9)!important;
  border-color:#cfe2d8!important;
  box-shadow:0 14px 36px rgba(8,44,99,.055)!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-pool-admin-head h1,
html[data-tp-theme="light"] .tp-pool-admin-head h2,
html[data-tp-theme="light"] .tp-pool-admin-head h3{
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-pool-admin-head p,
html[data-tp-theme="light"] .tp-pool-admin-head small{
  color:#607087!important;
}
html[data-tp-theme="light"] .tp-pool-admin-head .tp-btn:not(.primary),
html[data-tp-theme="light"] .tp-pool-admin-v3>.btn:not(.primary){
  background:#fff!important;
  border-color:#ced9e4!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-admin-v3-metric{
  background:#fff!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
  box-shadow:0 9px 24px rgba(8,44,99,.04)!important;
}
html[data-tp-theme="light"] .tp-admin-v3-metric span{color:#607087!important}
html[data-tp-theme="light"] .tp-admin-v3-metric strong{color:#071c38!important}
html[data-tp-theme="light"] .tp-admin-v3-metric:last-child strong{color:#a76a05!important}
html[data-tp-theme="light"] .tp-admin-round-banner{
  background:linear-gradient(135deg,#eaf8f0,#f7fbf9)!important;
  border-color:#b9e4cc!important;
  color:#071c38!important;
  box-shadow:0 8px 22px rgba(9,186,93,.045)!important;
}
html[data-tp-theme="light"] .tp-admin-round-banner h3{color:#071c38!important}
html[data-tp-theme="light"] .tp-admin-round-banner p{color:#607087!important}
html[data-tp-theme="light"] .tp-admin-round-banner .pill{
  background:#fff!important;
  border-color:#b9d7c6!important;
  color:#078b47!important;
}
html[data-tp-theme="light"] .tp-admin-v3-tabs{
  background:#fff!important;
  border:1px solid #dce5ed!important;
  box-shadow:0 8px 22px rgba(8,44,99,.035)!important;
}
html[data-tp-theme="light"] .tp-admin-v3-tab{color:#607087!important}
html[data-tp-theme="light"] .tp-admin-v3-tab:hover{background:#f3f7fb!important;color:#071c38!important}
html[data-tp-theme="light"] .tp-admin-v3-tab.active{
  background:#17d990!important;
  border-color:#17d990!important;
  color:#032117!important;
}
html[data-tp-theme="light"] .tp-admin-v3-panel,
html[data-tp-theme="light"] .tp-admin-v3-table-wrap,
html[data-tp-theme="light"] .tp-admin-settings-card{
  background:#fff!important;
  border-color:#dce5ed!important;
  color:#071c38!important;
  box-shadow:0 9px 24px rgba(8,44,99,.035)!important;
}
html[data-tp-theme="light"] .tp-admin-v3-panel h2,
html[data-tp-theme="light"] .tp-admin-v3-panel h3,
html[data-tp-theme="light"] .tp-admin-settings-card h3{color:#071c38!important}
html[data-tp-theme="light"] .tp-admin-v3-panel p,
html[data-tp-theme="light"] .tp-admin-v3-panel small,
html[data-tp-theme="light"] .tp-admin-settings-card p,
html[data-tp-theme="light"] .tp-admin-settings-card small{color:#607087!important}
html[data-tp-theme="light"] .tp-stadium-admin-summary-grid .ledger{border-color:#dce5ed!important}
html[data-tp-theme="light"] .tp-stadium-admin-fixture,
html[data-tp-theme="light"] .tp-admin-v3-fixture,
html[data-tp-theme="light"] .tp-block-row,
html[data-tp-theme="light"] .tp-admin-rank-row,
html[data-tp-theme="light"] .tp-admin-progression-row,
html[data-tp-theme="light"] .tp-admin-readonly{
  background:#f7fafc!important;
  border-color:#dfe7ee!important;
  color:#071c38!important;
}
html[data-tp-theme="light"] .tp-stadium-admin-fixture .match strong,
html[data-tp-theme="light"] .tp-admin-v3-fixture strong,
html[data-tp-theme="light"] .tp-block-row strong,
html[data-tp-theme="light"] .tp-admin-rank-row strong,
html[data-tp-theme="light"] .tp-admin-progression-row strong{color:#071c38!important}
html[data-tp-theme="light"] .tp-stadium-admin-fixture .match small,
html[data-tp-theme="light"] .tp-admin-v3-fixture small,
html[data-tp-theme="light"] .tp-block-row small,
html[data-tp-theme="light"] .tp-admin-rank-row small,
html[data-tp-theme="light"] .tp-admin-progression-row small,
html[data-tp-theme="light"] .tp-admin-readonly{color:#607087!important}
html[data-tp-theme="light"] .tp-stadium-admin-fixture .kits>span:not(.tp-shirt){color:#7a899c!important}
html[data-tp-theme="light"] .tp-stadium-admin-fixture .state .pill,
html[data-tp-theme="light"] .tp-admin-v3-fixture .pill,
html[data-tp-theme="light"] .tp-pool-admin-v3 .pill{
  background:#f3f7fb!important;
  border-color:#cbd8e3!important;
  color:#52637b!important;
}
html[data-tp-theme="light"] .tp-pool-admin-v3 .tp-status.open,
html[data-tp-theme="light"] .tp-pool-admin-v3 .tp-status.active{
  background:#eaf8f0!important;
  border-color:#b9e4cc!important;
  color:#078b47!important;
}
html[data-tp-theme="light"] .tp-admin-v3-table th{
  background:#f3f7fb!important;
  color:#607087!important;
  border-color:#e3eaf1!important;
}
html[data-tp-theme="light"] .tp-admin-v3-table td,
html[data-tp-theme="light"] .tp-admin-v3-table tr{
  background:#fff!important;
  color:#071c38!important;
  border-color:#e3eaf1!important;
}
html[data-tp-theme="light"] .tp-admin-person strong,
html[data-tp-theme="light"] .tp-answer-line strong{color:#071c38!important}
html[data-tp-theme="light"] .tp-admin-person small,
html[data-tp-theme="light"] .tp-answer-line span:first-child,
html[data-tp-theme="light"] .tp-hidden-answer{color:#607087!important}
html[data-tp-theme="light"] .tp-submission-badge{
  background:#f7fafc!important;
  border-color:#cbd8e3!important;
  color:#52637b!important;
}
html[data-tp-theme="light"] .tp-submission-badge.done{background:#eaf8f0!important;border-color:#b9e4cc!important;color:#078b47!important}
html[data-tp-theme="light"] .tp-submission-badge.pending{background:#fff8e7!important;border-color:#ecd69c!important;color:#8c6500!important}
html[data-tp-theme="light"] .tp-submission-badge.eliminated{background:#fff0f1!important;border-color:#efc2c7!important;color:#b43a46!important}
html[data-tp-theme="light"] .tp-pool-admin-v3 .tp-link-btn{color:#078b47!important}
html[data-tp-theme="light"] .tp-pool-admin-v3 .notice:not(.err){background:#eef7ff!important;border-color:#c9ddee!important;color:#31506f!important}
html[data-tp-theme="light"] .tp-pool-admin-v3 .tp-kicker{color:#078b47!important}
