.btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

footer.footer {
  margin-top: -80px;
}

@media (min-width: 768px) and (max-width: 991px) {
  #main-header {
    display: none !important;
  }
}

@media (min-width: 991px) {
  #aside-logo-container { 
    visibility: hidden !important; /* visible dentro del aside */    
  }
}

/* Ajustes responsivos para el sidebar */
@media (max-width: 991px) {
  aside.navbar-vertical {
    background-color: #1e293b !important;
  }
  
  aside.navbar-vertical .navbar-collapse {
    background-color: #1e293b;
  }
  
  #aside-logo-container {
    display: block !important;
    visibility: visible !important;
  }
}

header#main-header div h1 img.navbar-brand-image {
  display: block;
}

/* Fondo para el sidebar y mejoras de visibilidad */
aside.navbar-vertical {
  background-color: #1e293b;
}

/* Asegura que los enlaces del sidebar sean visibles */
aside.navbar-vertical .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
}

aside.navbar-vertical .nav-link:hover,
aside.navbar-vertical .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mejora visibilidad del dropdown del sidebar */
aside.navbar-vertical .dropdown-menu {
  background-color: #172030;
  border-color: #253649;
}

aside.navbar-vertical .dropdown-item {
  color: rgba(255, 255, 255, 0.7) !important;
}

aside.navbar-vertical .dropdown-item:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mejora los bordes para elementos de formulario en todo el sitio */
.form-control, 
.form-select {
  border: 1px solid #dee2e6;
}

.form-control:focus, 
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Asegura que los íconos del sidebar sean visibles */
aside.navbar-vertical .nav-link-icon {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Asegura que el logo en el sidebar se vea bien */
aside.navbar-vertical .navbar-brand-image {
  filter: brightness(1.2);
}

/* Mejora de la visibilidad de los botones */
.btn {
  border-width: 1px;
}

/* Mejora de dropdown del sidebar */
aside.navbar-vertical .navbar-collapse {
  margin-top: 10px;
}

/* Mejora de visibilidad para texto en sidebar */
aside.navbar-vertical .nav-link-title {
  opacity: 1;
}

/* MEJORAS DE CONTRASTE Y VISIBILIDAD GENERAL */

/* Mejora los bordes para elementos de formulario en todo el sitio */
.form-control, 
.form-select {
  border: 2px solid #6c757d !important; /* Borde más grueso y oscuro para mayor contraste */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; /* Sombra más visible */
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  background-color: var(--tblr-bg-surface) !important;
}

/* Mejoras específicas para tema oscuro */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
.theme-dark .form-control,
.theme-dark .form-select {
  border-color: #495057 !important;
  background-color: #2d3748 !important;
  color: #fff !important;
}

.form-control:focus, 
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Añadir un estado hover para mejor feedback visual */
.form-control:hover, 
.form-select:hover {
  border-color: #6c757d;
}

/* Asegurar que los campos deshabilitados son claramente reconocibles */
.form-control:disabled,
.form-select:disabled {
  background-color: #e9ecef;
  border-color: #ced4da;
  opacity: 0.75;
}

/* Asegurar que la validación de campos es visible */
.form-control.is-valid,
.form-select.is-valid {
  border-color: #198754;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Mejorar apariencia de campos readonly */
.form-control[readonly] {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}


/* Tema oscuro para footer */
footer.footer {
  background-color: #1e293b !important;
  color: rgba(255, 255, 255, 0.8) !important;
  margin-top: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

footer.footer .link-secondary {
  color: rgba(255, 255, 255, 0.6) !important;
}

footer.footer .link-secondary:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* MEJORAS ADICIONALES DE CONTRASTE */

/* Mejorar visibilidad de cards */
.card {
  border: 1px solid rgba(0,0,0,0.2) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.theme-dark .card {
  border-color: #495057 !important;
  background-color: #2d3748 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* Mejorar visibilidad de tablas */
.table {
  border: 1px solid #dee2e6 !important;
}

.theme-dark .table {
  border-color: #495057 !important;
}

.table th,
.table td {
  border-color: #dee2e6 !important;
}

.theme-dark .table th,
.theme-dark .table td {
  border-color: #495057 !important;
  background-color: transparent !important;
}

/* Mejorar visibilidad de botones */
.btn {
  border-width: 2px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-light,
.btn-outline-dark {
  border-width: 2px !important;
}

/* MEJORAS ESPECÍFICAS PARA TEMA OSCURO */

/* Mejorar visibilidad de celdas de tabla en tema oscuro */
.theme-dark .table td,
.theme-dark .table th {
  color: #e9ecef !important; /* Texto más claro en celdas */
  background-color: transparent !important;
}

.theme-dark .table-hover tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.075) !important;
  color: #ffffff !important;
}

/* Mejorar labels en tema oscuro */
.theme-dark .form-label,
.theme-dark label {
  color: #cbd5e0 !important; /* Labels más visibles */
  font-weight: 500 !important;
}

/* Iconos de calendario y controles de fecha en tema oscuro */
.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) !important; /* Convierte iconos negros a blancos */
  opacity: 0.8;
}

.theme-dark input[type="date"]::-webkit-calendar-picker-indicator:hover,
.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.theme-dark input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Mejorar checkboxes en tema oscuro */
.theme-dark .form-check-input {
  background-color: #4a5568 !important;
  border-color: #718096 !important;
}

.theme-dark .form-check-input:checked {
  background-color: #3182ce !important;
  border-color: #3182ce !important;
}

.theme-dark .form-check-label {
  color: #cbd5e0 !important;
}

/* Mejorar links en tema oscuro */
.theme-dark a,
.theme-dark .link-secondary {
  color: #63b3ed !important;
}

.theme-dark a:hover,
.theme-dark .link-secondary:hover {
  color: #90cdf4 !important;
}

/* Mejorar placeholders en tema oscuro */
.theme-dark .form-control::placeholder,
.theme-dark .form-select::placeholder {
  color: #a0aec0 !important;
  opacity: 0.8;
}

/* Mejorar separación visual */
.row > * {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Arreglar problema de scroll vertical en móvil */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1;
}

/* Mantener estilos existentes */
@media (min-width: 768px) and (max-width: 991px) {
  #main-header {
    display: none !important;
  }
}

@media (min-width: 991px) {
  #aside-logo-container { 
    visibility: hidden;
  }
}

/* Estilos específicos para corregir problemas en ZippyCart */
header .navbar-nav .dropdown-menu {
  position: absolute !important;
  right: 0;
  top: 100%;
  z-index: 1050; /* Valor alto para asegurar que esté por encima */
}

/* Eliminar cualquier transformación que pueda estar afectando la posición */
header .dropdown-menu.dropdown-menu-end {
  transform: none !important;
}

/* MEJORAS ESPECÍFICAS PARA PAGINACIÓN Y CARDS */

/* Mejorar visibilidad de botones de paginación en tema oscuro */
.theme-dark .simple-paginator .btn,
.theme-dark .pagination .page-link {
  color: #e9ecef !important;
  background-color: #495057 !important;
  border-color: #6c757d !important;
  font-weight: 600 !important;
}

.theme-dark .simple-paginator .btn:hover,
.theme-dark .pagination .page-link:hover {
  color: #ffffff !important;
  background-color: #6c757d !important;
  border-color: #868e96 !important;
}

.theme-dark .simple-paginator .btn:disabled,
.theme-dark .pagination .page-link:disabled {
  color: #6c757d !important;
  background-color: #343a40 !important;
  border-color: #495057 !important;
  opacity: 0.6;
}

/* Mejorar botones Anterior/Siguiente específicamente */
.theme-dark .simple-paginator .btn[disabled] {
  color: #868e96 !important;
  background-color: #343a40 !important;
  border-color: #495057 !important;
}

/* Mejorar visibilidad del texto en cards del dashboard */
.theme-dark .card .card-body,
.theme-dark .card-body {
  color: #e9ecef !important;
}

.theme-dark .card .card-title,
.theme-dark .card-title {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Estilos para iconos en card-header */
.card-header i {
  font-size: 1.25rem;
  opacity: 0.7;
}

.theme-dark .card-header i {
  color: #ffffff;
}

.theme-dark .card .card-text,
.theme-dark .card-text {
  color: #cbd5e0 !important;
}

.theme-dark .card .text-muted {
  color: #a0aec0 !important;
}

.theme-dark .card .small,
.theme-dark .card small {
  color: #a0aec0 !important;
}

/* Mejorar enlaces dentro de cards */
.theme-dark .card a:not(.btn) {
  color: #63b3ed !important;
}

.theme-dark .card a:not(.btn):hover {
  color: #90cdf4 !important;
}

/* Mejorar visibilidad de números/estadísticas en cards */
.theme-dark .card .h1,
.theme-dark .card .h2,
.theme-dark .card .h3,
.theme-dark .card .h4,
.theme-dark .card .h5,
.theme-dark .card .h6,
.theme-dark .card h1,
.theme-dark .card h2,
.theme-dark .card h3,
.theme-dark .card h4,
.theme-dark .card h5,
.theme-dark .card h6 {
  color: #ffffff !important;
}

/* Mejorar badges y etiquetas en cards */
.theme-dark .card .badge {
  background-color: #495057 !important;
  color: #e9ecef !important;
}

.theme-dark .card .badge.bg-primary {
  background-color: #0d6efd !important;
}

.theme-dark .card .badge.bg-success {
  background-color: #198754 !important;
}

.theme-dark .card .badge.bg-warning {
  background-color: #fd7e14 !important;
  color: #ffffff !important;
}

/* Mejorar todos los badges bg-warning globalmente en tema oscuro */
.theme-dark .badge.bg-warning {
  background-color: #fd7e14 !important;
  color: #ffffff !important;
}

.theme-dark .card .badge.bg-danger {
  background-color: #dc3545 !important;
}

/* MEJORAS ESPECÍFICAS PARA MODALES EN TEMA OSCURO */

/* Fondo y contenido general del modal */
.theme-dark .modal-content {
  background-color: #2d3748 !important;
  border-color: #495057 !important;
  color: #e9ecef !important;
}

.theme-dark .modal-header {
  background-color: #2d3748 !important;
  border-bottom-color: #495057 !important;
}

.theme-dark .modal-footer {
  background-color: #2d3748 !important;
  border-top-color: #495057 !important;
}

.theme-dark .modal-body {
  background-color: #2d3748 !important;
  color: #e9ecef !important;
}

/* Títulos de modal */
.theme-dark .modal-title,
.theme-dark .modal-header h1,
.theme-dark .modal-header h2,
.theme-dark .modal-header h3,
.theme-dark .modal-header h4,
.theme-dark .modal-header h5,
.theme-dark .modal-header h6 {
  color: #ffffff !important;
}

/* Labels de formularios dentro de modales */
.theme-dark .modal .form-label,
.theme-dark .modal label {
  color: #e9ecef !important;
  font-weight: 600 !important;
}

/* Campos de formulario en modales */
.theme-dark .modal .form-control,
.theme-dark .modal .form-select {
  background-color: #4a5568 !important;
  border-color: #718096 !important;
  color: #ffffff !important;
}

.theme-dark .modal .form-control:focus,
.theme-dark .modal .form-select:focus {
  background-color: #4a5568 !important;
  border-color: #63b3ed !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.25rem rgba(99, 179, 237, 0.25) !important;
}

.theme-dark .modal .form-control::placeholder {
  color: #a0aec0 !important;
  opacity: 0.8;
}

/* Botón de cerrar modal - Mejorado para máxima visibilidad */
.theme-dark .modal .btn-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.755 10.822 7.267-7.267a1 1 0 0 1 1.414 1.414L2.169 12.236a1 1 0 0 1-1.414-1.414Z'/%3e%3cpath d='M14.245 10.822a1 1 0 0 1-1.414 1.414L5.564 5.769A1 1 0 0 1 6.978 4.355l7.267 7.267Z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
  width: 1em !important;
  height: 1em !important;
  padding: 2em !important;
  color: #ffffff !important;
  border: none !important;
}

.theme-dark .modal .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  opacity: 1 !important;
  border-radius: 0.25rem !important;
}

.theme-dark .modal .btn-close:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  outline: none !important;
}

/* Alternativa adicional para botón close con ícono visible */
.theme-dark .btn-close,
.theme-dark .modal .btn-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
  opacity: 1 !important;
  filter: none !important;
}

/* MEJORAS PARA BOTONES PRIMARIOS Y SECUNDARIOS */

/* Mejorar visibilidad de botones primarios en tema oscuro */
.theme-dark .btn-primary {
  color: #ffffff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.theme-dark .btn-primary:hover {
  color: #ffffff !important;
  background-color: #0b5ed7 !important;
  border-color: #0a58ca !important;
}

.theme-dark .btn-primary:focus,
.theme-dark .btn-primary:active {
  color: #ffffff !important;
  background-color: #0a58ca !important;
  border-color: #0a53be !important;
  box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5) !important;
}

/* Mejorar SVG icons en botones primarios */
.theme-dark .btn-primary svg {
  stroke: #ffffff !important;
  fill: none !important;
  opacity: 1 !important;
}

/* Mejorar botones secundarios también */
.theme-dark .btn-secondary {
  color: #ffffff !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

.theme-dark .btn-secondary:hover {
  color: #ffffff !important;
  background-color: #5c636a !important;
  border-color: #565e64 !important;
}

.theme-dark .btn-secondary svg {
  stroke: #ffffff !important;
  fill: none !important;
}

/* Mejorar botones outline en tema oscuro */
.theme-dark .btn-outline-primary {
  color: #6ea8fe !important;
  border-color: #6ea8fe !important;
}

.theme-dark .btn-outline-primary:hover {
  color: #ffffff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.theme-dark .btn-outline-primary svg {
  stroke: currentColor !important;
}

.theme-dark .btn-outline-secondary {
  color: #adb5bd !important;
  border-color: #6c757d !important;
}

.theme-dark .btn-outline-secondary:hover {
  color: #ffffff !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

.theme-dark .btn-outline-secondary svg {
  stroke: currentColor !important;
}

.theme-dark .btn-outline-danger {
  color: #f5c2c7 !important;
  border-color: #dc3545 !important;
}

.theme-dark .btn-outline-danger:hover {
  color: #ffffff !important;
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
}

.theme-dark .btn-outline-danger svg {
  stroke: currentColor !important;
}

/* MEJORAS DE JERARQUÍA VISUAL PARA DATAGRID */

/* Jerarquizar el input de búsqueda con borde más blanco y placeholder más visible */
.theme-dark input[name="search"].form-control {
  border: 2px solid #ffffff !important;
  border-radius: 0.5rem !important;
  background-color: #2d3748 !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
}

.theme-dark input[name="search"].form-control::placeholder {
  color: #e2e8f0 !important;
  opacity: 0.9 !important;
  font-weight: 500 !important;
}

.theme-dark input[name="search"].form-control:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25), 0 4px 12px rgba(255, 255, 255, 0.15) !important;
  background-color: #2d3748 !important;
  color: #ffffff !important;
}

.theme-dark input[name="search"].form-control:hover {
  border-color: #f7fafc !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15) !important;
}

/* Jerarquizar los textos del thead del datagrid - más blancos y bold */
.theme-dark table thead th,
.theme-dark .table thead th {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.80rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  background-color: #1a202c !important;
  border-bottom: 2px solid #4a5568 !important;
  padding: 1rem 0.75rem !important;
}

.theme-dark table thead th:first-child,
.theme-dark .table thead th:first-child {
  border-left: 3px solid #0d6efd !important;
  padding-left: 1rem !important;
}

.theme-dark table thead th:last-child,
.theme-dark .table thead th:last-child {
  border-right: 3px solid #0d6efd !important;
  padding-right: 1rem !important;
}

/* Mejorar contraste de las filas del tbody también */
.theme-dark table tbody td,
.theme-dark .table tbody td {
  color: #e2e8f0 !important;
  font-weight: 400 !important;
  border-bottom: 1px solid #4a5568 !important;
  padding: 0.875rem 0.75rem !important;
}

/* Alternar colores de filas para mejor legibilidad */
.theme-dark table tbody tr:nth-child(even),
.theme-dark .table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.theme-dark table tbody tr:hover,
.theme-dark .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.theme-dark table tbody tr:hover td,
.theme-dark .table tbody tr:hover td {
  color: #ffffff !important;
}

/* MEJORAS PARA LABELS DE FILTROS EN DATAGRID */

/* Estilizar labels de filtros con estilo más elegante y posición mejorada */
.theme-dark label[for*="__filter_"],
.theme-dark form label[style*="margin-top"] {
  color: #cbd5e0 !important;
  /* font-style: italic !important; */
  font-weight: 400 !important;
  font-size: 0.85rem !important;
  margin-top: 0.125rem !important;
  margin-bottom: 0.5rem !important;
  opacity: 0.85 !important;
  letter-spacing: 0.025em !important;
  transition: color 0.2s ease-in-out !important;
}

/* Efecto hover para labels de filtros */
.theme-dark label[for*="__filter_"]:hover,
.theme-dark form label[style*="margin-top"]:hover {
  color: #e2e8f0 !important;
  opacity: 1 !important;
}

/* Mejorar la relación visual entre input y label */
.theme-dark .col-md-4:has(label[for*="__filter_"]),
.theme-dark .col-md-4:has(label[style*="margin-top"]) {
  position: relative;
}

/* Específicamente para labels de filtros en formularios de búsqueda */
.theme-dark #filter-form label,
.theme-dark form#filter-form label {
  color: #a0aec0 !important;
  /* font-style: italic !important; */
  font-weight: 300 !important;
  font-size: 0.8rem !important;
  margin-top: 0.1rem !important;
  margin-bottom: 0.75rem !important;
  opacity: 0.9 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

/* Mejorar espaciado entre input y label en filtros */
.theme-dark #filter-form .col-md-4 {
  margin-bottom: 0.5rem !important;
}

.theme-dark #filter-form .form-control,
.theme-dark #filter-form .form-select {
  margin-bottom: 0.25rem !important;
}

/* Estilo especial para labels cuando el input está enfocado */
.theme-dark .form-control:focus + label,
.theme-dark .form-select:focus + label {
  color: #e2e8f0 !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  transition: all 0.2s ease-in-out !important;
}

/* MEJORAS PARA OVERLAYS Y SPINNERS EN TEMA OSCURO */

/* Overlay oscuro general para tema oscuro */
.theme-dark .overlay,
.theme-dark .loading-overlay,
.theme-dark .spinner-overlay {
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(2px) !important;
}

/* Mejoras para estados de loading */
.theme-dark .loading {
  opacity: 0.4 !important;
}

/* Spinner personalizado para tema oscuro */
.theme-dark .spinner-border {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  border-top-color: #ffffff !important;
}

.theme-dark .spinner-grow {
  color: #ffffff !important;
  background-color: currentColor !important;
}

/* Overlay para modals en general */
.theme-dark .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Overlays adicionales que puedan aparecer */
.theme-dark .overlay-dark,
.theme-dark .loading-dark {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #ffffff !important;
}

.theme-dark .overlay-light,
.theme-dark .loading-light {
  background: rgba(0, 0, 0, 0.5) !important;
  color: #ffffff !important;
}

/* MEJORA PARA BOTÓN DE LIMPIAR BÚSQUEDA DENTRO DEL INPUT */

/* Container para el input de búsqueda con botón interno */
.search-input-container {
  position: relative;
  display: block;
  width: 100%;
}

/* Input de búsqueda con espacio para el botón clear */
.search-input-with-clear {
  padding-right: 2.5rem !important;
}

/* Botón clear posicionado dentro del input */
.search-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  padding: 0.25rem !important;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease-in-out;
}

.search-clear-btn:hover {
  background-color: rgba(108, 117, 125, 0.2) !important;
}

.search-clear-btn svg {
  opacity: 0.6;
  transition: opacity 0.2s ease-in-out;
}

.search-clear-btn:hover svg {
  opacity: 1;
}

/* Mejoras para tema oscuro */
.theme-dark .search-clear-btn {
  color: #adb5bd !important;
}

.theme-dark .search-clear-btn:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.theme-dark .search-clear-btn svg {
  fill: currentColor !important;
}


/* Hints y textos de ayuda en modales */
.theme-dark .modal .form-hint,
.theme-dark .modal .text-muted {
  color: #a0aec0 !important;
}

/* Tabs dentro de modales */
.theme-dark .modal .nav-tabs {
  border-bottom-color: #495057 !important;
}

.theme-dark .modal .nav-tabs .nav-link {
  color: #cbd5e0 !important;
  border-color: transparent !important;
}

.theme-dark .modal .nav-tabs .nav-link:hover {
  color: #ffffff !important;
  border-color: #495057 !important;
}

.theme-dark .modal .nav-tabs .nav-link.active {
  color: #ffffff !important;
  background-color: #2d3748 !important;
  border-color: #495057 #495057 #2d3748 !important;
}

/* Alerts dentro de modales */
.theme-dark .modal .alert {
  color: #e9ecef !important;
  border-color: #495057 !important;
}

.theme-dark .modal .alert-success {
  background-color: rgba(25, 135, 84, 0.2) !important;
  border-color: #198754 !important;
  color: #75dd8f !important;
}

.theme-dark .modal .alert-danger {
  background-color: rgba(220, 53, 69, 0.2) !important;
  border-color: #dc3545 !important;
  color: #f5a3ab !important;
}

.theme-dark .modal .alert-warning {
  background-color: rgba(253, 126, 20, 0.2) !important;
  border-color: #fd7e14 !important;
  color: #ffb366 !important;
}

.theme-dark .modal .alert-info {
  background-color: rgba(13, 202, 240, 0.2) !important;
  border-color: #0dcaf0 !important;
  color: #6edff6 !important;
}

/* ==========================================================================
   MEJORAS PARA TOASTR - ASEGURAR LEGIBILIDAD
   ========================================================================== */

/* Asegurar que toastr tenga mayor especificidad que Tabler */
#toast-container > div {
  opacity: 0.95 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  padding: 15px 15px 15px 50px !important;
  border-radius: 4px !important;
}

/* Asegurar texto blanco visible en todos los tipos de toastr */
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-info,
#toast-container > .toast-warning {
  color: #FFFFFF !important;
}

/* Mensaje y título siempre blancos */
#toast-container > div .toast-title,
#toast-container > div .toast-message {
  color: #FFFFFF !important;
  font-weight: 500 !important;
}

/* Asegurar colores de fondo correctos */
#toast-container > .toast-success {
  background-color: #51A351 !important;
}

#toast-container > .toast-error {
  background-color: #BD362F !important;
}

#toast-container > .toast-info {
  background-color: #2F96B4 !important;
}

#toast-container > .toast-warning {
  background-color: #F89406 !important;
}

/* Botón de cerrar siempre visible */
#toast-container > div button.toast-close-button {
  color: #FFFFFF !important;
  opacity: 0.9 !important;
}

#toast-container > div button.toast-close-button:hover {
  color: #FFFFFF !important;
  opacity: 1 !important;
}

/* Enlaces dentro de toastr */
#toast-container > div a {
  color: #FFFFFF !important;
  text-decoration: underline !important;
}

#toast-container > div a:hover {
  color: #F0F0F0 !important;
}

/* Asegurar que el texto sea legible con sombra si es necesario */
#toast-container > div .toast-message {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   FIN MEJORAS PARA TOASTR
   ========================================================================== */

/* ==========================================================================
   MEJORA DE CONTRASTE EN FORM LABELS
   ========================================================================== */

/* Labels de formulario con mejor contraste */
.form-check-label,
.form-switch .form-check-label {
  color: #1e293b !important;
  font-weight: 500;
}

/* En tema oscuro, usar color casi blanco */
.theme-dark .form-check-label,
.theme-dark .form-switch .form-check-label {
  color: #f1f5f9 !important;
  font-weight: 500;
}

/* Labels generales también con buen contraste */
label,
.form-label {
  color: #1e293b;
  font-weight: 500;
}

.theme-dark label,
.theme-dark .form-label {
  color: #f1f5f9 !important;
}

/* ==========================================================================
   FIN MEJORA DE CONTRASTE EN FORM LABELS
   ========================================================================== */


