/* Ajustes básicos para XAMPP */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Mejora campos del formulario */
.form-control:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Icono hamburguesa blancos en responsive */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* ========================================
   REGLA PRINCIPAL DE COLORES:
   - Fondo CLARO (bg-light, bg-white, card-body) = Texto OSCURO
   - Fondo OSCURO (page-header, bg-primary, bg-dark) = Texto BLANCO
   ======================================== */

/* Por defecto: títulos en negro/oscuro */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.card-title, .modal-title {
  color: #212529;
  text-shadow: none;
}

/* Fondos CLAROS - texto e iconos OSCUROS */
.bg-light h1, .bg-light h2, .bg-light h3, .bg-light h4, .bg-light h5, .bg-light h6,
.bg-white h1, .bg-white h2, .bg-white h3, .bg-white h4, .bg-white h5, .bg-white h6,
.card-body h1, .card-body h2, .card-body h3, .card-body h4, .card-body h5, .card-body h6 {
  color: #212529 !important;
  text-shadow: none !important;
}

.bg-light i, .bg-white i {
  color: inherit;
}

/* Fondos OSCUROS - texto e iconos BLANCOS */
.page-header h1, .page-header h2, .page-header h3,
.page-header h4, .page-header h5, .page-header h6,
.page-header .card-title,
.page-header small, .page-header p {
  color: #ffffff !important;
}

.page-header i {
  color: #ffffff !important;
}

.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-danger h1, .bg-danger h2, .bg-danger h3, .bg-danger h4, .bg-danger h5, .bg-danger h6,
.bg-success h1, .bg-success h2, .bg-success h3, .bg-success h4, .bg-success h5, .bg-success h6 {
  color: #ffffff !important;
}

.bg-primary i, .bg-dark i, .bg-danger i, .bg-success i {
  color: #ffffff !important;
}

/* Clases explícitas (siempre ganan) */
.text-white { color: #ffffff !important; }
.text-dark { color: #212529 !important; text-shadow: none !important; }
.text-muted { color: #6c757d !important; }
.text-primary { color: #0d6efd !important; }

/* Iconos heredan color del texto padre por defecto */
.card-body i, .list-group-item i, .btn i {
  color: inherit;
}

/* ========================================
   TÍTULOS DE SECCIÓN AZULES
   Para usar dentro del contenido de cards
   ======================================== */
.section-title-blue {
  color: #0d6efd !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0d6efd;
  margin-bottom: 1rem !important;
  text-shadow: none !important;
}

.section-title-blue i {
  color: #0d6efd !important;
  font-size: 1.1em;
  margin-right: 0.5rem;
}

/* ========================================
   CARD HEADER CON FONDO OSCURO (ESTILO PANEL)
   Para headers de formularios y secciones
   ======================================== */
.card-header-dark {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%) !important;
  color: #ffffff !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1rem;
}

.card-header-dark h5,
.card-header-dark h6,
.card-header-dark .card-title {
  color: #ffffff !important;
  margin-bottom: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

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

/* ========================================
   BOTÓN OSCURO (ESTILO PANEL)
   Para botones de acción principales
   ======================================== */
.btn-dark-gradient {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%) !important;
  color: #ffffff !important;
  border: none !important;
  transition: all 0.3s ease;
}

.btn-dark-gradient:hover {
  background: linear-gradient(135deg, #2c5282 0%, #3d6a9f 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.btn-dark-gradient:active {
  transform: translateY(0);
}

.btn-dark-gradient i {
  color: #ffffff !important;
}

/* ========================================
   DROPDOWNS - MEJORAS GLOBALES
   ======================================== */

/* Dropdown que no se corte en contenedores con overflow */
.dropdown-menu {
  z-index: 1050 !important;
}

/* Dropdown más compacto */
.dropdown-menu-compact {
  min-width: 120px;
  font-size: 0.85rem;
}

.dropdown-menu-compact .dropdown-item {
  padding: 0.35rem 0.75rem;
}

/* ========================================
   MODALES - MEJORAS GLOBALES
   ======================================== */

/* Z-index correcto para modales */
.modal-backdrop {
  z-index: 1040 !important;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.show {
  opacity: 0.5;
}

.modal {
  z-index: 1055 !important;
}

/* Limpiar backdrop huérfano */
body.modal-open {
  overflow: hidden;
  padding-right: 0 !important;
}

/* Modal centrado y con bordes redondeados */
.modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Header de modal con colores */
.modal-header[style*="background"] {
  border-bottom: none;
}

.modal-header[style*="background"] .modal-title {
  color: #fff !important;
}

.modal-header[style*="background"] .btn-close {
  filter: brightness(0) invert(1);
}