/* Dispatch Board — truck and trailer maintenance (backlog #34). Everything here is scoped to .maint-* and uses the app's
   tokens and existing classes (.kpi-card, .table-wrap, .loads, .btn, .req-chip, .status-pill), so light and dark themes
   and the company accent follow along without a second copy of anything. */

/* "Due now" — the same chip row the inspections repairs list uses, with room for the reason. */
.maint-due { padding: 0 16px; margin: 0 0 16px; }
.maint-due h3 { font-size: 13px; margin: 0 0 8px; }
.maint-due-row { align-items: center; gap: 10px; }
.maint-due-row .t-sub { color: var(--ink-muted); }
.maint-due-row .row-actions { flex-shrink: 0; justify-content: flex-end; }

/* Service schedules, under the work orders. */
.maint-scheds { padding: 0 16px 20px; }
.maint-scheds h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; margin: 18px 0 8px; }
.maint-inline-check { margin: 0; font-weight: 400; font-size: 12px; color: var(--ink-muted); }

/* The cost column of the work order table (.amt in app.css only applies inside .bill-lines). */
.maint-amt { text-align: right; font-family: "IBM Plex Mono", monospace; white-space: nowrap; }

/* Parts and labour lines in the work order drawer: kind, what it is, part #, quantity, cost, line total, remove. */
.maint-lines { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.maint-line {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 96px 66px 84px 84px 30px;
  gap: 6px;
  align-items: center;
}
.maint-line select,
.maint-line input { margin: 0; min-width: 0; font-size: var(--fs-md); padding: 6px 8px; }
.maint-line input[type="number"] { text-align: right; }
.maint-line-total {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-sm);
  text-align: right;
  color: var(--ink-muted);
  white-space: nowrap;
}
.maint-line .btn.small.danger { padding: 4px 7px; line-height: 1; }

/* The totals box beside the tax field. */
.maint-total { display: flex; flex-direction: column; gap: 2px; padding: 7px 0 0; }
.maint-total strong { font-family: "IBM Plex Mono", monospace; font-size: 18px; }
.maint-total .sub { margin: 0; }

/* The "Finish this work order" panel, revealed by the Finish button. */
.maint-finish {
  margin: 16px 0 0;
  padding: 2px 13px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.maint-finish .section-title { border-top: none; padding-top: 12px; margin-top: 0; }
/* One question per line, so "mark the defect repaired" and "back to active" don't run together. */
.maint-finish label.check-inline { display: flex; align-items: flex-start; gap: 7px; margin: 7px 0; }

@media (max-width: 760px) {
  .maint-line {
    grid-template-columns: minmax(0, 1fr) 84px 30px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .maint-line select { grid-column: 1 / -1; }
  .maint-line [data-f="description"] { grid-column: 1 / -1; }
  .maint-line [data-f="partNumber"] { grid-column: 1 / 3; }
  .maint-line-total { grid-column: 1 / 3; text-align: left; }
  .maint-due-row { align-items: flex-start; flex-direction: column; }
}
