/* Formato de validacion de recetas y cronogramas */

.fmt-toolbar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fmt-toolbar > div {
  min-width: 150px;
}

.fmt-toolbar .fmt-spacer {
  flex: 1;
}

.fmt-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.fmt-kpi {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-left: 5px solid #1565c0;
  border-radius: 8px;
  padding: 10px;
}

.fmt-kpi b {
  display: block;
  color: #0d3b66;
  font-size: 20px;
  margin-top: 3px;
}

.fmt-tabla-wrap {
  width: 100%;
  overflow-x: auto;
}

.fmt-matriz {
  border-collapse: collapse;
  background: #fff;
  min-width: 100%;
  width: max-content;
}

.fmt-matriz th,
.fmt-matriz td {
  border: 1px solid #455a64;
  padding: 5px;
  font-size: 11px;
  text-align: center;
  vertical-align: middle;
}

.fmt-matriz th {
  background: #e8f0fe;
  color: #263238;
}

.fmt-matriz .fmt-izq {
  min-width: 210px;
  max-width: 260px;
  text-align: left;
  white-space: normal;
}

.fmt-matriz .fmt-frec {
  min-width: 250px;
  max-width: 310px;
  text-align: left;
  white-space: normal;
}

.fmt-celda {
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 2px !important;
}

.fmt-celda button {
  width: 100%;
  height: 30px;
  padding: 2px;
  border-radius: 4px;
  font-size: 11px;
}

.fmt-sin {
  background: #eceff1;
  color: #78909c;
}

.fmt-programado {
  background: #1976d2;
  color: #fff;
}

.fmt-realizado {
  background: #2e7d32;
  color: #fff;
}

.fmt-pendiente {
  background: #c62828;
  color: #fff;
}

.fmt-no-aplica {
  background: #78909c;
  color: #fff;
}

.fmt-leyenda {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
  font-size: 12px;
}

.fmt-leyenda span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.fmt-muestra {
  width: 15px;
  height: 15px;
  display: inline-block;
  border-radius: 3px;
}

.fmt-form-grupo {
  border: 1px solid #b3e5fc;
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.fmt-form-grupo h4 {
  margin: 0;
  padding: 8px 12px;
  color: #0277bd;
  background: #e1f5fe;
}

.fmt-form-grupo > div {
  padding: 12px;
}

.fmt-validaciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}

.fmt-validacion {
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  padding: 8px;
}

.fmt-validacion label {
  display: block;
  min-height: 34px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #37474f;
}

.fmt-resultado-conforme {
  color: #2e7d32;
  font-weight: bold;
}

.fmt-resultado-observada {
  color: #ef6c00;
  font-weight: bold;
}

.fmt-resultado-rechazada {
  color: #c62828;
  font-weight: bold;
}

.fmt-mant-celda {
  min-width: 58px;
  max-width: 72px;
  cursor: pointer;
}

.fmt-mant-celda:hover {
  background: #e3f2fd;
}

.fmt-mant-celda small {
  display: block;
  font-size: 9px;
  line-height: 1.2;
}

.fmt-vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  height: 110px;
}

@media (max-width: 900px) {
  .fmt-toolbar > div {
    min-width: 130px;
    flex: 1 1 130px;
  }

  .fmt-toolbar button {
    flex: 1 1 170px;
  }

  .fmt-matriz {
    display: table;
    overflow: visible;
    white-space: normal;
  }

  .fmt-validaciones {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   COLORES INDEPENDIENTES DE LAS CELDAS F/S Y F/V
   Cada celda del Cronograma de Mantenimiento se pinta
   segun SU PROPIO estado, sin depender de la otra.
   ============================================================ */

.fmt-matriz td.fmt-mant-celda {
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: outline .12s ease;
}

.fmt-matriz td.fmt-mant-celda:hover {
  outline: 2px solid #0288d1;
  outline-offset: -2px;
}

.fmt-matriz td.fmt-mant-celda small {
  font-size: 11px;
  font-weight: bold;
}

.fmt-matriz td.fmt-mant-celda.fmt-programado {
  background: #bbdefb;
  color: #0d3b66;
}

.fmt-matriz td.fmt-mant-celda.fmt-realizado {
  background: #c8e6c9;
  color: #1b5e20;
}

.fmt-matriz td.fmt-mant-celda.fmt-pendiente {
  background: #ffcdd2;
  color: #b71c1c;
}

.fmt-matriz td.fmt-mant-celda.fmt-no-aplica {
  background: #e0e0e0;
  color: #424242;
}

.fmt-matriz td.fmt-mant-celda.fmt-sin {
  background: #fff;
  color: #90a4ae;
}