/* ============================================================
   Ops — the daily operations form, the field log list
   (lib/ops-ui.js), the equipment form and the equipment page
   additions. Prefix: ops-. Tokens only, so a re-theme is a
   token swap.
   ============================================================ */

.ops-daily[hidden],
.ops-eq-form[hidden],
.ops-insight[hidden],
.ops-section[hidden],
.ops-job-rest[hidden] { display: none; }

.ops-optional {
  font-size: 11.5px; font-weight: 500; color: hsl(var(--muted-foreground));
  margin-left: 4px;
}

/* ── field log entries (FGOps.renderEntries) ────────────────────── */

.ops-entries { display: flex; flex-direction: column; }
.ops-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--gray-border);
}
.ops-entry:first-child { border-top: 0; padding-top: 0; }
.ops-entry > .ops-entry-body:first-child { grid-column: 1 / 3; }
.ops-entry-date {
  font-size: 12px; color: hsl(var(--muted-foreground));
  white-space: nowrap; min-width: 52px; padding-top: 2px;
}
.ops-entry-body { min-width: 0; }
.ops-entry-title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.ops-entry-activity { font-weight: 700; }
.ops-entry-block {
  display: inline-block; font-weight: 700; font-size: 12.5px;
  padding: 1px 7px; border-radius: 6px;
  background: var(--cyan-tint); border: 1px solid var(--cyan-line); color: var(--cyan-ink);
}
.ops-entry-farm, .ops-entry-sub { font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.ops-entry-sub::before { content: "\00b7\00a0"; }
.ops-entry-who { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 2px; overflow-wrap: anywhere; }
.ops-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12.5px; }
.ops-entry-figs { font-family: var(--font-mono); font-weight: 600; }
.ops-entry-product { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ops-entry-stop {
  margin-top: 6px; font-size: 12.5px;
  color: var(--danger-ink);
}
.ops-entry-notes { margin-top: 4px; font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.ops-entry-del { align-self: center; }

.ops-entries.is-compact .ops-entry { padding: 8px 0; gap: var(--space-sm); }
.ops-entries.is-compact .ops-entry:first-child { padding-top: 0; }
.ops-entries.is-compact .ops-entry-title { font-size: 13.5px; }
.ops-entries.is-compact .ops-entry-meta { margin-top: 4px; }
.ops-empty { padding: var(--space-lg) var(--space-md); }

/* ── the daily form ─────────────────────────────────────────────── */

.ops-daily-loading { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-lg); }

.ops-day-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-md); }
.ops-day-other { flex: 0 1 220px; min-width: 0; }
.ops-day-other .input { min-height: 44px; }

.ops-job { position: relative; scroll-margin-top: calc(var(--topbar-height) + var(--space-md)); }
.ops-job-num { color: var(--black); letter-spacing: 0.04em; }
.ops-job-remove { min-height: 44px; }
.ops-job-remove[hidden] { display: none; }

.ops-job-summary {
  font-size: 14px; font-weight: 600; line-height: 1.45;
  padding: 10px 12px; margin: calc(-1 * var(--space-xs)) 0 var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--cyan-tint); border: 1px solid var(--cyan-line); color: var(--black);
  overflow-wrap: anywhere;
}
.ops-job-summary.is-empty { background: var(--gray-soft); border-color: var(--gray-border); color: hsl(var(--muted-foreground)); font-weight: 500; }

.ops-section {
  border-top: 1px solid var(--gray-border);
  padding-top: var(--space-md);
  margin-bottom: var(--space-md);
}
.ops-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cyan-ink); margin-bottom: var(--space-sm);
}

.ops-steppers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.ops-steppers .field { margin-bottom: 0; min-width: 0; }
.ops-daily .stepper-input,
.ops-steppers .stepper-input { min-width: 0; }
.ops-daily .stepper-btn { min-height: 44px; }
.ops-mandays {
  margin-top: var(--space-sm);
  font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--black);
}

.ops-fit-warn { color: var(--warning-ink); font-weight: 500; }

/* Only the implements for the job, with the way out to the rest. */
.ops-impl-toggle { margin-top: var(--space-sm); min-height: 44px; }
.ops-impl-toggle[hidden] { display: none; }

/* Diesel next to the hours; the L-per-hour line under both. */
.ops-diesel-hint { margin-top: var(--space-sm); }
.ops-hint-warn { color: var(--warning-ink); font-weight: 600; }

.ops-products { margin-bottom: var(--space-sm); }
.ops-product { min-width: 0; }
.ops-product .chip-label { overflow-wrap: anywhere; }
.ops-product-flag { margin-top: 4px; }
.ops-product.on .fsc-ok { background: var(--success-tint); }
.ops-fsc-warn strong { display: block; margin-bottom: 2px; }
.ops-fsc-confirm { margin-top: var(--space-sm); font-weight: 600; min-height: 44px; }
.ops-fsc-confirm input { width: 20px; height: 20px; }
.ops-qty { margin-top: var(--space-sm); margin-bottom: 0; }

.ops-add-job {
  width: 100%; min-height: 52px;
  border-style: dashed; border-width: 1.5px;
  background: var(--white); font-size: 15px;
  margin-bottom: var(--space-sm);
}
.ops-add-job span { font-size: 20px; line-height: 1; }

.ops-done-count { margin-top: 6px; font-size: 14px; }
.ops-done-warn { text-align: left; max-width: 460px; margin: var(--space-md) auto 0; }
.ops-done-warn ul { margin: 6px 0 0; padding-left: 18px; }
.ops-done-warn li { margin-top: 4px; }

/* ── the equipment form ─────────────────────────────────────────── */

.ops-eq-meter { font-size: 20px; font-weight: 700; font-family: var(--font-mono); min-height: 52px; max-width: 260px; }
.ops-eq-check { min-height: 44px; font-weight: 600; }
.ops-eq-check input { width: 20px; height: 20px; }
.ops-eq-form .input { min-height: 44px; }

/* ── the equipment page ─────────────────────────────────────────── */

.ops-click-row { cursor: pointer; }
.ops-click-row:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.ops-idle td { color: hsl(var(--muted-foreground)); }
.ops-bad { color: var(--danger-ink); font-weight: 700; }
.ops-gap-top { margin-top: var(--space-md); }

.ops-period { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-period-btn { min-height: 40px; }
.ops-period-btn.on { background: var(--black); color: var(--white); border-color: var(--black); }
.ops-hours-note { margin-top: 4px; max-width: 70ch; }

.ops-hours-charts {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-lg); margin-bottom: var(--space-md);
}
.ops-hours-chart { min-width: 0; }
.ops-insight { margin-bottom: var(--space-md); }
.ops-diesel-note { margin-bottom: var(--space-md); max-width: 80ch; }
.ops-hours-table { min-width: 900px; }

/* The implement's "Used for" line and the ticks in its editor. */
.ops-used-for { color: var(--accent-ink); }
.ops-used-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px var(--space-md);
}
.ops-used-tick { min-height: 44px; overflow-wrap: anywhere; }
.ops-used-tick input { width: 20px; height: 20px; }

.ops-detail-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-md); }
.ops-detail-figs .comp-fig-value { font-size: 14.5px; overflow-wrap: anywhere; }
.ops-detail-actions { margin-bottom: var(--space-md); }
.ops-detail-head {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin: var(--space-md) 0 var(--space-sm);
  padding-top: var(--space-md); border-top: 1px solid var(--gray-border);
}
.ops-detail-events { max-height: none; }

/* ── narrow screens ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .ops-hours-charts { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .ops-day-other { flex: 1 1 100%; }
  .ops-steppers { grid-template-columns: 1fr; }
  .ops-daily .stepper { max-width: none; }
  .ops-detail-figs { grid-template-columns: 1fr 1fr; }
  .ops-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-sm); }
  .ops-entry-date { grid-column: 1 / -1; min-width: 0; padding-top: 0; }
  .ops-entry > .ops-entry-body:first-child { grid-column: 1 / 2; }
  .ops-eq-meter { max-width: none; }
}
