/* AmSpec v388 — Fertilizer report final visual and usability corrections. */

/* Quantities per hold: cargo follows the same centered alignment as numeric fields. */
.fert-quantity-sheet th,
.fert-quantity-sheet td { vertical-align: middle !important; }
.fert-quantity-sheet th:nth-child(2),
.fert-quantity-sheet td:nth-child(2),
.fert-quantity-sheet .fert-quantity-cargo { text-align: center !important; }
.fert-hold-qty-editor [data-hq="cargo"] { text-align: center !important; }

/* Draft survey: one consistent format, centered throughout, with normalized units in data. */
.fert-draft-preview-table,
.fert-draft-preview-table th,
.fert-draft-preview-table td,
.fert-table-all-centered th,
.fert-table-all-centered td { text-align: center !important; vertical-align: middle !important; }
.fert-draft-preview-table td:first-child { text-align: center !important; }
.fert-draft-remarks { margin: 2mm 0 0; color: #172033 !important; }

/* Time Log has only date, time and event. */
.fert-time-log-simple { min-width: 760px !important; table-layout: fixed !important; }
.fert-time-log-simple th:nth-child(1), .fert-time-log-simple td:nth-child(1) { width: 150px !important; }
.fert-time-log-simple th:nth-child(2), .fert-time-log-simple td:nth-child(2),
.fert-time-log-simple th:nth-child(3), .fert-time-log-simple td:nth-child(3) { width: 120px !important; }
.fert-time-log-simple th:nth-child(4), .fert-time-log-simple td:nth-child(4) { width: 310px !important; }
.fert-time-log-simple th:nth-child(5), .fert-time-log-simple td:nth-child(5) { width: 55px !important; }
.fert-time-log-report th:nth-child(1), .fert-time-log-report td:nth-child(1) { width: 22%; text-align: center !important; }
.fert-time-log-report th:nth-child(2), .fert-time-log-report td:nth-child(2) { width: 22%; text-align: center !important; }
.fert-time-log-report th:nth-child(3), .fert-time-log-report td:nth-child(3) { width: 56%; text-align: center !important; }

/* Operational performance: operating time is explicit and stoppages remain simple totals. */
.fert-operating-hours-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  align-items: end;
  padding: 12px 14px;
  margin: 8px 0 12px;
  border: 1px solid #d8e0e8;
  border-radius: 10px;
  background: #f7f9fb;
}
.fert-operating-hours-card label { display: grid; gap: 6px; font-weight: 800; }
.fert-operating-hours-card input { width: 100%; text-align: center; box-sizing: border-box; }
.fert-operating-hours-card small { color: #607084; align-self: center; }
.fert-op-kpis-balanced { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.fert-op-row.is-operating strong { color: #172033; }
.fert-op-row.is-operating .fert-op-track span { background: #172033 !important; }

/* Highlighting: a single toggle per phrase, with fixed corporate colors. */
.fert-highlight-simple-note {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #ead2d2;
  border-radius: 10px;
  background: #fffafa;
}
.fert-highlight-simple-note strong { color: #8A2A2B; }
.fert-highlight-simple-note small { color: #607084; }
.fert-sentence-style-list { display: grid !important; gap: 7px !important; max-height: 420px !important; overflow: auto; }
.fert-highlight-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d9e0e7;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.fert-highlight-choice:hover { border-color: #bd8586; background: #fffafa; }
.fert-highlight-choice input { width: 17px; height: 17px; margin: 0; }
.fert-highlight-choice-copy { display: grid; gap: 2px; min-width: 0; }
.fert-highlight-choice-copy strong { font-size: .73rem; color: #172033; }
.fert-highlight-choice-copy small { font-size: .71rem; line-height: 1.35; color: #526174; white-space: normal; }
.fert-highlight-choice-swatch {
  justify-self: end;
  padding: 4px 7px;
  border-radius: 5px;
  background: #FCE8E8;
  color: #8A2A2B;
  font-size: .68rem;
  font-weight: 900;
  text-align: center;
}
.fert-highlight-choice:has(input:checked) { border-color: #8A2A2B; background: #fff5f5; }
.fert-highlight-choice:has(input:not(:checked)) .fert-highlight-choice-swatch { opacity: .38; filter: grayscale(.65); }

/* Quality editor: one hold at a time, eliminating the giant unusable matrix. */
.fert-quality-hold-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 8px;
}
.fert-quality-hold-tab {
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #fff;
  color: #172033;
  padding: 7px 13px;
  font-weight: 800;
  cursor: pointer;
}
.fert-quality-hold-tab.is-active { background: #8A2A2B; border-color: #8A2A2B; color: #fff; }
.fert-quality-active-label {
  margin: 0 0 7px;
  padding: 7px 10px;
  border-left: 4px solid #8A2A2B;
  background: #f7f9fb;
  color: #172033;
  font-size: .76rem;
  font-weight: 800;
}
.fert-quality-editor-table.fert-quality-single-hold {
  min-width: 930px !important;
  width: 100% !important;
  table-layout: fixed !important;
}
.fert-quality-single-hold th,
.fert-quality-single-hold td {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
  vertical-align: middle !important;
  text-align: center !important;
  line-height: 1.15 !important;
}
.fert-quality-single-hold th { color: #fff !important; background: #8A2A2B !important; }
.fert-quality-single-hold thead tr:nth-child(2) th { color: #172033 !important; background: #e5e9ed !important; }
.fert-quality-single-hold th:nth-child(1), .fert-quality-single-hold td:nth-child(1) { width: 135px !important; }
.fert-quality-single-hold th:nth-child(2), .fert-quality-single-hold td:nth-child(2) { width: 62px !important; }
.fert-quality-single-hold th:nth-child(3), .fert-quality-single-hold td:nth-child(3) { width: 90px !important; }
.fert-quality-single-hold th:nth-child(4), .fert-quality-single-hold td:nth-child(4),
.fert-quality-single-hold th:nth-child(5), .fert-quality-single-hold td:nth-child(5) { width: 62px !important; }
.fert-quality-single-hold th:nth-child(6), .fert-quality-single-hold td:nth-child(6),
.fert-quality-single-hold th:nth-child(7), .fert-quality-single-hold td:nth-child(7),
.fert-quality-single-hold th:nth-child(8), .fert-quality-single-hold td:nth-child(8) { width: 82px !important; }
.fert-quality-single-hold th:nth-child(9), .fert-quality-single-hold td:nth-child(9) { width: 96px !important; }
.fert-quality-single-hold th:nth-child(10), .fert-quality-single-hold td:nth-child(10) { width: 44px !important; }
.fert-quality-single-hold input { width: 100% !important; min-width: 0 !important; text-align: center !important; box-sizing: border-box; }
.fert-quality-single-hold td:first-child input { text-align: center !important; }
.fert-quality-single-hold small { display: block; margin-top: 2px; white-space: normal; font-size: .61rem; }

/* Quality report: maximum three holds per table; readable headers and values. */
.fert-final-analysis-table.fert-quality-report-readable {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 6.1pt !important;
  line-height: 1.16 !important;
}
.fert-quality-report-readable th,
.fert-quality-report-readable td {
  padding: .65mm .35mm !important;
  vertical-align: middle !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  color: #172033 !important;
}
.fert-quality-report-readable thead tr:first-child th {
  background: #8A2A2B !important;
  color: #fff !important;
  font-weight: 900 !important;
}
.fert-quality-report-readable thead tr:nth-child(2) th {
  background: #dfe4e8 !important;
  color: #172033 !important;
  font-weight: 900 !important;
}
.fert-quality-report-readable .fert-quality-param-col { width: 12%; }
.fert-quality-report-readable .fert-quality-mm-col { width: 5%; }
.fert-quality-report-readable .fert-quality-unit-col { width: 7%; }
.fert-quality-report-readable .fert-quality-limit-col { width: 5%; }
.fert-quality-report-readable .fert-quality-value-col { width: 6%; }
.fert-quality-report-readable .fert-quality-composite-col { width: 8%; }
.fert-quality-report-readable tbody td:first-child { font-weight: 800; }
.fert-quality-report-readable .is-off-spec { background: #FCE8E8 !important; color: #8A2A2B !important; font-weight: 900; }
.fert-quality-subtitle { margin: 1mm 0 1.5mm !important; text-align: center; font-size: 6.3pt !important; font-weight: 800; color: #243247; }

/* Method of discharge uses the same bordered table language as the report. */
.fert-method-report-table { width: 100% !important; table-layout: fixed; }
.fert-method-report-table td {
  padding: 2.2mm 2mm !important;
  text-align: center !important;
  vertical-align: middle !important;
  color: #172033 !important;
  font-weight: 800 !important;
  border: .25mm solid #222 !important;
  background: #fff !important;
}

@media (max-width: 900px) {
  .fert-operating-hours-card { grid-template-columns: 1fr; }
  .fert-highlight-choice { grid-template-columns: 22px minmax(0, 1fr); }
  .fert-highlight-choice-swatch { grid-column: 2; justify-self: start; }
}

@media print {
  .fert-quality-report-readable,
  .fert-method-report-table,
  .fert-draft-preview-table,
  .fert-quantity-sheet { print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
}

/* Photo captions use the same simple fixed highlight choice as evaluations. */
.fert-photo-highlight-toggle {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 52px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  background: rgba(255,255,255,.94);
  color: #253247;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}
.fert-photo-highlight-toggle input { width: 15px; height: 15px; margin: 0; }
.fert-photo-card figcaption.is-highlighted {
  background: #FCE8E8 !important;
  color: #8A2A2B !important;
  font-weight: 900 !important;
}
@media print {
  .fert-photo-highlight-toggle { display: none !important; }
}
