/* ==========================================================================
   Ajustes de contraste para MODO OSCURO (data-bs-theme="dark")
   Se carga después de app-shell.css / custom-modern.css en layout.php y
   layout-iframe.php. Todo está acotado a [data-bs-theme="dark"], por lo que
   el modo claro no cambia.
   ========================================================================== */

/* ---------- 1. Utilidades de Bootstrap fijas a claro ---------- */
[data-bs-theme="dark"] .bg-white {
  background-color: var(--app-surface) !important;
  color: var(--app-text);
}
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light-subtle {
  background-color: var(--app-surface-subtle) !important;
  color: var(--app-text);
}
[data-bs-theme="dark"] .text-dark {
  color: var(--app-text-title) !important;
}
[data-bs-theme="dark"] .btn-outline-warning.text-dark {
  color: #fbbf24 !important;
}
[data-bs-theme="dark"] .btn-outline-warning.text-dark:hover {
  color: #1e293b !important;
}
[data-bs-theme="dark"] .border-light,
[data-bs-theme="dark"] .border-white {
  border-color: var(--app-border) !important;
}

/* ---------- 2. Formularios: inputs, selects, input-group ---------- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea {
  background-color: var(--app-input-bg);
  border-color: var(--app-input-border);
  color: var(--app-input-color);
}
[data-bs-theme="dark"] .form-control.bg-body-secondary,
[data-bs-theme="dark"] .form-select.bg-body-secondary {
  background-color: var(--app-input-bg) !important;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--app-input-bg);
  color: var(--app-input-color);
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2);
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--app-text-muted);
  opacity: 0.8;
}
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .form-select:disabled {
  background-color: var(--app-surface-subtle);
  color: var(--app-text-muted);
}
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .input-group-text.bg-white,
[data-bs-theme="dark"] .input-group-text.bg-light,
[data-bs-theme="dark"] .input-group-text.bg-body-secondary,
[data-bs-theme="dark"] .input-group-text.bg-body-tertiary {
  background-color: var(--app-surface-subtle) !important;
  border-color: var(--app-input-border);
  color: var(--app-text-muted);
}
[data-bs-theme="dark"] .input-group-text.text-primary {
  color: var(--app-primary) !important;
}
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] legend {
  color: var(--app-text);
}
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .text-muted {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="time"] {
  color-scheme: dark;
}
[data-bs-theme="dark"] .form-check-input {
  background-color: var(--app-input-bg);
  border-color: var(--app-input-border);
}
[data-bs-theme="dark"] .form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

/* ---------- 3. Modales, offcanvas, dropdowns ---------- */
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas {
  background-color: var(--app-surface);
  color: var(--app-text);
}
[data-bs-theme="dark"] .modal-header[style*="bae6fd"] {
  border-bottom-color: var(--app-border) !important;
}
[data-bs-theme="dark"] .modal-footer.bg-body-secondary {
  background-color: var(--app-surface-subtle) !important;
}
[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--app-surface);
  border-color: var(--app-border);
}
[data-bs-theme="dark"] .dropdown-item {
  color: var(--app-text);
}
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: var(--app-surface-subtle);
  color: var(--app-text-title);
}
[data-bs-theme="dark"] .dropdown-item.active {
  background-color: var(--app-primary);
  color: #111418;
}
[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---------- 4. Selector segmentado de duración (30 min / 1 hora) ---------- */
[data-bs-theme="dark"] .duration-segmented-group {
  background-color: var(--app-input-bg);
  border-color: var(--app-input-border);
}
[data-bs-theme="dark"] .duration-radio-label {
  color: var(--app-text-muted);
}
[data-bs-theme="dark"] .duration-radio-label:hover {
  color: var(--app-text-title);
}
[data-bs-theme="dark"] .duration-radio-input:checked + .duration-radio-label {
  background-color: var(--app-primary);
  color: #111418;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---------- 5. Select2 (también en el panel lateral) ---------- */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: var(--app-input-bg) !important;
  border-color: var(--app-input-border) !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--app-input-color) !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--app-text-muted) transparent transparent transparent;
}
[data-bs-theme="dark"] .select2-dropdown {
  background-color: var(--app-surface);
  border-color: var(--app-input-border);
}
[data-bs-theme="dark"] .select2-results__option {
  color: var(--app-text);
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--app-primary);
  color: #111418;
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--app-surface-subtle);
}
[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: var(--app-input-bg);
  color: var(--app-input-color);
  border-color: var(--app-input-border);
}
[data-bs-theme="dark"] .select2-new-pacient-item {
  background-color: var(--app-surface-subtle) !important;
  color: var(--app-primary) !important;
}

/* ---------- 6. Pickadate (selector de hora / fecha) ---------- */
[data-bs-theme="dark"] .picker__holder,
[data-bs-theme="dark"] .picker__frame,
[data-bs-theme="dark"] .picker__box {
  background-color: var(--app-surface);
  color: var(--app-text);
}
[data-bs-theme="dark"] .picker__holder {
  border-color: var(--app-border);
}
[data-bs-theme="dark"] .picker__box {
  border-color: var(--app-border);
  box-shadow: var(--app-shadow-lg);
}
[data-bs-theme="dark"] .picker__list-item {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}
[data-bs-theme="dark"] .picker--time .picker__list-item:hover,
[data-bs-theme="dark"] .picker__list-item--highlighted,
[data-bs-theme="dark"] .picker__list-item--highlighted:hover {
  background-color: var(--app-surface-subtle);
  color: var(--app-text-title);
  border-color: var(--app-primary);
}
[data-bs-theme="dark"] .picker__list-item--selected,
[data-bs-theme="dark"] .picker__list-item--selected:hover,
[data-bs-theme="dark"] .picker--time .picker__list-item--selected,
[data-bs-theme="dark"] .picker--time .picker__list-item--selected:hover {
  background-color: var(--app-primary);
  color: #111418;
  border-color: var(--app-primary);
}
[data-bs-theme="dark"] .picker__list-item--disabled,
[data-bs-theme="dark"] .picker__list-item--disabled:hover {
  background-color: var(--app-surface-subtle);
  color: var(--app-text-muted);
  opacity: 0.5;
}
[data-bs-theme="dark"] .picker__button--clear,
[data-bs-theme="dark"] .picker__button--close,
[data-bs-theme="dark"] .picker__button--today {
  background-color: var(--app-surface);
  color: var(--app-text);
}
[data-bs-theme="dark"] .picker__day,
[data-bs-theme="dark"] .picker__weekday,
[data-bs-theme="dark"] .picker__month,
[data-bs-theme="dark"] .picker__year {
  color: var(--app-text);
}
[data-bs-theme="dark"] .picker__day--infocus:hover,
[data-bs-theme="dark"] .picker__day--outfocus:hover {
  background-color: var(--app-surface-subtle);
}
[data-bs-theme="dark"] .picker__day--outfocus {
  color: var(--app-text-muted);
}
[data-bs-theme="dark"] .picker__select--month,
[data-bs-theme="dark"] .picker__select--year {
  background-color: var(--app-input-bg);
  color: var(--app-input-color);
  border-color: var(--app-input-border);
}

/* ---------- 7. SweetAlert2 ---------- */
[data-bs-theme="dark"] .swal2-popup {
  background-color: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
}
[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container {
  color: var(--app-text-title);
}
[data-bs-theme="dark"] .swal2-html-container .text-muted {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select {
  background-color: var(--app-input-bg);
  color: var(--app-input-color);
  border-color: var(--app-input-border);
}
[data-bs-theme="dark"] .swal2-footer {
  border-top-color: var(--app-border);
}
[data-bs-theme="dark"] .swal2-validation-message {
  background-color: var(--app-surface-subtle);
  color: #fb7185;
}
[data-bs-theme="dark"] div:where(.swal2-container) div:where(.swal2-popup).swal2-toast {
  background-color: var(--app-surface);
}

/* ---------- 8. Agenda interactiva (FullCalendar) ---------- */
[data-bs-theme="dark"] .fc {
  --fc-page-bg-color: var(--app-surface);
  --fc-neutral-bg-color: var(--app-surface-subtle);
  --fc-neutral-text-color: var(--app-text-muted);
  --fc-border-color: var(--app-border);
  --fc-today-bg-color: rgba(56, 189, 248, 0.08);
  --fc-now-indicator-color: #38bdf8;
  color: var(--app-text);
}
[data-bs-theme="dark"] .fc-theme-standard td,
[data-bs-theme="dark"] .fc-theme-standard th,
[data-bs-theme="dark"] .fc-theme-standard .fc-scrollgrid {
  border-color: var(--app-border) !important;
}
[data-bs-theme="dark"] .fc-timegrid-slot-lane,
[data-bs-theme="dark"] .fc-timegrid-slot-minor {
  border-top-color: var(--app-border-subtle) !important;
}
[data-bs-theme="dark"] .fc-col-header,
[data-bs-theme="dark"] .fc-col-header-cell {
  background: var(--app-surface) !important;
  border-bottom-color: var(--app-border) !important;
}
[data-bs-theme="dark"] .custom-day-header,
[data-bs-theme="dark"] .custom-day-header .day-number {
  color: var(--app-text);
}
[data-bs-theme="dark"] .fc-day-today .custom-day-header .day-number {
  background-color: var(--app-primary) !important;
  color: #111418 !important;
}
[data-bs-theme="dark"] .fc-timegrid-axis-cushion,
[data-bs-theme="dark"] .fc-timegrid-slot-label-cushion {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] .fc-highlight {
  background: rgba(56, 189, 248, 0.18) !important;
}
[data-bs-theme="dark"] .fc-event:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
/* Barra superior de la agenda (Hoy / flechas / Día-Semana / filtro) */
[data-bs-theme="dark"] #btnCalToday,
[data-bs-theme="dark"] #btnCalPrev,
[data-bs-theme="dark"] #btnCalNext,
[data-bs-theme="dark"] #dropdownFiltroLens {
  background-color: var(--app-surface-subtle);
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}
[data-bs-theme="dark"] #btnCalToday:hover,
[data-bs-theme="dark"] #btnCalPrev:hover,
[data-bs-theme="dark"] #btnCalNext:hover,
[data-bs-theme="dark"] #dropdownFiltroLens:hover {
  background-color: var(--app-border);
  color: var(--app-text-title) !important;
}
[data-bs-theme="dark"] .btn-group[style*="f1f5f9"] {
  background: var(--app-surface-subtle) !important;
}
[data-bs-theme="dark"] #btnViewDay.bg-white,
[data-bs-theme="dark"] #btnViewWeek.bg-white {
  background-color: var(--app-primary) !important;
  color: #111418 !important;
}
[data-bs-theme="dark"] #btnViewDay.text-secondary,
[data-bs-theme="dark"] #btnViewWeek.text-secondary {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] #customCalendarTitle {
  color: var(--app-text-title) !important;
}

/* ---------- 9. Listado de citas / tablas ---------- */
[data-bs-theme="dark"] .table {
  --bs-table-color: var(--app-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--app-border);
  color: var(--app-text);
}
[data-bs-theme="dark"] .table-cards tbody td {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}
[data-bs-theme="dark"] .table-cards tbody tr.status-2 td {
  background-color: var(--app-surface-subtle) !important;
}
[data-bs-theme="dark"] .table-cards thead th {
  color: var(--app-text-muted) !important;
}
[data-bs-theme="dark"] .table-cards tbody tr {
  box-shadow: var(--app-shadow-xs);
}
[data-bs-theme="dark"] .table-cards tbody td .fw-bold.text-uppercase {
  color: var(--app-text-title) !important;
}
[data-bs-theme="dark"] .patient-avatar {
  background-color: var(--app-surface-subtle);
  color: var(--app-text);
}
[data-bs-theme="dark"] .att-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
[data-bs-theme="dark"] .att-no {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}
[data-bs-theme="dark"] .btn-action-noshow {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.5);
}
[data-bs-theme="dark"] .btn-action-noshow:hover {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: #fb7185;
}
[data-bs-theme="dark"] .btn-action-dots:hover {
  color: var(--app-text-title);
}
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter {
  color: var(--app-text);
}
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
  background-color: var(--app-input-bg);
  border-color: var(--app-input-border);
  color: var(--app-input-color);
}
[data-bs-theme="dark"] .page-link {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}
[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  color: #111418;
}
[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--app-surface-subtle);
  color: var(--app-text-muted);
}

/* ---------- 10. Tarjetas, badges y pastillas de color fijo (claro) ---------- */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
  border-color: var(--app-border);
}
[data-bs-theme="dark"] .badge.bg-body-secondary,
[data-bs-theme="dark"] .badge.bg-light {
  background-color: var(--app-surface-subtle) !important;
  color: var(--app-text) !important;
  border-color: var(--app-border) !important;
}
[data-bs-theme="dark"] .pwd-icon,
[data-bs-theme="dark"] .role-blue,
[data-bs-theme="dark"] .staff-kpi-blue,
[data-bs-theme="dark"] .staff-avatar-blue,
[data-bs-theme="dark"] .staff-badge-blue {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}
[data-bs-theme="dark"] .role-violet,
[data-bs-theme="dark"] .staff-kpi-violet,
[data-bs-theme="dark"] .staff-avatar-violet,
[data-bs-theme="dark"] .staff-badge-violet {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}
[data-bs-theme="dark"] .staff-kpi-amber,
[data-bs-theme="dark"] .staff-badge-amber {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}
[data-bs-theme="dark"] .staff-kpi-slate {
  background: var(--app-surface-subtle);
  color: var(--app-text);
}
[data-bs-theme="dark"] .staff-pill.active {
  background: var(--app-primary);
  color: #111418;
}
[data-bs-theme="dark"] .alert-warning {
  --bs-alert-bg: rgba(251, 191, 36, 0.12);
  --bs-alert-color: #fcd34d;
  --bs-alert-border-color: rgba(251, 191, 36, 0.35);
}
[data-bs-theme="dark"] .alert-success {
  --bs-alert-bg: rgba(16, 185, 129, 0.12);
  --bs-alert-color: #6ee7b7;
  --bs-alert-border-color: rgba(16, 185, 129, 0.35);
}
[data-bs-theme="dark"] .alert-danger {
  --bs-alert-bg: rgba(244, 63, 94, 0.12);
  --bs-alert-color: #fda4af;
  --bs-alert-border-color: rgba(244, 63, 94, 0.35);
}
[data-bs-theme="dark"] hr {
  border-color: var(--app-border);
  opacity: 0.6;
}

/* ---------- 11. Pacientes: avatares, pastillas y botones de acción ---------- */
[data-bs-theme="dark"] .filter-pill.active {
  background: var(--app-primary) !important;
  color: #111418 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] .patient-avatar-table {
  background: var(--app-surface-subtle);
  color: var(--app-text);
}
[data-bs-theme="dark"] .patient-avatar-table.female {
  background: rgba(244, 114, 182, 0.18);
  color: #f9a8d4;
}
[data-bs-theme="dark"] .patient-avatar-table.male {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}
[data-bs-theme="dark"] .btn-action-touch.btn-touch-edit {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}
[data-bs-theme="dark"] .btn-action-touch.btn-touch-history {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
}
[data-bs-theme="dark"] .btn-action-touch.btn-touch-consult {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
[data-bs-theme="dark"] .btn-action-touch.btn-touch-edit:hover,
[data-bs-theme="dark"] .btn-action-touch.btn-touch-history:hover,
[data-bs-theme="dark"] .btn-action-touch.btn-touch-consult:hover {
  color: #111418;
  background: var(--app-primary);
  border-color: var(--app-primary);
}

/* ---------- 12. Estilo AdminLTE 4 (Bootstrap 5.3 dark): página #2b3035, tarjetas/header #212529, sidebar #343a40 ---------- */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas {
  background-color: var(--app-surface);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 1px rgba(222, 226, 230, 0.125), 0 1px 3px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .card-header {
  background-color: rgba(222, 226, 230, 0.03);
  border-bottom-color: var(--app-border);
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
  border-color: var(--app-input-border) !important;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #adb5bd;
  --bs-btn-border-color: #6c757d;
  --bs-btn-hover-bg: #6c757d;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-border-color: #6c757d;
}
[data-bs-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: var(--app-border);
}
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
  --bs-table-hover-color: #dee2e6;
}

/* ---------- 13. Textos grises: más claros y legibles en modo oscuro ---------- */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-body-secondary,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .small.text-muted,
[data-bs-theme="dark"] small.text-muted {
  color: #ced4da !important;
}
[data-bs-theme="dark"] .text-body-tertiary,
[data-bs-theme="dark"] .text-black-50 {
  color: #adb5bd !important;
}
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .text-body-emphasis {
  color: #ffffff !important;
}
[data-bs-theme="dark"] .text-muted.opacity-50,
[data-bs-theme="dark"] .text-secondary.opacity-50,
[data-bs-theme="dark"] .text-muted.opacity-75,
[data-bs-theme="dark"] .text-secondary.opacity-75 {
  opacity: 1 !important;
}
[data-bs-theme="dark"] .breadcrumb-item,
[data-bs-theme="dark"] .breadcrumb-item.active,
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: #ced4da;
}
[data-bs-theme="dark"] .nav-link:not(.active) {
  color: #ced4da;
}
[data-bs-theme="dark"] .nav-link:not(.active):hover {
  color: #ffffff;
}
[data-bs-theme="dark"] .list-group-item {
  background-color: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

/* Clases propias con gris fijo (#64748b / #94a3b8 / #475569) */
[data-bs-theme="dark"] .table-cards thead th,
[data-bs-theme="dark"] .pwd-rules li,
[data-bs-theme="dark"] .role-card span,
[data-bs-theme="dark"] .staff-pill,
[data-bs-theme="dark"] .staff-status-off,
[data-bs-theme="dark"] .staff-legend span,
[data-bs-theme="dark"] #miTabla2_wrapper .dataTables_info,
[data-bs-theme="dark"] .sidebar-user-cedula .cedula-label,
[data-bs-theme="dark"] .sidebar-user-specialty {
  color: #ced4da !important;
}
[data-bs-theme="dark"] .pwd-rules li.ok {
  color: #4ade80 !important;
}
[data-bs-theme="dark"] .pwd-rules li i {
  color: #adb5bd;
}
[data-bs-theme="dark"] .staff-status-off span {
  background: #adb5bd;
}
[data-bs-theme="dark"] .btn-action-dots {
  color: #ced4da;
}
[data-bs-theme="dark"] .btn-action-dots:hover {
  color: #ffffff;
}
[data-bs-theme="dark"] .st-cancel {
  background: rgba(206, 212, 218, 0.18);
  color: #e9ecef;
}
[data-bs-theme="dark"] .fc-timegrid-axis-cushion,
[data-bs-theme="dark"] .fc-timegrid-slot-label-cushion {
  color: #ced4da !important;
}
[data-bs-theme="dark"] .custom-day-header,
[data-bs-theme="dark"] .custom-day-header .day-number {
  color: #f1f3f5;
}
[data-bs-theme="dark"] .patient-avatar-table,
[data-bs-theme="dark"] .patient-avatar {
  color: #f1f3f5;
}

/* ---------- 14. Gráficas ApexCharts (ejes, leyendas, etiquetas) ---------- */
[data-bs-theme="dark"] .apexcharts-text,
[data-bs-theme="dark"] .apexcharts-xaxis-label,
[data-bs-theme="dark"] .apexcharts-yaxis-label,
[data-bs-theme="dark"] .apexcharts-datalabel-label,
[data-bs-theme="dark"] .apexcharts-title-text,
[data-bs-theme="dark"] .apexcharts-subtitle-text {
  fill: #e9ecef !important;
}
[data-bs-theme="dark"] .apexcharts-legend-text {
  color: #e9ecef !important;
}
[data-bs-theme="dark"] .apexcharts-gridline,
[data-bs-theme="dark"] .apexcharts-xaxis-tick,
[data-bs-theme="dark"] .apexcharts-xaxis line,
[data-bs-theme="dark"] .apexcharts-yaxis line {
  stroke: #495057 !important;
}
[data-bs-theme="dark"] .apexcharts-menu,
[data-bs-theme="dark"] .apexcharts-tooltip {
  background: #343a40 !important;
  border-color: #6c757d !important;
  color: #f1f3f5 !important;
}
[data-bs-theme="dark"] .apexcharts-tooltip-title,
[data-bs-theme="dark"] .apexcharts-tooltip-text,
[data-bs-theme="dark"] .apexcharts-menu-item:hover {
  background: #3f474e !important;
  color: #f1f3f5 !important;
  border-color: #6c757d !important;
}
[data-bs-theme="dark"] .apexcharts-toolbar svg {
  fill: #ced4da;
}

/* ---------- 15. Bloques "subtle" y tablas claras: sin azul marino, a juego con la paleta ---------- */
[data-bs-theme="dark"] {
  --bs-primary-bg-subtle: rgba(110, 168, 254, 0.16);
  --bs-primary-border-subtle: rgba(110, 168, 254, 0.4);
  --bs-primary-text-emphasis: #9ec5fe;
  --bs-success-bg-subtle: rgba(25, 135, 84, 0.22);
  --bs-success-border-subtle: rgba(117, 183, 152, 0.4);
  --bs-success-text-emphasis: #75b798;
  --bs-danger-bg-subtle: rgba(220, 53, 69, 0.2);
  --bs-danger-border-subtle: rgba(234, 134, 143, 0.4);
  --bs-danger-text-emphasis: #ea868f;
  --bs-warning-bg-subtle: rgba(255, 193, 7, 0.16);
  --bs-warning-border-subtle: rgba(255, 218, 106, 0.4);
  --bs-warning-text-emphasis: #ffda6a;
  --bs-info-bg-subtle: rgba(13, 202, 240, 0.16);
  --bs-info-border-subtle: rgba(110, 223, 246, 0.4);
  --bs-info-text-emphasis: #6edff6;
  --bs-secondary-bg-subtle: #343a40;
  --bs-secondary-border-subtle: #495057;
  --bs-secondary-text-emphasis: #ced4da;
  --bs-light-bg-subtle: #343a40;
  --bs-light-border-subtle: #495057;
}
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table > thead.table-light > tr > *,
[data-bs-theme="dark"] thead.table-light th {
  --bs-table-color: #f1f3f5;
  --bs-table-bg: #343a40;
  --bs-table-border-color: #495057;
  --bs-table-striped-bg: #3a4047;
  --bs-table-hover-bg: #3f474e;
  background-color: #343a40 !important;
  color: #f1f3f5 !important;
  border-color: #495057 !important;
}
[data-bs-theme="dark"] .progress {
  background-color: #343a40;
}
[data-bs-theme="dark"] .kpi-card:hover {
  box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .45) !important;
}
[data-bs-theme="dark"] .kpi-alert {
  box-shadow: inset 3px 0 0 #f59e0b, 0 .125rem .25rem rgba(0, 0, 0, .35) !important;
}
