/* Operational document workspace, using the same tokens as receipts/shipments. */
.wo-ui {min-width:0}
.wo-ui h3 {font-size:17px;font-weight:600;margin:0}
.wo-ui label {display:block;font-size:13px;color:var(--text2);line-height:1.5}
.wo-ui label input,.wo-ui label select,.wo-ui label textarea {margin-top:6px}
.wo-form {padding:22px}
.wo-form fieldset {border:0;padding:0;margin:0;min-width:0}
.wo-form-head,.wo-section,.wo-history-toolbar,.wo-save-bar,.wo-history-footer,.wo-total {display:flex;align-items:center;justify-content:space-between;gap:16px}
.wo-form-head {margin-bottom:22px;align-items:flex-start}
.wo-form-head>div {display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.wo-form-head>[role=status] {font-size:12px;color:var(--text3)}
.wo-header-fields {display:grid;grid-template-columns:1fr 1.5fr 1.2fr 1.4fr;gap:16px}
.wo-store-note {min-height:0;font-size:12px;color:var(--text3);line-height:1.5;margin:10px 0 20px}
.wo-product-search {margin:20px 0 24px;position:relative}
.wo-product-search>label {font-size:15px;font-weight:600;color:var(--text)}
.wo-product-search>input {margin:8px 0}
.wo-product-search .prm-search-drop {z-index:50;left:0;right:0;top:100%;overflow:auto}
.wo-section {margin:20px 0 12px}
.wo-section small,.wo-total>span,.wo-history-footer {color:var(--text3);font-size:13px}
.wo-positions {min-width:820px;table-layout:fixed}
.wo-positions td {vertical-align:top;padding:12px 10px}
.wo-positions td:first-child>.prm-doc-link {text-align:left;white-space:normal}
.wo-positions td small,.wo-dialog small,.wo-history-table small {display:block;color:var(--text3);font-size:12px;line-height:1.5;margin-top:5px;overflow-wrap:anywhere}
.wo-positions textarea {resize:vertical;line-height:1.5;font-family:var(--mono)}
.wo-amount {font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere}
.wo-row-actions {display:flex;flex-direction:column;gap:7px;align-items:stretch}
.wo-row-actions>small {text-align:center}
.wo-row-actions>div {display:flex;gap:5px;justify-content:center}
.wo-row-actions>div>button {padding:5px;min-width:30px}
.wo-row-actions>[data-action=remove] {color:var(--red);padding:7px}
.wo-row-actions button:disabled {cursor:default}
.wo-line-errors {font-size:12px;line-height:1.45;color:var(--red);margin-top:8px}
.wo-total {margin:20px 0;padding-top:16px;border-top:1px solid var(--border)}
.wo-total strong {font-size:20px}
.wo-extra {margin-top:18px;color:var(--text2);font-size:13px}
.wo-extra summary {cursor:pointer;padding:10px 0;min-height:40px}
.wo-extra .wo-header-fields {max-width:600px;grid-template-columns:1fr 1fr;padding:12px 0}
.wo-extra p {color:var(--text3)}
.wo-save-bar {border-top:1px solid var(--border);margin-top:22px;padding-top:18px;flex-wrap:wrap}
.wo-save-bar>span {font-size:13px;color:var(--text3)}
.wo-note {border:1px solid var(--border2);padding:12px 14px;border-radius:8px;line-height:1.6;margin:14px 0;overflow-wrap:anywhere}
.wo-note.error {color:var(--red);border-color:var(--red)}
.wo-note.warning {color:var(--amber)}
.wo-note.success {color:var(--teal)}
.wo-note button {margin-left:8px}
.wo-draft {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;background:var(--bg3);border-radius:8px;margin-bottom:18px}
.wo-badge {display:inline-flex;align-items:center;border:1px solid var(--border2);border-radius:6px;font-size:12px;color:var(--text3);padding:4px 7px;line-height:1.3}
.wo-badge.posted {color:var(--teal);border-color:var(--teal-dim,var(--border2))}
.wo-history-toolbar {align-items:flex-end;flex-wrap:wrap;margin-bottom:18px}
.wo-history-toolbar>.wo-search-label {flex:1 1 320px}
.wo-history-toolbar>label {min-width:160px}
.wo-filter {border:1px solid var(--border2);background:var(--bg2);border-radius:10px;padding:16px;margin-bottom:18px}
.wo-filter-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.wo-dates {display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-top:16px}
.wo-dates>.date-filter-controls {flex-basis:100%}
.wo-history-table {width:100%;table-layout:fixed}
.wo-history-table th:nth-child(1) {width:16%}.wo-history-table th:nth-child(2) {width:17%}.wo-history-table th:nth-child(3) {width:34%}.wo-history-table th:nth-child(4) {width:22%}.wo-history-table th:nth-child(5) {width:11%}
.wo-history-table [data-document] {cursor:pointer;outline-offset:-2px}
.wo-history-table [data-document]:hover {background:var(--bg3)}
.wo-history-table [data-document]:focus-visible {outline:2px solid var(--blue)}
.wo-history-table td {vertical-align:top;overflow-wrap:anywhere;padding:14px 12px}
.wo-history-table .wo-badge {margin-top:8px}
.wo-history-footer {margin-top:18px}
.wo-comment {white-space:pre-wrap;display:-webkit-box!important;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.wo-dialog {width:min(1120px,96vw);max-width:96vw;max-height:92vh;background:var(--bg2);color:var(--text);padding:0;border:1px solid var(--border2);border-radius:12px}
.wo-dialog::backdrop {background:rgba(0,0,0,.55)}
.wo-dialog>header {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:20px 22px;border-bottom:1px solid var(--border2);position:sticky;top:0;background:var(--bg2);z-index:1}
.wo-dialog h2 {font-size:22px;margin:0}.wo-dialog header p {font-size:13px;color:var(--text3);margin:6px 0 0}
.wo-dialog-body {padding:20px 22px}
.wo-dialog dl {display:grid;grid-template-columns:150px 1fr;gap:10px 18px;margin:22px 0;font-size:14px}.wo-dialog dt {color:var(--text3)}.wo-dialog dd {margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.wo-dialog table {min-width:650px}
#wo-audit:not(:empty) {margin-top:22px;padding-top:18px;border-top:1px solid var(--border2)}
@media(max-width:1100px){.wo-header-fields {grid-template-columns:1fr 1fr}.wo-history-table {min-width:800px}}
@media(max-width:600px){.wo-form {padding:14px}.wo-header-fields,.wo-filter-grid {grid-template-columns:1fr}.wo-form-head {flex-wrap:wrap}.wo-section {align-items:flex-start;flex-direction:column;gap:5px}.wo-save-bar>.prm-actions {width:100%}.wo-save-bar>.prm-actions>button {flex:1}.wo-history-toolbar {gap:10px}.wo-history-toolbar>.wo-search-label {flex-basis:100%}.wo-history-toolbar>label {flex:1}.wo-dialog>header,.wo-dialog-body {padding:14px}.wo-dialog dl {grid-template-columns:1fr;gap:4px}.wo-dialog dd {margin-bottom:10px}.wo-total strong {font-size:18px}}

@media(max-width:600px){.wo-positions:has(.prm-empty){min-width:0}.wo-positions:has(.prm-empty) thead{display:none}}
