/* Dark theme overrides for better contrast */
:root.dark body {
  background-color: #0b1220; /* slate-950 */
  color: #e5e7eb; /* slate-200 */
}

:root.dark a { color: #c7d2fe; }
:root.dark a:hover { color: #e0e7ff; }

/* Cards and surfaces */
:root.dark .rounded-xl {
  background-color: #0f172a !important; /* slate-900 */
  border-color: #1f2937 !important; /* slate-800 */
}

/* Sidebar */
:root.dark #sidebar {
  background-color: #0b1220 !important;
  border-color: #1f2937 !important;
}

/* Buttons */
:root.dark .bg-primary {
  background-color: #4f46e5 !important; /* indigo-600 */
  color: #ffffff !important;
}

/* Tables */
:root.dark table {
  background-color: #0f172a;
  color: #e5e7eb;
}
:root.dark table thead tr {
  background-color: #111827; /* gray-900 */
}
:root.dark table th,
:root.dark table td {
  border-color: #1f2937; /* slate-800 */
}
:root.dark table tbody tr:hover {
  background-color: #1f2937; /* slate-800 */
}

/* Texto: elevar contraste de grises en oscuro */
:root.dark .text-gray-500 { color: #a3b1c6 !important; /* ~slate-400 */ }
:root.dark .text-gray-600 { color: #cbd5e1 !important; /* slate-300 */ }
:root.dark .text-gray-700 { color: #e2e8f0 !important; /* slate-200 */ }
:root.dark .text-gray-800 { color: #f1f5f9 !important; /* slate-100 */ }
:root.dark .text-gray-900 { color: #ffffff !important; }

/* Labels y encabezados ligeros */
:root.dark label,
:root.dark .font-medium { color: #e2e8f0 !important; }

/* Encabezados de tabla con mejor contraste */
:root.dark thead tr .text-gray-600,
:root.dark thead tr th { color: #e5e7eb !important; }

/* Form controls */
:root.dark input,
:root.dark select,
:root.dark textarea {
  background-color: #0b1220;
  color: #e5e7eb;
  border-color: #334155; /* slate-700 */
}
:root.dark input::placeholder,
:root.dark textarea::placeholder {
  color: #94a3b8; /* slate-400 */
}

/* Simple-DataTables overrides */
:root.dark .dataTable-container {
  background-color: #0f172a;
}
:root.dark .dataTable-top,
:root.dark .dataTable-bottom {
  color: #e5e7eb;
}
:root.dark .dataTable-input,
:root.dark .dataTable-selector {
  background-color: #0b1220;
  color: #e5e7eb;
  border-color: #334155;
}
:root.dark .dataTable-pagination a {
  color: #c7d2fe;
}
:root.dark .dataTable-pagination .active a {
  background-color: #4f46e5;
  color: #ffffff;
}

/* Tom Select (dark mode) */
:root.dark .ts-control, :root.dark .ts-wrapper.single .ts-control {
  background-color: #0b1220; /* bg */
  color: #e5e7eb; /* text */
  border-color: #334155; /* border */
}
:root.dark .ts-control input {
  color: #e5e7eb;
}
:root.dark .ts-dropdown, :root.dark .ts-dropdown .ts-dropdown-content {
  background-color: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
}
:root.dark .ts-dropdown .active {
  background-color: #1f2937;
  color: #ffffff;
}
:root.dark .ts-control .item {
  background-color: #111827;
  color: #e5e7eb;
  border-color: #334155;
}
:root.dark .ts-control .clear-button, :root.dark .ts-control .remove {
  color: #cbd5e1;
}
