/* public/assets/css/libs.css */
/* Librerías externas – Versión 2025 (optimizada + dark mode perfecto) */

/* ============= SELECT2 + Tema Bootstrap 5 ============= */
@import url('https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css');
@import url('https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css');

/* ============= SWEETALERT2 ============= */
@import url('https://cdn.jsdelivr.net/npm/sweetalert2@11.14.4/dist/sweetalert2.min.css');

/* ============= DATATABLES + Bootstrap 5 ============= */
/* Opción jsDelivr (paquete correcto) */
@import url('https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.8/css/dataTables.bootstrap5.min.css');

/* Botones (asegúrate de usar una versión compatible con tu DataTables) */
@import url('https://cdn.jsdelivr.net/npm/datatables.net-buttons-bs5@2.4.2/css/buttons.bootstrap5.min.css');

/* ============= FLATPICKR (fecha/hora) ============= */
@import url('https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css');
@import url('https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/themes/material_blue.css');

/* ============= TOASTR (notificaciones opcional) ============= */
/* @import url('https://cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.css'); */


/* ============= INTEGRACIÓN VISUAL Y FIXES GLOBALES ============= */

/* Select2: ancho; z-index lo define app.css (una sola fuente de verdad) */
.select2-container { width: 100% !important; }
.select2-results__options { max-height: 280px; overflow-y: auto; }

/* Alineación con .form-select de Bootstrap 5 + tu app.css */
.select2-container--bootstrap-5 .select2-selection {
  min-height: calc(1.5em + 0.75rem + 2px) !important;
  padding: 0.375rem 0.75rem !important;
  border-radius: 0.75rem !important;
  font-size: 0.925rem; line-height: 1.5;
}

/* DataTables: estilo limpio y coherente con tu tema */
table.dataTable { font-size: 0.875rem; }
table.dataTable thead th {
  text-transform: none !important; letter-spacing: normal !important;
  font-weight: 600; font-size: 0.75rem;
}
table.dataTable tbody td { vertical-align: middle; }

/* Flatpickr: paleta primaria */
.flatpickr-calendar { font-family: 'Inter', system-ui, sans-serif; }
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
  background: #6366f1 !important; border-color: #6366f1 !important; color: #fff !important;
}
.flatpickr-day.today { border-color: #6366f1 !important; color: #6366f1 !important; }
.flatpickr-day.today:hover { background: rgba(99,102,241,.1) !important; }

/* ============= DARK MODE ============= */
html[data-theme="dark"] .swal2-popup { background: #111827 !important; color: #f3f4f6 !important; }
html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-content { color: #f3f4f6 !important; }
html[data-theme="dark"] .swal2-confirm { background: #6366f1 !important; }
html[data-theme="dark"] .swal2-cancel { background: #374151 !important; }

html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: #1f2937 !important; border-color: #374151 !important; color: #e5e7eb !important;
}
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
  background: #111827 !important; color: #e5e7eb !important;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background: #6366f1 !important; color: #fff !important;
}

html[data-theme="dark"] table.dataTable thead th {
  background: #111827 !important; color: #e5e7eb !important; border-bottom-color: #374151 !important;
}
html[data-theme="dark"] table.dataTable tbody tr:hover { background-color: rgba(99,102,241,.15) !important; }
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background: #1f2937; border-color: #374151; color: #e5e7eb;
}

html[data-theme="dark"] .flatpickr-calendar {
  background: #0f172a !important; border: 1px solid #374151 !important; box-shadow: 0 10px 30px rgba(0,0,0,.6) !important;
}
html[data-theme="dark"] .flatpickr-day { color: #e5e7eb !important; }
html[data-theme="dark"] .flatpickr-day.selected,
html[data-theme="dark"] .flatpickr-day.today {
  background: #6366f1 !important; border-color: #6366f1 !important; color: #fff !important;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 576px){
  .select2-container--bootstrap-5 .select2-selection { font-size: 16px !important; } /* evita zoom iOS */
}
