/* Scoped to the production order editor; no other modal/table is restyled. */
.production-form-backdrop { padding: 20px; background: rgba(15, 23, 42, .52); }
.production-order-form.modal-production { width: min(1460px, calc(100vw - 40px)); height: min(94vh, 1100px); height: min(94dvh, 1100px); max-height: calc(100dvh - 40px); border: 0; border-radius: 16px; box-shadow: 0 28px 90px rgba(15, 23, 42, .26); }
.production-order-form .modal-header { flex-shrink: 0; padding: 22px 28px; gap: 20px; align-items: flex-start; }
.production-order-form .po-heading { min-width: 0; }
.production-order-form .po-eyebrow { display: block; font-size: 10px; letter-spacing: .13em; font-weight: 700; color: var(--primary-600); margin-bottom: 5px; }
.production-order-form .modal-header h3 { font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.3; }
.production-order-form .po-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.production-order-form .po-header-actions { display: flex; align-items: center; gap: 16px; }
.production-order-form .po-badge { padding: 5px 10px; background: #f1f5f9; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--primary-800); }
.production-order-form .modal-body { padding: 0; background: #f4f6f8; flex: 1; min-height: 0; overscroll-behavior: contain; overflow-anchor: none; scroll-padding: 20px; }
.production-order-form .po-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.production-order-form .po-settings { padding: 26px 22px; }
.production-order-form .po-section-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.production-order-form .po-section-heading h3 { font-size: 15px; line-height: 1.45; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.production-order-form .po-section-heading p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.production-order-form .po-step { display: inline-flex; flex: 0 0 28px; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: #e8edf2; color: var(--primary-800); font-size: 11px; font-weight: 700; }
.production-order-form .po-fields { display: grid; gap: 18px; margin-top: 24px; }
.production-order-form label { display: block; margin: 0 0 7px; font-size: 12px; color: var(--primary-800); font-weight: 600; }
.production-order-form .po-optional { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.production-order-form .input, .production-order-form .select { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; border-radius: 7px; font-size: 13px; background: #fff; border: 1px solid #dce2e9; padding: 9px 10px; }
.production-order-form textarea.input { resize: vertical; min-height: 88px; line-height: 1.6; }
.production-order-form .input:focus, .production-order-form .select:focus { outline: 2px solid #cbd9e6; outline-offset: 1px; border-color: var(--primary-600); }
.production-order-form .input:disabled, .production-order-form .select:disabled { color: #475569; -webkit-text-fill-color: #475569; opacity: 1; background: #f8fafc; }
.production-order-form button:focus-visible { outline: 3px solid #8aaac4; outline-offset: 3px; }
.production-order-form .btn { min-height: 38px; font-size: 12px; padding: 8px 12px; border-radius: 7px; box-shadow: none; }
.production-order-form .icon-btn { width: 36px; height: 36px; min-width: 36px; border-radius: 7px; font-size: 19px; }
.production-order-form .po-guide { border-top: 1px solid #dce2e9; padding-top: 20px; margin-top: 26px; }
.production-order-form .po-guide strong { font-size: 12px; color: var(--primary-800); }
.production-order-form .po-guide p { color: var(--muted); margin: 6px 0 0; line-height: 1.75; font-size: 12px; }
.production-order-form .po-workspace { min-width: 0; padding: 24px; border-left: 1px solid #e3e8ee; display: grid; gap: 20px; }
.production-order-form .po-section { min-width: 0; background: #fff; border: 1px solid #e1e6ec; border-radius: 12px; padding: 20px; box-shadow: 0 2px 4px rgba(15, 23, 42, .015); }
.production-order-form .po-section-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.production-order-form .po-outputs { display: grid; gap: 10px; margin-top: 18px; }
.production-order-form .po-output { display: grid; grid-template-columns: 24px minmax(0, 1fr) 138px auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.production-order-form .po-output.is-selected { border-color: #b6c5d4; background: #f7f9fc; box-shadow: inset 3px 0 0 var(--primary-800); }
.production-order-form .po-line-number { color: var(--primary-600); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.production-order-form .po-output-actions { display: flex; align-items: center; gap: 5px; padding-top: 21px; }
.production-order-form .po-detail-btn { color: var(--primary-800); background: #fff; }
.production-order-form .po-detail-btn[aria-pressed="true"] { border-color: transparent; background: #e8eef5; color: var(--primary-900); }
.production-order-form .po-remove { color: var(--muted); background: transparent; border: 1px solid transparent; }
.production-order-form .po-remove:not(:disabled):hover { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.production-order-form .po-remove:disabled { opacity: .35; }
.production-order-form .po-quantity-field { position: relative; }
.production-order-form .po-quantity-field .input { padding-right: 54px; font-weight: 600; }
.production-order-form .po-quantity-field span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); max-width: 45px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); pointer-events: none; }
.production-order-form .po-output-progress { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.production-order-form .po-active-product { overflow-wrap: anywhere; }
.production-order-form .po-material-context { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 16px 38px; color: #64748b; font-size: 12px; }
.production-order-form .po-material-context strong { color: var(--primary-800); }
.production-order-form .po-material-toolbar { background: #f8fafc; border: 1px solid #e7ecf1; padding: 12px; border-radius: 8px; margin: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.production-order-form .po-material-toolbar p { margin: 0; max-width: 470px; color: #64748b; font-size: 12px; line-height: 1.6; }
.production-order-form .po-material-toolbar.is-special { background: #f1f8f5; border-color: #cfe5da; }
.production-order-form .po-material-toolbar.is-special p { color: #38644f; }
.production-order-form .po-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.production-order-form .po-special-btn { color: #365b4c; border-color: #b4d2c3; background: #fff; }
.production-order-form .po-special-btn[aria-pressed="true"] { color: #38644f; opacity: 1; background: #e4f2eb; border-color: transparent; }
.production-order-form .table-wrap { border: 1px solid #e7ecf1; border-radius: 8px; overflow: auto; }
.production-order-form table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; }
.production-order-form th { background: #f4f6f9; color: #627083; font-size: 11px; font-weight: 600; padding: 11px 8px; text-transform: none; border-bottom: 1px solid #e7ecf1; white-space: normal; }
.production-order-form td { padding: 10px 8px; white-space: normal; overflow-wrap: anywhere; border-bottom: 1px solid #edf0f4; font-size: 12px; background: #fff; vertical-align: middle; }
.production-order-form tbody tr:last-child td { border-bottom: 0; }
.production-order-form .po-material-table th:nth-child(1) { width: 34px; }
.production-order-form .po-material-table th:nth-child(2) { width: auto; }
.production-order-form .po-material-table th:nth-child(3) { width: 75px; }
.production-order-form .po-material-table th:nth-child(4), .production-order-form .po-material-table th:nth-child(5) { width: 105px; }
.production-order-form .po-material-table th:nth-child(6) { width: 115px; }
.production-order-form .po-material-table th:nth-child(7) { width: 40px; }
.production-order-form .po-material-table .input, .production-order-form .po-material-table .select { font-size: 12px; padding: 8px 6px; }
.production-order-form .po-standard-row .input:disabled, .production-order-form .po-standard-row .select:disabled { background: transparent; border-color: transparent; padding-left: 0; }
.production-order-form .po-material-table input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.production-order-form .po-standard-row .select:disabled { appearance: none; }
.production-order-form .po-material-tag { display: block; font-size: 10px; color: #7b8796; margin-top: 3px; }
.production-order-form .po-material-tag.is-special { color: #2e7154; font-weight: 600; }
.production-order-form .po-special-row td { background: #f8fcfa; }
.production-order-form .po-material-table .btn { padding: 6px 8px; font-size: 11px; width: 100%; white-space: normal; }
.production-order-form .po-stock-section { background: #fcfdfe; }
.production-order-form .po-stock-table { margin-top: 16px; }
.production-order-form .po-stock-table th:nth-child(1) { width: 35px; }
.production-order-form .po-stock-table th:nth-child(2) { width: 34%; }
.production-order-form .po-stock-table th:nth-child(3) { width: 70px; }
.production-order-form .po-stock-table th:nth-child(4), .production-order-form .po-stock-table th:nth-child(5) { width: 120px; }
.production-order-form .po-stock-table .sub { font-size: 10px; margin-top: 4px; color: #7b8796; }
.production-order-form .po-footnote { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.7; }
.production-order-form .po-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px 22px; color: var(--muted); }
.production-order-form .po-empty-mark { display: flex; align-items: center; justify-content: center; background: #eef2f6; color: #8a98a9; width: 42px; height: 42px; border-radius: 12px; font-size: 27px; margin-bottom: 10px; }
.production-order-form .po-empty strong { font-size: 13px; font-weight: 600; color: #526174; }
.production-order-form .po-empty p { font-size: 12px; max-width: 360px; margin: 6px 0 0; line-height: 1.7; }
.production-order-form .po-empty-cell { text-align: center; color: var(--muted); padding: 24px; }
.production-order-form .modal-footer { position: static; flex-shrink: 0; padding: 16px 28px; gap: 20px; background: #fff; }
.production-order-form .po-footer-message { color: var(--muted); font-size: 12px; min-width: 0; }
.production-order-form .po-footer-message .status:empty { display: none; }
.production-order-form .modal-footer .btn { min-height: 42px; padding: 10px 20px; }
.production-order-form .modal-footer .primary { min-width: 140px; }
.production-order-form .po-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1150px) {
  .production-order-form .po-layout { grid-template-columns: minmax(0, 1fr); }
  .production-order-form .po-settings { padding: 20px 24px; }
  .production-order-form .po-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
  .production-order-form .po-note-field { grid-column: 1 / -1; }
  .production-order-form textarea.input { min-height: 54px; height: 54px; }
  .production-order-form .po-guide { display: none; }
  .production-order-form .po-workspace { border: 0; padding-top: 0; }
}
@media (max-width: 800px) {
  .production-form-backdrop { padding: 12px; }
  .production-order-form.modal-production { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); height: calc(100dvh - 24px); border-radius: 12px; }
  .production-order-form .modal-header { padding: 18px 20px; }
  .production-order-form .modal-header h3 { font-size: 20px; }
  .production-order-form .po-header-actions .po-badge { display: none; }
  .production-order-form .po-output { grid-template-columns: 20px minmax(0, 1fr) 130px; }
  .production-order-form .po-output-actions { grid-column: 2 / -1; justify-content: flex-end; padding-top: 0; }
  .production-order-form .po-material-table { border: 0; border-radius: 0; overflow: visible; }
  .production-order-form .po-material-table table, .production-order-form .po-material-table tbody { display: block; }
  .production-order-form .po-material-table thead { display: none; }
  .production-order-form .po-material-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid #e1e6ec; border-radius: 9px; padding: 12px; margin-top: 12px; gap: 12px; background: #fff; }
  .production-order-form .po-material-table tr.po-special-row { border-color: #b9d8c8; background: #f8fcfa; }
  .production-order-form .po-material-table td { display: block; border: 0; padding: 0; min-width: 0; background: transparent; }
  .production-order-form .po-material-table td:nth-child(1) { display: none; }
  .production-order-form .po-material-table td:nth-child(2) { grid-column: 1 / -1; }
  .production-order-form .po-material-table td:nth-child(6) { grid-column: 1 / 3; }
  .production-order-form .po-material-table td:nth-child(7) { display: flex; justify-content: flex-end; align-items: flex-end; }
  .production-order-form .po-material-table td:nth-child(n+3):not(:last-child)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
  .production-order-form .po-material-table input[type="number"] { text-align: left; }
  .production-order-form .po-material-table .input, .production-order-form .po-material-table .select { font-size: 14px; }
  .production-order-form .po-material-table .btn { width: auto; min-width: 110px; }
  .production-order-form .po-stock-table { border: 0; overflow: visible; }
  .production-order-form .po-stock-table table, .production-order-form .po-stock-table tbody { display: block; }
  .production-order-form .po-stock-table thead { display: none; }
  .production-order-form .po-stock-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; border: 1px solid #e1e6ec; border-radius: 8px; padding: 14px; margin-bottom: 10px; background: #fff; }
  .production-order-form .po-stock-table td { display: block; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
  .production-order-form .po-stock-table td:nth-child(1):not([colspan]) { display: none; }
  .production-order-form .po-stock-table td:nth-child(2), .production-order-form .po-stock-table td:nth-child(6), .production-order-form .po-stock-table td[colspan] { grid-column: 1 / -1; }
  .production-order-form .po-stock-table td:nth-child(6):empty { display: none; }
  .production-order-form .po-stock-table td:nth-child(n+3)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
  .production-order-form .po-stock-table td:nth-child(4), .production-order-form .po-stock-table td:nth-child(5) { font-weight: 600; }
  .production-order-form .modal-footer { padding: 14px 20px; }
}
@media (max-width: 520px) {
  .production-form-backdrop { padding: 0; }
  .production-order-form.modal-production { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .production-order-form .modal-header { padding: 16px; gap: 10px; }
  .production-order-form .po-heading p { font-size: 12px; }
  .production-order-form .po-settings { padding: 20px 16px; }
  .production-order-form .po-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .production-order-form .po-fields > div:nth-child(3) { grid-column: 1 / -1; }
  .production-order-form .po-workspace { padding: 0 12px 20px; gap: 14px; }
  .production-order-form .po-section { padding: 16px 12px; }
  .production-order-form .po-section-toolbar { align-items: flex-start; }
  .production-order-form .po-output { grid-template-columns: minmax(0, 1fr) 120px; padding: 12px; gap: 12px; }
  .production-order-form .po-line-number { display: none; }
  .production-order-form .po-output-product { grid-column: 1 / -1; }
  .production-order-form .po-output-actions { grid-column: auto; align-self: end; }
  .production-order-form .po-output-progress { grid-column: 1 / -1; }
  .production-order-form .po-output-actions .po-detail-btn { font-size: 10px; padding: 8px; }
  .production-order-form .po-material-context { margin-left: 0; }
  .production-order-form .po-actions { width: 100%; }
  .production-order-form .po-material-toolbar .po-actions > .btn { flex: 1 1 auto; }
  .production-order-form .input, .production-order-form .select, .production-order-form .po-material-table .input, .production-order-form .po-material-table .select { font-size: 16px; min-height: 44px; }
  .production-order-form .btn { min-height: 44px; }
  .production-order-form .icon-btn { width: 44px; height: 44px; min-width: 44px; }
  .production-order-form .modal-footer { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; }
  .production-order-form .po-footer-message { font-size: 11px; }
  .production-order-form .modal-footer .po-actions { display: grid; grid-template-columns: 1fr 2fr; }
}
