/* ========================================================
   ЕДИНАЯ ДИЗАЙН-СИСТЕМА SELFSAFE 2.0 (LIGHT / DARK THEMES)
   ======================================================== */

:root, html[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-inner: #0f172a;
  --bg-subtle: #0b1120;
  --border-color: #1f2937;
  --border-subtle: #1e293b;
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-sky: #0284c7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
}

html[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-inner: #f8fafc;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-sky: #0284c7;
  --accent-emerald: #16a34a;
  --accent-amber: #d97706;
  --accent-rose: #dc2626;
}

body {
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Карточки и общие контейнеры в стиле Логиста 2.0 */
.card-dark, .theme-card {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

.card-inner {
  background-color: var(--bg-inner) !important;
  border-color: var(--border-subtle) !important;
}

/* Кнопка переключения темы */
.theme-toggle-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.theme-toggle-btn:hover {
  filter: brightness(1.1);
}

/* ========================================================
   ИСПРАВЛЕНИЕ ЧИТАЕМОСТИ В СВЕТЛОЙ ТЕМЕ ДЛЯ ВСЕХ КАБИНЕТОВ
   ======================================================== */
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] .text-slate-300,
html[data-theme="light"] .text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] .text-slate-500 {
  color: #64748b !important;
}

/* Инверсия фонов контейнеров */
html[data-theme="light"] .bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .bg-slate-900 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .bg-slate-900\/50,
html[data-theme="light"] .bg-slate-900\/60,
html[data-theme="light"] .bg-slate-900\/80 {
  background-color: #f8fafc !important;
}

html[data-theme="light"] .border-slate-800,
html[data-theme="light"] .border-slate-800\/60,
html[data-theme="light"] .border-slate-800\/80,
html[data-theme="light"] .border-slate-700 {
  border-color: #cbd5e1 !important;
}

/* Исправление полей ввода и селектов в светлой теме */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

/* Исправление карточек клиентов и выпадающих списков */
html[data-theme="light"] .client-card,
html[data-theme="light"] .client-order-card {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Вспомогательные кнопки в светлой теме */
html[data-theme="light"] .bg-slate-800 {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .bg-slate-800:hover {
  background-color: #e2e8f0 !important;
}

/* Сохранение сочности акцентных бейджей в светлой теме */
html[data-theme="light"] .text-sky-400 { color: #0284c7 !important; }
html[data-theme="light"] .text-emerald-400 { color: #16a34a !important; }
html[data-theme="light"] .text-amber-400 { color: #d97706 !important; }
html[data-theme="light"] .text-rose-400 { color: #dc2626 !important; }
html[data-theme="light"] .text-indigo-400 { color: #4f46e5 !important; }
html[data-theme="light"] .text-fuchsia-400 { color: #c026d3 !important; }
html[data-theme="light"] .text-violet-400 { color: #7c3aed !important; }

/* Полупрозрачные акцентные фоны */
html[data-theme="light"] .bg-sky-950,
html[data-theme="light"] .bg-sky-950\/30,
html[data-theme="light"] .bg-sky-950\/40 {
  background-color: #e0f2fe !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}

html[data-theme="light"] .bg-emerald-950,
html[data-theme="light"] .bg-emerald-950\/40 {
  background-color: #dcfce7 !important;
  border-color: #bbf7d0 !important;
  color: #15803d !important;
}

html[data-theme="light"] .bg-rose-950,
html[data-theme="light"] .bg-rose-950\/40 {
  background-color: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

html[data-theme="light"] .bg-amber-950,
html[data-theme="light"] .bg-amber-950\/40 {
  background-color: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

html[data-theme="light"] .bg-fuchsia-950,
html[data-theme="light"] .bg-fuchsia-950\/40 {
  background-color: #fae8ff !important;
  border-color: #f5d0fe !important;
  color: #a21caf !important;
}
