/**
 * Theme overrides loaded last — wins over legacy hardcoded colors
 */

html[data-theme] body.vpm {
  background: var(--vpm-bg);
  color: var(--vpm-text);
}

html[data-theme] body.vpm.vpm-institutional,
html[data-theme] body.vpm.vpm-institutional--refresh {
  background: var(--vpm-i-bg);
  color: var(--vpm-i-text);
}

html[data-theme] .vpm-panel,
html[data-theme] .vpm-metric-card,
html[data-theme] .vpm-dash-sidebar,
html[data-theme] .vpm-dash-header {
  background: var(--vpm-surface);
  border-color: var(--vpm-border);
  color: var(--vpm-text);
}

html[data-theme] .vpm-i-bento-card,
html[data-theme] .vpm-i-feature {
  background: var(--vpm-i-surface);
  border-color: var(--vpm-i-border);
  color: var(--vpm-i-text);
}

html[data-theme] .vpm-table--terminal th,
html[data-theme] .vpm-table--terminal td {
  border-color: var(--vpm-border);
  color: var(--vpm-text);
}

/* Legacy reference/marketing surfaces */
html[data-theme='light'] body.vpm-reference-landing {
  background: var(--vpm-bg);
  color: var(--vpm-text);
}

html[data-theme='light'] .vpm-ref-section,
html[data-theme='light'] .vpm-ref-section--dark,
html[data-theme='light'] .vpm-ref-section--navy {
  background: var(--vpm-surface);
  color: var(--vpm-text);
}

html[data-theme='light'] .vpm-ref-section--dark,
html[data-theme='light'] .vpm-ref-section--navy,
html[data-theme='light'] .vpm-ref-news {
  border-block: 1px solid var(--vpm-border);
}

html[data-theme='light'] .vpm-ref-header.vpm-ref-header--scrolled,
html[data-theme='light'] .vpm-ref-header--solid {
  background: color-mix(in srgb, var(--vpm-surface) 94%, transparent);
  border-bottom-color: var(--vpm-border);
  box-shadow: var(--vpm-shadow-sm);
}

html[data-theme='light'] .vpm-ref-header__link,
html[data-theme='light'] .vpm-ref-header__lang,
html[data-theme='light'] .vpm-ref-header__menu,
html[data-theme='light'] .vpm-ref-header__dashboard {
  color: var(--vpm-text);
}

html[data-theme='light'] .vpm-contact-page,
html[data-theme='light'] .vpm-mcontent-page {
  background: var(--vpm-bg);
  color: var(--vpm-text);
}

html[data-theme='dark'] .vpm-contact-page,
html[data-theme='dark'] .vpm-mcontent-page {
  background: var(--vpm-bg);
  color: var(--vpm-text);
}

html[data-theme] .vpm-contact-form,
html[data-theme] .vpm-mcontent-card {
  background: var(--vpm-surface);
  border-color: var(--vpm-border);
  color: var(--vpm-text);
}

html[data-theme='dark'] .vpm-contact-form,
html[data-theme='dark'] .vpm-mcontent-card {
  box-shadow: var(--vpm-shadow-card);
}

/* Cards page mobile shell used by app/cards/index.blade.php */
html[data-theme] .vpm-shell__main--cards .vpm-cards-matrix__panel {
  background: var(--vpm-cards-panel-bg, var(--vpm-surface));
  border-color: var(--vpm-cards-panel-border, var(--vpm-border));
}

html[data-theme] .vpm-shell__main--cards .vpm-cards-matrix__title,
html[data-theme] .vpm-shell__main--cards .vpm-cards-matrix__label,
html[data-theme] .vpm-shell__main--cards .vpm-cards-matrix__cell {
  border-color: var(--vpm-cards-table-border, var(--vpm-border));
  color: var(--vpm-cards-table-text, var(--vpm-text));
}

html[data-theme] .vpm-shell__main--cards .vpm-cards-tier-carousel__divider,
html[data-theme] .vpm-shell__main--cards .vpm-cards-tier-carousel__cell {
  background: var(--vpm-cards-table-border, var(--vpm-border));
}

html[data-theme] .vpm-shell__main--cards .vpm-cards-tier-carousel__nav {
  background: var(--vpm-cards-tier-shell-bg, var(--vpm-surface));
  border-color: var(--vpm-cards-tier-shell-border, var(--vpm-border));
  color: var(--vpm-cards-tier-label-text, var(--vpm-text));
}

html[data-theme='light'] .vpm-shell__main--cards .vpm-cards-tier-carousel__dots button.is-active {
  background: var(--vpm-text);
}

/* Auth theme toggle placement */
.vpm-auth-ref__top {
  display: flex;
  width: min(400px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
