/* Document controls are outside the paper and independent of the app theme. */
.quote-print-preview-actions { gap: 10px; flex-wrap: wrap; }
.quote-print-ui .quote-print-edit-action {
  background: #193b60;
  color: #ffffff;
  border: 1px solid #193b60;
  border-radius: 6px;
  font-weight: 700;
  min-height: 42px;
  padding: 10px 16px;
  text-decoration: none;
  box-shadow: 0 2px 4px #10253a22;
}
.quote-print-ui .quote-print-edit-action:hover { background: #102940; border-color: #102940; color: #fff; }
.quote-print-ui .quote-print-edit-action:focus-visible { outline: 3px solid #006e9b; outline-offset: 3px; }

.shipment-editor { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.shipment-editor fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.shipment-intro { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.shipment-intro strong { font-size: 19px; }
.shipment-order-context { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shipment-order-context > div { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.shipment-order-context span { color: var(--muted); font-size: 13px; }
.shipment-intro p, .shipment-help { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 8px 0 0; }
.shipment-header-fields { display: grid; grid-template-columns: minmax(0, 260px); gap: 16px; padding: 24px; }
.shipment-header-fields label, .shipment-notes { display: grid; gap: 8px; font-size: 14px; }
.shipment-table-scroll { overflow-x: auto; margin: 0 24px; border: 1px solid var(--line); border-radius: 8px; }
.shipment-entry-table { min-width: 1020px; width: 100%; table-layout: fixed; }
.shipment-entry-table col:nth-child(1) { width: 24%; }
.shipment-entry-table col:nth-child(2) { width: 12%; }
.shipment-entry-table col:nth-child(3) { width: 12%; }
.shipment-entry-table col:nth-child(4) { width: 40%; }
.shipment-entry-table col:nth-child(5) { width: 12%; }
.shipment-entry-table td { vertical-align: top; padding: 0 12px 14px; }
.shipment-entry-table .shipment-row-heading > td { padding: 12px 12px 0; border-bottom: 0; }
.shipment-row-header { display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(180px, 1fr) minmax(165px, .95fr) 100px 128px; align-items: start; gap: 16px; }
.shipment-row-header .shipment-source-summary { grid-column: 1; }
.shipment-row-header .shipment-catalog-warehouse { grid-column: 2; min-width: 0; }
.shipment-row-header .shipment-warehouse { grid-column: 3; min-width: 0; }
.shipment-row-header .shipment-ng-option { grid-column: 4; }
.shipment-row-header .shipment-catalog-warehouse > span, .shipment-row-header .shipment-warehouse > span { display: block; min-height: 18px; line-height: 18px; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.shipment-row-header .shipment-source-summary > small { line-height: 18px; }
.shipment-entry-table .shipment-source-summary strong { min-height: 40px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.shipment-row-header .shipment-row-actions { grid-column: 5; margin-top: 23px; }
.shipment-source-summary { min-width: 0; }
.shipment-source-summary > * { display: block; overflow-wrap: anywhere; }
.shipment-entry-table tr[data-shipment-row] td:first-child > * { display: block; overflow-wrap: anywhere; }
.shipment-entry-table td:first-child strong { margin: 4px 0; }
.shipment-source-size { font-weight: 400; white-space: nowrap; }
.shipment-entry-table td:first-child small, .shipment-source-code { color: var(--muted); font-size: 12px; }
.shipment-input { position: relative; display: block; min-width: 0; margin-top: 10px; }
.shipment-entry-table .shipment-input > span, .shipment-base-field > span, .shipment-field-caption { display: block; min-height: 18px; margin-bottom: 5px; color: var(--muted); font-size: 12px; line-height: 18px; }
.shipment-entry-table .shipment-base-field .shipment-input { margin-top: 0; }
.shipment-entry-table .shipment-base-field .shipment-input > span { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); }
.shipment-entry-table input, .shipment-entry-table select { min-width: 0; width: 100%; height: 40px; min-height: 40px; box-sizing: border-box; }
.shipment-auto-code input { font-family: Consolas, monospace; font-weight: 600; color: var(--text); }
.shipment-auto-code small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.shipment-auto-code small:empty { display: none; }
.shipment-base-field { margin-top: 10px; }
.shipment-warehouse-result { display: flex; align-items: center; height: 40px; box-sizing: border-box; white-space: nowrap; }
.shipment-ng-option { display: flex; align-items: center; gap: 8px; margin-top: 23px; min-height: 40px; flex-shrink: 0; white-space: nowrap; font-size: 12px; cursor: pointer; }
.shipment-entry-table .shipment-ng-option input { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; margin: 0; padding: 0; }
.shipment-entry-table td:first-child .shipment-library-pending { color: #eab849; margin-top: 6px; line-height: 1.5; }
.shipment-quantity { text-align: center; }
.shipment-quantity-summary { margin-top: 10px; }
.shipment-entry-table .shipment-manual-quantity { text-align: center; font-size: 18px; font-weight: 600; padding: 6px; }
.shipment-entry-table .shipment-quantity-mode { display: block; margin-top: 8px; height: 32px; min-height: 32px; padding: 4px; font-size: 12px; }
.shipment-quantity strong { display: flex; height: 40px; align-items: center; justify-content: center; font-size: 18px; }
.shipment-quantity span { color: var(--muted); font-size: 12px; }
.shipment-quantity small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.shipment-row-actions { position: sticky; right: 10px; display: flex; flex-shrink: 0; gap: 4px; margin-left: auto; background: var(--panel); }
.shipment-row-actions .btn { min-width: 28px; height: 28px; padding: 0 6px; line-height: 1; font-size: 16px; }
.shipment-row-actions .btn:disabled { opacity: .3; cursor: default; }
.shipment-add-material { margin: 12px 24px; }
.shipment-duplicate-note { color: #eab849; }
.shipment-help { margin: 12px 24px; }
.shipment-notes { padding: 12px 24px 24px; }
.shipment-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--line); }
[data-shipment-feedback] { color: var(--muted); font-size: 13px; }
[data-shipment-feedback].is-error { color: #ff9c9c; }
.shipment-warning { padding: 14px 18px; background: #fff7dc; color: #5f4100; border: 1px solid #d79a22; border-radius: 6px; line-height: 1.6; }
.shipment-warning button { margin-left: 16px; background: #193b60; color: #fff; }
.shipment-preview-tools { max-width: 194mm; margin: 0 auto 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.shipment-preview-tools .btn { color: #fff; background: #193b60; border-color: #193b60; }
.shipment-preview-tools .shipment-warning { flex-basis: 100%; }
.shipment-sheet { box-sizing: border-box; max-width: 194mm; margin: 0 auto; background: #fff; padding: 24px; color: #142335; border: 1px solid #cbd5e1; font-family: "Microsoft JhengHei", sans-serif; }
.shipment-sheet header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 3px solid #193b60; }
.shipment-sheet header div { display: grid; gap: 6px; }
.shipment-sheet header strong { font-size: 18px; }
.shipment-sheet header span { font-size: 12px; }
.shipment-sheet h1 { font-size: 26px; margin: 0; white-space: nowrap; }
.shipment-print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 12px; padding: 18px 0; }
.shipment-print-meta b { display: inline-block; min-width: 65px; }
.shipment-sheet table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.shipment-sheet thead { display: table-header-group; }
.shipment-sheet th, .shipment-sheet td { border: 1px solid #a8b5c4; padding: 9px 6px; white-space: normal; overflow-wrap: anywhere; }
.shipment-sheet tbody tr:last-child td { border-bottom: 1px solid #a8b5c4; }
.shipment-sheet th:first-child { width: 5%; }
.shipment-sheet th:nth-child(2) { width: 26%; }
.shipment-sheet th:nth-child(3) { width: 24%; }
.shipment-sheet th:nth-child(4) { width: 7%; }
.shipment-sheet th:nth-child(5) { width: 13%; }
.shipment-sheet th:nth-child(6) { width: 12%; }
.shipment-sheet th:nth-child(7) { width: 13%; }
.shipment-sheet td small { display: block; margin-top: 4px; color: #475569; }
.shipment-sheet tr { break-inside: avoid; }
.shipment-print-notes { font-size: 12px; margin-top: 18px; }
.shipment-print-notes p { min-height: 36px; white-space: pre-wrap; overflow-wrap: anywhere; }
.shipment-sheet footer { border-top: 1px solid #a8b5c4; padding-top: 12px; font-size: 11px; break-inside: avoid; }
.shipment-sheet footer p { color: #475569; line-height: 1.6; }
.shipment-sheet footer div { margin-top: 22px; }
@media (max-width: 640px) {
  .shipment-intro, .shipment-header-fields, .shipment-notes, .shipment-footer { padding: 16px; }
  .shipment-header-fields { grid-template-columns: 1fr; }
  .shipment-order-context { grid-template-columns: 1fr; }
  .shipment-table-scroll { margin: 0 16px; }
  .shipment-help { margin: 12px 16px; }
  .shipment-add-material { margin: 12px 16px; }
  .shipment-footer { align-items: stretch; flex-direction: column; }
  .shipment-footer .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .shipment-preview { padding: 12px; overflow-x: auto; }
  .shipment-sheet { min-width: 680px; }
  .quote-print-ui-head { flex-wrap: wrap; }
}
.print-source-details { margin: 12px 0; color: #475569; font-size: 12px; }
.print-source-details summary { cursor: pointer; width: fit-content; }
.print-sheet td .print-source-details { margin: 4px 0 0; }
.print-source-details > div { margin-top: 8px; padding: 12px; background: #f1f5f9; border-radius: 6px; overflow-wrap: anywhere; }
@media print {
  .print-source-details { display: none !important; }
  .shipment-preview-tools { display: none !important; }
  .shipment-preview { padding: 0 !important; background: #fff; }
  .shipment-sheet { width: 100%; min-width: 0; max-width: none; padding: 0; border: 0; }
  .shipment-sheet th { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
