/* Customer orders follow the catalog table and dialog design. */
.ko-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}.ko-toolbar>span{font-size:12px;color:var(--mu)}
#xc-rows.ko-list .ko-table{min-width:940px}#xc-rows.ko-list .ko-table th:first-child,#xc-rows.ko-list .ko-table th:last-child{width:auto}.ko-table col:nth-child(1){width:17%}.ko-table col:nth-child(2){width:26%}.ko-table col:nth-child(3){width:16%}.ko-table col:nth-child(4){width:23%}.ko-table col:nth-child(5){width:18%}
#xc-rows.ko-list .ko-table th,#xc-rows.ko-list .ko-table tbody.xc-catalog-body>tr>td{padding:13px 12px}#xc-rows.ko-list .ko-table tbody.xc-catalog-body>tr>td{font-size:12px;line-height:1.6;vertical-align:middle}.ko-table small{display:block;color:var(--mu);font-size:11px;margin-top:4px}.ko-order-link{font-size:13px;font-weight:500;white-space:nowrap}.ko-ellipsis{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ko-table .b{font-size:11px;line-height:1.5;white-space:normal}.ko-total{font-weight:600;font-variant-numeric:tabular-nums}.ko-table .ko-late{color:var(--rd)}.ko-date-line{display:flex;gap:10px;white-space:nowrap;font-size:12px;line-height:1.8}.ko-date-line>span{color:var(--mu);width:25px;font-size:10px}.ko-no-date{color:#a2afbf}.ko-table .xc-search-row td{padding:8px 12px}
dialog.ko-dialog{width:min(1040px,calc(100% - 32px));padding:0;max-height:calc(100dvh - 32px)}.ko-dialog form{display:flex;flex-direction:column;max-height:calc(100dvh - 34px)}.ko-dialog .xmodalhead{padding:20px 24px;margin:0;border-bottom:1px solid var(--bd);flex:none}.ko-dialog .xmodalhead h2{margin:0}.ko-dialog .xmodalhead p{font-size:12px;margin:6px 0 0}.ko-form-body{padding:20px 24px;overflow:auto}.ko-customer-fields{display:grid;grid-template-columns:2fr 1fr;gap:18px}.ko-form-meta{display:flex;gap:24px;font-size:12px;color:var(--mu);margin:0 0 24px}.ko-form-meta b{font-weight:500;color:var(--tx)}.ko-products-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px}.ko-products-head h3{font-size:14px;margin:0}.ko-products-head .btn{font-size:12px}.ko-item{display:grid;grid-template-columns:minmax(170px,2fr) minmax(70px,.7fr) minmax(75px,.7fr) minmax(75px,.7fr) minmax(100px,1fr) minmax(105px,1fr) 24px;gap:10px;align-items:start;padding:14px;background:var(--sf2);border:1px solid var(--bd);border-radius:8px;margin-bottom:12px}.ko-item .xf{min-width:0;margin:0}.ko-dialog .ko-item .xf>span{font-size:11px;min-height:18px;line-height:1.5;display:block;margin-bottom:7px}.ko-item input,.ko-item select{min-width:0;width:100%;font-size:12px!important;padding-left:9px!important}.ko-item .xremove{margin-top:26px;padding:0;width:24px;height:32px}.ko-line-value>span{font-size:11px;line-height:1.5;color:var(--mu);display:block;margin-bottom:15px}.ko-line-value strong{font-size:12px;font-weight:600;overflow-wrap:anywhere}.ko-form-total{display:flex;justify-content:space-between;gap:20px;padding:10px 0 18px;font-size:13px}.ko-form-total strong{color:var(--pr);text-align:right}.ko-extras{border-top:1px solid var(--bd);margin-top:6px}.ko-extras-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:16px 0}.ko-extras-head h3{font-weight:500;font-size:13px;margin:0}.ko-extras-head small{font-size:11px;color:var(--mu);font-weight:400}.ko-extras>div{padding-top:4px}.ko-dialog [type=file]{font-size:12px;background:var(--sf2)}.ko-dialog .ko-form-foot{margin:0;padding:12px 16px;border-top:1px solid var(--bd);flex:none;display:flex;align-items:center;gap:8px}.ko-form-foot>.uorder-next-note{flex:1;min-width:0;margin-right:auto}.ko-form-body [data-ko-error]{margin:16px 0 0}.ko-dialog button:disabled{opacity:.55}.ko-dialog .xf>small{font-size:11px;color:var(--mu);line-height:1.6;display:block;margin-top:5px}
@media(max-width:900px){.ko-item{grid-template-columns:repeat(3,minmax(0,1fr))}.ko-item .xf:first-child{grid-column:span 2}.ko-item .xremove{grid-column:3;grid-row:1;justify-self:end;margin:24px 0 0}.ko-item .ko-line-value{grid-column:span 2}.ko-line-value>span{margin-bottom:6px}}
@media(max-width:600px){dialog.ko-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px)}.ko-dialog form{max-height:calc(100dvh - 18px)}.ko-dialog .xmodalhead,.ko-form-body{padding:16px}.ko-customer-fields{grid-template-columns:1fr;gap:0}.ko-form-meta{flex-wrap:wrap;gap:8px 18px;margin-bottom:18px}.ko-item{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px}.ko-item .xf:first-child{grid-column:1/-1;padding-right:28px}.ko-item .xremove{grid-column:2;grid-row:1}.ko-item .ko-line-value{grid-column:1/-1}.ko-dialog .ko-form-foot{padding:12px 16px;flex-wrap:wrap}.ko-form-foot>.uorder-next-note{flex-basis:100%;width:100%;max-width:none}.ko-form-foot .btn{font-size:12px;padding:8px 10px}.ko-toolbar{align-items:flex-start}.ko-toolbar>span{max-width:150px;line-height:1.6}}


/* Match order list and create-order spacing across both entry points. */
#xc-rows.ko-list .ko-table th{padding:12px 20px}
#xc-rows.ko-list .ko-table tbody.xc-catalog-body>tr>td{padding:14px 20px}
.ko-list .xempty{padding:16px;min-height:0}
.ko-list .xempty h2{font-size:14px;margin:0 0 6px}
.ko-list .xempty p{font-size:12px;line-height:1.6;margin:0 0 10px}
.ko-dialog .ko-form-foot{padding:12px 16px}
.ko-dialog .xmodalhead,.ko-form-body{padding:16px}
.ko-item{padding:16px;margin-bottom:16px;border-radius:8px}

.ko-add-product{margin:2px 0 14px}.ko-add-product .btn{font-size:12px}
/* The global list adds only customer context and the processing action. */
.ko-global-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:0 0 16px}.ko-global-toolbar>div{display:flex;gap:12px;flex-wrap:wrap}.ko-global-toolbar label{margin:0;display:block}.ko-global-toolbar label>span{display:block;font-size:11px;color:var(--mu);margin-bottom:5px}.ko-global-toolbar select{width:165px;min-height:34px;height:34px;padding:6px 10px;font-size:12px;border:1px solid var(--bd);border-radius:5px;background:#fff;color:var(--tx)}.ko-global-toolbar>a{font-size:12px;min-height:34px;padding:7px 10px}
.ko-table.ko-global-table col:nth-child(1){width:14%}.ko-table.ko-global-table col:nth-child(2){width:18%}.ko-table.ko-global-table col:nth-child(3){width:18%}.ko-table.ko-global-table col:nth-child(4){width:13%}.ko-table.ko-global-table col:nth-child(5){width:17%}.ko-table.ko-global-table col:nth-child(6){width:12%}.ko-table.ko-global-table col:nth-child(7){width:8%}
.ko-global-table th{white-space:nowrap}.ko-global-table .xc-column-search input{width:100%;min-width:0}.ko-global-table .xc-status-filter{width:100%;min-width:0}.ko-global-table .ko-date-line{gap:5px;font-size:11px}.ko-global-table .ko-date-line>span{width:24px;flex:none}.ko-global-table .ko-customer-cell>a{font-size:12px;font-weight:500;overflow-wrap:anywhere}.ko-global-table .ko-customer-cell small{font-size:10px}.ko-global-table .ko-action-cell{padding:12px 8px!important;text-align:right}.ko-action-cell .btn{font-size:11px;min-height:32px;padding:6px 8px;white-space:nowrap}.ko-create-trigger:disabled{opacity:.55;cursor:not-allowed}.ko-dialog select[name=customerId]{width:100%;min-height:36px}
@media(max-width:700px){.ko-global-toolbar{align-items:flex-start;flex-wrap:wrap}.ko-global-toolbar>div{width:100%;gap:10px}.ko-global-toolbar label{flex:1;min-width:135px}.ko-global-toolbar select{width:100%}}

:root[data-theme="dark"] .ko-global-table .xc-status-filter{
 background-color:var(--sf);color:var(--tx);border-color:var(--bd);
 height:34px;line-height:20px;border-radius:5px;
}


/* Keep the global order and follow-up lists aligned. */
#xc-rows.xc-shared-list .xc-catalog-table{min-width:1040px}
#xc-rows.xc-shared-list .xc-catalog-table th,
#xc-rows.xc-shared-list .xc-catalog-table tbody.xc-catalog-body>tr>td{padding:12px;font-size:12px;line-height:1.6;vertical-align:middle}
#xc-rows.xc-shared-list .xc-search-row td{padding:8px 12px}
/* Bảng đơn hàng có thêm cột Kế toán (người có quyền xác nhận kế toán) */
.ko-table.ko-global-table.ko-acc col:nth-child(1){width:13%}.ko-table.ko-global-table.ko-acc col:nth-child(2){width:15%}.ko-table.ko-global-table.ko-acc col:nth-child(3){width:14%}.ko-table.ko-global-table.ko-acc col:nth-child(4){width:11%}.ko-table.ko-global-table.ko-acc col:nth-child(5){width:14%}.ko-table.ko-global-table.ko-acc col:nth-child(6){width:10%}.ko-table.ko-global-table.ko-acc col:nth-child(7){width:14%}.ko-table.ko-global-table.ko-acc col:nth-child(8){width:9%}
