.dispatch-company{height:auto;display:flex;align-items:flex-start;justify-content:initial;gap:12px;border-bottom:1px solid #000;padding-bottom:8px;margin-bottom:8px;color:#000}.dispatch-company>img{width:125px;height:auto}.dispatch-company>div{flex:1}.dispatch-company h2{display:block;text-align:left;font:bold 15pt 'Times New Roman';margin:0 0 5px}.dispatch-company p{font:11pt 'Times New Roman';margin:2px 0!important;line-height:1.2}.dispatch-form{font:12pt 'Times New Roman';color:#000}.dispatch-form>h1{font:bold 15pt 'Times New Roman';text-align:center;margin:10px 0 4px}.dispatch-form p{color:#000;margin:5px 0!important;line-height:1.2}.dispatch-date{text-align:center}.dispatch-number{text-align:right}.dispatch-meta{display:flex;gap:12px;justify-content:space-between;margin:5px 0}.dispatch-signatures{display:flex;justify-content:space-between;text-align:center;margin-top:12mm;min-height:22mm;font-size:11pt}.dispatch-signatures>div{width:32%}.dispatch-signatures i{padding:0}.dispatch-table{table-layout:fixed;width:100%;font-size:11pt!important}.dispatch-table td,.dispatch-table th{border:1px solid #000!important;min-width:0!important;padding:4px!important;vertical-align:middle!important;text-align:center!important;overflow-wrap:anywhere}.dispatch-table th{background:#fffdec!important}.dispatch-table tbody td:nth-child(2){text-align:left!important}.dispatch-table .dispatch-total td{font-weight:bold}.dispatch-table .dispatch-total td:nth-child(2){text-align:center!important}.dispatch-source{break-before:page;page-break-before:always}.dispatch-source img{max-width:100%;max-height:240mm;object-fit:contain}.dispatch-original-docs{border-top:1px solid #000;padding-top:6px}#dispatch-fields{border-top:1px solid #ddd;margin-top:20px;padding-top:20px}#dispatch-fields[hidden]{display:none!important}
@media print{
#print-root .dispatch-form{font:12pt 'Times New Roman'!important;line-height:1.15!important}
#print-root .dispatch-company{display:flex!important;height:auto!important;border-bottom:1px solid #000;padding:0 0 5px!important;margin:0 0 6px!important}
#print-root .dispatch-company>img{width:34mm!important;height:auto!important;max-height:15mm!important;object-fit:contain}
#print-root .dispatch-company h2{font-size:14pt!important;margin:0 0 3px!important}
#print-root .dispatch-company p{font-size:10.5pt!important;margin:1px 0!important;line-height:1.1!important}
#print-root .dispatch-form h1{font:bold 15pt 'Times New Roman'!important;margin:6px 0!important;text-align:center!important}
#print-root .dispatch-form>p,#print-root .dispatch-meta{font:12pt 'Times New Roman'!important;line-height:1.15!important;margin:4px 0!important}
#print-root .dispatch-table{font:11pt 'Times New Roman'!important;table-layout:fixed!important}
#print-root .dispatch-table th,#print-root .dispatch-table td{font:11pt 'Times New Roman'!important;padding:4px 2px!important;line-height:1.15!important;vertical-align:middle!important;text-align:center!important;min-width:0!important;width:auto!important}
#print-root .dispatch-table th{font-weight:bold!important}
#print-root .dispatch-table tbody td:nth-child(2){text-align:left!important}
#print-root .dispatch-table .dispatch-total td{font-weight:bold!important}
#print-root .dispatch-table .dispatch-total td:nth-child(2){text-align:center!important}
#print-root .dispatch-signatures{font-size:11pt!important;margin-top:12mm!important;min-height:22mm!important;break-inside:avoid}
#print-root .dispatch-source{break-before:page!important;page-break-before:always!important}
}

/* Dàn đều dòng theo số mã hàng, không chèn dòng đệm. */
.dispatch-table thead tr{height:16mm}.dispatch-table tbody tr:not(.dispatch-total){height:var(--dispatch-row-height,14mm)}.dispatch-table tbody tr.dispatch-total{height:11mm}.dispatch-table td,.dispatch-table th{vertical-align:middle!important;padding:6px 4px!important}.dispatch-signatures{margin-top:14mm;min-height:25mm}
@media print{
#print-root .dispatch-form{width:100%;box-sizing:border-box}
#print-root .dispatch-table thead tr{height:16mm!important}
#print-root .dispatch-table tbody tr:not(.dispatch-total){height:var(--dispatch-row-height,14mm)!important;break-inside:avoid;page-break-inside:avoid}
#print-root .dispatch-table tbody tr.dispatch-total{height:11mm!important}
#print-root .dispatch-table td,#print-root .dispatch-table th{padding:6px 3px!important;vertical-align:middle!important;line-height:1.25!important}
#print-root .dispatch-signatures{margin-top:14mm!important;min-height:25mm!important}
#print-root .dispatch-original-docs{margin-top:5mm!important;padding-top:4mm!important}
}

.item-note-input{min-width:220px;min-height:90px;font:18px Arial!important;line-height:1.4}#print-root .dispatch-table td:nth-child(8),.dispatch-table td:nth-child(8){white-space:pre-line!important;overflow-wrap:anywhere}

#dispatch-fields select{width:100%;font:20px Arial;padding:9px;border:1px solid #dce1e7;border-radius:5px;background:white;color:#26313e;margin-top:7px}#dispatch-reason[hidden]{display:none!important}

#history-dialog{width:min(850px,92vw);max-height:85vh;overflow:auto;border:1px solid #ccd5df;border-radius:12px;padding:24px}#history-search{width:100%;margin-bottom:12px}.history-entry{padding:16px 0;border-bottom:1px solid #dde3eb}.history-entry p{margin:8px 0}#history-list button{padding:8px 14px}@media print{#history-dialog{display:none!important}}

/* Saved slips occupy the free area of the left sidebar. */
@media(min-width:801px){body>aside{display:flex;flex-direction:column;gap:0;overflow:hidden}body>aside .brand,body>aside>small,body>aside>nav,body>aside .asidefoot{flex-shrink:0}body>aside .asidefoot{position:static;margin-top:14px;line-height:1.6}.sidebar-history{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-top:4px;scrollbar-width:thin;scrollbar-color:#526575 #172432}}
.sidebar-history-entry{display:block;width:100%;text-align:left;border:1px solid #344554;background:#203140;color:#edf3f7;padding:11px 12px;margin:0 0 8px;border-radius:7px}.sidebar-history-entry b{display:block;font-size:16px;line-height:1.4;overflow-wrap:anywhere}.sidebar-history-entry span{display:block;color:#bac9d5;font-size:12px;margin-top:4px}.sidebar-history-entry:hover,.sidebar-history-entry.selected{background:#344c60;border-color:#8ca5ba}.sidebar-history-entry:focus-visible{outline:2px solid white;outline-offset:-3px}.sidebar-history-empty{color:#aebfcd;font-size:12px;margin:8px 0}

#history-save-status{font-size:13px;color:#315b45;margin:14px 0 8px}.actions #save-export{border-color:#467c60;color:#315b45;font-weight:600}

#history-dialog .row{flex-wrap:wrap}#history-dialog .row button{flex:1 1 130px}#history-clear-all{color:#b32638;border-color:#d9a1a9}#history-clear-all:hover{background:#fff0f1}

/* Compact editor only: print and Word keep their existing typography. */
#items{table-layout:fixed;min-width:1120px}#items th:nth-child(1){width:48%}#items th:nth-child(2){width:6%}#items th:nth-child(3){width:5%}#items th:nth-child(4){width:10%}#items th:nth-child(5){width:14%}#items th:nth-child(6){width:14%}#items th:nth-child(7){width:3%}#items td{vertical-align:top;padding:8px 4px}#items td:first-child{min-width:0}#items input,#items select,#items textarea{font-size:14px!important;min-width:0;width:100%;padding:7px!important;min-height:34px}#items .compact-steel-fields{display:grid;grid-template-columns:1.1fr .8fr .7fr 1.6fr;gap:6px}#items .compact-steel-fields label{margin:0;font-size:11px}#items .compact-steel-fields input,#items .compact-steel-fields select{margin-top:4px}#items td:not(:first-child){padding-top:26px}#items .item-note-input{min-width:0;min-height:36px;height:36px;margin:0;resize:vertical;line-height:1.3}#items [data-k="kg"]{margin-top:4px}#items .item-details,#items .weight-details{margin:5px 0 0;font-size:11px}#items .item-details summary,#items .weight-details summary{cursor:pointer;color:#596d80}#items .source-line{display:block;white-space:pre-wrap;overflow-wrap:anywhere}#items .row-warning{display:block;margin-top:4px}#items button[data-del]{padding:7px;min-height:34px;width:100%}.data>.tablewrap{max-height:65vh;overflow:auto}.data>#items{width:100%}#items thead{position:sticky;top:0;z-index:1}#items th{font-size:12px;font-weight:600}#items .other-note[hidden]{display:none!important}

.scale-panel{display:flex;flex-wrap:wrap;align-items:end;gap:8px;padding:12px;margin-top:12px;border:1px solid #d8e3dd;background:#f6faf7;border-radius:7px}.scale-panel label{min-width:240px;flex:1}.scale-panel input{margin-top:5px}.scale-panel p{flex-basis:100%;margin:0;font-size:12px;color:#375a47}

.scale-panel[hidden]{display:none!important}

.dispatch-table th{background:#fff!important;color:#000!important;font-weight:700!important}
