/* ============================================================
   historicos.riegos.print.css
   Estilos específicos para PDF de Históricos Aplicación de Riegos
   Se activa temporalmente durante la generación con html2pdf
   ============================================================ */

/* Contenedor raíz del print */
#histRiegosPrintRoot {
  width: 277mm;
  margin: 0 auto;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

/* Cada página individual */
#histRiegosPrintRoot .hist-riegos-page {
  width: 100%;
  overflow: visible;
  page-break-after: always;
  break-after: page;
  margin: 0;
  padding: 0;
  background: #fff;
}

/* ===== Header ===== */
#histRiegosPrintRoot .riegos-top-head {
  grid-template-columns: 80px minmax(0, 1fr) 80px;
  column-gap: 16px;
}

#histRiegosPrintRoot .riegos-top-logo img {
  max-width: 56px;
}

#histRiegosPrintRoot .riegos-title-main {
  font-size: 16px;
  padding: 6px 6px;
}

#histRiegosPrintRoot .riegos-title-sub {
  font-size: 14px;
  padding: 6px 6px;
}

#histRiegosPrintRoot .riegos-header-table th,
#histRiegosPrintRoot .riegos-header-table td {
  padding: 5px 6px;
  font-size: 11px;
}

#histRiegosPrintRoot .riegos-meta-row td {
  font-size: 11px;
}

/* ===== Grid de Rancho / Semana ===== */
#histRiegosPrintRoot .riegos-rancho-grid {
  grid-template-columns: 80px 1fr 110px 1fr;
}

#histRiegosPrintRoot .riegos-rancho-label-cell {
  font-size: 11px;
  padding: 5px 8px;
}

#histRiegosPrintRoot .riegos-rancho-input-cell {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

/* ===== Tabla principal de detalles ===== */
#histRiegosPrintRoot .riego-main-table-scroll {
  overflow: hidden;
  margin-top: 6px;
}

#histRiegosPrintRoot .riegos-main-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid #333;
}

#histRiegosPrintRoot .riegos-main-table thead th {
  padding: 4px 3px;
  font-size: 9px;
  border: 1px solid #0a6a4a;
  background: #0b7a55;
  color: #fff;
  text-align: center;
  vertical-align: middle;
}

#histRiegosPrintRoot .riegos-main-table tbody td {
  padding: 3px;
  font-size: 9px;
  border: 1px solid #d1d5db;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Anchos de columna para PDF (mismos % que en pantalla) */
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(1) { width: 11%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(2) { width: 11%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(3) { width: 14%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(4) { width: 9%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(5) { width: 9%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(6) { width: 9%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(7) { width: 8%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(8) { width: 8%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(9) { width: 8%; }
#histRiegosPrintRoot .riegos-main-table thead th:nth-child(10) { width: 13%; }

/* ===== Tabla pequeña de lecturas ===== */
#histRiegosPrintRoot .riego-small-table-scroll {
  overflow: hidden;
}

#histRiegosPrintRoot .riegos-small-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid #333;
}

#histRiegosPrintRoot .riegos-small-table th,
#histRiegosPrintRoot .riegos-small-table td {
  padding: 4px 6px;
  font-size: 10px;
  border: 1px solid #d1d5db;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

#histRiegosPrintRoot .riegos-small-table th {
  background: #0b7a55;
  color: #fff;
  border: 1px solid #0a6a4a;
}

/* ===== Zona inferior ===== */
#histRiegosPrintRoot .riegos-bottom-zone {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  align-items: flex-start;
}

#histRiegosPrintRoot .riegos-small-block {
  flex: 1;
  min-width: 0;
}

#histRiegosPrintRoot .riegos-firmas {
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#histRiegosPrintRoot .firma-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

#histRiegosPrintRoot .firma-row label {
  font-weight: 700;
  font-size: 11px;
  color: #354052;
  white-space: nowrap;
  min-width: 60px;
}

#histRiegosPrintRoot .firma-row input.ro {
  background: #f8fafc;
  flex: 1;
  min-width: 0;
  font-size: 11px;
  height: 26px;
}

/* ===== Evitar que tablas se partan entre páginas ===== */
#histRiegosPrintRoot .riegos-main-table {
  page-break-inside: avoid;
}

#histRiegosPrintRoot .riegos-small-table {
  page-break-inside: avoid;
}
