.po-home-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:20px 0}.po-home-heading h2{margin:0}.po-home-heading p{margin-bottom:0}.po-save-actions{display:flex;gap:10px;white-space:nowrap}#poHome[hidden],#poEditor[hidden]{display:none!important}#purchaseOrdersPage .workspace{max-width:1480px;margin:auto}.po-kicker{color:#6a786d;font-size:11px;letter-spacing:2px;font-weight:700}.po-panel{padding:26px;margin-bottom:22px}.po-fields{display:grid;grid-template-columns:2fr 1fr 1fr;gap:18px;margin:22px 0}.po-fields label,.po-notes{display:grid;gap:8px;font-size:12px;font-weight:650;color:#58635b}.po-fields input,.po-notes textarea,#poSearch,#poItems input{border:1px solid #dce2dc;border-radius:8px;padding:11px 12px;background:white;font:inherit;color:#26372b;min-width:0;width:100%;box-sizing:border-box}.po-fields input:focus,#poSearch:focus,#poItems input:focus{outline:2px solid #7f9f87;outline-offset:1px}.po-search{position:relative;margin:22px 0}#poSearch{font-size:14px;padding:15px 18px;background:#f7faf7}#poSearchResults{max-height:330px;overflow:auto;border:1px solid #e7ece7;border-radius:8px;margin-top:8px}.po-search-hint{padding:10px 16px;color:#788179;font-size:12px}.po-result{display:flex;align-items:center;text-align:left;gap:14px;width:100%;border:0;border-bottom:1px solid #edf0ed;padding:12px;background:white;cursor:pointer}.po-result:hover{background:#f0f6ef}.po-result span{flex:1}.po-result small{display:block;color:#748078;margin-top:4px}.po-result strong{font-size:12px;color:#526b57}.po-result .thumb,.po-thumb{width:55px;height:55px;object-fit:cover;border-radius:7px}.po-lines-table{width:100%;min-width:1100px;table-layout:fixed}.po-lines-table th:nth-child(1){width:64px}.po-lines-table th:nth-child(2){width:22%}.po-lines-table th:nth-child(3){width:16%}.po-lines-table th:nth-child(4),.po-lines-table th:nth-child(5),.po-lines-table th:nth-child(6){width:68px}.po-lines-table th:nth-child(7){width:70px}.po-lines-table th:nth-child(8){width:95px}.po-lines-table th:nth-child(9){width:96px}.po-lines-table th:nth-child(10){width:48px}.po-line-qty{font-weight:700}.po-legacy-note{display:block;font-size:11px;color:#a06320;margin-top:6px}.po-destination-summary{font-size:10px;white-space:nowrap}.po-lines-table td{vertical-align:middle}#poItems input{padding:9px;font-size:13px}#poItems b{font-size:12px}.po-lines-table .stock-sku{display:block;margin-top:5px;overflow-wrap:anywhere}.po-summary{display:flex;align-items:center;justify-content:space-between;padding:22px 0;border-bottom:1px solid #e6ebe5;margin-bottom:20px}.po-summary strong{font-size:24px;color:#344d3b}.po-summary small{margin-right:18px;color:#7e877e}.po-actions{display:flex;justify-content:space-between;align-items:center;margin-top:20px;gap:15px}.po-actions p{max-width:65%;margin:0}.po-notes textarea{resize:vertical;min-height:65px}#poPreviewDialog{border:none;border-radius:14px;max-width:1000px;width:90vw;max-height:90vh;padding:0;box-shadow:0 24px 90px #0005}#poPreviewDialog::backdrop{background:#1c2c235c}.po-preview-tools{display:flex;justify-content:space-between;align-items:center;padding:15px 24px;background:#f4f7f2;border-bottom:1px solid #ddd}.po-preview-tools small{display:block;font-size:11px;color:#677765;max-width:620px;margin-top:5px}#poDocument{padding:38px;color:#26372b;font-family:-apple-system,BlinkMacSystemFont,'PingFang TC','Microsoft JhengHei',sans-serif}.po-doc-brand{font-weight:800;letter-spacing:3px;border-bottom:2px solid #45624c;padding-bottom:20px}.po-doc-brand span{float:right;font-size:11px;letter-spacing:1px;font-weight:500}.po-doc-meta{display:grid;grid-template-columns:2fr 1fr 1fr;gap:16px;margin:22px 0 30px}.po-doc-meta small{display:block;color:#748078;margin-bottom:8px}#poDocument table{width:100%;border-collapse:collapse}#poDocument td,#poDocument th{padding:14px 8px;border-bottom:1px solid #dfe6df;text-align:left;font-size:12px}#poDocument th{background:#f1f5ef}.po-print-thumb{width:76px;height:76px;object-fit:contain}#poDocument tr{break-inside:avoid}#poDocument small{font-size:11px}#poDocument td{overflow-wrap:anywhere}#poDocument td div{margin:6px 0;color:#687668}.po-doc-total{padding:24px 0;text-align:right;font-size:18px}.po-doc-total b{margin-left:28px}.po-doc-notes{white-space:pre-wrap;font-size:13px}@media(max-width:900px){.po-fields{grid-template-columns:1fr}.po-panel{padding:16px}.po-actions{align-items:start;flex-direction:column}.po-actions p{max-width:100%}}@media print{@page{size:A4;margin:12mm}body{background:#fff!important;display:block!important}body>*:not(#poPreviewDialog){display:none!important}#poPreviewDialog{display:block!important;position:static!important;max-width:none!important;width:100%!important;max-height:none!important;height:auto!important;overflow:visible!important;padding:0!important;box-shadow:none!important;border:0!important;margin:0!important}.po-preview-tools{display:none!important}#poDocument{padding:0!important}#poDocument thead{display:table-header-group}#poDocument img{print-color-adjust:exact}#poDocument .po-doc-meta{break-inside:avoid}}

/* Clickable line identity → Item detail */
.po-item-link{border:0;background:transparent;padding:0;text-align:left;cursor:pointer;color:inherit;font:inherit}
.po-item-link:hover b{color:var(--blue);text-decoration:underline}
.po-item-text{display:block;width:100%}

/* Line order controls */
.po-row-actions{white-space:nowrap;text-align:right}

/* Drag to reorder */
.po-first{vertical-align:middle}
.po-first-row{display:flex;align-items:center;gap:6px}
.po-drag{cursor:grab;touch-action:none;padding:4px 6px;min-width:24px;line-height:1;color:#8a919c;font-size:12px;flex:0 0 auto}
.po-drag:active{cursor:grabbing}
tr.po-dragging td{background:#fffdf5}
tr.po-dragging{position:relative;z-index:5;box-shadow:0 6px 18px rgba(20,30,50,.18);will-change:transform}
tr.po-drop-target td{border-top:2px solid var(--blue)}
@media (max-width:760px){.po-drag{padding:10px 8px;font-size:15px}}
