/* AmSpec v387 — Fertilizer report usability corrections only. */

/* Quantities editor: keep cargo and remarks usable instead of collapsing. */
.fert-hold-qty-editor {
  min-width: 1120px !important;
  table-layout: fixed !important;
}
.fert-hold-qty-editor th:nth-child(1), .fert-hold-qty-editor td:nth-child(1) { width: 76px !important; }
.fert-hold-qty-editor th:nth-child(2), .fert-hold-qty-editor td:nth-child(2) { width: 180px !important; }
.fert-hold-qty-editor th:nth-child(3), .fert-hold-qty-editor td:nth-child(3),
.fert-hold-qty-editor th:nth-child(4), .fert-hold-qty-editor td:nth-child(4) { width: 145px !important; }
.fert-hold-qty-editor th:nth-child(5), .fert-hold-qty-editor td:nth-child(5) { width: 125px !important; }
.fert-hold-qty-editor th:nth-child(6), .fert-hold-qty-editor td:nth-child(6) { width: 330px !important; }
.fert-hold-qty-editor th:nth-child(7), .fert-hold-qty-editor td:nth-child(7) { width: 58px !important; }
.fert-hold-qty-editor input,
.fert-hold-qty-editor textarea { width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
.fert-hold-qty-editor textarea { min-height: 48px; resize: vertical; }
.fert-hold-qty-editor th { white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; }
.fert-hold-qty-editor [data-hq="cargo"],
.fert-quantity-sheet .fert-quantity-cargo { text-align: center !important; }
.fert-quantity-sheet td,
.fert-quantity-sheet th { vertical-align: middle !important; }

/* Operational performance is now a stopped-hours summary, not another time log. */
.fert-performance-total-editor { min-width: 760px !important; table-layout: fixed !important; }
.fert-performance-total-editor th:nth-child(1), .fert-performance-total-editor td:nth-child(1) { width: 270px !important; }
.fert-performance-total-editor th:nth-child(2), .fert-performance-total-editor td:nth-child(2) { width: 145px !important; text-align: center !important; }
.fert-performance-total-editor th:nth-child(3), .fert-performance-total-editor td:nth-child(3) { width: 290px !important; }
.fert-performance-total-editor th:nth-child(4), .fert-performance-total-editor td:nth-child(4) { width: 55px !important; }
.fert-performance-total-editor input,
.fert-performance-total-editor textarea { width: 100% !important; box-sizing: border-box; }
.fert-performance-total-editor textarea { min-height: 48px; resize: vertical; }
.fert-op-kpis-stoppage { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.fert-op-empty { padding: 10px; color: #607084; text-align: center; }

/* Per-sentence styling: deliberate opt-in, never surprise highlighting. */
.fert-sentence-style-editor { display: block !important; }
.fert-sentence-style-head { display: grid; gap: 3px; margin-bottom: 10px; }
.fert-sentence-style-head small { color: #607084; }
.fert-sentence-style-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding-right: 3px; }
.fert-sentence-style-row {
  display: grid;
  grid-template-columns: minmax(155px, .75fr) minmax(260px, 1.7fr) 72px 92px 62px 64px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}
.fert-sentence-style-row label { display: grid; gap: 3px; font-size: .7rem; }
.fert-sentence-style-row input[type="color"] { width: 100%; height: 32px; padding: 2px; }
.fert-style-enable { grid-template-columns: 20px 1fr !important; align-items: center; font-weight: 800; }
.fert-style-bold { grid-template-columns: 20px 1fr !important; align-items: center; }
.fert-sentence-preview { font-size: .72rem; line-height: 1.35; color: #35465a; max-height: 66px; overflow: auto; }
.fert-styled-sentence { display: inline; padding: .15mm .45mm; border-radius: .7mm; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Official quality matrix: TYLER/MESH + tolerance + Top/Mid/Bot per hold + composite. */
.fert-quality-scroll { max-height: 64vh !important; }
.fert-quality-editor-table.fert-quality-matrix { min-width: 1480px !important; table-layout: auto !important; }
.fert-quality-matrix th,
.fert-quality-matrix td { text-align: center !important; vertical-align: middle !important; white-space: nowrap; }
.fert-quality-editor-table.fert-quality-matrix th { min-width: 66px; }
.fert-quality-editor-table.fert-quality-matrix th:first-child,
.fert-quality-editor-table.fert-quality-matrix td:first-child { min-width: 118px; }
.fert-quality-editor-table.fert-quality-matrix th:nth-child(2),
.fert-quality-editor-table.fert-quality-matrix td:nth-child(2) { min-width: 70px; }
.fert-quality-editor-table.fert-quality-matrix input { min-width: 58px !important; text-align: center; }
.fert-quality-editor-table.fert-quality-matrix td:first-child input { min-width: 108px !important; text-align: left; }
.fert-final-analysis-table.fert-quality-matrix { table-layout: fixed !important; font-size: 5.1pt !important; }
.fert-final-analysis-table.fert-quality-matrix th,
.fert-final-analysis-table.fert-quality-matrix td { padding: .45mm .25mm !important; }
.fert-final-analysis-table.fert-quality-matrix td:first-child { text-align: center !important; }

@media (max-width: 1050px) {
  .fert-sentence-style-row { grid-template-columns: 1fr 1fr; }
  .fert-sentence-preview { grid-column: 1 / -1; }
}

@media print {
  .fert-styled-sentence { print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
}
