/* =============================================================
   PRODUCTION ORDERS (#view-production-orders)
   Layout only; components come from form-kit.css.
   ============================================================= */

/* ---------- Setup form ---------- */
.po-setup-head { padding-bottom: 0; }

.po-setup-body {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 4px 24px 0;
}

.po-setup-fields {
  flex: 2 1 520px;
  min-width: 0;
}

.po-setup-output {
  flex: 1 1 300px;
  min-width: 0;
  padding: 20px 0 24px;
}

.po-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--hp-surface-2);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-lg);
}

.po-output__total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px dashed var(--hp-border-strong);
}

.po-output__figure {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* The planned quantity is computed, never typed: shown as a figure, not as a box. */
.po-qty-big {
  /* Sized to its figure so the unit sits right after it; 8ch is the fallback width. */
  width: 8ch;
  field-sizing: content;
  min-width: 2ch;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hp-text);
  font: inherit;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  outline: none;
  cursor: default;
  -moz-appearance: textfield;
}

.po-qty-big::-webkit-outer-spin-button,
.po-qty-big::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.po-qty-big::placeholder { color: var(--hp-text-3); }

.po-output__unit {
  font-weight: 600;
  color: var(--hp-text-2);
}

.po-inherited-hint {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--hp-radius);
  background: var(--hp-ok-soft);
  color: var(--hp-ok);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- List ---------- */
.po-list-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.po-list-search {
  width: 280px;
  max-width: 100%;
}

#view-production-orders .orders-table-wrapper { min-height: 0; }

#view-production-orders .hp-table { min-width: 1100px; }

.po-th-progress { width: 160px; }

.po-order-no {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.po-machine { font-weight: 600; }

.po-actual { font-weight: 600; }

.po-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* Row actions keep their text labels: on the shop floor a word reads faster than an icon. */
.orders-action-btn.hp-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Edit-order dialog (built in productionOrders.js) ---------- */
.po-edit-card {
  width: 100%;
  max-width: 520px;
  padding: 24px;
}

.po-edit-card__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--hp-text);
}

.po-edit-card__desc {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hp-border);
}

.po-edit-card__fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.po-edit-card__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--hp-radius);
  background: var(--hp-surface-2);
  border: 1px solid var(--hp-border);
}

.po-edit-card__total strong {
  font-size: 18px;
  color: var(--hp-text);
}

.po-edit-card__foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.po-delete-running {
  color: var(--hp-warn) !important;
  border-color: rgba(245, 165, 36, 0.35) !important;
}
