:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #08111f !important;
  color: #e5eefb !important;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(71, 85, 105, 0.78) !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #111827 !important;
  border-color: #334155 !important;
  color: #e5eefb !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100 {
  background-color: #111827 !important;
}

html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .ring-slate-200 {
  border-color: #334155 !important;
  --tw-ring-color: #334155 !important;
}

html[data-theme="dark"] .text-slate-900 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-600 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .table-card.active {
  background: rgba(79, 70, 229, 0.18) !important;
  border-color: #818cf8 !important;
}

.qpx-theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f172a;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  font-size: 18px;
  font-weight: 800;
  backdrop-filter: blur(12px);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.qpx-theme-toggle:hover {
  transform: translateY(-1px);
}

html[data-theme="dark"] .qpx-theme-toggle {
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border-color: rgba(99, 102, 241, 0.45);
}
