:root{--navy:#08335c;--blue:#0a67b2;--pale:#edf5fb;--line:#dbe5ed;--text:#182838;--muted:#687887;--red:#d63b3b;--yellow:#e5a514;--green:#198754;--side:250px}
*{box-sizing:border-box}
body{margin:0;background:#f4f7fa;color:var(--text);font:14px system-ui,-apple-system,Segoe UI,sans-serif}
aside{position:fixed;inset:0 auto 0 0;width:var(--side);background:var(--navy);color:white;z-index:4;display:flex;flex-direction:column}
.brand{padding:22px 20px;border-bottom:1px solid #ffffff1f}
.brand b{font-size:19px;letter-spacing:1.5px}
.brand small{display:block;color:#bcd4e8;margin-top:5px;font-size:10px}
nav{padding:6px 8px 20px;overflow:auto;flex:1;scrollbar-width:thin}
nav::-webkit-scrollbar{width:6px}nav::-webkit-scrollbar-thumb{background:#ffffff33;border-radius:6px}
.navGroup{color:#83a9c8;font-size:10px;font-weight:700;letter-spacing:1px;padding:14px 10px 6px;text-transform:uppercase}
.navItem{display:flex;gap:10px;align-items:center;padding:9px 10px;border-radius:7px;color:#cce0ef;cursor:pointer;margin:1px 0;font-size:13px}
.navItem:hover,.navItem.active{background:#ffffff19;color:white}
.navItem span:first-child{width:20px;text-align:center}
.asideFoot{padding:12px 20px;color:#93bad6;font-size:10px;border-top:1px solid #ffffff1f}
/* v6f: menu phân hệ thu gọn */
.moduleGroup{margin:2px 0}
.moduleHead{width:100%;display:flex;align-items:center;justify-content:space-between;padding:10px 11px;border-radius:7px;background:transparent;color:#cce0ef;font-size:12px;font-weight:750;letter-spacing:.35px;text-align:left}
.moduleHead:hover,.moduleGroup.open>.moduleHead{background:#ffffff17;color:#fff}
.moduleHead b{font-size:17px;line-height:1;color:#83a9c8;font-weight:500}
.moduleItems{display:none;padding:3px 0 5px 8px;border-left:1px solid #ffffff1f;margin-left:12px}
.moduleGroup.open>.moduleItems{display:block}
.moduleItems .navItem{font-size:12px;padding:8px 9px;margin:1px 0}
.moduleItems .navItem span:first-child{width:18px;flex:0 0 18px}

body>header{position:fixed;top:0;left:var(--side);right:0;height:64px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 22px;z-index:3;justify-content:space-between}
body>header b{font-size:17px}
body>header small{display:block;color:var(--muted);margin-top:2px;font-size:11px}
.headActions{display:flex;gap:10px;align-items:center}
.avatar{background:var(--navy);color:#fff;border-radius:50%;width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
button{border:0;border-radius:7px;padding:8px 12px;cursor:pointer;background:var(--blue);color:white;font-weight:600;font-size:13px}
button.ghost{background:white;color:var(--navy);border:1px solid var(--line)}
.commerce-head .v9-actions button.v7-action,.commerce-head .tp-plan-tabs button.v7-action{background:#2563eb;color:#fff;border:1px solid #2563eb;box-shadow:0 2px 7px #1d4ed640}
button.warn{background:var(--yellow)}
button.danger{background:var(--red)}
button.small{font-size:12px;padding:5px 8px}
#hamb{display:none;background:none;color:var(--navy);font-size:24px;padding:8px 12px;min-width:48px;min-height:48px;touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:transparent}
#menuBackdrop{display:none;position:fixed;inset:0;background:#001b3370;border:0;border-radius:0;padding:0;z-index:3}
main{margin-left:var(--side);padding:86px 22px 40px}
.hero{background:linear-gradient(115deg,#08335c,#0b6bb6);border-radius:12px;color:#fff;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.hero h1{font-size:20px;margin:0 0 6px}
.hero p{margin:0;color:#d7e8f6;font-size:13px}
.grid{display:grid;gap:14px}
.stats{grid-template-columns:repeat(4,1fr);margin:14px 0}
.card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px;box-shadow:0 2px 6px #17324d08}
.stat small,.muted{color:var(--muted)}
.stat strong{display:block;font-size:24px;margin:6px 0}
.stat .delta{font-size:12px}
.stat .delta.red{color:var(--red)}.stat .delta.green{color:var(--green)}.stat .delta.yellow{color:var(--yellow)}
.two{grid-template-columns:1.4fr 1fr}
.three{grid-template-columns:repeat(3,1fr)}
.sectionTitle{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:10px;flex-wrap:wrap}
.sectionTitle h2{margin:0;font-size:15px}
.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;align-items:center}
input,select,textarea{border:1px solid var(--line);border-radius:7px;background:white;padding:8px 10px;color:var(--text);font-size:13px;font-family:inherit}
.toolbar input{min-width:220px}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:#66798a;font-size:10.5px;text-transform:uppercase;background:#f7fafc;letter-spacing:.5px}
th,td{padding:10px;border-bottom:1px solid #e7edf2;vertical-align:middle}
tr:hover td{background:#fafcfe}
.tableWrap{overflow:auto}
.tag{display:inline-block;border-radius:20px;padding:3px 9px;font-size:11px;font-weight:700;background:#e8f1f7;color:var(--navy)}
.tag.green{background:#e3f5eb;color:#137446}
.tag.red{background:#ffe5e5;color:#aa2020}
.tag.yellow{background:#fff1c9;color:#8e6500}
.tag.gray{background:#edf0f2;color:#60707d}
.tag.blue{background:#e0eefb;color:#0a5590}
.priority-red{border-left:4px solid var(--red)}
.priority-yellow{border-left:4px solid var(--yellow)}
.priority-white{border-left:4px solid #cbd5df}
.progress{height:7px;background:#e7edf2;border-radius:9px;overflow:hidden}
.progress i{display:block;height:100%;background:var(--blue)}
.alertRow{padding:11px;border-left:4px solid var(--yellow);background:#fffaf0;margin-bottom:8px;border-radius:5px}
.alertRow.red{border-color:var(--red);background:#fff3f3}
.alertRow b{display:block;margin-bottom:3px}
.formGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.field label{display:block;font-size:12px;font-weight:700;margin-bottom:5px;color:#495969}
.field input,.field select,.field textarea{width:100%}
.field.full{grid-column:1/-1}
.modal{display:none;position:fixed;inset:0;background:#001b3388;z-index:9;align-items:center;justify-content:center;padding:16px}
.modal.show{display:flex}
.modalBox{background:#fff;width:min(760px,100%);border-radius:12px;padding:22px;max-height:92vh;overflow:auto;position:relative}
.modalBox h2{margin-top:0}
.modalX{position:absolute;right:8px;top:6px;background:none;color:#555;font-size:26px;padding:4px 10px}
#toast{position:fixed;right:20px;bottom:20px;background:#173b5d;color:white;padding:12px 18px;border-radius:8px;transform:translateY(120px);opacity:0;transition:.25s;z-index:20;max-width:340px}
#toast.show{transform:none;opacity:1}
.process{display:flex;gap:4px;min-width:280px}
.process span{height:8px;flex:1;border-radius:5px;background:#dce5eb}
.process span.done{background:var(--green)}
.process span.current{background:var(--yellow)}
.workerPanel{max-width:760px;margin:auto}
.workerPanel .job{border:2px solid var(--blue);border-radius:12px;padding:16px;margin-bottom:14px;background:white}
.bigInput{font-size:18px;padding:12px!important}
.resultButtons{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.resultButtons button{padding:12px}
.empty{text-align:center;padding:35px;color:var(--muted)}
.kpiBars .bar{display:grid;grid-template-columns:150px 1fr 45px;gap:9px;align-items:center;margin:12px 0}
.bar div{height:12px;background:#e7edf2;border-radius:9px;overflow:hidden}
.bar i{height:100%;background:var(--blue);display:block}
.bar i.red{background:var(--red)}.bar i.green{background:var(--green)}.bar i.yellow{background:var(--yellow)}
.note{padding:11px 14px;background:#eef7ff;border:1px solid #cee4f5;border-radius:8px;color:#315571;margin-bottom:14px;font-size:13px}
.flow{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
.flow .step{padding:5px 11px;background:#eef4fa;border-radius:20px;font-size:12px;color:#3c556e;border:1px solid #dbe6f0}
.flow .step.done{background:#e3f5eb;color:#137446;border-color:#b6e2c8}
.flow .step.current{background:#fff1c9;color:#8e6500;border-color:#f1d986}
.flow .arrow{color:#8ba9c4;align-self:center}
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:14px;flex-wrap:wrap}
.tab{padding:9px 14px;cursor:pointer;color:var(--muted);font-weight:600;border-bottom:2px solid transparent;font-size:13px}
.tab.active{color:var(--navy);border-bottom-color:var(--blue)}
.pill{display:inline-block;padding:3px 8px;border-radius:5px;font-size:11px;font-weight:700;background:#eef4fa;color:#3c556e;margin-right:4px}
.pill.red{background:#ffe5e5;color:#aa2020}
.pill.green{background:#e3f5eb;color:#137446}
.linkBtn{background:none;color:var(--blue);padding:0;font-weight:600;text-decoration:underline}
.grid.two.narrow{grid-template-columns:1fr 1fr}
.moneyRed{color:var(--red);font-weight:700}
.moneyGreen{color:var(--green);font-weight:700}
@media(max-width:1000px){.stats{grid-template-columns:repeat(2,1fr)}.two,.three{grid-template-columns:1fr}.grid.two.narrow{grid-template-columns:1fr}}
@media(max-width:760px){:root{--side:260px}body>aside{transform:translateX(-100%);transition:transform .25s cubic-bezier(0.4,0,0.2,1);z-index:10005}body.menuOpen>aside{transform:translateX(0)!important}body.menuOpen>#menuBackdrop{display:block;z-index:10004}body>header{left:0;padding:0 8px;z-index:1000}#hamb{display:inline-flex;align-items:center;justify-content:center;min-width:48px;min-height:48px;font-size:26px;border:none;outline:none;position:relative;z-index:1001}body>header>div:nth-child(2){flex:1;margin-left:8px}.headActions .ghost{display:none}main{margin-left:0;padding:78px 12px 30px}.stats{grid-template-columns:1fr 1fr}.formGrid{grid-template-columns:1fr}.field.full{grid-column:auto}th,td{white-space:nowrap}.workerPanel .job{padding:12px}}
@media(max-width:430px){.stats{grid-template-columns:1fr}.resultButtons{grid-template-columns:1fr}.hero button{display:none}}

/* v52: Chỉ định khách hàng rộng hơn nhưng luôn là một dòng. */
.customerInstructionWide{grid-column:1/-1;min-width:0}
.customerInstructionWide input{width:100%;white-space:nowrap;overflow-x:auto;text-overflow:clip}

/* v53: mỗi nhãn và ô nhập là một khối nguyên vẹn; không tách qua hai hàng. */
.stageFieldGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:start}
.stageFieldGrid>label{display:flex;flex-direction:column;gap:6px;min-width:0;font-weight:700;color:#334155;break-inside:avoid}
.stageFieldGrid>label>span{display:block;min-height:18px}
.stageFieldGrid>label input,.stageFieldGrid>label select,.stageFieldGrid>label textarea{display:block;width:100%;min-width:0;box-sizing:border-box}
.stageFieldGrid .customerInstructionWide,.stageFieldAlert{grid-column:1/-1}
.stageFieldGrid .dieQuantityNewRow{grid-column:1}
@media(max-width:1100px){.stageFieldGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.stageFieldGrid .dieQuantityNewRow{grid-column:1}}
@media(max-width:680px){.stageFieldGrid{grid-template-columns:1fr}.stageFieldGrid .dieQuantityNewRow{grid-column:1}}

/* v54: Khổ giấy nguồn gồm hai chiều riêng để phục vụ tính cuộn màng. */
.paperDimensionInputs{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;min-height:38px}
.paperDimensionInputs>b{text-align:center;font-size:18px;color:#475569}
.paperDimensionInputs>input{width:100%;min-width:0}

/* v55: các trường số ngắn gọn tại Ghép file/Bình bản. */
.stageFieldGrid .compactPrepressField{max-width:170px}
.stageFieldGrid .compactPrepressField input{max-width:170px}

/* v69-49: t\u1ed5 B\u1ebf th\u00eam M\u00e3 khu\u00f4n nh\u01b0ng v\u1eabn g\u1ecdn trong 2 h\u00e0ng. */
.stageFieldGrid.dieFieldGrid{grid-template-columns:minmax(190px,1.5fr) minmax(120px,1fr) minmax(70px,.55fr) minmax(120px,1fr) minmax(130px,1.05fr)}
.dieFieldGrid .dieQuantityNewRow{grid-column:1}
.stageFieldGrid .compactDieField input{max-width:120px}
@media(max-width:1100px){.stageFieldGrid.dieFieldGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.stageFieldGrid .compactDieField input{max-width:none}}
@media(max-width:680px){.stageFieldGrid.dieFieldGrid{grid-template-columns:1fr}}
.linkedSourceAlert[hidden]{display:none!important}
@media(max-width:680px){.stageFieldGrid .compactPrepressField,.stageFieldGrid .compactPrepressField input{max-width:none}}

/* v56: Ghép file/Bình bản có 5 khối trên hàng đầu, các trường số sát và ngắn. */
.stageFieldGrid.prepressFieldGrid{grid-template-columns:minmax(240px,1.8fr) minmax(64px,.48fr) minmax(64px,.48fr) minmax(110px,.82fr) minmax(120px,.9fr) minmax(120px,.9fr);column-gap:10px}
.prepressFieldGrid .paperSizeSource{grid-column:1}
.prepressFieldGrid .compactPrepressField{max-width:none}
.prepressFieldGrid .compactPrepressField input{max-width:none}
.prepressFieldGrid .customerInstructionWide{grid-column:1/-1;grid-row:2}
@media(max-width:900px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.prepressFieldGrid .paperSizeSource,.prepressFieldGrid .customerInstructionWide{grid-column:1/-1}.prepressFieldGrid .customerInstructionWide{grid-row:auto}}
@media(max-width:520px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:1fr}.prepressFieldGrid .paperSizeSource,.prepressFieldGrid .customerInstructionWide{grid-column:1}}


/* v58: KCS in ba trường cân đối cùng hàng. */
.stageFieldGrid.kcsPrintFieldGrid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:760px){.stageFieldGrid.kcsPrintFieldGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.stageFieldGrid.kcsPrintFieldGrid{grid-template-columns:1fr}}

/* v58: nút Trở về chung trước tiêu đề mọi trang. */
.headerTitleArea{display:flex;align-items:center;gap:10px;min-width:0}
.globalBack{display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--navy);font-size:24px;line-height:1}
.globalBack:hover{background:var(--pale)}
@media(max-width:760px){header>.headerTitleArea{flex:1;margin-left:8px}.headerTitleArea{gap:7px}.globalBack{flex-basis:34px;width:34px;height:34px}#pageTitle{display:block;max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}


/* v59: sáu ô chỉ định ghép riêng cho Lệnh CT hộp cứng. */
.ctMergeEditor{margin:14px 0;border:2px solid #0f4775;border-radius:10px;padding:12px;background:#f8fbff}
.ctMergeEditor h3{margin:0 0 10px;color:#08335c}
.ctMergeInputGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.ctMergeInputGrid label{display:flex;flex-direction:column;gap:5px;font-weight:700;min-width:0}
.ctMergeInputGrid input{width:100%;min-width:0}
@media(max-width:760px){.ctMergeInputGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.ctMergeInputGrid{grid-template-columns:1fr}}
/* v69-18: Ghép file/Bình bản — Loại màu gọn, hai trường kích thước rõ nguồn liên kết. */
.prepressFieldGrid label:has(> span:first-child:nth-last-child(2)){min-width:0}
.prepressFieldGrid .compactPrepressField input{min-width:0}
@media(min-width:1101px){.prepressFieldGrid .compactPrepressField{max-width:120px}.prepressFieldGrid label:has(input[data-f="Ghép file|3"]){max-width:140px}}


/* v69-115: Ghép file/Bình bản thêm Loại giấy liên kết trên cùng hàng. */
@media(min-width:1101px){
 .stageFieldGrid.prepressFieldGrid{grid-template-columns:96px 72px 72px 144px repeat(3,minmax(112px,1fr));column-gap:12px}
 .prepressFieldGrid .paperSizeSource{width:96px}
 .prepressFieldGrid .paperDimensionInputs{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr);gap:3px}
 .prepressFieldGrid .prepressColorField{width:144px;max-width:144px}
 .prepressFieldGrid .prepressPaperField,.prepressFieldGrid .prepressProductSizeField{max-width:none}
}

/* v69-149: thời gian xử lý trong Kế hoạch đã hoàn thành */
.tp-completed-time{min-width:112px;white-space:normal;font-size:13px}
.tp-completed-clock,.tp-completed-date{display:block;line-height:1.35;white-space:nowrap}
.tp-completed-clock{font-weight:800;color:#172033}
.tp-completed-date{margin-top:2px;color:#64748b;font-size:12px}
.tp-completed-duration{min-width:145px;white-space:nowrap;color:#0f766e}
.tp-completed-time-grid{display:grid;grid-template-columns:repeat(3,minmax(170px,1fr));gap:10px;margin-top:12px;padding:10px;border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff}
.tp-completed-time-grid>div{display:flex;flex-direction:column;gap:4px}
.tp-completed-time-grid small{color:#475569;font-weight:700}
.tp-completed-time-grid .tp-completed-clock,.tp-completed-time-grid .tp-completed-date{display:block}
@media(max-width:760px){.tp-completed-time-grid{grid-template-columns:1fr}.tp-completed-time,.tp-completed-duration{white-space:normal}}

/* v69-150: lựa chọn theo từng LSX hoàn thành trong Ghép file/Bình bản */
.tp-completed-pick-cell{width:54px;min-width:54px;text-align:center;vertical-align:middle}
.tp-completed-pick-cell .completedPick{width:18px;height:18px;cursor:pointer}

/* v69-151: lý do sửa khi mở lại biểu mẫu gốc của kế hoạch đã hoàn thành */
.tp-completed-revision-reason{display:block;margin-top:14px;padding:12px;border:1px solid #f59e0b;border-radius:10px;background:#fffbeb}
.tp-completed-revision-reason textarea{width:100%;min-height:84px;margin-top:6px}

/* v69-153: tiến độ toàn tuyến ngay trong kết quả tìm LSX/khách hàng */
.tp-workshop-search-row{display:block;width:100%;text-align:left;padding:12px 14px;margin:8px 0;border:1px solid #dbe4ee;border-radius:12px;background:#fff;color:#172033}
.tp-search-result-head{display:grid;grid-template-columns:minmax(190px,.8fr) minmax(260px,1.4fr) minmax(150px,.7fr);gap:12px;align-items:center}
.tp-search-result-head>em{text-align:right;color:#b45309;font-style:normal;font-weight:800}
.tp-search-progress{margin-top:10px;padding-top:10px;border-top:1px solid #e2e8f0}
.tp-search-progress-summary{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center;font-size:13px}
.tp-search-progress-summary>em{margin-left:auto;padding:2px 8px;border-radius:999px;background:#e0f2fe;color:#075985;font-style:normal;font-weight:900}
.tp-search-progress-bar{height:9px;margin:8px 0 10px;border-radius:999px;background:#e5e7eb;overflow:hidden}
.tp-search-progress-bar>i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#16a34a,#22c55e)}
.tp-search-route{display:flex;align-items:center;gap:5px;overflow-x:auto;padding-bottom:3px;scrollbar-width:thin}
.tp-search-route>span{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#e5e7eb;color:#475569;font-size:12px;font-weight:750;white-space:nowrap}
.tp-search-route>span.done{background:#dcfce7;color:#166534}
.tp-search-route>span.current{background:#ffedd5;color:#9a3412;box-shadow:inset 0 0 0 1px #fb923c}
.tp-search-route>i{color:#94a3b8;font-style:normal}
@media(max-width:760px){.tp-search-result-head{grid-template-columns:1fr}.tp-search-result-head>em{text-align:left}.tp-search-progress-summary>em{margin-left:0}}

/* v69-154: bảng kết quả tìm kiếm 8 cột thẳng hàng, không chồng nội dung */
.tp-workshop-search-results{overflow:hidden}
.tp-search-table-head,.tp-search-result-grid{display:grid;grid-template-columns:minmax(145px,1.15fr) minmax(125px,1fr) minmax(180px,1.45fr) minmax(105px,.85fr) minmax(92px,.72fr) minmax(135px,1.05fr) minmax(70px,.55fr) minmax(105px,.82fr);column-gap:12px;align-items:stretch;width:100%;min-width:1050px}
.tp-search-table-head{padding:9px 12px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:9px;color:#0f4775;font-size:12px}
.tp-search-table-head>b{min-width:0;overflow-wrap:anywhere}
.tp-workshop-search-row{box-sizing:border-box;margin:8px 0;padding:0;overflow:hidden}
.tp-search-result-grid{box-sizing:border-box;padding:12px;text-align:left}
.tp-search-cell{display:flex;min-width:0;flex-direction:column;gap:4px;padding-right:8px;border-right:1px solid #e2e8f0}
.tp-search-cell:last-child{padding-right:0;border-right:0}
.tp-search-cell>small{display:none;color:#64748b;font-size:11px;font-weight:750}
.tp-search-cell>strong{display:block;min-width:0;overflow-wrap:anywhere;word-break:normal;line-height:1.35;color:#172033;font-size:13px}
.tp-search-cell.current>strong{color:#b45309}
.tp-search-cell.percent>strong{color:#0369a1}
.tp-search-progress{margin:0;padding:0 12px 12px;border-top:0;text-align:left}
.tp-search-progress-bar{width:100%;margin:0 0 10px}
.tp-search-route{width:100%;max-width:100%}
@media(max-width:1180px){.tp-workshop-search-results{overflow-x:auto}.tp-search-table-head,.tp-search-result-grid{min-width:1050px}}
@media(max-width:760px){.tp-workshop-search-results{overflow:visible}.tp-search-table-head{display:none}.tp-search-result-grid{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0;row-gap:10px}.tp-search-cell{padding:0 8px 8px 0;border-right:0;border-bottom:1px solid #e2e8f0}.tp-search-cell>small{display:block}.tp-search-cell.product,.tp-search-cell.current{grid-column:1/-1}.tp-search-progress{padding:0 12px 12px}}
@media(max-width:480px){.tp-search-result-grid{grid-template-columns:1fr}.tp-search-cell.product,.tp-search-cell.current{grid-column:auto}}

/* v69-155: tuyến công đoạn gọn ở chân dòng; khóa đúng hai cột số cuối */
.tp-search-table-head,.tp-search-result-grid{grid-template-columns:minmax(145px,1.15fr) minmax(125px,1fr) minmax(180px,1.45fr) minmax(105px,.85fr) minmax(92px,.72fr) minmax(135px,1.05fr) 82px 116px}
.tp-search-table-head>b:nth-child(7),.tp-search-table-head>b:nth-child(8){display:flex;align-items:center;justify-content:center;text-align:center}
.tp-search-cell.remaining,.tp-search-cell.percent{align-items:center;justify-content:flex-start;text-align:center;padding-left:4px;padding-right:4px}
.tp-search-cell.remaining>strong,.tp-search-cell.percent>strong{width:100%;text-align:center;font-size:14px;font-variant-numeric:tabular-nums}
.tp-search-progress{clear:both;display:block;width:auto;margin:0;padding:0 12px 7px;border-top:0}
.tp-search-progress-bar{height:4px;margin:0 0 4px}
.tp-search-route{display:flex;width:100%;max-width:100%;height:19px;min-height:19px;align-items:center;gap:2px;overflow-x:auto;overflow-y:hidden;padding:0 0 1px;white-space:nowrap;scrollbar-width:thin}
.tp-search-route>span{flex:0 0 auto;max-width:145px;padding:1px 5px;border-radius:6px;font-size:9px;font-weight:700;line-height:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-search-route>i{flex:0 0 auto;font-size:9px;line-height:14px}
@media(max-width:760px){.tp-search-table-head,.tp-search-result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tp-search-cell.remaining,.tp-search-cell.percent{align-items:flex-start;text-align:left}.tp-search-cell.remaining>strong,.tp-search-cell.percent>strong{text-align:left}.tp-search-route{height:18px;min-height:18px}.tp-search-route>span{font-size:8px;line-height:13px;padding:1px 4px}}
@media(max-width:480px){.tp-search-result-grid{grid-template-columns:1fr}}

/* v69-156: tách cấu trúc hàng dữ liệu và chân tuyến; dùng chung một lưới tuyệt đối */
.tp-workshop-search-results{--tp-search-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1.45fr) minmax(0,.85fr) minmax(0,.72fr) minmax(0,1.05fr) minmax(64px,.55fr) minmax(92px,.82fr);overflow:visible}
.tp-search-table-head,.tp-search-result-grid{box-sizing:border-box;display:grid;grid-template-columns:var(--tp-search-columns);column-gap:0;width:100%;min-width:0;padding-left:0;padding-right:0}
.tp-search-table-head{padding:0;border:1px solid #bfdbfe;overflow:hidden}
.tp-search-table-head>b{box-sizing:border-box;padding:9px 8px;border-right:1px solid #dbeafe;text-align:left}
.tp-search-table-head>b:nth-child(7),.tp-search-table-head>b:nth-child(8){display:block;text-align:center}
.tp-workshop-search-record{box-sizing:border-box;width:100%;margin:8px 0;border:1px solid #dbe4ee;border-radius:12px;background:#fff;overflow:hidden}
.tp-workshop-search-row{display:block;box-sizing:border-box;width:100%;height:auto;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:#fff;overflow:visible;text-align:left;color:#172033}
.tp-search-result-grid{padding:0;align-items:stretch}
.tp-search-cell{box-sizing:border-box;min-width:0;min-height:48px;padding:9px 8px;border-right:1px solid #e2e8f0;border-bottom:0;overflow:hidden}
.tp-search-cell:last-child{border-right:0}
.tp-search-cell>strong{max-height:38px;overflow:hidden;line-height:19px}
.tp-search-cell.remaining,.tp-search-cell.percent{display:flex;align-items:center;justify-content:center;padding:9px 4px;text-align:center}
.tp-search-cell.remaining>strong,.tp-search-cell.percent>strong{display:block;width:100%;text-align:center}
.tp-search-footer{position:static;display:block;box-sizing:border-box;width:100%;height:18px;margin:0;padding:2px 8px 3px;border-top:1px solid #edf2f7;background:#fafcff;overflow:hidden;text-align:left}
.tp-search-footer .tp-search-progress-bar{display:none}
.tp-search-footer .tp-search-route{position:static;display:flex;width:100%;height:12px;min-height:12px;margin:0;padding:0;align-items:center;gap:2px;overflow-x:auto;overflow-y:hidden;white-space:nowrap}
.tp-search-footer .tp-search-route>span{position:static;flex:0 0 auto;max-width:110px;height:11px;box-sizing:border-box;padding:0 3px;border-radius:3px;font-size:7px;font-weight:650;line-height:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-search-footer .tp-search-route>i{flex:0 0 auto;font-size:7px;line-height:10px}
@media(max-width:1180px){.tp-workshop-search-results{overflow:visible}.tp-search-table-head,.tp-search-result-grid{min-width:0}}
@media(max-width:760px){.tp-workshop-search-results{--tp-search-columns:repeat(2,minmax(0,1fr))}.tp-search-table-head{display:none}.tp-search-cell{min-height:0}.tp-search-cell.product,.tp-search-cell.current{grid-column:1/-1}.tp-search-cell.remaining,.tp-search-cell.percent{align-items:flex-start;justify-content:flex-start;text-align:left}.tp-search-cell.remaining>strong,.tp-search-cell.percent>strong{text-align:left}.tp-search-footer{height:17px;padding:2px 6px}.tp-search-footer .tp-search-route{height:11px;min-height:11px}}
@media(max-width:480px){.tp-workshop-search-results{--tp-search-columns:1fr}.tp-search-cell.product,.tp-search-cell.current{grid-column:auto}}

/* v69-157: bảng HTML thật — tiêu đề và dữ liệu dùng chung colgroup */
.tp-workshop-search-results{overflow:hidden}
.tp-search-table-scroll{width:100%;overflow-x:auto;border:1px solid #bfdbfe;border-radius:9px}
.tp-search-table{width:100%;min-width:930px;border-collapse:collapse;table-layout:fixed;background:#fff;color:#172033}
.tp-search-table col.lsx{width:15%}.tp-search-table col.customer{width:13%}.tp-search-table col.product{width:18%}.tp-search-table col.progress{width:11%}.tp-search-table col.done{width:10%}.tp-search-table col.current{width:14%}.tp-search-table col.remaining{width:8%}.tp-search-table col.percent{width:11%}
.tp-search-table th{box-sizing:border-box;padding:8px 7px;border-right:1px solid #dbeafe;border-bottom:1px solid #bfdbfe;background:#eff6ff;color:#0f4775;font-size:11px;line-height:15px;text-align:left;vertical-align:middle;white-space:normal}
.tp-search-table th:nth-child(7),.tp-search-table th:nth-child(8){text-align:center}
.tp-search-table th:last-child{border-right:0}
.tp-search-table .tp-workshop-search-row{display:table-row;width:auto;height:auto;margin:0;padding:0;border:0;border-radius:0;background:#fff;overflow:visible;cursor:pointer}
.tp-search-table .tp-workshop-search-row:hover td{background:#f8fbff}
.tp-search-table .tp-workshop-search-row:focus{outline:none}
.tp-search-table .tp-workshop-search-row:focus td{box-shadow:inset 0 0 0 2px #60a5fa}
.tp-search-table .tp-search-cell{display:table-cell;box-sizing:border-box;min-width:0;height:42px;min-height:0;padding:7px;border-right:1px solid #e2e8f0;border-bottom:0;overflow:hidden;text-align:left;vertical-align:middle}
.tp-search-table .tp-search-cell:last-child{border-right:0}
.tp-search-table .tp-search-cell>strong{display:block;width:auto;max-height:32px;overflow:hidden;color:#172033;font-size:11px;line-height:16px;overflow-wrap:anywhere;word-break:normal;text-align:left}
.tp-search-table .tp-search-cell.current>strong{color:#b45309}
.tp-search-table .tp-search-cell.percent>strong{color:#0369a1}
.tp-search-table .tp-search-cell.remaining,.tp-search-table .tp-search-cell.percent{display:table-cell;padding:7px;text-align:center;vertical-align:middle}
.tp-search-table .tp-search-cell.remaining>strong,.tp-search-table .tp-search-cell.percent>strong{width:100%;text-align:center;font-size:12px;font-variant-numeric:tabular-nums}
.tp-search-route-row>td{height:15px;padding:0 6px 2px;border-bottom:1px solid #dbe4ee;background:#fafcff;vertical-align:top}
.tp-search-table tbody .tp-search-route-row:last-child>td{border-bottom:0}
.tp-search-table .tp-search-footer{display:block;box-sizing:border-box;width:100%;height:13px;margin:0;padding:1px 0 0;border:0;background:transparent;overflow:hidden}
.tp-search-table .tp-search-footer .tp-search-progress-bar{display:none}
.tp-search-table .tp-search-footer .tp-search-route{display:flex;width:100%;height:11px;min-height:11px;margin:0;padding:0;align-items:center;gap:2px;overflow-x:auto;overflow-y:hidden;white-space:nowrap}
.tp-search-table .tp-search-footer .tp-search-route>span{flex:0 0 auto;max-width:105px;height:10px;box-sizing:border-box;padding:0 3px;border-radius:3px;font-size:7px;font-weight:650;line-height:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-search-table .tp-search-footer .tp-search-route>i{flex:0 0 auto;font-size:7px;line-height:9px}
@media(max-width:760px){.tp-workshop-search-results{overflow:hidden}.tp-search-table-scroll{overflow-x:auto}.tp-search-table{min-width:930px}.tp-search-table .tp-search-cell.product,.tp-search-table .tp-search-cell.current{display:table-cell}.tp-search-table .tp-search-cell.remaining,.tp-search-table .tp-search-cell.percent{display:table-cell;text-align:center}.tp-search-table .tp-search-cell.remaining>strong,.tp-search-table .tp-search-cell.percent>strong{text-align:center}}

/* v69-157 visual correction: fit trọn bảng trong vùng nội dung 930px */
.tp-search-table{width:100%;min-width:880px}
.tp-search-table col.lsx{width:15%}.tp-search-table col.customer{width:13%}.tp-search-table col.product{width:18%}.tp-search-table col.progress{width:11%}.tp-search-table col.done{width:10%}.tp-search-table col.current{width:14%}.tp-search-table col.remaining{width:7%}.tp-search-table col.percent{width:12%}
.tp-search-table th:last-child,.tp-search-table .tp-search-cell:last-child{padding-left:5px;padding-right:5px}
@media(max-width:760px){.tp-search-table{min-width:880px}}
/* v69-158: three independent production-stage tabs; prep-stage views remain unchanged. */
.tp-stage-tabs-three{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.tp-workshop-completed-table{overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:8px}
.tp-workshop-completed-table .v7-table{width:max-content;min-width:100%;table-layout:auto}
.tp-workshop-completed-table th,.tp-workshop-completed-table td{vertical-align:top;white-space:nowrap;line-height:1.35;padding:12px 14px}
.tp-workshop-completed-table thead th{position:sticky;top:0;z-index:2;background:#f8fafc}
.tp-workshop-completed-table .tp-completed-pick{min-width:72px;text-align:center}
.tp-workshop-completed-table .tp-completed-lsx{min-width:150px}
.tp-workshop-completed-table .tp-completed-customer{min-width:170px;max-width:240px;white-space:normal}
.tp-workshop-completed-table .tp-completed-product{min-width:180px;max-width:280px;white-space:normal}
.tp-workshop-completed-table .tp-completed-field{min-width:125px}
.tp-workshop-completed-table .tp-completed-field-printOperator,
.tp-workshop-completed-table .tp-completed-field-operatorName{min-width:165px}
.tp-workshop-completed-table .tp-completed-field-note{min-width:230px;max-width:330px;white-space:normal}
.tp-workshop-completed-table .tp-completed-time{min-width:145px;white-space:nowrap}
.tp-workshop-completed-table .tp-completed-clock,
.tp-workshop-completed-table .tp-completed-date{display:block;white-space:nowrap}
.tp-workshop-completed-table .tp-completed-clock{font-weight:700}
.tp-workshop-completed-table .tp-completed-date{margin-top:3px;color:#64748b;font-size:12px}
.tp-workshop-completed-table .tp-completed-duration{min-width:130px;white-space:nowrap}
.tp-no-payroll-note{margin-top:12px;padding:10px 12px;border:1px solid #b7e4c7;border-radius:9px;background:#effaf3;color:#176b3a;font-weight:700;font-size:12px}
@media(max-width:800px){.tp-stage-tabs-three{width:100%;margin-left:0}.tp-stage-tabs-three button{flex:1;min-width:130px}}
/* v69-159 approved piecework evidence cards */
.tp-piecework-card{border:1px solid #dbe7f5;border-left:5px solid #2563eb;border-radius:14px;background:#fff;padding:18px;margin:14px 0;box-shadow:0 5px 18px rgba(37,99,235,.08)}
.tp-piecework-card-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:12px}.tp-piecework-card-head h3{margin:0;color:#123b71}.tp-piecework-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px}.tp-piecework-grid label{display:flex;flex-direction:column;gap:5px;font-weight:650;color:#334155}.tp-piecework-grid input,.tp-piecework-grid select,.tp-piecework-grid textarea{width:100%}.tp-piecework-evidence{grid-column:1/-1;background:#f8fbff;border:1px solid #cbdff7;border-radius:10px;padding:12px}.tp-piecework-status{margin-top:12px;padding:10px 12px;border-radius:9px;font-weight:750}.tp-piecework-status.invalid{background:#fff1f2;color:#b42318;border:1px solid #fecdd3}.tp-piecework-status.valid{background:#ecfdf3;color:#067647;border:1px solid #abefc6}.tp-piecework-card .v9-actions{justify-content:flex-end}.tp-piecework-card button:disabled{opacity:.45;cursor:not-allowed}.tp-piecework-readonly{background:#f8fafc;color:#475569}@media(max-width:900px){.tp-piecework-grid{grid-template-columns:1fr}.tp-piecework-card-head{display:block}}
/* v69-160: khối nhận biết và dữ liệu nguồn riêng cho mọi công đoạn. */
.tp-print-lsx-identification{margin:12px 0;padding:14px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff}
.tp-print-lsx-identification h3,.tp-stage-source-detail h3{margin:0 0 10px;color:#1e3a8a}
.tp-print-lsx-identification>div,.tp-stage-source-detail>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px 14px}
.tp-print-lsx-identification span,.tp-stage-source-detail span{display:block;min-width:0}
.tp-stage-source-detail{margin:10px 0;padding:12px 14px;border-left:4px solid #2563eb;background:#f8fafc}
.tp-stage-source-detail p{margin:0;color:#64748b}
@media(max-width:640px){.tp-print-lsx-identification>div,.tp-stage-source-detail>div{grid-template-columns:1fr}}

/* v69-160: khối nhận biết và dữ liệu nguồn riêng cho mọi công đoạn. */
.tp-print-lsx-identification{margin:12px 0;padding:14px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff}
.tp-print-lsx-identification h3,.tp-stage-source-detail h3{margin:0 0 10px;color:#1e3a8a}
.tp-print-lsx-identification>div,.tp-stage-source-detail>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px 14px}
.tp-print-lsx-identification span,.tp-stage-source-detail span{display:block;min-width:0}
.tp-stage-source-detail{margin:10px 0;padding:12px 14px;border-left:4px solid #2563eb;background:#f8fafc}
.tp-stage-source-detail p{margin:0;color:#64748b}
@media(max-width:640px){.tp-print-lsx-identification>div,.tp-stage-source-detail>div{grid-template-columns:1fr}}
.tp-lamination-size-field{display:flex;flex-direction:column;gap:6px}.tp-lamination-size-field>span{font-weight:700}.tp-lamination-size-field>small{color:#64748b}.tp-lamination-size-field>small.tp-linked-missing{color:#dc2626;font-weight:700}.tp-lamination-size{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:end}.tp-lamination-size>b{font-size:24px;line-height:42px;text-align:center;color:#334155}.tp-lamination-size label{margin:0}@media(max-width:680px){.tp-lamination-size{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:6px}.tp-lamination-size>b{font-size:20px}}
/* v69-169: Hồ sơ nhân sự thật từ Công nhân viên TP.xlsx */
.tp-hr-toolbar #hrStaffSearch{min-width:min(420px,100%)}
.tp-hr-table{min-width:980px}
.tp-hr-table th,.tp-hr-table td{vertical-align:top}
.tp-hr-table .tp-hr-phone{white-space:nowrap}
.tp-hr-actions{white-space:nowrap}
.tp-hr-form-card{max-width:920px}
.tp-hr-detail{max-width:900px}
.tp-hr-detail dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0}
.tp-hr-detail dl>div{padding:14px;border:1px solid #dbe7ef;border-radius:10px;background:#f8fbfd}
.tp-hr-detail dt{font-size:12px;color:#607585;margin-bottom:5px}
.tp-hr-detail dd{margin:0;font-weight:600;white-space:pre-wrap}
@media(max-width:760px){.tp-hr-detail dl{grid-template-columns:1fr}.tp-hr-toolbar #hrStaffSearch{min-width:100%}}
/* v69-171: trạng thái, đánh giá và nhập XLSX nhân sự */
.tp-hr-bulk{margin:10px 0}.tp-hr-table{min-width:1180px}.tp-hr-table input[type=checkbox]{width:18px;height:18px}.tp-hr-toolbar input[type=date]{width:auto}.tp-hr-detail h3{margin-top:20px}.danger{background:#b42318!important;color:#fff!important}@media(max-width:760px){.tp-hr-toolbar input[type=date],.tp-hr-toolbar select{width:100%}}
/* v69-172: nhiều tệp hồ sơ nhân viên, lưu cục bộ bằng IndexedDB */
.tp-hr-file-field{padding:14px;border:1px dashed #9bb8ca;border-radius:12px;background:#f8fbfd}.tp-hr-file-field>small{display:block;margin:7px 0;color:#607585}.tp-hr-files{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px}.tp-hr-files li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #dbe7ef;border-radius:10px;background:#fff}.tp-hr-files li>span:first-child{min-width:0;overflow-wrap:anywhere}.tp-hr-files small{display:block;color:#607585;margin-top:3px}.tp-hr-no-files{margin:8px 0}.tp-hr-file-field input[type=file]{width:100%;padding:10px;background:#fff;border:1px solid #cbdbe5;border-radius:8px}@media(max-width:680px){.tp-hr-files li{align-items:flex-start;flex-direction:column}.tp-hr-files li>span:last-child{width:100%;display:flex;gap:6px;flex-wrap:wrap}}
/* v69-173: xem trực tiếp ảnh/PDF trong phần mềm */
.tp-hr-preview-modal{position:fixed;inset:0;z-index:10000;padding:24px;background:rgba(9,25,36,.72);display:flex;align-items:center;justify-content:center}.tp-hr-preview-box{width:min(1180px,96vw);height:min(880px,94vh);background:#fff;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.35);overflow:hidden;display:flex;flex-direction:column}.tp-hr-preview-box header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid #dbe7ef}.tp-hr-preview-box header strong{min-width:0;overflow-wrap:anywhere}.tp-hr-preview-content{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:#eef3f6}.tp-hr-preview-content iframe{width:100%;height:100%;border:0;background:#fff}.tp-hr-preview-content img{display:block;max-width:100%;max-height:100%;object-fit:contain}@media(max-width:680px){.tp-hr-preview-modal{padding:8px}.tp-hr-preview-box{width:100%;height:96vh}.tp-hr-preview-box header{align-items:flex-start;flex-direction:column}.tp-hr-preview-box header span{display:flex;gap:6px}}

/* v69-260 — Xén: 5 ô cùng hàng, kích thước còn khoảng 2/3 độ rộng cũ. */
.stageFieldGrid.cutFieldGrid{grid-template-columns:minmax(150px,1.33fr) minmax(64px,.55fr) minmax(72px,.62fr) minmax(64px,.55fr) minmax(130px,1.05fr);column-gap:10px}
.cutFieldGrid .compactCutField{max-width:105px}
.cutFieldGrid .compactCutField input{max-width:105px}
@media(max-width:900px){.stageFieldGrid.cutFieldGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.cutFieldGrid .compactCutField,.cutFieldGrid .compactCutField input{max-width:none}}
@media(max-width:520px){.stageFieldGrid.cutFieldGrid{grid-template-columns:1fr}}

/* v69-275: seven prepress fields; reset earlier fixed widths/spans explicitly. */
.stageFieldGrid.prepressFieldGrid{display:grid;grid-template-columns:minmax(160px,1.4fr) 80px 80px minmax(100px,1fr) 110px minmax(110px,1fr) minmax(85px,.8fr);gap:10px;align-items:start}
.stageFieldGrid.prepressFieldGrid>label{width:auto;min-width:0;max-width:none;grid-column:auto;grid-row:auto}
.stageFieldGrid.prepressFieldGrid>label input{width:100%;min-width:0;max-width:none;box-sizing:border-box}
.stageFieldGrid.prepressFieldGrid .paperDimensionInputs{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr);gap:3px}
.stageFieldGrid.prepressFieldGrid .paperDimensionInputs>input{width:100%!important;min-width:0;max-width:none}
@media(max-width:1100px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:768px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:minmax(0,1fr)}}

/* LSX spot colors: retain legacy fields, split offset color cell only. */
.stageColorPair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
.stageColorPair>label{min-width:0}
.stageColorPair input{width:100%;min-width:0;box-sizing:border-box}
.stageFieldGrid.prepressFieldGrid .stageColorPair{grid-template-columns:80px 80px}
.stageFieldGrid.prepressFieldGrid label:has(>input[data-f="Ghép file|5"]){width:75%}
@media(min-width:1101px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:minmax(120px,1.4fr) 80px 168px minmax(80px,1fr) 110px minmax(85px,1fr) minmax(64px,.8fr)}}
@media(max-width:1100px){.stageFieldGrid.prepressFieldGrid .stageColorPair{grid-template-columns:repeat(2,minmax(0,1fr))}}
.stageColorPair>label>span{display:block;font-weight:700;font-size:12px;white-space:nowrap}

/* LSX alignment: scope to the two color-pair sections; equal label slots and controls.
   Nested pair labels must use the same layout as direct stage-grid labels. */
.stageFieldGrid:has(> .stageColorPair){gap:12px;align-items:start}
.stageFieldGrid:has(> .stageColorPair)>label,
.stageFieldGrid:has(> .stageColorPair)>.stageColorPair>label{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;font-weight:700;color:#334155}
.stageFieldGrid:has(> .stageColorPair)>label>span:first-child,
.stageFieldGrid:has(> .stageColorPair)>.stageColorPair>label>span:first-child{display:flex;align-items:flex-end;height:36px;min-height:36px;line-height:18px;font-size:12px;white-space:normal}
.stageFieldGrid:has(> .stageColorPair) input{height:38px;min-height:38px;margin:0;box-sizing:border-box}
.stageFieldGrid:has(> .stageColorPair)>.stageColorPair{gap:12px}
.stageFieldGrid.prepressFieldGrid>.stageColorPair{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:1101px){.stageFieldGrid.prepressFieldGrid{grid-template-columns:minmax(120px,1.4fr) 80px 172px minmax(80px,1fr) 110px minmax(85px,1fr) minmax(64px,.8fr)}}
/* Override the legacy 140px color cap, which left a larger visual gutter. */
.stageFieldGrid.prepressFieldGrid>label.prepressColorField{width:auto;max-width:none}

/* LSX finishing paper: independent dimensions, stable labels and level controls. */
.stageFieldGrid.finishingPaperGrid{gap:12px;align-items:start}
.stageFieldGrid.finishingPaperGrid>label{margin:0;gap:6px;min-width:0}
.stageFieldGrid.finishingPaperGrid>label>span:first-child{display:flex;align-items:flex-end;height:36px;min-height:36px;line-height:18px;font-size:12px}
.stageFieldGrid.finishingPaperGrid input,.stageFieldGrid.finishingPaperGrid select{height:38px;min-height:38px;margin:0;box-sizing:border-box}
.stageFieldGrid.finishingPaperGrid .paperDimensionInputs{grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr);gap:3px}
@media(min-width:1101px){
 .stageFieldGrid.laminationPaperGrid{grid-template-columns:calc((100% - 36px)/4) calc((100% - 36px)/8) minmax(0,1fr) calc((100% - 36px)/8) calc((100% - 36px)/8)}
}

/* Bế: preserve indexed fields; ten controls in two balanced desktop rows. */
.stageFieldGrid.dieStatusGrid{grid-template-columns:repeat(5,minmax(0,1fr))}
.stageFieldGrid.dieStatusGrid>label{min-width:0;grid-column:auto}
.stageFieldGrid.dieStatusGrid input,.stageFieldGrid.dieStatusGrid select{width:100%;min-width:0;max-width:none;box-sizing:border-box}
@media(max-width:1100px){.stageFieldGrid.dieStatusGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.stageFieldGrid.dieStatusGrid{grid-template-columns:minmax(0,1fr)}}
