/* ============================================================================
   СЕРВИС: ЗАКАЗ-НАРЯДЫ · ТЗ 5.4
   Значений здесь нет — только токены `motorplace-tokens.css`.
   ============================================================================ */

/* Строки работ и запчастей в карточке — плотная таблица, числа вправо. */
.mp-wo-lines { overflow-x: auto; }
.mp-wo-lines table { width: 100%; border-collapse: collapse; font-size: var(--mp-size-body); }
.mp-wo-lines th {
  text-align: left;
  font-size: var(--mp-size-caption);
  font-weight: var(--mp-weight-col);
  color: var(--mp-text-mute);
  padding: 0 8px 6px;
  border-bottom: 1px solid var(--mp-line);
  white-space: nowrap;
}
.mp-wo-lines td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--mp-line-soft);
  vertical-align: top;
  color: var(--mp-text);
}
.mp-wo-lines tr:last-child td { border-bottom: 0; }
.mp-wo-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-wo-lines .mono { font-family: var(--mp-font-mono); white-space: nowrap; }
.mp-wo-lines .strong { font-weight: 600; }
.mp-wo-lines tr.is-cancelled td { color: var(--mp-text-faint); text-decoration: line-through; }

/* «нет ставки нормо-часа» — не ошибка ввода, а предупреждение: цвет предупреждения. */
.mp-wo-lines .is-missing,
.mp-wo-totals .is-missing dd,
.mp-wo-amount.is-missing { color: var(--mp-st-w-ink); font-weight: 500; }

.mp-wo-note {
  display: inline-block;
  margin-left: 6px;
  font-size: var(--mp-size-caption);
  color: var(--mp-text-mute);
  text-decoration: none;
}
.mp-wo-empty { color: var(--mp-text-mute); font-size: var(--mp-size-body); margin: 0; }

/* Итоги: подпись слева, сумма справа, итоговые строки жирнее. */
.mp-wo-totals dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-wo-totals dl > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mp-wo-totals dt { color: var(--mp-text-soft); }
.mp-wo-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--mp-text); }
.mp-wo-totals .strong { padding-top: 6px; border-top: 1px solid var(--mp-line-soft); }
.mp-wo-totals .strong dt,
.mp-wo-totals .strong dd { font-weight: 600; color: var(--mp-text); }
.mp-wo-totals .muted dt,
.mp-wo-totals .muted dd { color: var(--mp-text-mute); }
.mp-wo-warn {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: var(--mp-radius-sm);
  background: var(--mp-st-w-bg);
  color: var(--mp-st-w-ink);
  font-size: var(--mp-size-caption);
}
.mp-wo-caption { margin: 8px 0 0; font-size: var(--mp-size-caption); color: var(--mp-text-faint); }

/* Сумма строки в форме — текст, а не поле: её не вводят. */
.mp-wo-amount { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* История обслуживания техники. */
.mp-wo-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mp-wo-history li { padding: 8px 0; border-bottom: 1px solid var(--mp-line-soft); }
.mp-wo-history li:last-child { border-bottom: 0; }
.mp-wo-history li.is-current { background: var(--mp-surface-2); margin: 0 -8px; padding: 8px; border-radius: var(--mp-radius-sm); }
.mp-wo-history .head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mp-wo-history .mono { font-family: var(--mp-font-mono); font-weight: 600; }
.mp-wo-history a.mono { color: var(--mp-text); text-decoration: underline; text-underline-offset: 2px; }
.mp-wo-history .meta { color: var(--mp-text-mute); font-size: var(--mp-size-caption); }
.mp-wo-history .sum { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-wo-history .body { margin-top: 4px; font-size: var(--mp-size-caption); color: var(--mp-text-soft); }
.mp-wo-history .lbl { color: var(--mp-text-mute); }

/* Ход наряда: переходы статусов, новые сверху. */
.mp-wo-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mp-wo-timeline .when { font-size: var(--mp-size-caption); color: var(--mp-text-mute); }
.mp-wo-timeline .what { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--mp-text-soft); }
.mp-wo-timeline .comment { margin-top: 2px; font-size: var(--mp-size-caption); color: var(--mp-text-soft); }

/* Повторитель строк в форме: в узкой колонке таблица прокручивается сама,
   а не распирает страницу (у страницы горизонтальной прокрутки нет). */
.mp-wo-repeater { overflow-x: auto; }
.mp-wo-repeater table { min-width: 860px; }

/* Итог строкой под запчастями — пересчёт виден там, где правят строки. */
.mp-wo-totals-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 20px;
  padding-top: 10px;
  border-top: 1px solid var(--mp-line-soft);
  font-variant-numeric: tabular-nums;
  color: var(--mp-text);
}
.mp-wo-totals-inline .lbl { color: var(--mp-text-mute); }
.mp-wo-totals-inline .strong { font-weight: 600; }
.mp-wo-totals-inline .is-missing { color: var(--mp-st-w-ink); }
.mp-wo-lines .sub { margin-top: 2px; font-size: var(--mp-size-caption); color: var(--mp-text-mute); }
.mp-wo-lines th.num { text-align: right; }
.mp-wo-lines td:nth-child(2) { min-width: 200px; }
