/* Тёмная тема: подключается последним. html[data-theme="dark"] выставляет theme.js */

html[data-theme="dark"] .subtle-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .subtle-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .nav-item {
    color: var(--text-secondary);
}
html[data-theme="dark"] .nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .nav-item.active {
    background: var(--brand-primary);
    color: #0f172a;
}

html[data-theme="dark"] .icon-btn {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.65);
    color: var(--text-secondary);
}
html[data-theme="dark"] .icon-btn:hover {
    background: rgba(51, 65, 85, 0.85);
}

html[data-theme="dark"] .btn-ghost {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
}
html[data-theme="dark"] .btn-ghost:hover {
    background: rgba(51, 65, 85, 0.75);
}

html[data-theme="dark"] .suggest-chip {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-secondary);
}

html[data-theme="dark"] .badge-low { background: rgba(22, 101, 52, 0.45); color: #86efac; }
html[data-theme="dark"] .badge-med { background: rgba(133, 77, 14, 0.45); color: #fde047; }
html[data-theme="dark"] .badge-high { background: rgba(153, 27, 27, 0.45); color: #fca5a5; }

html[data-theme="dark"] .tag-44 { background: rgba(3, 105, 161, 0.35); color: #7dd3fc; }
html[data-theme="dark"] .tag-223 { background: rgba(91, 33, 182, 0.35); color: #c4b5fd; }
html[data-theme="dark"] .tag-com { background: rgba(51, 65, 85, 0.6); color: var(--text-muted); }

html[data-theme="dark"] .tender-card {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(56, 189, 248, 0.2);
}
html[data-theme="dark"] .tender-card .tender-price,
html[data-theme="dark"] .tender-card .tender-price-main,
html[data-theme="dark"] .tender-card .tender-title {
    color: var(--text-primary);
}
html[data-theme="dark"] .tender-card .tender-price-sub {
    color: var(--text-muted);
}
html[data-theme="dark"] .tender-card .tender-customer,
html[data-theme="dark"] .tender-card .tender-deadline {
    color: var(--text-muted);
}
html[data-theme="dark"] .tender-card .tender-winner {
    color: var(--text-secondary);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}
html[data-theme="dark"] .tender-card .tender-deadline {
    border-top-color: rgba(51, 65, 85, 0.85);
}

html[data-theme="dark"] .filter-chip {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
}
html[data-theme="dark"] .filter-chip:hover {
    background: rgba(51, 65, 85, 0.85);
}
html[data-theme="dark"] .filter-chip.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #0f172a;
}

html[data-theme="dark"] .search-field {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.3);
}
html[data-theme="dark"] .search-field input {
    color: var(--text-primary);
}
html[data-theme="dark"] .search-field input::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .stat-card {
    background: rgba(30, 41, 59, 0.82);
    border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .stat-card .stat-value {
    color: var(--text-primary);
}
html[data-theme="dark"] .stat-card .stat-label {
    color: var(--text-secondary);
}
html[data-theme="dark"] .stat-card .stat-meta {
    color: var(--text-muted);
}
html[data-theme="dark"] .stat-card .stat-meta.up {
    color: #86efac;
}
html[data-theme="dark"] .stat-card .stat-meta.down {
    color: #fca5a5;
}

/* Чат: typing (остальное .ai-prose — блок ниже «Чат») */
html[data-theme="dark"] .typing-dot {
    background: #94a3b8;
}

/* Анализ: подзаголовки и крошки (text-gray-* на тёмной панели) */
html[data-theme="dark"] .analysis-page .text-gray-500 {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .analysis-page .hover\:text-gray-900:hover {
    color: var(--text-primary) !important;
}

/* Дашборд: подзаголовок под h1 */
html[data-theme="dark"] .dashboard-layout .dashboard-header p.text-gray-500 {
    color: var(--text-secondary) !important;
}

/* Анализ */
html[data-theme="dark"] .analysis-page .rounded-2xl.border.border-white {
    border-color: rgba(148, 163, 184, 0.35) !important;
}
html[data-theme="dark"] .analysis-input-wrap {
    background: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="dark"] .tenvizor-app-boot-card {
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* ========== Помощь (help.css — светлые #fff / rgba заданы жёстко) ========== */
html[data-theme="dark"] .help-subtitle {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] .help-search {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme="dark"] .help-search:focus-within {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}
html[data-theme="dark"] .help-search input::placeholder {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] .quick-card {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(148, 163, 184, 0.32);
}
html[data-theme="dark"] .quick-card:hover {
    background: rgba(51, 65, 85, 0.88);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .quick-icon.violet {
    background: rgba(109, 40, 217, 0.28);
    color: #c4b5fd;
}
html[data-theme="dark"] .quick-icon.green {
    background: rgba(22, 163, 74, 0.28);
    color: #86efac;
}

html[data-theme="dark"] .help-section,
html[data-theme="dark"] .support-card:not(.dark) {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.32);
}

html[data-theme="dark"] .article-card,
html[data-theme="dark"] .faq-item {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .faq-question i {
    color: var(--text-muted);
}

html[data-theme="dark"] .contact-row {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .status-row {
    color: #86efac;
}

/* Акцентный блок: в тёмной теме --brand-dark светлый, возвращаем глубокий фон как в светлой */
html[data-theme="dark"] .support-card.dark {
    background: linear-gradient(155deg, #0c4a6e 0%, #082f49 100%);
    border-color: rgba(56, 189, 248, 0.22);
}
html[data-theme="dark"] .support-card.dark h2,
html[data-theme="dark"] .support-card.dark p {
    color: rgba(255, 255, 255, 0.92);
}
html[data-theme="dark"] .support-card.dark p {
    color: rgba(255, 255, 255, 0.68);
}

/* ========== Чат: классы из chat.css + типовые «белые» блоки в вёрстке ========== */
html[data-theme="dark"] .chat-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .chat-item.active {
    background: rgba(51, 65, 85, 0.85);
    box-shadow: none;
}

html[data-theme="dark"] .ai-prose {
    color: var(--text-secondary);
}
html[data-theme="dark"] .ai-prose h4,
html[data-theme="dark"] .ai-prose strong {
    color: var(--text-primary);
}
html[data-theme="dark"] .ai-prose .callout {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-secondary);
    border-left-color: var(--brand-primary);
}
html[data-theme="dark"] .ai-prose .callout.warn {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    border-left-color: #f59e0b;
}
html[data-theme="dark"] .ai-prose .callout.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border-left-color: #f87171;
}

html[data-theme="dark"] .input-wrap:focus-within {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

/* Анализ: карточки и форма (analysis.css) */
html[data-theme="dark"] .analysis-search-card {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.32);
}
html[data-theme="dark"] .analysis-card {
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(148, 163, 184, 0.22);
}
html[data-theme="dark"] .analysis-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .analysis-flow {
    color: var(--text-muted);
}
html[data-theme="dark"] .analysis-message.is-working {
    color: #fde047;
}
html[data-theme="dark"] .analysis-message.is-ready {
    color: #86efac;
}

html[data-theme="dark"] .analysis-card .tender-price,
html[data-theme="dark"] .analysis-card .tender-title {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .analysis-card .tender-customer {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .analysis-card-footer {
    border-top-color: rgba(51, 65, 85, 0.85);
    color: var(--text-muted);
}
html[data-theme="dark"] .analysis-progress span {
    background: rgba(51, 65, 85, 0.85);
}

/* Дашборд: явный bg-white в main */
html[data-theme="dark"] .dashboard-layout .bg-white,
html[data-theme="dark"] main .rounded-3xl.bg-white {
    background-color: rgba(30, 41, 59, 0.75) !important;
}

/* Логин: правая панель (много локальных #fff в login.css) */
html[data-theme="dark"] .login-panel {
    background: var(--bg-panel) !important;
}
html[data-theme="dark"] .auth-tabs {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme="dark"] .auth-tab {
    background: transparent;
    color: var(--text-secondary);
}
html[data-theme="dark"] .auth-tab.active {
    background: var(--brand-dark);
    color: #ffffff;
}
html[data-theme="dark"] .auth-field span {
    color: var(--text-muted);
}
html[data-theme="dark"] .auth-field input {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: var(--text-primary);
}
html[data-theme="dark"] .auth-field input::placeholder {
    color: rgba(148, 163, 184, 0.55);
}
/* Шаги регистрации — в светлой теме фон рассчитан на голубой фон страницы;
   в тёмной с белой подложкой выглядит как «слепое» белое пятно. */
html[data-theme="dark"] .register-step {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
}
html[data-theme="dark"] .register-step span {
    background: rgba(148, 163, 184, 0.20);
    color: var(--text-secondary);
}
html[data-theme="dark"] .register-step.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}
html[data-theme="dark"] .register-step.active span {
    background: #ffffff;
    color: var(--brand-primary-hover, #0284c7);
}
html[data-theme="dark"] .register-panel {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.20);
}
html[data-theme="dark"] .register-panel h2 {
    color: var(--text-primary);
}
html[data-theme="dark"] .register-panel p {
    color: var(--text-muted);
}
/* Жёлтая «Яндекс ID будет подключён позже» в тёмной теме отдаём акценту тоном теплее,
   но без агрессивного жёлтого свечения. */
html[data-theme="dark"] .yandex-btn {
    background: rgba(252, 211, 77, 0.10);
    color: #fde68a;
    border: 1px solid rgba(252, 211, 77, 0.30);
}
html[data-theme="dark"] .yandex-btn:hover {
    background: rgba(252, 211, 77, 0.16);
}
/* Дисклеймер в самом низу — в тёмной теме у него `bg-white/40` через Tailwind,
   что выглядит грязно-серой плашкой. Перебиваем. */
html[data-theme="dark"] .login-shell .auth-extra.bg-white\/40 {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(148, 163, 184, 0.20) !important;
}
html[data-theme="dark"] .login-shell .auth-extra a {
    color: var(--text-primary);
}
html[data-theme="dark"] .login-shell .auth-extra a:hover {
    color: var(--brand-primary);
}

/* ========== Админка: страница «Пользователи», общий хром и аналитика ==========
   control-* подстраницы уже имеют dark-оверрайды в admin.css. Здесь — то, что
   осталось со светлыми значениями: модалка пользователя, поиск/таблица/пагинация,
   инпуты, модальные диалоги и KPI/графики/инфо-карточки дашборда.
   Палитра — как в существующих dark-правилах admin.css. */

/* ── Модалка карточки пользователя ── */
html[data-theme="dark"] .user-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .user-stat { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .user-action-row input,
html[data-theme="dark"] .user-action-row select {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .user-action-row .action-btn.ghost {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .user-action-row .action-btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .user-action-label { color: var(--text-secondary); }

/* ── Общий хром: плейсхолдер, шапка таблицы, инпут, поиск, пагинация ── */
html[data-theme="dark"] .admin-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .admin-table-head {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
}
html[data-theme="dark"] .admin-input {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .admin-input:focus {
    background: rgba(0, 0, 0, 0.35);
    border-color: var(--brand-primary);
}
html[data-theme="dark"] .admin-search {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .admin-search:focus-within {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--brand-primary);
}
html[data-theme="dark"] .admin-pager {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .pager-btn { color: var(--text-secondary); }
html[data-theme="dark"] .pager-btn:not(:disabled):hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .pager-info { color: var(--text-secondary); }

/* ── Модалка: шапка/аватар/закрытие + текстовые диалоги ── */
html[data-theme="dark"] .admin-modal-head { border-bottom-color: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .admin-modal-avatar { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .admin-modal-close:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .admin-dialog-input {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .admin-dialog-btn.ghost {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .admin-dialog-btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* ── Дашборд: период-свитч, диапазон дат, KPI/графики/инфо-карточки ── */
html[data-theme="dark"] .period-switch,
html[data-theme="dark"] .date-range {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .period-divider { background: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .period-btn { color: var(--text-secondary); }
html[data-theme="dark"] .period-btn:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .info-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .info-or-bar { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .kpi-icon-green  { color: #34d399; }
html[data-theme="dark"] .kpi-icon-amber  { color: #fbbf24; }
html[data-theme="dark"] .kpi-icon-violet { color: #a78bfa; }

/* =========================================================================
   DARK THEME — consolidated audit overrides (append last in css/dark.css)
   ========================================================================= */

/* --- tender.html / tender.css --- */
html[data-theme="dark"] .tn-breadcrumb,
html[data-theme="dark"] .tn-breadcrumb a { color: var(--text-secondary); }
html[data-theme="dark"] .tn-breadcrumb a:hover,
html[data-theme="dark"] .tn-breadcrumb span { color: var(--text-primary); }
html[data-theme="dark"] [data-aside-price] { color: var(--text-primary); }
html[data-theme="dark"] .tn-aside-label { color: var(--text-muted); }
html[data-theme="dark"] .tn-action-title { color: var(--text-primary); }

/* --- search.css --- */
html[data-theme="dark"] .srch-subtitle { color: var(--text-secondary); }
html[data-theme="dark"] .srch-card-customer { color: var(--text-secondary); }
html[data-theme="dark"] .srch-meta-label { color: var(--text-muted); }
html[data-theme="dark"] .srch-meta-value { color: var(--text-primary); }
html[data-theme="dark"] .srch-pager-jump { color: var(--text-secondary); }
html[data-theme="dark"] .srch-pager-jump input { background: rgba(0, 0, 0, 0.25); }
html[data-theme="dark"] .srch-empty,
html[data-theme="dark"] .srch-disabled,
html[data-theme="dark"] .srch-status { color: var(--text-secondary); }
html[data-theme="dark"] .srch-disabled h3 { color: var(--text-primary); }
/* hint tooltip: #0f172a blends into page bg → lift to panel surface */
html[data-theme="dark"] .srch-hint-bubble { background: #1e293b; }
html[data-theme="dark"] .srch-hint-bubble::before { background: #1e293b; }

/* --- components.css (login glass, billing modal, packs) --- */
html[data-theme="dark"] .glass-panel { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .tn-billing-reason,
html[data-theme="dark"] .tn-billing-label { color: var(--text-secondary); }
html[data-theme="dark"] .tn-billing-option-note,
html[data-theme="dark"] .tn-pack-desc { color: var(--text-muted); }

/* --- chat.html / chat.css --- */
html[data-theme="dark"] .chat-lightbox-close { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
html[data-theme="dark"] .chat-lightbox-close:hover { background: rgba(255, 255, 255, 0.20); }
html[data-theme="dark"] .input-wrap { background: rgba(0, 0, 0, 0.25); border-color: rgba(255, 255, 255, 0.08); }
/* tender-select labels in attach modal */
html[data-theme="dark"] label.rounded-2xl.bg-white\/70 { background: rgba(30, 41, 59, 0.85); border-color: rgba(148, 163, 184, 0.32); }
html[data-theme="dark"] label.rounded-2xl.bg-white\/70:hover { background: rgba(51, 65, 85, 0.88); border-color: rgba(148, 163, 184, 0.45); }
/* demo/attachment cards — require marker class (see markup_changes) */
html[data-theme="dark"] .chat-attach-card { background: rgba(30, 41, 59, 0.88); border-color: rgba(148, 163, 184, 0.28); }
html[data-theme="dark"] .chat-demo-divider { background: rgba(255, 255, 255, 0.06); }

/* --- help.html --- */
html[data-theme="dark"] .inline-flex.bg-white\/70.border-white { background: rgba(56, 189, 248, 0.15); border-color: rgba(56, 189, 248, 0.35); color: var(--brand-primary); }

/* --- profile.html (dashboard) --- */
html[data-theme="dark"] main .flex.items-center.gap-2.text-gray-500 { color: var(--text-secondary) !important; }
html[data-theme="dark"] main .flex.items-center.gap-2.text-gray-500 a { color: var(--text-secondary); }
html[data-theme="dark"] main .flex.items-center.gap-2.text-gray-500 a:hover,
html[data-theme="dark"] main .flex.items-center.gap-2.text-gray-500 span.text-gray-900 { color: var(--text-primary); }
html[data-theme="dark"] main > h1.text-gray-900,
html[data-theme="dark"] main h3.text-gray-900 { color: var(--text-primary) !important; }
html[data-theme="dark"] main > p.text-gray-500,
html[data-theme="dark"] main .text-\[11px\].text-gray-500,
html[data-theme="dark"] main .text-\[13px\].text-gray-500 { color: var(--text-secondary) !important; }
html[data-theme="dark"] main .rounded-3xl.border.border-white { border-color: rgba(255, 255, 255, 0.08) !important; }
html[data-theme="dark"] main .border-t.border-gray-200 { border-color: rgba(255, 255, 255, 0.08) !important; }
html[data-theme="dark"] main [data-profile-stat-active],
html[data-theme="dark"] main [data-profile-stat-wins],
html[data-theme="dark"] main [data-profile-stat-winrate] { color: var(--text-primary) !important; }
html[data-theme="dark"] #passwordCodeBlock { border-top-color: rgba(255, 255, 255, 0.08) !important; }
html[data-theme="dark"] .menu-row [data-lucide="chevron-right"].text-gray-400 { color: var(--text-muted) !important; }
html[data-theme="dark"] #logoutBtn { background: rgba(239, 68, 68, 0.15) !important; color: #fecaca !important; }
html[data-theme="dark"] #logoutBtn:hover { background: rgba(239, 68, 68, 0.22) !important; }
html[data-theme="dark"] #deleteAccountBtn { background: rgba(255, 255, 255, 0.05) !important; border-color: rgba(255, 255, 255, 0.12) !important; color: var(--text-secondary) !important; }
html[data-theme="dark"] #deleteAccountBtn:hover { background: rgba(255, 255, 255, 0.08) !important; }

/* --- shared pages: login / payment-result / analysis --- */
html[data-theme="dark"] #title { color: var(--text-primary); }
html[data-theme="dark"] #subtitle { color: var(--text-secondary); }
html[data-theme="dark"] #authMain > h1,
html[data-theme="dark"] #codeTitle,
html[data-theme="dark"] #forgotPanel > h1,
html[data-theme="dark"] #resetPanel > h1 { color: var(--text-primary); }
html[data-theme="dark"] #authMain > p,
html[data-theme="dark"] .auth-flow p,
html[data-theme="dark"] #codeSubtitle,
html[data-theme="dark"] #resetSubtitle { color: var(--text-secondary); }
html[data-theme="dark"] .analysis-search-card h2,
html[data-theme="dark"] .analysis-history h2 { color: var(--text-primary); }

/* --- partials/header.html --- */
html[data-theme="dark"] .mobile-nav-item { color: var(--text-secondary); background: transparent; }
html[data-theme="dark"] .mobile-nav-item:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] #menuToggleBtn { color: var(--text-primary); }
html[data-theme="dark"] [data-billing-balance],
html[data-theme="dark"] [data-billing-plan],
html[data-theme="dark"] [data-auth-name] { color: var(--text-primary); }
html[data-theme="dark"] header svg.text-gray-500 { color: var(--text-secondary); }
html[data-theme="dark"] #mobileMenu .text-gray-500 { color: var(--text-secondary); }
html[data-theme="dark"] #mobileMenu .text-gray-900 { color: var(--text-primary); }

/* --- admin/* (inline-Tailwind pages) --- */
html[data-theme="dark"] main > div:first-of-type { border-bottom-color: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] main section.bg-white\/60,
html[data-theme="dark"] main .bg-white\/60 { background: rgba(255, 255, 255, 0.03) !important; border-color: rgba(255, 255, 255, 0.06) !important; }
html[data-theme="dark"] main .border-t { border-top-color: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] #mailHistoryBody tr { border-bottom-color: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] tbody td.text-gray-400 { color: var(--text-muted); }
html[data-theme="dark"] .admin-search i.text-gray-400 { color: var(--text-muted); }
html[data-theme="dark"] span.text-sky-700.bg-sky-100 { background: rgba(14, 165, 233, 0.15) !important; color: #38bdf8 !important; }

/* ── Админка: внутренние плашки модалки/дашборда (светлый фон + белый текст) ── */
/* Строки транзакций и активных сессий в модалке пользователя */
html[data-theme="dark"] .tx-item { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .tx-item .tx-amount.is-positive { color: #34d399; }
html[data-theme="dark"] .tx-item .tx-amount.is-negative { color: #f87171; }
/* Карточка «История анализов» */
html[data-theme="dark"] .adm-th-card { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.06); }
/* Топ-листы дашборда */
html[data-theme="dark"] .top-item { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .top-item:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .top-item::before { background: rgba(255, 255, 255, 0.10); color: var(--text-secondary); }
/* Планы (control-plans) — только дефолтная кнопка, primary/toggle не трогаем */
html[data-theme="dark"] .plan-action-btn:not(.primary):not(.toggle) { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
html[data-theme="dark"] .plan-action-btn:not(.primary):not(.toggle):hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
html[data-theme="dark"] .plan-action-btn.toggle.is-off { color: var(--text-muted); }
html[data-theme="dark"] .plan-action-btn.toggle.is-on { color: #34d399; }
html[data-theme="dark"] .plan-field textarea { background: rgba(0, 0, 0, 0.25); border-color: rgba(255, 255, 255, 0.08); color: #e5e7eb; }
html[data-theme="dark"] .plan-preview { background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }
html[data-theme="dark"] .plans-empty { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.12); }
