/* ============================================================
themes.css — v1.0: ТЁМНАЯ ТЕМА LiteCAD (карта переопределений)
Механика: html[data-theme="dark"] + специфичность выше Tailwind-
утилит, поэтому разметку не трогаем. Инлайн-стили JS-виджетов
(тосты) перебиваем через !important.
Светлая тема = текущий вид (data-theme="light" или отсутствие).
Известные границы v1.0: часть hover:-состояний цветных кнопок и
@media print остаются светлыми — на работу не влияет.
============================================================ */
:root { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* ---------- поверхности ---------- */
html[data-theme="dark"] body { background: #0b1220; color: #e2e8f0; }
html[data-theme="dark"] .bg-white { background-color: #16202f; }
html[data-theme="dark"] .bg-slate-50 { background-color: #1d2939; }
html[data-theme="dark"] .bg-slate-100 { background-color: #0b1220; }
html[data-theme="dark"] .bg-slate-200 { background-color: #0b1220; }
html[data-theme="dark"] .bg-slate-300 { background-color: #223046; }
html[data-theme="dark"] .hover\:bg-slate-100:hover { background-color: #1d2939; }
html[data-theme="dark"] .hover\:bg-slate-200:hover { background-color: #223046; }
html[data-theme="dark"] .hover\:bg-blue-50:hover { background-color: rgba(37,99,235,.18); }
html[data-theme="dark"] .hover\:bg-blue-100:hover { background-color: rgba(37,99,235,.28); }
html[data-theme="dark"] .hover\:bg-red-100:hover { background-color: rgba(239,68,68,.22); }

/* ---------- тонированные панели ---------- */
html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-blue-50\/70 { background-color: rgba(37,99,235,.14); }
html[data-theme="dark"] .bg-amber-50\/70 { background-color: rgba(245,158,11,.13); }
html[data-theme="dark"] .bg-emerald-50\/70 { background-color: rgba(16,185,129,.13); }
html[data-theme="dark"] .bg-purple-50\/70 { background-color: rgba(139,92,246,.14); }
html[data-theme="dark"] .bg-red-50 { background-color: rgba(239,68,68,.14); }
html[data-theme="dark"] .bg-indigo-50 { background-color: rgba(99,102,241,.15); }

/* ---------- текст ---------- */
html[data-theme="dark"] .text-slate-800 { color: #e2e8f0; }
html[data-theme="dark"] .text-slate-700 { color: #cbd5e1; }
html[data-theme="dark"] .text-slate-600 { color: #a7b6c8; }
html[data-theme="dark"] .text-slate-500 { color: #8b9bad; }
html[data-theme="dark"] .text-slate-400 { color: #6d7f93; }
html[data-theme="dark"] .text-blue-600 { color: #93c5fd; }
html[data-theme="dark"] .text-blue-700 { color: #93c5fd; }
html[data-theme="dark"] .text-blue-800 { color: #bfdbfe; }
html[data-theme="dark"] .text-blue-900 { color: #bfdbfe; }
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-900 { color: #fcd34d; }
html[data-theme="dark"] .text-emerald-800,
html[data-theme="dark"] .text-emerald-900 { color: #6ee7b7; }
html[data-theme="dark"] .text-purple-800 { color: #c4b5fd; }
html[data-theme="dark"] .text-red-600 { color: #f87171; }
html[data-theme="dark"] .muted { color: #8b9bad; }
html[data-theme="dark"] .warnline { color: #fbbf24; }
html[data-theme="dark"] .empty,
html[data-theme="dark"] td.empty { color: #6d7f93; }

/* ---------- границы ---------- */
html[data-theme="dark"] .border-slate-200 { border-color: #2a3648; }
html[data-theme="dark"] .border-slate-300 { border-color: #3b4a5e; }
html[data-theme="dark"] .border-blue-200 { border-color: rgba(59,130,246,.40); }
html[data-theme="dark"] .border-amber-200 { border-color: rgba(245,158,11,.40); }
html[data-theme="dark"] .border-emerald-200 { border-color: rgba(16,185,129,.40); }
html[data-theme="dark"] .border-purple-200 { border-color: rgba(139,92,246,.40); }
html[data-theme="dark"] .border-indigo-200 { border-color: rgba(99,102,241,.40); }
html[data-theme="dark"] .border-red-100,
html[data-theme="dark"] .border-red-200 { border-color: rgba(239,68,68,.40); }

/* ---------- поля ввода ---------- */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #0e1626; color: #e2e8f0; border-color: #3b4a5e;
}
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] textarea:disabled { background: #1d2939; color: #6d7f93; }

/* ---------- JS-виджеты с инлайн-стилями (!important) ---------- */
html[data-theme="dark"] #lcad-auto-toast,
html[data-theme="dark"] #pro-ok-toast,
html[data-theme="dark"] #lcad-workplace-notice,
html[data-theme="dark"] #settings-toast,
html[data-theme="dark"] #auth-toast-root > div {
  background: #1d2939 !important; color: #e2e8f0 !important; border-color: #3b4a5e !important;
}
html[data-theme="dark"] #cookie-consent-banner .bg-white,
html[data-theme="dark"] #offline-blocker .bg-white { background-color: #16202f; }

/* ---------- админка / справка / политика (семантика) ---------- */
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card { background: #16202f; border-color: #2a3648; }
html[data-theme="dark"] .stat-card span { color: #8b9bad; }
html[data-theme="dark"] table.adm th { color: #8b9bad; border-color: #2a3648; }
html[data-theme="dark"] table.adm td { border-color: #1d2939; }
html[data-theme="dark"] .tr-revoked td { background: rgba(239,68,68,.10); }
html[data-theme="dark"] pre.out { background: #0e1626; border-color: #2a3648; }
html[data-theme="dark"] .banner { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.40); color: #fcd34d; }
html[data-theme="dark"] .banner-red { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.40); color: #fca5a5; }
html[data-theme="dark"] .banner-green { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.40); color: #6ee7b7; }
html[data-theme="dark"] .btn-ghost { background: #1d2939; border-color: #3b4a5e; color: #cbd5e1; }
html[data-theme="dark"] .btn-ghost:hover { background: #223046; }
html[data-theme="dark"] .btn-danger { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.45); color: #f87171; }
html[data-theme="dark"] .btn-danger:hover { background: rgba(239,68,68,.18); }
html[data-theme="dark"] .btn-ok { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.45); color: #6ee7b7; }
html[data-theme="dark"] .btn-ok:hover { background: rgba(16,185,129,.20); }
html[data-theme="dark"] .pill-new { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.45); color: #6ee7b7; }
html[data-theme="dark"] .pill-issued { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.45); color: #93c5fd; }
html[data-theme="dark"] .pill-active { background: rgba(52,211,153,.18); border-color: rgba(52,211,153,.50); color: #6ee7b7; }
html[data-theme="dark"] .pill-revoked { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.45); color: #fca5a5; }
html[data-theme="dark"] .overlay .mbox,
html[data-theme="dark"] #deny-screen .box { background: #16202f; }
html[data-theme="dark"] .overlay .mbox p,
html[data-theme="dark"] #deny-screen .box p { color: #a7b6c8; }
html[data-theme="dark"] .overlay .mbox pre { background: #0e1626; border-color: #3b4a5e; }
html[data-theme="dark"] kbd { background: #223046; border-color: #3b4a5e; color: #cbd5e1; }
html[data-theme="dark"] table { background: #16202f; border-color: #2a3648; }
html[data-theme="dark"] td { border-color: #2a3648; }
html[data-theme="dark"] a.back,
html[data-theme="dark"] button.act { background: #1d2939; border-color: #3b4a5e; color: #e2e8f0; }
html[data-theme="dark"] p.intro,
html[data-theme="dark"] footer { color: #8b9bad; }