:root {
  color-scheme: light;
  --site-bg: #f8fafc;
  --site-surface: #ffffff;
  --site-surface-muted: #f1f5f9;
  --site-text: #0f172a;
  --site-text-muted: #64748b;
  --site-border: #e2e8f0;
}

html.dark {
  color-scheme: dark;
  --site-bg: #090d16;
  --site-surface: #0f172a;
  --site-surface-muted: #1e293b;
  --site-text: #f1f5f9;
  --site-text-muted: #94a3b8;
  --site-border: #334155;
}

html.dark body {
  background-color: var(--site-bg) !important;
  background-image: none !important;
  color: var(--site-text);
}

html.dark [class~="bg-white"],
html.dark [class~="bg-white/90"],
html.dark [class~="bg-white/85"],
html.dark [class~="bg-white/80"],
html.dark [class~="bg-slate-50"],
html.dark [class~="bg-gray-50"] {
  background-color: var(--site-surface) !important;
}

html.dark [class~="bg-slate-100"],
html.dark [class~="bg-gray-100"],
html.dark [class~="bg-slate-200"],
html.dark [class~="bg-gray-200"] {
  background-color: var(--site-surface-muted) !important;
}

html.dark [class~="text-slate-900"],
html.dark [class~="text-slate-800"],
html.dark [class~="text-gray-900"],
html.dark [class~="text-gray-800"] {
  color: var(--site-text) !important;
}

html.dark [class~="text-slate-700"],
html.dark [class~="text-slate-600"],
html.dark [class~="text-slate-500"],
html.dark [class~="text-gray-700"],
html.dark [class~="text-gray-600"],
html.dark [class~="text-gray-500"] {
  color: var(--site-text-muted) !important;
}

html.dark [class~="border-slate-200"],
html.dark [class~="border-slate-100"],
html.dark [class~="border-gray-200"],
html.dark [class~="border-gray-100"] {
  border-color: var(--site-border) !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea,
html.dark .form-input,
html.dark .klin-select,
html.dark .nr-combobox,
html.dark .hr-select {
  color-scheme: dark;
  background-color: var(--site-surface-muted);
  color: var(--site-text);
  border-color: var(--site-border);
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: var(--site-text-muted);
}

html.dark select option,
html.dark .klin-select option,
html.dark .nr-combobox option,
html.dark .edu-select option,
html.dark .hr-select option {
  background-color: var(--site-surface-muted);
  color: var(--site-text);
}

html.dark .login-wrapper {
  --white: var(--site-surface);
  --text-dark: var(--site-text);
  --text-gray: var(--site-text-muted);
  border-color: var(--site-border);
}

html.dark .klin-select,
html.dark .nr-combobox,
html.dark .edu-select {
  -webkit-text-fill-color: var(--site-text);
}

html.dark .form-input:focus,
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  background-color: var(--site-surface) !important;
}

html.dark .alert-error {
  background-color: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

html.dark .alert-success {
  background-color: #052e16;
  border-color: #166534;
  color: #bbf7d0;
}

html.dark .success-icon {
  background-color: #1e3a8a;
}

html.dark .success-icon svg {
  color: #93c5fd;
}

@media print {
  html.dark,
  html.dark body {
    color-scheme: light !important;
    background: #fff !important;
    color: #000 !important;
  }
}
