/**
 * Site Dark Mode – full-page dark theme.
 * Same --color-* tokens as Dashboard Metrics so the dashboard follows automatically.
 * Uses broad selectors so dark mode applies to the entire screen and all elements.
 *
 * @package Site_Dark_Mode
 */

/* Light (default) */
:root,
body {
	--color-bg: #ffffff;
	--color-surface: #f5f5f5;
	--color-surface-elevated: #fafafa;
	--color-text: #1e1e1e;
	--color-text-muted: #555555;
	--color-border: #e0e0e0;
	--color-accent: #0073aa;
	--color-accent-hover: #005d87;
	--color-accent-contrast: #ffffff;
	--color-warning-bg: #fff3cd;
	--color-warning-border: #856404;
	--color-warning-text: #856404;
	--color-error-text: #b32d2e;
	--color-link: #0073aa;
	--color-link-hover: #005d87;
	--color-chart-bar: rgba(0, 115, 170, 0.8);
	--color-chart-bar-border: rgb(0, 93, 135);
}

/* Dark – variable definitions */
body[data-theme="dark"] {
	--color-bg: #1a1a1a;
	--color-surface: #2d2d2d;
	--color-surface-elevated: #252525;
	--color-text: #e8e8e8;
	--color-text-muted: #a0a0a0;
	--color-border: #404040;
	--color-accent: #4a9fd4;
	--color-accent-hover: #6bb3e0;
	--color-accent-contrast: #1a1a1a;
	--color-warning-bg: #3d3520;
	--color-warning-border: #856404;
	--color-warning-text: #e6c04a;
	--color-error-text: #e07070;
	--color-link: #6bb3e0;
	--color-link-hover: #8fc4e8;
	--color-chart-bar: rgba(74, 159, 212, 0.85);
	--color-chart-bar-border: rgb(107, 179, 224);
}

/* ==========================================================================
   Full-page dark: body and common root wrappers (entire screen)
   ========================================================================== */

body[data-theme="dark"] {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Direct children of body (many themes use one wrapper div) */
body[data-theme="dark"] > * {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Theme root wrappers – force dark so whole layout is dark */
body[data-theme="dark"] #page,
body[data-theme="dark"] .site,
body[data-theme="dark"] .site-content,
body[data-theme="dark"] .site-inner,
body[data-theme="dark"] #main,
body[data-theme="dark"] .main,
body[data-theme="dark"] #content,
body[data-theme="dark"] .content-area,
body[data-theme="dark"] .content-wrapper,
body[data-theme="dark"] .page-wrapper,
body[data-theme="dark"] .site-main,
body[data-theme="dark"] main,
body[data-theme="dark"] .main-content,
body[data-theme="dark"] .container,
body[data-theme="dark"] .wrap,
body[data-theme="dark"] .entry,
body[data-theme="dark"] .page,
body[data-theme="dark"] .post {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Header / nav (site title, menu) */
body[data-theme="dark"] .site-header,
body[data-theme="dark"] header,
body[data-theme="dark"] .header,
body[data-theme="dark"] #masthead,
body[data-theme="dark"] .masthead,
body[data-theme="dark"] nav,
body[data-theme="dark"] .navigation,
body[data-theme="dark"] .main-navigation,
body[data-theme="dark"] .site-branding,
body[data-theme="dark"] .site-title,
body[data-theme="dark"] .site-title a {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .main-navigation a,
body[data-theme="dark"] .nav-menu a,
body[data-theme="dark"] .menu a,
body[data-theme="dark"] nav a {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .main-navigation a:hover,
body[data-theme="dark"] .nav-menu a:hover,
body[data-theme="dark"] nav a:hover {
	color: var(--color-link) !important;
}

/* Footer */
body[data-theme="dark"] .site-footer,
body[data-theme="dark"] footer,
body[data-theme="dark"] .footer,
body[data-theme="dark"] #colophon {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
	color: var(--color-text-muted) !important;
}

/* ==========================================================================
   Content: entries, blocks, headings, text
   ========================================================================== */

body[data-theme="dark"] .entry-header,
body[data-theme="dark"] .entry-content,
body[data-theme="dark"] .entry-summary,
body[data-theme="dark"] .post-content,
body[data-theme="dark"] .page-content,
body[data-theme="dark"] .block-content,
body[data-theme="dark"] .content {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] p,
body[data-theme="dark"] li,
body[data-theme="dark"] span,
body[data-theme="dark"] label {
	color: var(--color-text) !important;
}

body[data-theme="dark"] a {
	color: var(--color-link) !important;
}

body[data-theme="dark"] a:hover {
	color: var(--color-link-hover) !important;
}

/* WordPress block editor blocks – columns, groups, etc. */
body[data-theme="dark"] .wp-block-group,
body[data-theme="dark"] .wp-block-columns,
body[data-theme="dark"] .wp-block-column,
body[data-theme="dark"] [class*="wp-block-"],
body[data-theme="dark"] .has-background {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

/* Block inner content */
body[data-theme="dark"] .wp-block-group .wp-block-group__inner-container,
body[data-theme="dark"] .wp-block-column * {
	color: var(--color-text) !important;
}

/* ==========================================================================
   Form elements (search, inputs, selects, buttons)
   ========================================================================== */

body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="search"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="url"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] input[type="tel"],
body[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="image"]),
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
	color: var(--color-text-muted) !important;
}

/* ==========================================================================
   Sidebars, widgets, cards, panels
   ========================================================================== */

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .widget-area,
body[data-theme="dark"] aside,
body[data-theme="dark"] .widget,
body[data-theme="dark"] .card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] [class*="sidebar"],
body[data-theme="dark"] [class*="widget"] {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .widget .widget-title,
body[data-theme="dark"] .widget-title {
	color: var(--color-text) !important;
}

/* ==========================================================================
   Tables
   ========================================================================== */

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] thead th {
	background: var(--color-surface-elevated) !important;
}

/* ==========================================================================
   Charts / canvas containers (generic – Chart.js etc. may need JS theme)
   ========================================================================== */

body[data-theme="dark"] .chart-container,
body[data-theme="dark"] [class*="chart"],
body[data-theme="dark"] canvas {
	/* Canvas is drawn by JS; container gets dark bg so chart area isn’t white */
}

body[data-theme="dark"] .chart-container,
body[data-theme="dark"] [class*="chart"] {
	background: var(--color-surface) !important;
}

/* Article / single post page */
body[data-theme="dark"] .article,
body[data-theme="dark"] .single,
body[data-theme="dark"] .archive {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Elementor / page builders (common wrapper classes) */
body[data-theme="dark"] .elementor-section,
body[data-theme="dark"] .elementor-widget-container,
body[data-theme="dark"] .fl-page,
body[data-theme="dark"] .fl-content {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* ==========================================================================
   Genesis Framework + Genesis Sample child theme
   (Selectors from site-dark-mode/themes/genesis + genesis-sample)
   ========================================================================== */

/* Outer wrappers – Genesis header.php/footer.php + framework.php */
body[data-theme="dark"] .site-container,
body[data-theme="dark"] .site-inner,
body[data-theme="dark"] .site-container .wrap,
body[data-theme="dark"] .site-inner .wrap {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Content + sidebar layout wrap (framework.php) */
body[data-theme="dark"] .content-sidebar-wrap {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Main content – Genesis uses <main class="content"> */
body[data-theme="dark"] .content-sidebar-wrap .content,
body[data-theme="dark"] .content-sidebar .content,
body[data-theme="dark"] .sidebar-content .content,
body[data-theme="dark"] main.content {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

/* Sidebars – Genesis markup: .sidebar .sidebar-primary .widget-area */
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar-primary,
body[data-theme="dark"] .sidebar-secondary {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

/* Site header – <header class="site-header"> (Genesis Sample: #fff) */
body[data-theme="dark"] .site-header,
body[data-theme="dark"] .site-container .site-header {
	background: var(--color-surface) !important;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.2) !important;
	border-color: var(--color-border) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .site-header .wrap,
body[data-theme="dark"] .site-header .title-area,
body[data-theme="dark"] .site-header .widget-area {
	background: transparent !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .site-title a,
body[data-theme="dark"] .site-title a:focus,
body[data-theme="dark"] .site-title a:hover {
	color: var(--color-text) !important;
}

/* Primary/secondary nav – id="genesis-nav-primary", class="nav-primary" */
body[data-theme="dark"] .nav-primary,
body[data-theme="dark"] .nav-secondary,
body[data-theme="dark"] .genesis-nav-menu,
body[data-theme="dark"] .nav-primary .wrap,
body[data-theme="dark"] .nav-secondary .wrap {
	background: transparent !important;
	border-color: var(--color-border) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .nav-primary a,
body[data-theme="dark"] .nav-secondary a,
body[data-theme="dark"] .genesis-nav-menu a {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .nav-primary a:hover,
body[data-theme="dark"] .nav-secondary a:hover,
body[data-theme="dark"] .genesis-nav-menu a:focus,
body[data-theme="dark"] .genesis-nav-menu a:hover,
body[data-theme="dark"] .genesis-nav-menu .current-menu-item > a {
	color: var(--color-link) !important;
}

/* Submenu items – Genesis Sample sets .genesis-nav-menu .sub-menu a { background #fff } */
body[data-theme="dark"] .nav-primary .sub-menu,
body[data-theme="dark"] .nav-secondary .sub-menu,
body[data-theme="dark"] .genesis-nav-menu .sub-menu {
	background: var(--color-surface-elevated) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .genesis-nav-menu .sub-menu a {
	background: var(--color-surface-elevated) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .genesis-nav-menu .sub-menu a:hover,
body[data-theme="dark"] .genesis-nav-menu .sub-menu .current-menu-item > a {
	color: var(--color-link) !important;
}

/* Mobile menu toggles (Genesis Sample .menu-toggle, .sub-menu-toggle) */
body[data-theme="dark"] .menu-toggle,
body[data-theme="dark"] .sub-menu-toggle {
	background-color: transparent !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .menu-toggle:hover,
body[data-theme="dark"] .menu-toggle:focus,
body[data-theme="dark"] .sub-menu-toggle:hover,
body[data-theme="dark"] .sub-menu-toggle:focus {
	color: var(--color-link) !important;
}

/* Highlight menu item (Genesis Sample .menu-highlight) */
body[data-theme="dark"] .genesis-nav-menu > .menu-highlight > a {
	background-color: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
}

body[data-theme="dark"] .genesis-nav-menu > .menu-highlight > a:hover,
body[data-theme="dark"] .genesis-nav-menu > .menu-highlight > a:focus {
	background-color: var(--color-accent-hover) !important;
}

/* Footer widgets – Genesis Sample .footer-widgets { background #fff } */
body[data-theme="dark"] .footer-widgets,
body[data-theme="dark"] .footer-widgets .wrap,
body[data-theme="dark"] .footer-widgets .widget-area,
body[data-theme="dark"] .footer-widget-area {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .site-footer,
body[data-theme="dark"] .site-footer .wrap {
	background: var(--color-surface) !important;
	color: var(--color-text-muted) !important;
	border-color: var(--color-border) !important;
}

/* Entry (post/page), archive description */
body[data-theme="dark"] .entry,
body[data-theme="dark"] .entry-header,
body[data-theme="dark"] .entry-content,
body[data-theme="dark"] .entry-footer,
body[data-theme="dark"] .archive-description {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .entry-footer {
	border-top-color: var(--color-border) !important;
}

/* Author box, after-entry (Genesis Sample #f5f5f5) */
body[data-theme="dark"] .author-box,
body[data-theme="dark"] .after-entry {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

/* Breadcrumbs */
body[data-theme="dark"] .breadcrumb {
	background: transparent !important;
	color: var(--color-text-muted) !important;
	border-bottom-color: var(--color-border) !important;
}

/* Pagination (Genesis Sample .archive-pagination li a) */
body[data-theme="dark"] .pagination,
body[data-theme="dark"] .archive-pagination li a {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .archive-pagination li a:hover,
body[data-theme="dark"] .archive-pagination li.active a {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
}

/* Comments */
body[data-theme="dark"] .comment-respond,
body[data-theme="dark"] .entry-comments,
body[data-theme="dark"] .entry-pings,
body[data-theme="dark"] .comment-list li,
body[data-theme="dark"] .comment-header,
body[data-theme="dark"] .comment-content {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .comment-respond input,
body[data-theme="dark"] .comment-respond textarea {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

/* Focus outline (Genesis Sample :focus { outline #ccc }) */
body[data-theme="dark"] .site-container :focus {
	outline-color: var(--color-border) !important;
}

/* Sticky content / entry (Genesis Sample .content .sticky) */
body[data-theme="dark"] .content .sticky {
	background: var(--color-surface) !important;
}

/* ==========================================================================
   MLS Salary Explorer app (mls-salary-app-modular)
   ========================================================================== */

body[data-theme="dark"] .mls-salary-app,
body[data-theme="dark"] .mls-salary-app .mls-salary-app-title {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .mls-salary-app .search-container,
body[data-theme="dark"] .mls-salary-app #search-input {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .mls-salary-app #search-input::placeholder {
	color: var(--color-text-muted) !important;
}

body[data-theme="dark"] .mls-salary-app .mls-salary-app-loading,
body[data-theme="dark"] .mls-salary-app #mls-salary-app-loading {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .mls-salary-app #error-container {
	background: var(--color-warning-bg) !important;
	color: var(--color-warning-text) !important;
	border-color: var(--color-warning-border) !important;
}

body[data-theme="dark"] .mls-salary-app .breadcrumb-container,
body[data-theme="dark"] .mls-salary-app .breadcrumb {
	color: var(--color-text-muted) !important;
}

body[data-theme="dark"] .mls-salary-app #timeSeriesChartContainer {
	background: var(--color-surface) !important;
	border-radius: 8px;
}

body[data-theme="dark"] .mls-salary-app .controls-and-stats,
body[data-theme="dark"] .mls-salary-app #timeSeriesStatisticsContainer {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] .mls-salary-app #timeSeriesStatisticsContainer h4,
body[data-theme="dark"] .mls-salary-app #timeSeriesStatisticsContainer p {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .mls-salary-app-table-wrapper,
body[data-theme="dark"] .mls-salary-app table,
body[data-theme="dark"] .mls-salary-app table th,
body[data-theme="dark"] .mls-salary-app table td {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .mls-salary-app table th:hover {
	background: var(--color-surface-elevated) !important;
}

body[data-theme="dark"] .mls-salary-app-pagination__label {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .mls-salary-app-pagination .mls-salary-app-pagination__btn {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .mls-salary-app-pagination .mls-salary-app-pagination__btn:hover {
	background: var(--color-surface-elevated) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .mls-salary-app-pagination .mls-salary-app-pagination__btn--active {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
	border-color: var(--color-accent) !important;
}

body[data-theme="dark"] .mls-salary-app-return-btn {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
}

body[data-theme="dark"] .mls-salary-app-return-btn:hover {
	background: var(--color-accent-hover) !important;
}

/* ==========================================================================
   Partner Dashboard (partner-dashboard-project)
   ========================================================================== */

body[data-theme="dark"] .pd-wrap,
body[data-theme="dark"] .pd-portal {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-wrap h2,
body[data-theme="dark"] .pd-portal p {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-portal a {
	color: var(--color-link) !important;
}

body[data-theme="dark"] .pd-portal a:hover {
	color: var(--color-link-hover) !important;
}

body[data-theme="dark"] .pd-filters {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-filters label,
body[data-theme="dark"] .pd-filter-group label {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-filter-input,
body[data-theme="dark"] select.pd-filter-input {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-filter-custom-dates {
	border-top-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-button {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
}

body[data-theme="dark"] .pd-button:hover {
	background: var(--color-accent-hover) !important;
}

body[data-theme="dark"] .pd-pagination-info,
body[data-theme="dark"] .pd-pagination-count {
	color: var(--color-text-muted) !important;
}

body[data-theme="dark"] .pd-pagination-btn {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-pagination-btn:hover {
	background: var(--color-surface-elevated) !important;
}

body[data-theme="dark"] .pd-pagination-btn-disabled {
	background: var(--color-surface) !important;
	color: var(--color-text-muted) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-view-toggle {
	border-bottom-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-view-toggle-link {
	color: var(--color-link) !important;
	border-color: var(--color-link) !important;
}

body[data-theme="dark"] .pd-view-toggle-link:hover {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
	border-color: var(--color-accent) !important;
}

body[data-theme="dark"] .pd-metadata-note,
body[data-theme="dark"] .pd-metadata-range {
	color: var(--color-text-muted) !important;
}

body[data-theme="dark"] .pd-metadata-warning {
	background: var(--color-warning-bg) !important;
	color: var(--color-warning-text) !important;
	border-left-color: var(--color-warning-border) !important;
}

body[data-theme="dark"] .pd-rank-summary,
body[data-theme="dark"] .pd-rank-summary-empty {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-rank-summary strong {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-rank-item {
	background: var(--color-surface-elevated) !important;
	border-color: var(--color-border) !important;
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-export-controls .pd-button-export {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
	border-color: var(--color-accent) !important;
}

body[data-theme="dark"] .pd-export-controls .pd-button-export:hover {
	background: var(--color-accent-hover) !important;
}

body[data-theme="dark"] .pd-email-filter-banner {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-email-filter-banner .pd-email-filter-label,
body[data-theme="dark"] .pd-email-filter-banner .pd-email-filter-value {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-email-filter-banner .pd-filter-clear {
	background: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
	border-color: var(--color-accent) !important;
}

body[data-theme="dark"] .pd-email-filter-banner .pd-filter-clear:hover {
	background: var(--color-accent-hover) !important;
	border-color: var(--color-accent-hover) !important;
	color: var(--color-accent-contrast) !important;
}

body[data-theme="dark"] .pd-table-wrapper,
body[data-theme="dark"] .pd-table,
body[data-theme="dark"] .pd-table thead th,
body[data-theme="dark"] .pd-table tbody td,
body[data-theme="dark"] .pd-table tbody th {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .pd-table thead th a {
	color: var(--color-link) !important;
}

body[data-theme="dark"] .pd-table tbody tr {
	background: var(--color-surface) !important;
}

body[data-theme="dark"] .pd-table tbody tr:hover {
	background: var(--color-surface-elevated) !important;
}

body[data-theme="dark"] .pd-table .pd-status-refunded {
	color: var(--color-error-text) !important;
}

body[data-theme="dark"] .pd-table .pd-status-warning {
	color: var(--color-warning-text) !important;
}

body[data-theme="dark"] .pd-table .pd-status-paid {
	color: var(--color-text) !important;
}

body[data-theme="dark"] .pd-table td::before {
	color: var(--color-text-muted) !important;
}

/* Partner Dashboard admin forms (wrap form) */
body[data-theme="dark"] .wrap .pd-admin-form-group {
	background: transparent !important;
}

body[data-theme="dark"] .wrap form .pd-admin-input,
body[data-theme="dark"] .wrap form select.pd-admin-input,
body[data-theme="dark"] .wrap form input[type="month"].pd-admin-input {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body[data-theme="dark"] .wrap form label {
	color: var(--color-text) !important;
}

/* ==========================================================================
   IG Dashboard (3four3-IG-Dashboard) – wrapper; iframe content syncs via postMessage
   ========================================================================== */

body[data-theme="dark"] #ig-dashboard-embed,
body[data-theme="dark"] .ig-dashboard-wrapper {
	background: var(--color-bg) !important;
}

/* ==========================================================================
   Login page (wp-login.php) – follow site dark mode via body.login[data-theme="dark"]
   ========================================================================== */

body.login #login h1 {
	display: none;
}

body.login[data-theme="dark"] {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
}

body.login[data-theme="dark"] #login {
	background: var(--color-surface) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body.login[data-theme="dark"] #login h1 a {
	color: var(--color-link) !important;
}

body.login[data-theme="dark"] #login h1 a:hover,
body.login[data-theme="dark"] #login h1 a:focus {
	color: var(--color-link-hover) !important;
}

body.login[data-theme="dark"] #loginform {
	background: var(--color-surface) !important;
	border-color: var(--color-border) !important;
}

body.login[data-theme="dark"] #loginform label {
	color: var(--color-text) !important;
}

body.login[data-theme="dark"] #loginform input[type="text"],
body.login[data-theme="dark"] #loginform input[type="password"],
body.login[data-theme="dark"] .login form .input,
body.login[data-theme="dark"] .login input[type="text"],
body.login[data-theme="dark"] .login input[type="password"] {
	background: var(--color-bg) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body.login[data-theme="dark"] #loginform input::placeholder {
	color: var(--color-text-muted) !important;
}

body.login[data-theme="dark"] .login .button-primary,
body.login[data-theme="dark"] #wp-submit {
	background: var(--color-accent) !important;
	border-color: var(--color-accent) !important;
	color: var(--color-accent-contrast) !important;
}

body.login[data-theme="dark"] .login .button-primary:hover,
body.login[data-theme="dark"] .login .button-primary:focus,
body.login[data-theme="dark"] #wp-submit:hover,
body.login[data-theme="dark"] #wp-submit:focus {
	background: var(--color-accent-hover) !important;
	border-color: var(--color-accent-hover) !important;
	color: var(--color-accent-contrast) !important;
}

body.login[data-theme="dark"] #nav a,
body.login[data-theme="dark"] #backtoblog a {
	color: var(--color-link) !important;
}

body.login[data-theme="dark"] #nav a:hover,
body.login[data-theme="dark"] #backtoblog a:hover {
	color: var(--color-link-hover) !important;
}

body.login[data-theme="dark"] .login #login_error,
body.login[data-theme="dark"] .login .message {
	background: var(--color-surface-elevated) !important;
	color: var(--color-text) !important;
	border-color: var(--color-border) !important;
}

body.login[data-theme="dark"] .login .message {
	border-left-color: var(--color-accent) !important;
}

body.login[data-theme="dark"] #loginform .forgetmenot label {
	color: var(--color-text) !important;
}

/* ==========================================================================
   Header toggle (site-wide control)
   ========================================================================== */

/* Push toggle to the right in Genesis header: .wrap contains .title-area + .header-widget-area */
.site-header .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}
.site-header .wrap .title-area {
	float: none;
}
.site-dark-mode-header-toggle {
	display: inline-flex;
	align-items: center;
}
.site-header .header-widget-area {
	margin-left: auto;
}

.site-dark-mode-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.35em 0.6em;
	font-size: 0.9em;
	font-family: inherit;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.site-dark-mode-toggle:hover,
.site-dark-mode-toggle:focus {
	color: var(--color-link);
	border-color: var(--color-border);
	background: var(--color-surface-elevated);
	outline: none;
}

.site-dark-mode-toggle-icon {
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	background: currentColor;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	/* Moon icon (dark mode = show sun to switch to light) */
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

.site-dark-mode-header-toggle.is-dark .site-dark-mode-toggle-icon {
	/* Sun icon when in dark mode */
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
}

.site-dark-mode-toggle-label {
	white-space: nowrap;
}
