.pl-theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.pl-theme-toggle:hover {
  background: var(--soft);
}

html[data-theme="dark"] body {
  background-color: var(--surface);
  color: var(--ink);
}

/* Tailwind utilities in the existing templates and dynamically rendered rows. */
[data-theme="dark"] :is(.bg-white, .bg-light, .bg-body) {
  background-color: var(--panel) !important;
}

[data-theme="dark"] :is(.bg-gray-50, .bg-slate-50, .bg-gray-100, .bg-slate-100) {
  background-color: var(--surface) !important;
}

[data-theme="dark"] :is(.bg-gray-200, .bg-gray-300, .bg-secondary-subtle,
  .hover\:bg-gray-50:hover, .hover\:bg-gray-100:hover, .hover\:bg-gray-200:hover,
  .hover\:bg-gray-300:hover, .hover\:bg-slate-50:hover, .hover\:bg-slate-100:hover) {
  background-color: var(--neutral-bg) !important;
}

[data-theme="dark"] :is(.bg-blue-50, .bg-blue-100, .bg-brand-soft, .bg-sky-100,
  .bg-violet-100, .hover\:bg-blue-50:hover, .hover\:bg-blue-100:hover) {
  background-color: var(--soft) !important;
}

[data-theme="dark"] :is(.bg-green-50, .bg-green-100, .bg-emerald-50, .bg-emerald-100) {
  background-color: var(--success-bg) !important;
}

[data-theme="dark"] :is(.bg-amber-50, .bg-amber-100, .bg-yellow-50, .bg-orange-100) {
  background-color: var(--warning-bg) !important;
}

[data-theme="dark"] :is(.bg-red-50, .bg-red-100, .hover\:bg-red-50:hover) {
  background-color: var(--danger-bg) !important;
}

[data-theme="dark"] :is(.text-gray-700, .text-gray-800, .text-gray-900, .text-slate-700,
  .text-slate-800, .text-slate-900, .text-dark, .hover\:text-gray-900:hover) {
  color: var(--ink) !important;
}

[data-theme="dark"] :is(.text-gray-400, .text-gray-500, .text-gray-600, .text-slate-500,
  .text-slate-600, .text-body-secondary) {
  color: var(--muted) !important;
}

[data-theme="dark"] :is(.text-blue-500, .text-blue-600, .text-blue-700, .text-blue-800,
  .text-blue-900, .text-brand, .text-brand-accent, .text-sky-700, .text-sky-900,
  .text-violet-900, .hover\:text-blue-800:hover) {
  color: var(--accent) !important;
}

[data-theme="dark"] :is(.text-red-500, .text-red-600, .text-red-700, .text-red-800,
  .text-red-900, .hover\:text-red-700:hover) {
  color: var(--danger-ink) !important;
}

[data-theme="dark"] :is(.text-green-500, .text-green-600, .text-green-700, .text-green-800,
  .text-green-900, .text-emerald-900) {
  color: var(--success-ink) !important;
}

[data-theme="dark"] :is(.text-amber-500, .text-amber-600, .text-amber-700, .text-amber-800,
  .text-amber-900, .text-amber-950, .text-yellow-600, .text-yellow-700,
  .text-yellow-800, .text-yellow-900, .text-orange-900) {
  color: var(--warning-ink) !important;
}

[data-theme="dark"] :is(.border-gray-100, .border-gray-200, .border-gray-300,
  .border-slate-100, .border-slate-200, .border-slate-300, .border-blue-100,
  .border-blue-200, .border-blue-300, .border-red-100, .border-red-200, .border-red-300,
  .border-green-200, .border-green-300, .border-emerald-100, .border-amber-100,
  .border-amber-200, .border-amber-300, .border-yellow-200, .border-yellow-300,
  .border-violet-100),
[data-theme="dark"] :is(.divide-gray-100, .divide-gray-200, .divide-slate-200) > :not(:last-child) {
  border-color: var(--line) !important;
}

[data-theme="dark"] :is(input:not([type]), input[type="text"], input[type="email"],
  input[type="number"], input[type="search"], input[type="password"], input[type="date"],
  input[type="datetime-local"], input[type="url"], input[type="tel"], textarea, select)::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .dashboard-sidebar {
  background: var(--panel) !important;
  border-color: var(--line);
}
