/* ============================================================
   BlinkHustle — Centralized Theme System (Light / Dark / System)
   ============================================================
   HOW THIS WORKS
   ─────────────────
   1. <html data-theme="light|dark"> is set by theme.js (and the tiny
      inline bootstrap snippet in <head>, to avoid a flash on load).
   2. Semantic CSS variables below define the palette for each mode.
      They map directly onto the existing BlinkHustle brand colors —
      dark mode is a properly designed dark surface system, not an
      inverted light theme.
   3. Below the variables, this file re-skins every shared component
      class used across dashboard.css / admin.css / mobile.css /
      style.css and the app's individual pages (cards, buttons, forms,
      tables, modals, nav, sidebar, notifications, badges, etc).
      `!important` is used deliberately here ONLY for color/background/
      border paint properties, so this file reliably wins over each
      page's own inline <style> block regardless of load order —
      without touching layout, spacing, or any existing functionality.
   4. A page built entirely from these shared classes needs ZERO extra
      work to support dark mode — it inherits it automatically. New
      one-off elements should prefer the CSS variables below (e.g.
      `background: var(--surface); color: var(--text-primary);`)
      to stay theme-safe by default.
   ============================================================ */

:root {
    /* Brand — identical in both themes, never touched by dark mode */
    --brand-primary: #10b981;
    --brand-primary-dark: #059669;
    --brand-accent: #f59e0b;
    --brand-danger: #ef4444;
    --brand-info: #6366f1;

    /* Light mode (default) surface system */
    --bg-body: #f0f4f8;
    --bg-page-alt: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-hover: #f8fafc;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-brand: #ffffff;
    --text-disabled: #cbd5e1;

    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --divider: #f1f5f9;

    --shadow-color: rgba(15, 23, 42, 0.08);
    --shadow-color-strong: rgba(15, 23, 42, 0.18);
    --overlay-bg: rgba(0, 0, 0, 0.5);

    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-placeholder: #94a3b8;

    --header-bg: rgba(255, 255, 255, 0.96);
    --sidebar-bg: #ffffff;
    --dark-panel-bg: #0f172a;

    --theme-transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

[data-theme="dark"] {
    /* !important on every one of these: many individual pages define
       their OWN unscoped :root{--surface:...} etc. with the same
       common names (--surface, --text, --border...) in their inline
       <style> block, which loads AFTER this stylesheet. Without
       !important, same-specificity + later-in-source means the
       page's own light-mode value silently wins and this whole
       variable system does nothing on that page. */
    --bg-body: #0b1120 !important;
    --bg-page-alt: #0f172a !important;
    --surface: #131b2e !important;
    --surface-2: #182338 !important;
    --surface-3: #1e293b !important;
    --surface-hover: #1c2740 !important;

    --text-primary: #eef2f8 !important;
    --text-secondary: #a3b0c4 !important;
    --text-muted: #7686a0 !important;
    --text-on-brand: #ffffff !important;
    --text-disabled: #4b5872 !important;

    --border-color: #263349 !important;
    --border-subtle: #1e293b !important;
    --divider: #1e293b !important;

    --shadow-color: rgba(0, 0, 0, 0.35) !important;
    --shadow-color-strong: rgba(0, 0, 0, 0.55) !important;
    --overlay-bg: rgba(0, 0, 0, 0.72) !important;

    --input-bg: #182338 !important;
    --input-border: #2c3a54 !important;
    --input-placeholder: #6b7893 !important;

    --header-bg: rgba(19, 27, 46, 0.96) !important;
    --sidebar-bg: #101828 !important;
    --dark-panel-bg: #060a14 !important;
}

/* Smooth, no-refresh switching (req #9) — scoped to paint properties only */
html[data-theme] body,
html[data-theme] body * {
    transition: var(--theme-transition);
}

/* ============================================================
   BASE
   ============================================================ */
[data-theme="dark"] body { background: var(--bg-body) !important; color: var(--text-primary) !important; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg-page-alt) !important; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155 !important; }
[data-theme="dark"] a { color: inherit; }
[data-theme="dark"] hr { border-color: var(--divider) !important; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
[data-theme="dark"] .dashboard-header-nav,
[data-theme="dark"] .admin-header-nav {
    background: var(--header-bg) !important;
    border-bottom-color: var(--border-color) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.35) !important;
}
[data-theme="dark"] .mobile-menu-btn,
[data-theme="dark"] .admin-mobile-menu-btn,
[data-theme="dark"] .notification-bell {
    background: var(--surface-3) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .mobile-menu-btn .bar,
[data-theme="dark"] .admin-mobile-menu-btn .bar { background: var(--text-primary) !important; }

/* ============================================================
   SIDEBAR
   ============================================================ */
[data-theme="dark"] .dashboard-sidebar {
    background: var(--sidebar-bg) !important;
    border-right-color: var(--border-color) !important;
    box-shadow: 2px 0 20px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .sidebar-link { color: var(--text-secondary) !important; }
[data-theme="dark"] .sidebar-link:hover { background: rgba(16,185,129,0.12) !important; color: #34d399 !important; }
[data-theme="dark"] .sidebar-link.active { background: rgba(16,185,129,0.16) !important; color: #34d399 !important; }
[data-theme="dark"] .sidebar-section-label { color: var(--text-muted) !important; }
[data-theme="dark"] .sidebar-divider,
[data-theme="dark"] .admin-sidebar-divider { border-top-color: var(--divider) !important; }
[data-theme="dark"] .mobile-nav-drawer { background: var(--sidebar-bg) !important; }
[data-theme="dark"] .mobile-nav-links a { color: var(--text-secondary) !important; }
[data-theme="dark"] .mobile-nav-links a:hover { background: rgba(16,185,129,0.12) !important; color: #34d399 !important; }
[data-theme="dark"] .mobile-nav-divider { border-top-color: var(--divider) !important; }

/* ============================================================
   CARDS
   ============================================================ */
[data-theme="dark"] .card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .task-card,
[data-theme="dark"] .task-item-fancy,
[data-theme="dark"] .tile,
[data-theme="dark"] .cat-card,
[data-theme="dark"] .quick-link-card,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-state-fancy,
[data-theme="dark"] .modal,
[data-theme="dark"] .toast,
[data-theme="dark"] .step-card,
[data-theme="dark"] .testi-card {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .settings-card-header {
    border-bottom-color: var(--border-subtle) !important;
}
[data-theme="dark"] .card-header h2,
[data-theme="dark"] .settings-card-header h3,
[data-theme="dark"] .stat-content h3,
[data-theme="dark"] .tile-value,
[data-theme="dark"] .cat-card-meta h3 {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .stat-content p,
[data-theme="dark"] .tile-label,
[data-theme="dark"] .tile-sub,
[data-theme="dark"] .cat-card-meta p,
[data-theme="dark"] .settings-card-header p,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .stat-content small {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .glass-card {
    background: rgba(19,27,46,0.75) !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* ============================================================
   FORMS
   ============================================================ */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-control {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--input-placeholder) !important; }
[data-theme="dark"] .form-label,
[data-theme="dark"] label {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-control:focus {
    border-color: var(--brand-primary) !important;
    background: var(--surface-2) !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */
[data-theme="dark"] .btn-secondary {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .btn-secondary:hover { border-color: var(--brand-primary) !important; color: #34d399 !important; }
[data-theme="dark"] .quick-link-card,
[data-theme="dark"] .action-btn { color: var(--text-primary) !important; }

/* ============================================================
   TABLES
   ============================================================ */
[data-theme="dark"] .data-table th,
[data-theme="dark"] table.wa-table th {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-subtle) !important;
}
[data-theme="dark"] .data-table td,
[data-theme="dark"] table.wa-table td {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-subtle) !important;
}
[data-theme="dark"] .data-table tr:hover td { background: var(--surface-hover) !important; }

/* ============================================================
   MODALS / OVERLAYS / POPUPS
   ============================================================ */
[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .gamify-popup-overlay {
    background: var(--overlay-bg) !important;
}
[data-theme="dark"] .modal h3 { color: var(--text-primary) !important; }

/* ============================================================
   NOTIFICATIONS DROPDOWN + USER MENU
   ============================================================ */
[data-theme="dark"] .notifications-panel,
[data-theme="dark"] .user-menu-dropdown {
    background: var(--surface) !important;
    box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 0 1px var(--border-color) !important;
}
[data-theme="dark"] .notification-item { border-bottom-color: var(--border-subtle) !important; }
[data-theme="dark"] .notification-item:hover { background: var(--surface-hover) !important; }
[data-theme="dark"] .notif-content strong { color: var(--text-primary) !important; }
[data-theme="dark"] .notif-content p { color: var(--text-secondary) !important; }
[data-theme="dark"] .notif-content small,
[data-theme="dark"] .no-notifications { color: var(--text-muted) !important; }
[data-theme="dark"] .notifications-footer {
    background: var(--surface-2) !important;
    border-top-color: var(--border-subtle) !important;
}
[data-theme="dark"] .user-info strong { color: var(--text-primary) !important; }
[data-theme="dark"] .user-info small { color: var(--text-secondary) !important; }
[data-theme="dark"] .user-menu-dropdown a { color: var(--text-secondary) !important; }
[data-theme="dark"] .user-menu-dropdown a:hover { background: var(--surface-hover) !important; }
[data-theme="dark"] .user-menu-dropdown hr { border-top-color: var(--border-subtle) !important; }

/* ============================================================
   TABS / STATUS PILLS / BADGES
   ============================================================ */
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .status-tab,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .ptab,
[data-theme="dark"] .btn-secondary.active {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .pill.na { background: var(--surface-3) !important; color: var(--text-muted) !important; }

/* ============================================================
   SETTINGS LIST / ACTIVITY / MISC ROWS
   ============================================================ */
[data-theme="dark"] .setting-item,
[data-theme="dark"] .activity-item,
[data-theme="dark"] .top-ref-row,
[data-theme="dark"] .form-row {
    border-bottom-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .activity-content p { color: var(--text-primary) !important; }
[data-theme="dark"] .activity-content small { color: var(--text-muted) !important; }

/* ============================================================
   HERO / GRADIENT BANNERS — already dark-designed, just deepen slightly
   ============================================================ */
[data-theme="dark"] .rev-banner,
[data-theme="dark"] .ref-banner,
[data-theme="dark"] .balance-hero-fancy {
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
}

/* ============================================================
   INLINE-STYLE SAFETY NET
   ────────────────────────────────────────────────────────────
   Many individual pages set colors via inline style="" attributes
   rather than classes. Inline styles normally beat external CSS, so
   this section targets the specific hex values used repeatedly across
   BlinkHustle's pages and force-overrides them (!important) only when
   data-theme="dark" is active. This is a pragmatic safety net, not a
   substitute for using the CSS variables above in new code.
   ============================================================ */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"] {
    background: var(--surface) !important;
}
[data-theme="dark"] [style*="color:#0f172a"],
[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#374151"],
[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#1f2937"],
[data-theme="dark"] [style*="color: #1f2937"] {
    color: var(--text-primary) !important;
}
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#6b7280"],
[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569"] {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] [style*="color:#cbd5e1"],
[data-theme="dark"] [style*="color: #cbd5e1"] {
    color: var(--text-muted) !important;
}
[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-color:#e2e8f0"],
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border:1px solid #f1f5f9"],
[data-theme="dark"] [style*="border: 1px solid #f1f5f9"] {
    border-color: var(--border-color) !important;
}
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"] {
    background: var(--surface-3) !important;
    color: var(--text-secondary) !important;
}

/* ============================================================
   THEME TOGGLE UI
   ============================================================ */
.theme-quick-toggle-btn {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--surface-3, #f8fafc);
    border: 2px solid var(--border-color, #e2e8f0);
    cursor: pointer; font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    transition: var(--theme-transition, all .2s);
    color: var(--text-primary, #0f172a);
}
.theme-quick-toggle-btn:hover { border-color: var(--brand-primary); transform: translateY(-2px); }

.appearance-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 560px) { .appearance-options { grid-template-columns: 1fr; } }

.appearance-option {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1.25rem 1rem; border-radius: 14px;
    border: 2px solid var(--border-color, #e2e8f0);
    background: var(--surface, #fff);
    cursor: pointer; transition: var(--theme-transition, all .2s);
    text-align: center;
}
.appearance-option:hover { border-color: var(--brand-primary); transform: translateY(-2px); }
.appearance-option.active {
    border-color: var(--brand-primary);
    background: rgba(16,185,129,0.08);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.appearance-option .ao-icon { font-size: 1.8rem; }
.appearance-option .ao-label { font-weight: 700; font-size: 0.88rem; color: var(--text-primary, #0f172a); }
.appearance-option .ao-check {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--border-color, #cbd5e1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: transparent;
}
.appearance-option.active .ao-check {
    border-color: var(--brand-primary); background: var(--brand-primary); color: white;
}

/* ============================================================
   EXTENDED CARD-LIKE CONTAINERS
   ────────────────────────────────────────────────────────────
   Many pages define their own one-off "card" style classes
   (stat strips, data cards, chart cards, achievement cards,
   admin panels, etc.) with a hardcoded white/light background
   in their own <style> block instead of using the shared .card
   class. These never picked up dark mode. This block brings
   every one of them onto the same --surface/--text-primary
   system used by .card and .profile-card (see setup-totp.php)
   so all cards look consistent in dark mode.
   ============================================================ */
[data-theme="dark"] .data-card,
[data-theme="dark"] .data-card-header,
[data-theme="dark"] .ach-card,
[data-theme="dark"] .ach-icon,
[data-theme="dark"] .ach-sum,
[data-theme="dark"] .alert-item,
[data-theme="dark"] .ann-card,
[data-theme="dark"] .api-stat,
[data-theme="dark"] .benefit-card,
[data-theme="dark"] .biz-stat-card,
[data-theme="dark"] .box,
[data-theme="dark"] .campaign-card,
[data-theme="dark"] .cat-stat,
[data-theme="dark"] .ch-card,
[data-theme="dark"] .challenge-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .chart-card-head,
[data-theme="dark"] .comments-section,
[data-theme="dark"] .delivery-opt,
[data-theme="dark"] .diag-card,
[data-theme="dark"] .dr-card,
[data-theme="dark"] .export-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .fs-card,
[data-theme="dark"] .fs-step,
[data-theme="dark"] .gamif-mini,
[data-theme="dark"] .gamify-popup,
[data-theme="dark"] .hist-card,
[data-theme="dark"] .hof-card,
[data-theme="dark"] .how-card,
[data-theme="dark"] .how-it-works,
[data-theme="dark"] .info-card,
[data-theme="dark"] .info-row,
[data-theme="dark"] .leader-card,
[data-theme="dark"] .log-card,
[data-theme="dark"] .login-item,
[data-theme="dark"] .meta-item,
[data-theme="dark"] .mini,
[data-theme="dark"] .mission-card,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .modal-head,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .msg-box,
[data-theme="dark"] .p-meta,
[data-theme="dark"] .participant-card,
[data-theme="dark"] .pay-card-head,
[data-theme="dark"] .pkg-card,
[data-theme="dark"] .plan-card,
[data-theme="dark"] .popup-box,
[data-theme="dark"] .prize-card,
[data-theme="dark"] .proof-box,
[data-theme="dark"] .proof-content,
[data-theme="dark"] .proof-item,
[data-theme="dark"] .proof-text-val,
[data-theme="dark"] .proof-type-tag,
[data-theme="dark"] .q-card,
[data-theme="dark"] .qr-section,
[data-theme="dark"] .receipt-card,
[data-theme="dark"] .ref-card,
[data-theme="dark"] .review-form,
[data-theme="dark"] .risk-meter,
[data-theme="dark"] .search-results,
[data-theme="dark"] .seo-card,
[data-theme="dark"] .session-item,
[data-theme="dark"] .slot-section,
[data-theme="dark"] .squad-card,
[data-theme="dark"] .stat-box,
[data-theme="dark"] .stat-mini,
[data-theme="dark"] .stat-tile,
[data-theme="dark"] .state-leaderboard,
[data-theme="dark"] .status-inactive,
[data-theme="dark"] .status-proof-box,
[data-theme="dark"] .step,
[data-theme="dark"] .sticky-footer,
[data-theme="dark"] .strip-card,
[data-theme="dark"] .sub-card,
[data-theme="dark"] .sub-meta,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .t-toggle-row,
[data-theme="dark"] .task-mgmt-card,
[data-theme="dark"] .task-stat,
[data-theme="dark"] .task-tag,
[data-theme="dark"] .task-type,
[data-theme="dark"] .tier-card,
[data-theme="dark"] .toggle-row,
[data-theme="dark"] .verify-box,
[data-theme="dark"] .video-card,
[data-theme="dark"] .wa-stat,
[data-theme="dark"] .wd-card,
[data-theme="dark"] .week-item,
[data-theme="dark"] .why-card,
[data-theme="dark"] .xp-hist-card {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

/* Titles / headings / values inside those cards that had a
   hardcoded dark navy color (invisible once the card background
   goes dark) */
[data-theme="dark"] .ach-name,
[data-theme="dark"] .api-stat-val,
[data-theme="dark"] .asc-val,
[data-theme="dark"] .at-title,
[data-theme="dark"] .benefit-title,
[data-theme="dark"] .caption-box,
[data-theme="dark"] .card-head,
[data-theme="dark"] .card-title,
[data-theme="dark"] .ch-title,
[data-theme="dark"] .challenge-title,
[data-theme="dark"] .comment-text,
[data-theme="dark"] .dc-title,
[data-theme="dark"] .dm-title,
[data-theme="dark"] .export-card,
[data-theme="dark"] .fallback-label,
[data-theme="dark"] .faq-q,
[data-theme="dark"] .fs-step-title,
[data-theme="dark"] .how-title,
[data-theme="dark"] .info-value,
[data-theme="dark"] .leader-name,
[data-theme="dark"] .log-card-name,
[data-theme="dark"] .log-subject,
[data-theme="dark"] .meta-val,
[data-theme="dark"] .mission-name,
[data-theme="dark"] .ms-name,
[data-theme="dark"] .msg-box,
[data-theme="dark"] .notif-title,
[data-theme="dark"] .page-title,
[data-theme="dark"] .popup-title,
[data-theme="dark"] .prev-total,
[data-theme="dark"] .proof-content,
[data-theme="dark"] .proof-name,
[data-theme="dark"] .proof-text-val,
[data-theme="dark"] .proof-type-tag,
[data-theme="dark"] .qr-title,
[data-theme="dark"] .rcm-name,
[data-theme="dark"] .ref-name,
[data-theme="dark"] .ref-total,
[data-theme="dark"] .sc-val,
[data-theme="dark"] .section-head,
[data-theme="dark"] .section-heading,
[data-theme="dark"] .section-label,
[data-theme="dark"] .slot-title,
[data-theme="dark"] .sm-val,
[data-theme="dark"] .sri-name,
[data-theme="dark"] .stat-mini-val,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .step-title,
[data-theme="dark"] .strip-val,
[data-theme="dark"] .task-mgmt-title,
[data-theme="dark"] .task-stat,
[data-theme="dark"] .task-title,
[data-theme="dark"] .tc-subject,
[data-theme="dark"] .tname,
[data-theme="dark"] .toast-title,
[data-theme="dark"] .tsj,
[data-theme="dark"] .utm-lbl,
[data-theme="dark"] .wa-stat-val,
[data-theme="dark"] .week-item-text,
[data-theme="dark"] .worker-name {
    color: var(--text-primary) !important;
}

/* Secondary / muted labels, descriptions, meta text inside those
   cards */
[data-theme="dark"] .ach-desc,
[data-theme="dark"] .ach-prog-label,
[data-theme="dark"] .ach-sum-lbl,
[data-theme="dark"] .ad-thumb-ph,
[data-theme="dark"] .alert-msg,
[data-theme="dark"] .alert-time,
[data-theme="dark"] .amb-stat-lbl,
[data-theme="dark"] .api-stat-lbl,
[data-theme="dark"] .asc-label,
[data-theme="dark"] .asc-sub,
[data-theme="dark"] .bar-lbl,
[data-theme="dark"] .benefit-desc,
[data-theme="dark"] .calc-sub,
[data-theme="dark"] .campaign-desc,
[data-theme="dark"] .comment-time,
[data-theme="dark"] .cost-val,
[data-theme="dark"] .cur-img,
[data-theme="dark"] .dc-sub,
[data-theme="dark"] .done-no,
[data-theme="dark"] .export-desc,
[data-theme="dark"] .fallback-title,
[data-theme="dark"] .faq-a,
[data-theme="dark"] .fee-label,
[data-theme="dark"] .fee-note,
[data-theme="dark"] .feed-time,
[data-theme="dark"] .fhint,
[data-theme="dark"] .follow-stats,
[data-theme="dark"] .footer-desc,
[data-theme="dark"] .fs-step-desc,
[data-theme="dark"] .fs-step-num,
[data-theme="dark"] .hero-stat-lbl,
[data-theme="dark"] .hero-sub,
[data-theme="dark"] .hidden-since,
[data-theme="dark"] .hof-empty,
[data-theme="dark"] .hof-sub,
[data-theme="dark"] .how-desc,
[data-theme="dark"] .info-label,
[data-theme="dark"] .leader-school,
[data-theme="dark"] .log-card-date,
[data-theme="dark"] .log-card-email,
[data-theme="dark"] .log-card-meta,
[data-theme="dark"] .log-meta,
[data-theme="dark"] .log-preview,
[data-theme="dark"] .log-time,
[data-theme="dark"] .login-meta,
[data-theme="dark"] .login-time,
[data-theme="dark"] .logo-sub,
[data-theme="dark"] .meta-label,
[data-theme="dark"] .mini-lbl,
[data-theme="dark"] .mission-desc,
[data-theme="dark"] .mission-progress-text,
[data-theme="dark"] .ms-locked,
[data-theme="dark"] .neutral,
[data-theme="dark"] .note,
[data-theme="dark"] .notif-msg,
[data-theme="dark"] .notif-time,
[data-theme="dark"] .p-meta-label,
[data-theme="dark"] .page-footer,
[data-theme="dark"] .page-sub,
[data-theme="dark"] .page-subtitle,
[data-theme="dark"] .pin-tip,
[data-theme="dark"] .plan-info,
[data-theme="dark"] .poll-pct,
[data-theme="dark"] .popup-msg,
[data-theme="dark"] .popup-subtitle,
[data-theme="dark"] .profit-zero,
[data-theme="dark"] .progress-label,
[data-theme="dark"] .progress-labels,
[data-theme="dark"] .proof-label,
[data-theme="dark"] .proof-meta,
[data-theme="dark"] .proof-time,
[data-theme="dark"] .provider-info,
[data-theme="dark"] .range-label,
[data-theme="dark"] .rcm-date,
[data-theme="dark"] .rcm-meta,
[data-theme="dark"] .ref-code,
[data-theme="dark"] .ref-email,
[data-theme="dark"] .ref-rank,
[data-theme="dark"] .ref-stat-lbl,
[data-theme="dark"] .risk-sub,
[data-theme="dark"] .s-closed,
[data-theme="dark"] .sc-lbl,
[data-theme="dark"] .sc-sub,
[data-theme="dark"] .sec-lbl,
[data-theme="dark"] .section-label,
[data-theme="dark"] .section-month,
[data-theme="dark"] .session-meta,
[data-theme="dark"] .slot-desc,
[data-theme="dark"] .sm-lbl,
[data-theme="dark"] .src-guest,
[data-theme="dark"] .sri-email,
[data-theme="dark"] .sstat-lbl,
[data-theme="dark"] .stat-lbl,
[data-theme="dark"] .stat-mini-label,
[data-theme="dark"] .stat-tile-lbl,
[data-theme="dark"] .state-members,
[data-theme="dark"] .step-desc,
[data-theme="dark"] .step-label,
[data-theme="dark"] .step-num,
[data-theme="dark"] .strip-label,
[data-theme="dark"] .sub-date,
[data-theme="dark"] .subtitle,
[data-theme="dark"] .suggest-hint,
[data-theme="dark"] .task-desc,
[data-theme="dark"] .task-meta-item,
[data-theme="dark"] .task-meta-row,
[data-theme="dark"] .task-price-header,
[data-theme="dark"] .task-tag,
[data-theme="dark"] .tc-user,
[data-theme="dark"] .tloc,
[data-theme="dark"] .track-label,
[data-theme="dark"] .ttext,
[data-theme="dark"] .tx-ref,
[data-theme="dark"] .wa-stat-lbl,
[data-theme="dark"] .wb-done,
[data-theme="dark"] .wd-meta,
[data-theme="dark"] .worker-task {
    color: var(--text-secondary) !important;
}

/* ============================================================
   ROUND 2 — classes missed by the first pass because they were
   preceded by a CSS comment (e.g. "/* Activity Feed *\/ .feed-item")
   which broke the original selector-extraction sweep. Same
   treatment as the block above.
   ============================================================ */
[data-theme="dark"] .ad-strip,
[data-theme="dark"] .admin-topbar,
[data-theme="dark"] .app-form,
[data-theme="dark"] .bottom-ad-strip,
[data-theme="dark"] .calc-card,
[data-theme="dark"] .feed-item,
[data-theme="dark"] .follow-card,
[data-theme="dark"] .gamif-sec,
[data-theme="dark"] .history-card,
[data-theme="dark"] .manual-key,
[data-theme="dark"] .markup-bar,
[data-theme="dark"] .notif-list,
[data-theme="dark"] .poll-card,
[data-theme="dark"] .progress-card,
[data-theme="dark"] .proof-block,
[data-theme="dark"] .ref-extra-card,
[data-theme="dark"] .ref-stats-panel,
[data-theme="dark"] .report-card,
[data-theme="dark"] .summary-box,
[data-theme="dark"] .task-row,
[data-theme="dark"] .ticket-card,
[data-theme="dark"] .top-earners,
[data-theme="dark"] .treasure-card,
[data-theme="dark"] .verify-card {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .empty,
[data-theme="dark"] .pw-toggle {
    color: var(--text-secondary) !important;
}


/* ============================================================
   ROUND 3 — short/ambiguous-looking class names that were
   deliberately skipped in round 1 out of caution (looked like
   generic utility classes such as margin-bottom helpers). Each
   was individually verified to be a real, page-scoped card/box
   component (used in exactly one or two pages, e.g. support.php's
   ticket cards, quick-help cards, contact tiles, FAQ items,
   earnings/referrals stat cards) and not a shared layout utility,
   so they're safe to re-skin the same way.
   ============================================================ */
[data-theme="dark"] .sc,
[data-theme="dark"] .tr,
[data-theme="dark"] .qhc,
[data-theme="dark"] .ct,
[data-theme="dark"] .sm,
[data-theme="dark"] .mb {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .fq {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .fa {
    color: var(--text-secondary) !important;
}

/* Form-like fields using page-local classes instead of .form-input */
[data-theme="dark"] .fi,
[data-theme="dark"] .rta {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* ============================================================
   ROUND 3B — plain gray "secondary" buttons (reset/cancel/hide)
   that hardcode the same light-gray bg + gray text pattern as
   .btn-secondary but under their own page-local class name.
   ============================================================ */
[data-theme="dark"] .btn-can,
[data-theme="dark"] .btn-cancel-sm,
[data-theme="dark"] .btn-dup,
[data-theme="dark"] .btn-reset,
[data-theme="dark"] .task-hide-btn {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* ============================================================
   ROUND 4 — LOCAL DESIGN-TOKEN OVERRIDE
   ────────────────────────────────────────────────────────────
   ~30 pages (verify-account.php, tasks.php, index.php, login.php,
   business-*.php, etc.) each define their OWN local :root custom
   properties for surface/text colors (--card, --ink, --text,
   --dark, --muted, --border, etc.) instead of using theme.css's
   --surface/--text-primary system. Those never responded to dark
   mode at all — no class-level fix can reach a raw var() reference.
   This redefines the shared *semantic* names (surface/ink/text/
   muted/border) once dark mode is on, at higher priority than the
   page's own :root, so every page's local "white card, dark text"
   tokens flip automatically. Brand/accent tokens (emerald, indigo,
   gold, amber, biz-*, user-*, etc.) are left alone on purpose —
   those are intentional colors, not surface/text tokens.
   ============================================================ */
html[data-theme="dark"] {
    --card: var(--surface) !important;
    --bg: var(--bg-body) !important;
    --ink: var(--text-primary) !important;
    --text: var(--text-primary) !important;
    --dark: var(--text-primary) !important;
    --dark2: var(--text-primary) !important;
    --muted: var(--text-secondary) !important;
    --subtle: var(--text-secondary) !important;
    --slate-900: var(--text-primary) !important;
    --border: var(--border-color) !important;
    --border-2: var(--border-color) !important;
    --ivory: var(--surface) !important;
    --mist: var(--surface) !important;
    --pay-bg: var(--surface) !important;
}

/* ============================================================
   ROUND 5 — remaining confirmed-broken containers + generic
   patterns for "*-head" title wrappers and empty-state messages,
   which repeat near-identically across dozens of pages with
   hardcoded #0f172a / #64748b text.
   ============================================================ */
[data-theme="dark"] .tcard,
[data-theme="dark"] .tcard-head,
[data-theme="dark"] .empty-s,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .ndpa-notice,
[data-theme="dark"] .activation-notice {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .filter-group label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* Generic: any "*-head" wrapper's heading text (covers .pg-head h1,
   .card-header h2, .data-card-header h2, .feed-head h2, .page-header h1,
   .profile-card-head h3, .progress-header h2, .q-card-head h2,
   .tcard-head h2, .wd-head h2, .xp-hist-head h2, and any future ones
   following the same naming convention) */
[data-theme="dark"] [class*="head"] h1,
[data-theme="dark"] [class*="head"] h2,
[data-theme="dark"] [class*="head"] h3 {
    color: var(--text-primary) !important;
}
[data-theme="dark"] [class*="head"] p {
    color: var(--text-secondary) !important;
}

/* Generic: any "*empty*" state wrapper's title/description text
   (covers .empty-state h3/p, .empty-s p, .hof-empty, etc.) */
[data-theme="dark"] [class*="empty"] h2,
[data-theme="dark"] [class*="empty"] h3 {
    color: var(--text-primary) !important;
}
[data-theme="dark"] [class*="empty"] p {
    color: var(--text-secondary) !important;
}

/* ============================================================
   ROUND 6 — tab-strip WRAPPER containers (not the individual tab
   buttons, which keep their own active/inactive styling — just
   the white bar they sit inside of).
   ============================================================ */
[data-theme="dark"] .section-tabs,
[data-theme="dark"] .sec-tabs,
[data-theme="dark"] .hof-tabs {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .wd-item {
    background: var(--surface-2) !important;
}

/* Poll option buttons: real content-carrying "cards" the person clicks
   to vote, not decorative UI chrome — needed explicit text color or
   it silently inherited body's (light) color onto a white background. */
[data-theme="dark"] .poll-opt-btn {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .poll-opt-btn:hover,
[data-theme="dark"] .poll-opt-btn.selected {
    background: var(--surface-2) !important;
}

[data-theme="dark"] .form-card {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .sec-tab.active {
    color: var(--text-primary) !important;
    border-bottom-color: var(--text-primary) !important;
}

[data-theme="dark"] .cta-btn {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .network-btn {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .network-btn .net-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .video-info h3 {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .video-info p {
    color: var(--text-secondary) !important;
}

/* Generic: "*-info" content wrappers (video-info, task-info, etc.) —
   same repeating hardcoded-title/hardcoded-description pattern as
   the "*-head" and "*empty*" wrappers above. */
[data-theme="dark"] [class*="-info"] h1,
[data-theme="dark"] [class*="-info"] h2,
[data-theme="dark"] [class*="-info"] h3 {
    color: var(--text-primary) !important;
}
[data-theme="dark"] [class*="-info"] p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .step-body strong {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notif-item.unread {
    background: rgba(0, 135, 81, 0.12) !important;
    border-left-color: var(--user-primary, #00a862) !important;
}
[data-theme="dark"] .notif-item.unread:hover {
    background: rgba(0, 135, 81, 0.18) !important;
}
[data-theme="dark"] .notif-item:hover {
    background: var(--surface-2) !important;
}

[data-theme="dark"] .sch h2 {
    color: var(--text-primary) !important;
}

/* ============================================================
   ROUND 7 — fixes from screenshots 206-212
   ============================================================ */

/* --white used as a genuine surface/background token on login.php
   and register.php (never as text color there — confirmed by
   checking every usage) */
html[data-theme="dark"] {
    --white: var(--surface) !important;
}

/* Security Center checklist box: pale-green background never
   changed, and its row text has no explicit color so it silently
   inherited the (light) body text color -> invisible on a light
   green card */
[data-theme="dark"] .security-tips {
    background: rgba(0, 135, 81, 0.12) !important;
    border-color: rgba(0, 168, 98, 0.3) !important;
}
[data-theme="dark"] .tip-row {
    color: var(--text-primary) !important;
}

/* ============================================================
   ROUND 8 — light/white ":hover" backgrounds that never got a
   dark-mode equivalent, several of which set no explicit hover
   text color at all (so the already-light dark-mode text became
   invisible the moment the background flashed light on hover).
   ============================================================ */
[data-theme="dark"] .sub-header:hover,
[data-theme="dark"] .task-table tr:hover td,
[data-theme="dark"] .payment-method:hover,
[data-theme="dark"] .faq-q:hover,
[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] tr:hover td {
    background: var(--surface-2) !important;
}

[data-theme="dark"] .notif-btn:hover {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
}

/* Pale semantic hovers (approve/reject/status pills) — keep the
   accent color but drop the near-white tint underneath it */
[data-theme="dark"] .app-link:hover,
[data-theme="dark"] .qf-pill:hover,
[data-theme="dark"] .status-tab.active,
[data-theme="dark"] .status-tab:hover,
[data-theme="dark"] .page-btn:hover:not(.active),
[data-theme="dark"] .ct:hover,
[data-theme="dark"] .notif-btn.read-btn:hover,
[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone.drag-over,
[data-theme="dark"] .confirm-section label:hover {
    background: rgba(0, 135, 81, 0.14) !important;
}
[data-theme="dark"] .notif-btn.del-btn:hover,
[data-theme="dark"] .btn-reject:hover,
[data-theme="dark"] .task-hide-btn:hover {
    background: rgba(239, 68, 68, 0.14) !important;
}
[data-theme="dark"] .btn-revision:hover {
    background: rgba(139, 92, 246, 0.14) !important;
}

/* ============================================================
   ROUND 9 — screenshots 208-215
   ============================================================ */

/* Notification filter pills, fee-range pills, earnings log tabs:
   real filter/toggle controls that got caught by an overly broad
   "exclude anything with -filter/-tab/-pill in the name" rule in
   earlier passes. Each is confirmed scoped to a single page, so
   safe to re-skin like any other card/pill. */
[data-theme="dark"] .filter-tab,
[data-theme="dark"] .qf-pill,
[data-theme="dark"] .tab {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .filter-tab.active,
[data-theme="dark"] .qf-pill.active,
[data-theme="dark"] .qf-pill.active-high,
[data-theme="dark"] .qf-pill.active-medium,
[data-theme="dark"] .qf-pill.active-small,
[data-theme="dark"] .tab.active {
    color: #ffffff !important;
}

/* Bare/generic table headers across several pages that never used
   the shared .data-table class */
[data-theme="dark"] th,
[data-theme="dark"] .htable th,
[data-theme="dark"] .log-table th,
[data-theme="dark"] .src-table th,
[data-theme="dark"] .task-table th,
[data-theme="dark"] .tbl th {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Personal dashboard "Explore & Earn" spotlight banner + the
   Spin/Quests/Missions tiles: each sets its own inline pastel
   gradient per state, with inline color:#0f172a text that the
   safety-net correctly turns light — but the gradient itself
   never changed, so it went light-text-on-light-gradient.
   !important here overrides the inline gradient regardless of
   which of the 3 color variants is active. */
[data-theme="dark"] .fs-header,
[data-theme="dark"] .card-lift {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
}

/* User menu dropdown header strip: lives in dashboard.css (a
   stylesheet not included in what was uploaded — see note below),
   so this blindly overrides it from theme.css instead. */
[data-theme="dark"] .user-info {
    background: var(--surface) !important;
}

/* ============================================================
   ROUND 10 — screenshots 216-218
   ============================================================ */

/* setup-totp.php authenticator-app links: only :hover was fixed
   before, base (non-hover) state still had its own light bg/text */
[data-theme="dark"] .app-link {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* Pagination buttons: same story — only :hover:not(.active) was
   fixed, the resting/base state never was */
html[data-theme="dark"] .page-btn,
[data-theme="dark"] .page-btn {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .page-btn.active,
[data-theme="dark"] .page-btn.active {
    background: #008751 !important;
    color: #ffffff !important;
    border-color: #008751 !important;
}
[data-theme="dark"] .page-btn.active {
    color: #ffffff !important;
}

/* Achievements page XP History row hover — same "light bg, no
   explicit text color" pattern as the other list-row hovers */
[data-theme="dark"] .xp-row:hover {
    background: var(--surface-2) !important;
}

/* ============================================================
   ROUND 11 — comprehensive re-sweep of ALL ":hover" rules with a
   near-white background (not just an exact hex-list match this
   time, so it also catches near-white shades like #fafbfc/#fafafe
   that earlier passes' fixed hex list missed), mostly on admin
   pages that hadn't been screenshotted yet.
   ============================================================ */
[data-theme="dark"] .ad-table tbody tr:hover td,
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-status-update:hover,
[data-theme="dark"] .htable tr:hover td,
[data-theme="dark"] .lb-row:hover,
[data-theme="dark"] .log-item:hover,
[data-theme="dark"] .pg-btn:hover:not(.active),
[data-theme="dark"] .reaction-btn:hover,
[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .src-table tr:hover td,
[data-theme="dark"] .tbl tr:hover td,
[data-theme="dark"] .range-pill:hover {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .range-pill.active {
    color: #ffffff !important;
}

/* Semantic-tinted hovers: keep their accent meaning, just swap the
   near-white base for a dark-appropriate tint of the same hue */
[data-theme="dark"] .emoji-btn:hover,
[data-theme="dark"] .emoji-btn.selected,
[data-theme="dark"] .hof-tab:hover,
[data-theme="dark"] .ptab.active,
[data-theme="dark"] .ptab:hover {
    background: rgba(0, 135, 81, 0.14) !important;
}
[data-theme="dark"] .modal-x:hover {
    background: rgba(239, 68, 68, 0.14) !important;
}

/* ============================================================
   ROUND 12 — index.php (public marketing homepage) now supports
   real dark mode instead of being locked to light. Fixes every
   section wrapper and card class found with a hardcoded light or
   pale-gradient background, matched against theme.css's shared
   --surface/--text system so it's visually consistent with the
   rest of the site.
   ============================================================ */

/* body itself already flips via the shared rule; these are the
   individual <section>/<div> wrappers stacked on top of it that
   each had their own opaque light background */
[data-theme="dark"] #about,
[data-theme="dark"] #advertise,
[data-theme="dark"] #how-it-works,
[data-theme="dark"] #seo,
[data-theme="dark"] #stats,
[data-theme="dark"] #tasks,
[data-theme="dark"] #testimonials,
[data-theme="dark"] #vtu,
[data-theme="dark"] #faq,
[data-theme="dark"] #challenge-winners {
    background: var(--bg-body) !important;
    background-image: none !important;
}

/* Card-level classes unique to the homepage that the dashboard
   sweep never touched */
[data-theme="dark"] .ad-placeholder,
[data-theme="dark"] .ad-slot,
[data-theme="dark"] .gami-card,
[data-theme="dark"] .ref-sec,
[data-theme="dark"] .dd-menu,
[data-theme="dark"] .ref-link-box {
    background: var(--surface) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Small colored badges/pills/buttons unique to the homepage */
[data-theme="dark"] .btn-ad-cta,
[data-theme="dark"] .btn-cta-w,
[data-theme="dark"] .cac-badge {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
}

/* "What can you earn" popup cards — pale blue/green tinted,
   keep the tint but darken it like the other semantic cards */
[data-theme="dark"] .pop-card-biz {
    background: rgba(99, 102, 241, 0.14) !important;
}
[data-theme="dark"] .pop-card-earn,
[data-theme="dark"] .testi-earn {
    background: rgba(0, 135, 81, 0.14) !important;
}
[data-theme="dark"] .pop-progress-bar {
    background: var(--surface-2) !important;
}

/* "Premium Activation" explainer box on the homepage — a one-off
   inline-styled card (no shared class), matched by its distinctive
   border color instead */
[data-theme="dark"] [style*="border:1.5px solid #86efac"] {
    background: rgba(0, 135, 81, 0.14) !important;
    background-image: none !important;
}
[data-theme="dark"] [style*="border:1px solid #86efac"] {
    background: var(--surface) !important;
}

/* ============================================================
   ROUND 13 — index.php: nav bar + a --dark variable collision
   ────────────────────────────────────────────────────────────
   #calculator, #why, and footer all use var(--dark) as a
   BACKGROUND color (their own local --dark: #0a0f1e means "dark
   navy panel", and they were already dark even in this page's
   light mode by design). The global --dark override added earlier
   redefines --dark to mean "light heading text" for the pages
   where it's used that way instead, which flips these three
   sections light by accident. Forcing their real backgrounds back
   here, bypassing the variable entirely, fixes it regardless of
   what --dark currently resolves to.
   ============================================================ */
[data-theme="dark"] #calculator,
[data-theme="dark"] #why {
    background: linear-gradient(135deg, #0a0f1e, #0d2137) !important;
}
[data-theme="dark"] footer {
    background: #0a0f1e !important;
}

/* Translucent white nav bar — never tied to any variable at all */
[data-theme="dark"] nav#mainNav {
    background: rgba(11, 17, 32, 0.92) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] nav#mainNav.scrolled {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4) !important;
}

/* Same var(--dark)-as-background collision, three more spots */
[data-theme="dark"] .quick-facts {
    background: linear-gradient(135deg, #0a0f1e, #1e3a5f) !important;
}
[data-theme="dark"] .about-dark-box,
[data-theme="dark"] .seo-trust {
    background: linear-gradient(145deg, #0a0f1e, #1e293b) !important;
}
/* Same variable, opposite problem: this button's text is meant to
   stay dark navy against its own gold gradient background, not
   turn light along with the rest of the page */
[data-theme="dark"] .btn-hero-p {
    color: #0a0f1e !important;
}

[data-theme="dark"] .ticker-wrap {
    background: #0d1117 !important;
}

/* Pale-green mini stat tiles (About section) — same "pale semantic
   highlight" pattern as elsewhere, darken the tint but keep the
   green accent meaning */
[data-theme="dark"] .about-ms {
    background: rgba(0, 135, 81, 0.14) !important;
    border-color: rgba(0, 168, 98, 0.3) !important;
}

/* ============================================================
   ROUND 14 — the same "container fixed, its own h2/h3 title text
   wasn't" gap keeps recurring across different "-card" classes
   (.ref-extra-card h3, .summary-card h2, .form-card h2, .chart-card
   h2, etc.) Adding the specific ones found, plus a generic rule so
   any future "*-card" title following the same pattern is covered
   automatically instead of needing another round like this one.
   ============================================================ */
[data-theme="dark"] [class*="-card"] h1,
[data-theme="dark"] [class*="-card"] h2,
[data-theme="dark"] [class*="-card"] h3 {
    color: var(--text-primary) !important;
}

/* Non-heading title/value elements with the same hardcoded-color
   pattern, found via screenshots */
[data-theme="dark"] .hd,
[data-theme="dark"] .sr-value,
[data-theme="dark"] .summary-row.total .sr-value {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .sr-label {
    color: var(--text-secondary) !important;
}

/* Earnings bar-chart track (the "empty" background behind each
   month's green fill bar) */
[data-theme="dark"] .bar-track {
    background: var(--surface-2) !important;
}

/* ============================================================
   ROUND 15 — business pages (create-task, auto-task, business-
   tasks/submissions/payments/analytics)
   ────────────────────────────────────────────────────────────
   Two structural gaps found here:
   1. The foundational --surface/--text/--border variable block
      above never had !important, so any page whose own <style>
      block (loaded after theme.css) redefines the same variable
      names in an unscoped :root{} — which several business pages
      do — silently won and undid the whole system on that page.
      Fixed at the source above.
   2. "card-header"/"card-title" (prefix pattern) were never
      matched by the "[class*='-card']" generic rule from round 14
      — that only matches a SUFFIX pattern ("task-card", not
      "card-header"). Adding the missing direction here.
   ============================================================ */
[data-theme="dark"] [class^="card-"] h1,
[data-theme="dark"] [class^="card-"] h2,
[data-theme="dark"] [class^="card-"] h3,
[data-theme="dark"] .card-title {
    color: var(--text-primary) !important;
}

/* create-task.php's header strip has its own hardcoded off-white
   background, separate from its parent .task-card (which is
   already fixed via the --surface variable). Scoped to .task-card
   specifically — activate.php also has a ".card-header" but it's
   an intentional colorful gradient banner under a plain ".card"
   wrapper, not this off-white strip, and shouldn't be touched. */
[data-theme="dark"] .task-card .card-header {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
}

/* Pale blue "info" notices on create-task.php */
[data-theme="dark"] .targeting-header,
[data-theme="dark"] .slot-calc-display {
    background: rgba(59, 130, 246, 0.14) !important;
    color: var(--text-primary) !important;
}

/* Pale red error alert (auto-task.php) */
[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

/* "How Auto Tasks Work" pale-green info banner */
[data-theme="dark"] .how-it-works {
    background: rgba(0, 135, 81, 0.14) !important;
    border-color: rgba(0, 168, 98, 0.35) !important;
}

/* Business Wallet hero "Fund Wallet" button — sits on a colorful
   gradient banner and is meant to always be a white pill with
   indigo text regardless of theme (same design intent as similar
   floating CTAs elsewhere); reinforced explicitly in case anything
   else on the page is interfering with it */
[data-theme="dark"] .wallet-btn-primary {
    background: #ffffff !important;
    color: #4f46e5 !important;
}

/* ============================================================
   ROUND 16 — screenshots 263-266 (business wallet / analytics /
   my-tasks pages)
   ============================================================ */

/* Transaction filter tabs (All/Deposits/Task Spend/Refunds) */
[data-theme="dark"] .tx-tabs {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .tx-tab {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .tx-tab.active,
[data-theme="dark"] .tx-tab:hover {
    color: #ffffff !important;
}

/* Pagination on business-payments.php uses its own "pg-btn" name
   (distinct from "page-btn" fixed elsewhere) */
[data-theme="dark"] .pg-btn {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .pg-btn.cur {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

/* Analytics date-range pills (7 days/30 days/90 days/1 year) —
   floating on a colorful gradient banner like the wallet button
   above, same "white pill, indigo text" intentional design when
   active; explicitly reinforced in case anything interferes */
[data-theme="dark"] .range-pill.active,
[data-theme="dark"] .range-pill:hover {
    background: #ffffff !important;
    color: #4f46e5 !important;
}

/* "View / Edit / N Subs" pills on business-tasks.php — colored
   border + text already carries the meaning, just the white
   background needed darkening like other semantic-tint pills */
[data-theme="dark"] .btn-view {
    background: rgba(99, 102, 241, 0.14) !important;
}
[data-theme="dark"] .btn-edit {
    background: rgba(245, 158, 11, 0.14) !important;
}
[data-theme="dark"] .btn-subs {
    background: rgba(0, 135, 81, 0.14) !important;
}

/* Worker Submissions status filter pills (All/Pending/Approved/
   Rejected/Revision) — the .active variants are colorful gradients
   already fine on any theme, but the resting/inactive state was a
   plain white pill with gray text */
[data-theme="dark"] .filter-pill {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* ============================================================
   ROUND 17 — the SAME --ink/--dark-used-as-background collision
   fixed for index.php's #calculator/#why/footer turns out to be
   present across ~13 more files: every admin auth page (login,
   profile, setup-totp, verify-totp — all share ".panel-left" or
   ".admin-sidebar"/".profile-hero"), and every static/legal page
   (advertise, anti-fraud, contact, cookie, forgot-password,
   post-task, privacy, refund, terms — all share ".topnav",
   ".page-footer", and a ".hero"/".legal-hero"-style banner).
   Each forces its real background directly, bypassing whatever
   --ink/--dark currently resolves to elsewhere on the page.
   ============================================================ */
[data-theme="dark"] .panel-left,
[data-theme="dark"] .admin-sidebar,
[data-theme="dark"] .profile-hero {
    background: #050e08 !important;
}
[data-theme="dark"] .topnav,
[data-theme="dark"] .page-footer,
[data-theme="dark"] .pricing-header {
    background: #0a0f1e !important;
}
[data-theme="dark"] .legal-hero {
    background: linear-gradient(135deg, #0a0f1e, #0d1f35) !important;
}
[data-theme="dark"] .audience-wrap {
    background: linear-gradient(135deg, #0a0f1e, #0d2137) !important;
}
/* NOTE: ".hero" deliberately NOT overridden here — index.php also
   defines a ".hero" with its own intentional colorful gradient
   unrelated to this bug, and a blanket rule here would clobber it.
   The handful of OTHER pages whose ".hero" collides with the
   var(--dark) bug (contact.php, post-task.php) are fixed directly
   in their own source below instead, to keep this page-agnostic
   stylesheet from having to guess which file is asking. */

/* Verify-TOTP fallback option buttons (worker + admin) — real
   content-carrying option cards, not decorative chrome */
[data-theme="dark"] .fallback-btn {
    background: var(--surface) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .fallback-label {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .fallback-desc {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] #backupForm {
    background: rgba(217, 119, 6, 0.14) !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
}

/* VTU provider toggle cards (admin_settings_vtu_snippet.php) — each
   has its own inline pale-tint background depending on on/off
   state; darken regardless of which inline variant is active */
[data-theme="dark"] .provider-toggle-card {
    background: var(--surface-2) !important;
}

/* ============================================================
   ROUND 18 — comprehensive sweep of all 49 admin/*.php files.
   Same recurring patterns as the rest of the site (light card
   backgrounds, hardcoded dark/muted text never covered), just a
   fresh batch of page-local class names.
   ============================================================ */
[data-theme="dark"] .action-chip,
[data-theme="dark"] .bar-wrap,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .filters-bar,
[data-theme="dark"] .ftab,
[data-theme="dark"] .info-chip,
[data-theme="dark"] .meta-pill,
[data-theme="dark"] .metric-tab,
[data-theme="dark"] .mode-tab,
[data-theme="dark"] .net-tab,
[data-theme="dark"] .prize-input-wrap,
[data-theme="dark"] .receipt-thumb,
[data-theme="dark"] .rej-tpl-btn,
[data-theme="dark"] .suggest-chip,
[data-theme="dark"] .table-card,
[data-theme="dark"] .tpl-btn,
[data-theme="dark"] .type-chip,
[data-theme="dark"] .btn-cancel,
[data-theme="dark"] .btn-note {
    background: var(--surface-2) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .btn-delete {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .badge-draft,
[data-theme="dark"] .badge-off {
    background: var(--surface-2) !important;
    color: var(--text-secondary) !important;
}

/* Form-control-like elements following the same pattern */
[data-theme="dark"] .filter-sel,
[data-theme="dark"] .status-select,
[data-theme="dark"] .reply-textarea,
[data-theme="dark"] .otp-field {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* ============================================================
   ROUND 19 — admin pages: the overall page background never went
   dark. body itself is correctly dark already (rule near the top
   of this file), but every admin page wraps its content in
   ".admin-container" > ".admin-main", which almost certainly gets
   its own opaque light background from admin.css/dashboard.css —
   two stylesheets loaded by every admin page that were never
   included in what was uploaded, so this is a blind defensive fix
   rather than one read from the actual source. If this doesn't
   fully resolve it, the real admin.css is needed to see exactly
   what's setting it.
   ============================================================ */
[data-theme="dark"] body,
[data-theme="dark"] html {
    background: var(--bg-body) !important;
}
[data-theme="dark"] .admin-container,
[data-theme="dark"] .admin-main,
[data-theme="dark"] .admin-content,
[data-theme="dark"] .admin-body,
[data-theme="dark"] .main-content,
[data-theme="dark"] .dashboard-container,
[data-theme="dark"] .dashboard-main,
[data-theme="dark"] .content-wrapper {
    background: var(--bg-body) !important;
}