/* ============================================
   ESTILOS ESPECÍFICOS PARA REPORTE DE MANTENIMIENTO TOTAL
   ============================================ */

/* Loader */
#loader {
  transition: all 0.3s ease-in-out;
  opacity: 1;
  visibility: visible;
  position: fixed;
  height: 100vh;
  width: 100%;
  background: #fff;
  z-index: 90000;
  top: 0;
  left: 0;
}

#loader.fadeOut {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#loader[style*="display: none"] {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  position: absolute;
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  background-color: #333;
  border-radius: 100%;
  -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
  animation: sk-scaleout 1.0s infinite ease-in-out;
}

@-webkit-keyframes sk-scaleout {
  0% { -webkit-transform: scale(0) }
  100% {
    -webkit-transform: scale(1.0);
    opacity: 0;
  }
}

@keyframes sk-scaleout {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
  } 100% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
    opacity: 0;
  }
}

/* SOLUCIÓN ESPECÍFICA SOLO PARA ESTA PÁGINA */
body.app.reporte-mantenimiento-page {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.app.reporte-mantenimiento-page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* IMPORTANTE: NO modificar .page-container ni el navbar
   Estos elementos están en base.php y deben mantener sus estilos originales
   Solo modificamos el contenido dentro de #mainContent */

/* CONTENEDOR PRINCIPAL CON SCROLL */
body.app.reporte-mantenimiento-page .main-content {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  max-height: none !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 20px !important;
}

body.app.reporte-mantenimiento-page .main-content::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.app.reporte-mantenimiento-page #mainContent {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.app.reporte-mantenimiento-page #mainContent::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Aplicar padding solo al contenido interno, no al contenedor principal */
body.app.reporte-mantenimiento-page #mainContent > .container-fluid,
body.app.reporte-mantenimiento-page #mainContent > .row {
  padding: 0 !important;
}

/* CONTENEDOR DE RESULTADOS */
body.app.reporte-mantenimiento-page #reportResults,
body.app.reporte-mantenimiento-page #reportPage {
  min-height: 500px;
  overflow: visible;
}

/* ESTILOS PARA TABLA DE RESULTADOS */
.table-container {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  /* Ocultar scrollbars */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.table-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

body.app.reporte-mantenimiento-page .table-container {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.app.reporte-mantenimiento-page .table-container::-webkit-scrollbar {
  display: none;
}

.table-responsive {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0,0,0,.075);
}

/* Dark mode support */
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255,255,255,.05);
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: rgba(255,255,255,.075);
}

/* Estilos para tabla completa con scroll horizontal */
.table-mantenimiento-completa {
  min-width: 1800px;
  white-space: nowrap;
  margin-bottom: 0;
}

.table-mantenimiento-completa th,
.table-mantenimiento-completa td {
  padding: 8px 12px;
  text-align: center;
  border: 1px solid #dee2e6;
  vertical-align: middle;
}

.table-mantenimiento-completa th {
  background-color: #343a40;
  color: white;
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-mantenimiento-completa td {
  font-size: 11px;
}

.table-mantenimiento-completa tbody tr:hover {
  background-color: #f8f9fa;
}

/* Scrollbar personalizado para la tabla */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Estilos para columnas personalizadas */
.col-md-2-4 {
  flex: 0 0 20%;
  max-width: 20%;
  padding-left: 8px;
  padding-right: 8px;
}

.col-md-3 {
  flex: 0 0 25%;
  max-width: 25%;
  padding-left: 8px;
  padding-right: 8px;
}

@media (min-width: 768px) {
  .col-md-2-4 {
    flex: 0 0 20%;
    max-width: 20%;
  }
  
  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* BOTONES */
.btn-transparent-red {
  background-color: transparent !important;
  border: 1px solid #dc3545 !important;
  color: #dc3545 !important;
  transition: all 0.3s ease !important;
}

.btn-transparent-red:hover {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

.header-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

/* Estilos para badges de estado */
.badge-mantenimiento {
  padding: 0.5em 0.75em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.badge-urgente {
  background-color: #dc3545;
  color: white;
}

.badge-proximo {
  background-color: #fd7e14;
  color: white;
}

.badge-normal {
  background-color: #28a745;
  color: white;
}

.badge-vencido {
  background-color: #6c757d;
  color: white;
}

.badge-completado {
  background-color: #007bff;
  color: white;
}

/* ASEGURAR QUE EL SELECTOR DE TEMA SEA VISIBLE */
body.app.reporte-mantenimiento-page .header .nav-left .theme-toggle,
body.app.reporte-mantenimiento-page .header .nav-right .theme-toggle {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: 65px !important;
  align-items: center !important;
}

body.app.reporte-mantenimiento-page .header .theme-toggle .form-check {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 !important;
}

body.app.reporte-mantenimiento-page .header .theme-toggle .form-check-input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.app.reporte-mantenimiento-page .header .theme-toggle .form-check-label {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ROW Y COLUMNAS - Asegurar que ocupen todo el ancho */
body.app.reporte-mantenimiento-page .row {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* MASONRY ITEMS */
body.app.reporte-mantenimiento-page .masonry-item {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.app.reporte-mantenimiento-page .masonry-item.w-100 {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* CONTENEDORES DE TARJETAS */
body.app.reporte-mantenimiento-page .bd.bgc-white.p-20,
body.app.reporte-mantenimiento-page .bd.bgc-white,
body.app.reporte-mantenimiento-page .layers.bd.bgc-white.p-20 {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: auto !important;
  width: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

