/* ============================================================
   REPORTES
   ============================================================ */

.selector-reporte {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2)
}

.opcion-reporte {
  min-height: 44px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s
}

.opcion-reporte:hover {
  color: var(--text)
}

.opcion-reporte.activa {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(61, 42, 30, .12)
}

/* ---------------- Barra de filtros ---------------- */

.barra-filtros-reporte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line)
}

.acciones-reporte {
  display: flex;
  gap: 8px;
  margin-left: auto
}

.acciones-reporte button {
  min-height: 42px;
  padding: 0 16px;
  font-size: 13px;
  white-space: nowrap
}

.acciones-reporte button:disabled {
  opacity: .5;
  cursor: not-allowed
}

/* ---------------- Encabezado y datos ---------------- */

.reporte-encabezado {
  margin-bottom: 14px
}

.reporte-encabezado h3 {
  margin: 0 0 3px;
  font-size: 18px;
  color: var(--title)
}

.reporte-encabezado p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft)
}

.datos-reporte {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px
}

.dato-reporte {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line)
}

.dato-reporte.destacado {
  background: linear-gradient(135deg, #fdf3e3, #fffdf6);
  border-color: var(--gold)
}

.dato-reporte .num {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--title);
  line-height: 1.2;
  font-variant-numeric: tabular-nums
}

.dato-reporte .txt {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-soft)
}

.aviso-ok {
  grid-column: 1/-1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #e6f3ea;
  border: 1px solid rgba(47, 143, 78, .3);
  color: var(--green-2);
  font-weight: 600;
  font-size: 14px
}

/* ---------------- Tabla ---------------- */

.tabla-reporte-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface)
}

.tabla-reporte {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px
}

.tabla-reporte thead th {
  position: sticky;
  top: 0;
  background: var(--primary-2);
  color: #fff8ef;
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap
}

.tabla-reporte tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-transform: capitalize
}

.tabla-reporte tbody tr:last-child td {
  border-bottom: none
}

.tabla-reporte tbody tr:nth-child(even) td {
  background: var(--surface-2)
}

.tabla-reporte tbody tr:hover td {
  background: #fdf3e3
}

.tabla-reporte .derecha {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap
}

.tabla-reporte .centro {
  text-align: center
}

.mini-estado {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800
}

.mini-estado.ok {
  background: #e2f2e6;
  color: var(--green-2)
}

.mini-estado.no {
  background: #f7e2dc;
  color: var(--danger-2)
}

/* ---------------- Resumen de listados ---------------- */

.resumen-listado {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-soft)
}

.resumen-listado strong {
  color: var(--title)
}

.pendiente-dato {
  color: var(--danger-2);
  font-weight: 700
}

/* ---------------- Móvil ---------------- */

@media(max-width:768px) {
  .selector-reporte {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    padding: 4px
  }

  .opcion-reporte {
    min-height: 40px;
    font-size: 12.5px
  }

  .barra-filtros-reporte {
    gap: 6px
  }

  .barra-filtros-reporte > div {
    flex: 1 1 100%
  }

  .barra-filtros-reporte .select-filtro {
    width: 100%
  }

  .acciones-reporte {
    margin-left: 0;
    width: 100%
  }

  .acciones-reporte button {
    flex: 1 1 0;
    min-height: 44px;
    padding: 0 8px;
    font-size: 12.5px
  }

  .datos-reporte {
    grid-template-columns: 1fr 1fr;
    gap: 8px
  }

  .dato-reporte {
    padding: 10px 12px
  }

  .dato-reporte.destacado {
    grid-column: 1/-1
  }

  .dato-reporte .num {
    font-size: 17px
  }

  .tabla-reporte {
    font-size: 12px
  }

  .tabla-reporte thead th,
  .tabla-reporte tbody td {
    padding: 7px 9px
  }
}

/* La columna por la que está ordenada la lista se resalta */
.tabla-reporte th.col-orden {
  background: var(--gold-2);
  position: relative
}

.tabla-reporte th.col-orden::after {
  content: ' ↓';
  opacity: .8
}

.tabla-reporte td.col-orden {
  font-weight: 700;
  color: var(--gold-2)
}
