/* Estilos base y responsividad */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .filters-form .row > div {
    margin-bottom: 1rem;
  }

  .filters-form .filter-section {
    padding: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .card-header .btn {
    margin-top: 0.5rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .card-body {
    padding: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

body {
  margin-bottom: 60px;
}

/* Estados de focus mejorados */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Estilos de tarjetas mejorados */
.card {
  border-radius: 12px;
  transition: transform 0.2s ease-in-out;
  border: 1px solid #dee2e6;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
}

/* Formularios y controles mejorados */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-select:disabled {
  background-color: #e9ecef;
  opacity: 0.65;
}

.form-control:disabled {
  background-color: #e9ecef;
  opacity: 0.65;
}

.input-group-text {
  border-radius: 8px 0 0 8px;
  background-color: #f8f9fa;
  border-right: none;
}

.form-select {
  border-left: none;
  padding-left: 0.5rem;
}

/* Botones mejorados */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.75rem 1.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, #198754 0%, #146c43 100%);
  border: none;
}

.btn-outline-secondary {
  border: 1px solid #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
}

/* Filtros de formulario mejorados */
.filters-form .filter-section {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  background-color: #f8f9fa;
}

.filters-form .filter-options {
  margin-bottom: 12px;
}

.filters-form .filter-options .form-check {
  margin-bottom: 8px;
}

.filters-form .filter-options .form-check:last-child {
  margin-bottom: 0;
}

.filters-form .filter-dropdown {
  margin-bottom: 12px;
}

.filters-form .filter-dropdown:last-child {
  margin-bottom: 0;
}

.filters-form .date-inputs {
  margin-top: 8px;
}

.filters-form .date-inputs .form-control {
  font-size: 0.9rem;
}

.filters-form .form-check-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.filters-form .form-select {
  font-size: 0.9rem;
}

/* Sección de fechas mejorada */
.date-filter-section {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Checkboxes y radios mejorados */
.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.form-check-label {
  font-weight: 500;
}

/* Efectos de gradiente y texto */
.header-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tarjetas de estadísticas */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Etiquetas de filtro */
.filter-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #495057;
  font-size: 0.9rem;
}

/* Estados deshabilitados */
.disabled-section {
  opacity: 0.6;
  pointer-events: none;
}

/* Iconos y contenedores */
.icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

/* Notificaciones Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1055;
}

.toast {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estados vacíos */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.text-center .bi-inbox {
  color: #6c757d;
}

/* Mejoras en tablas */
.table-responsive {
  border-radius: 8px;
  overflow: hidden;
}

.table th {
  font-weight: 600;
  font-size: 0.9rem;
  border-top: none;
}

.table td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.badge {
  font-size: 0.75rem;
}

/* Estados de entrada de fecha específicos */
.filters-form .date-inputs input:disabled {
  background-color: #e9ecef;
  opacity: 0.65;
}

/* Mejoras adicionales para consistencia */
.card-header.bg-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

.form-check-input:focus {
  border-color: #258cfb;
  box-shadow: 0 0 0 0.25rem rgba(37, 140, 251, 0.25);
}

/* Asegurar que los inputs de fecha tengan el mismo estilo */
input[type="date"].form-control {
  appearance: none;
  -webkit-appearance: none;
}

/* Mejoras visuales para grupos de input */
.input-group:focus-within .input-group-text {
  border-color: #0d6efd;
  background-color: #e9f0ff;
}

/* Estados hover para cards interactivas */
.card[onclick]:hover {
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Mejoras para elementos de filtro en móviles */
@media (max-width: 576px) {
  .filters-form .filter-section {
    margin-bottom: 1rem;
  }

  .date-filter-section {
    padding: 1rem;
  }

  .icon-wrapper {
    width: 35px;
    height: 35px;
    margin-right: 10px;
  }

  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state-icon {
    font-size: 3rem;
  }
}

/* Animaciones suaves para transiciones */
.form-control, .form-select, .btn, .card {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .card, .form-control, .form-select, .btn {
    transition: none;
  }
}

/* Estados de validación */
.form-control.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.73.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 {
  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 d='m5.8 3.6.4.4.4-.4'/%3e%3cpath d='M6 7v2'/%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);
}