/* v9 customer catalog & orders */
.v9-search{position:relative;margin-bottom:14px}.v9-search label,.v9-form label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#334155}.v9-search input,.v9-form input,.v9-form select,.v9-form textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:9px;padding:10px;background:#fff;color:#0f172a;font:inherit}.v9-suggestions{position:absolute;z-index:20;left:0;right:0;top:100%;background:#fff;border-radius:10px;box-shadow:0 12px 30px #0f172a26;max-height:230px;overflow:auto}.v9-suggestions:empty{display:none}.v9-suggestions button{display:flex;width:100%;border:0;border-bottom:1px solid #e2e8f0;background:#fff;color:#000;padding:10px 12px;text-align:left;flex-direction:column}.v9-suggestions button:hover,.v9-suggestions button:focus{background:#eff6ff;color:#000}.v9-suggestions small,.v9-muted{display:block;color:#64748b;margin-top:4px}.v9-form{margin:14px 0}.v9-form h2{margin-top:0}.v9-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.v9-grid .wide{grid-column:1/-1}.v9-customer{position:relative}.v9-customer-info{margin-top:14px;padding:12px;background:#f8fafc;border-left:4px solid #3b82f6}.v9-warning{color:#92400e;background:#fef3c7;padding:7px 9px;border-radius:7px;margin-top:8px}.v9-alert{padding:12px 14px;border-radius:9px;margin:12px 0}.v9-alert.error{color:#991b1b;background:#fee2e2;border:1px solid #fecaca}.v9-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.v9-previews{display:flex;flex-wrap:wrap;gap:10px}.v9-previews>div{position:relative;width:110px}.v9-previews img{display:block;width:110px;height:82px;object-fit:cover;border-radius:8px;border:1px solid #cbd5e1}.v9-previews button{position:absolute;right:-5px;top:-5px;width:24px;height:24px;padding:0;border:0;border-radius:50%;background:#dc2626;color:#fff}.v9-previews small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v9-flow{margin:12px 0;padding:12px;border-left:4px solid #16a34a;background:#f0fdf4}.v9-form[hidden],.v9-alert[hidden],.v9-form label[hidden]{display:none!important}
.v9-delivery-picker{position:relative}.v9-delivery-picker .v9-delivery-suggestions{top:calc(100% - 20px);z-index:30}.v9-delivery-picker .v9-delivery-suggestions button{font-weight:400}.v9-delivery-picker .v9-delivery-suggestions b{font-weight:700}
.order-detail-scroll{overflow-x:auto;overscroll-behavior-inline:contain}.order-detail-table{width:100%;min-width:1280px;table-layout:fixed}.order-detail-table col.col-code{width:128px}.order-detail-table col.col-detail{width:85px}.order-detail-table col.col-customer{width:135px}.order-detail-table col.col-product{width:155px}.order-detail-table col.col-size{width:115px}.order-detail-table col.col-spec{width:210px}.order-detail-table col.col-qty{width:92px}.order-detail-table col.col-stage{width:155px}.order-detail-table col.col-delivery{width:142px}.order-detail-table col.col-priority{width:82px}.order-detail-table th,.order-detail-table td{white-space:normal;overflow-wrap:anywhere;word-break:normal;vertical-align:top;line-height:1.4}.order-detail-table .order-code,.order-detail-table .order-qty{overflow-wrap:normal;word-break:keep-all}.order-stage-badge,.order-delivery-badge{display:inline-block;max-width:100%;border-radius:8px;padding:6px 8px;font-size:11px;font-weight:800;line-height:1.25;text-align:center;overflow-wrap:break-word}.order-stage-badge.not-started{background:#e2e8f0;color:#475569}.order-stage-badge.active{background:#dbeafe;color:#1d4ed8}.order-stage-badge.complete{background:#dcfce7;color:#166534}.order-delivery-badge.normal{background:#e8f1f7;color:#334155}.order-delivery-badge.three{background:#ffedd5;color:#c2410c;border:1px solid #fdba74}.order-delivery-badge.two{background:#fef9c3;color:#854d0e;border:1px solid #fde047}.order-delivery-badge.one{background:#fee2e2;color:#b91c1c;border:1px solid #fca5a5}.order-delivery-badge.today{background:#991b1b;color:#fff;border:2px solid #7f1d1d;box-shadow:0 0 0 2px #fecaca}.order-delivery-badge.overdue{background:linear-gradient(135deg,#7f1d1d,#701a75);color:#fff;border:2px solid #f0abfc;box-shadow:0 0 0 2px #fecaca;font-size:11px}.order-delivery-badge.invalid{background:#e2e8f0;color:#64748b}.order-delivery-date{display:block;margin-top:5px;color:#64748b;font-size:10px;text-align:center}.order-detail-mobile .order-stage-badge,.order-detail-mobile .order-delivery-badge{margin-top:4px}.order-detail-mobile .order-delivery-date{text-align:left;margin-left:0}
@media(max-width:900px){.v9-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.v9-grid{grid-template-columns:1fr}.v9-grid .wide{grid-column:auto}.v9-actions{position:sticky;bottom:0;background:#fff;padding:10px 0}.v9-form{padding:12px}.v9-previews>div,.v9-previews img{width:92px}.v9-previews img{height:70px}}

/* v69-63 — Danh mục khách hàng đồng bộ giao diện Nhà cung cấp */
.kh-head-actions{display:flex;gap:8px}.kh-stats{margin-bottom:14px}.kh-filter{display:grid;grid-template-columns:minmax(260px,2fr) repeat(2,minmax(165px,1fr)) auto;gap:10px;margin-bottom:14px}.kh-filter input,.kh-filter select,.kh-filter button{width:100%;min-width:0}.kh-table td{vertical-align:top}.kh-mobile{display:none}.kh-profile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.kh-profile-head h1{margin:10px 0 5px;font-size:25px}.kh-profile-head p{margin:0;color:#5c6d7d}.kh-profile-actions{display:flex;gap:8px}.kh-tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:1px}.kh-tabs .tab{white-space:nowrap;background:#0879bd!important;color:#fff!important;font-weight:800!important;font-size:15px;border:2px solid #0879bd!important;text-shadow:0 1px 1px rgba(0,0,0,.22)}.kh-tabs .tab:hover,.kh-tabs .tab:focus-visible{background:#075f96!important;border-color:#075f96!important}.kh-tabs .tab.active{background:#fff!important;color:#075f96!important;border-color:#075f96!important;box-shadow:inset 0 -3px 0 #075f96;text-shadow:none}.kh-dl{display:grid;grid-template-columns:135px 1fr;gap:10px 14px;margin:0}.kh-dl dt{color:#677889;font-weight:700}.kh-dl dd{margin:0;min-width:0}.kh-audit{display:grid;grid-template-columns:110px 150px 1fr;gap:12px;padding:12px 0}.kh-audit p{margin:0}.kh-audit span{color:#68798a}
@media(max-width:900px){.kh-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.kh-filter #customerSearch{grid-column:1/-1}}
@media(max-width:760px){.kh-head-actions,.kh-head-actions button{width:100%}.kh-table{display:none}.kh-mobile{display:grid;gap:10px}.kh-mobile article{border:1px solid #dfe7ee;border-radius:10px;padding:14px;background:#fff}.kh-mobile article>div:first-child{display:flex;justify-content:space-between;gap:12px}.kh-mobile small{color:#708090}.kh-mobile p{margin:8px 0;color:#536474}.kh-mobile button{width:100%;margin-top:6px}.kh-profile-head{flex-direction:column}.kh-profile-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.kh-dl{grid-template-columns:105px 1fr}.kh-audit{grid-template-columns:1fr;gap:4px}}
@media(max-width:480px){.kh-filter{grid-template-columns:1fr}.kh-filter #customerSearch{grid-column:auto}.kh-profile-head h1{font-size:21px}.kh-dl{grid-template-columns:1fr;gap:3px}.kh-dl dd{margin-bottom:9px}}
/* v69-96 — Tổng quan công đoạn và trang chi tiết theo quyền tài khoản */
.tp-stage-group{margin:14px 0;border-radius:14px;padding:14px;border:1px solid #dbe7f3;background:#f8fbff}.tp-stage-group>h2{margin:0 0 10px;font-size:15px;letter-spacing:.08em;color:#0f3f68}.tp-stage-group.prepare{border-top:5px solid #7c3aed}.tp-stage-group.print{border-top:5px solid #2563eb}.tp-stage-group.process{border-top:5px solid #f59e0b}.tp-stage-group.finish{border-top:5px solid #16a34a}.tp-stage-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:stretch}.tp-stage-grid>.tp-stage-card{height:100%}.tp-stage-card{display:block;text-align:left;width:100%;min-height:142px;padding:12px;background:#fff;color:#18344f;border:1px solid #cbdceb;border-radius:10px;box-shadow:0 2px 7px rgba(15,63,104,.08)}.tp-stage-card:hover{border-color:#2563eb;transform:translateY(-1px)}.tp-stage-card-head{display:flex;justify-content:space-between;gap:8px;align-items:center;border-bottom:1px solid #e5edf5;padding-bottom:8px}.tp-stage-card-head b{font-size:15px;overflow-wrap:anywhere}.tp-stage-card-head em{font-style:normal;background:#0f67b1;color:#fff;border-radius:999px;min-width:26px;padding:3px 7px;text-align:center}.tp-stage-card ul{list-style:none;padding:0;margin:8px 0 0}.tp-stage-order{display:flex;flex-direction:column;border-left:3px solid #cbd5e1;padding:3px 6px;margin:4px 0;font-size:11px;line-height:1.35}.tp-stage-order.urgent{border-color:#dc2626}.tp-stage-order.warning{border-color:#eab308}.tp-stage-order span{white-space:normal;overflow-wrap:anywhere}.tp-stage-order.empty{color:#64748b;border:0}.tp-stage-detail{display:grid;gap:9px}.tp-stage-job{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:11px;border-left:4px solid #cbd5e1;background:#fff;border-radius:7px}.tp-stage-job.urgent{border-color:#dc2626}.tp-stage-job.warning{border-color:#eab308}.tp-stage-job>div:last-child{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.tp-stage-spec{margin-top:6px;padding:6px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:6px;font-size:12px;white-space:normal;overflow-wrap:anywhere}.tp-stage-permission{margin-top:16px}.tp-stage-permission summary{cursor:pointer}.tp-stage-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:5px;margin:10px 0}.tp-stage-checks label,.tp-stage-viewall{display:flex;gap:6px;align-items:center;padding:6px;background:#f8fafc;border-radius:5px}.tp-stage-denied{text-align:center;padding:28px}@media(max-width:1100px){.tp-stage-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:850px){.tp-stage-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.tp-stage-grid{grid-template-columns:1fr}.tp-stage-job{grid-template-columns:1fr}.tp-stage-job>div:last-child{justify-content:flex-start}}
/* v69-99: hàng điều hướng công đoạn độc lập, không đè tiêu đề. */
.tp-stage-nav-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:100%;margin:4px 0 14px}.tp-stage-back{margin-right:0}.tp-stage-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}@media(max-width:700px){.tp-stage-nav-row{align-items:stretch}.tp-stage-tabs{width:100%;margin-left:0}.tp-stage-tabs button{flex:1 1 180px}.tp-stage-nav-row>.ghost{align-self:flex-start}.v9-actions{position:static}}

/* v69-109 — chọn đơn và thao tác hàng loạt */
.order-bulk-head{display:flex;align-items:center;justify-content:space-between;gap:14px;background:linear-gradient(90deg,#075f96,#0b86c9);color:#fff;padding:14px 18px;margin:-16px -16px 14px;border-radius:10px 10px 0 0}.order-bulk-head>div:first-child{display:flex;flex-direction:column;gap:4px}.order-bulk-head small{color:#dbeafe}.order-bulk-actions{display:flex;gap:8px;flex-wrap:wrap}.order-bulk-actions button{background:#fff}.v9-legacy-spec{padding:8px;background:#fff7ed;border-left:3px solid #f59e0b}@media(max-width:600px){.order-bulk-head{align-items:stretch;flex-direction:column;margin:-12px -12px 12px}.order-bulk-actions{display:grid;grid-template-columns:repeat(3,1fr)}.order-bulk-actions button{width:100%}}

/* v69-110: readable bulk actions on desktop/mobile. */
.order-bulk-actions button,.order-bulk-actions .danger{color:#0f172a!important;background:#fff!important;border:1px solid rgba(15,23,42,.22)!important;font-weight:700;opacity:1}.order-bulk-actions button:disabled{color:#64748b!important;background:#e2e8f0!important;opacity:.78}

/* v69-117 — chọn đơn trên thẻ mobile, đồng bộ với bảng desktop. */
.order-mobile-select-all,.order-mobile-select{display:none}.order-mobile-select input,.order-mobile-select-all input{width:22px;height:22px;accent-color:#0879bd;flex:0 0 auto}@media(max-width:760px){.order-mobile-select-all{display:flex;align-items:center;gap:8px;margin-top:5px;color:#fff;font-size:14px;font-weight:700}.order-mobile-select{display:flex;align-items:center;gap:9px;margin:-3px -3px 12px;padding:10px;border:2px solid #7dd3fc;border-radius:9px;background:#e0f2fe;color:#075985;font-weight:800}.order-mobile-select:has(input:checked){background:#dcfce7;border-color:#22c55e;color:#166534}}

/* v69-113 — Khách hàng và Nguồn khách cùng hàng trên desktop, xếp dọc trên mobile. */
.v69-113-customer-source{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:13px;align-items:start}
@media(max-width:600px){.v69-113-customer-source{grid-template-columns:1fr}}

/* v69-124 — Thanh tiến độ công đoạn mỏng, một hàng + biểu mẫu kết quả In offset. */
.tp-stage-job-main{min-width:0}.tp-compact-stage-progress{max-width:100%;overflow-x:auto;overflow-y:hidden;margin-top:5px;padding-bottom:2px;scrollbar-width:thin}.tp-compact-stage-track{display:flex;align-items:center;width:max-content;min-width:100%;height:20px;gap:4px;white-space:nowrap;font-size:10px;line-height:1}.tp-compact-stage{padding:3px 5px;border-radius:999px;background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0}.tp-compact-stage.done{background:#dcfce7;color:#15803d;border-color:#bbf7d0}.tp-compact-stage.current{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd;font-weight:700}.tp-compact-stage.external{background:#ffedd5;color:#9a3412;border-color:#fb923c;font-weight:800}.tp-stage-arrow{color:#94a3b8}.tp-stage-remaining{margin-left:4px;padding-left:8px;border-left:1px solid #cbd5e1;color:#334155;font-weight:700}.tp-print-result-grid{margin-top:12px}.tp-print-note{grid-column:1/-1}.tp-print-note textarea{min-height:72px}

/* v69-125 — Bố cục biểu mẫu In offset theo nhóm, nhãn trên ô nhập. */
.tp-print-result-grid{display:grid;gap:12px;margin-top:12px}.tp-print-row{display:grid;gap:12px;align-items:end}.tp-print-row-result{grid-template-columns:minmax(150px,.8fr) minmax(240px,1.5fr) minmax(170px,.9fr)}.tp-print-row-plates,.tp-print-row-staff{grid-template-columns:repeat(2,minmax(180px,1fr))}.tp-print-result-grid label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:6px;font-weight:700;min-width:0}.tp-print-result-grid input,.tp-print-result-grid select,.tp-print-result-grid textarea{width:100%!important;margin:0!important;box-sizing:border-box}.tp-print-note{display:flex;grid-column:auto}.tp-print-note textarea{min-height:82px;resize:vertical}@media(max-width:760px){.tp-print-row-result,.tp-print-row-plates,.tp-print-row-staff{grid-template-columns:1fr 1fr}.tp-print-row-result label:nth-child(2){grid-column:1/-1;grid-row:2}.tp-print-row-result label:nth-child(3){grid-column:2;grid-row:1}}@media(max-width:520px){.tp-print-row-result,.tp-print-row-plates,.tp-print-row-staff{grid-template-columns:1fr}.tp-print-row-result label:nth-child(2),.tp-print-row-result label:nth-child(3){grid-column:auto;grid-row:auto}}
.tp-manual-result-grid{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px;margin-top:12px;align-items:start}.tp-manual-result-grid label,.tp-result-readonly label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:6px;font-weight:700;min-width:0}.tp-manual-result-grid input,.tp-manual-result-grid select,.tp-manual-result-grid textarea,.tp-result-readonly input{width:100%!important;margin:0!important;box-sizing:border-box}.tp-manual-note{grid-column:1/-1}.tp-manual-note textarea{min-height:82px;resize:vertical}.tp-result-readonly{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px;margin-top:12px;padding-top:12px;border-top:1px dashed #cbd5e1}.tp-result-readonly label{color:#64748b}.tp-result-readonly input{background:#f1f5f9}@media(max-width:760px){.tp-manual-result-grid,.tp-result-readonly{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.tp-manual-result-grid,.tp-result-readonly{grid-template-columns:1fr}.tp-manual-note{grid-column:auto}}
/* v69-131 — tách Gia công ngoài khỏi nhóm IN và dashboard tiến độ */
.tp-stage-group.outsource{border-top:5px solid #f97316;border-right:2px solid #f97316}.tp-stage-group.outsource>h2{color:#c2410c}.tp-outsource-summary{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:10px;margin:12px 0}.tp-outsource-summary span{display:flex;flex-direction:column;background:#fff;border:1px solid #dbe3ef;border-radius:10px;padding:12px;color:#475569}.tp-outsource-summary b{font-size:22px;color:#0f172a}.tp-outsource-summary .danger{border-color:#fca5a5;background:#fef2f2}@media(max-width:760px){.tp-outsource-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.tp-stage-group.outsource{border-right:0;border-bottom:2px solid #f97316}}@media(max-width:520px){.tp-outsource-summary{grid-template-columns:1fr}}

/* v69-134 — thông tin nhận biết LSX riêng, không thay thế dòng thông số công đoạn */
.tp-print-lsx-identification{margin:10px 0;padding:10px 12px;border:1px solid #bfdbfe;border-left:4px solid #2563eb;border-radius:9px;background:#f8fbff}.tp-print-lsx-identification h3{margin:0 0 8px;font-size:14px;color:#1e3a8a}.tp-print-lsx-identification>div{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:7px 12px}.tp-print-lsx-identification span{font-size:12px;line-height:1.35;min-width:0;overflow-wrap:anywhere}@media(max-width:900px){.tp-print-lsx-identification>div{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:520px){.tp-print-lsx-identification>div{grid-template-columns:1fr}}
/* v69-136 — thao tác an toàn trong Kế hoạch đã hoàn thành */
.tp-completed-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0;padding:10px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc}.tp-completed-actions label{display:flex;align-items:center;gap:6px;font-weight:700}.tp-completed-actions .completedCount{margin-right:auto;color:#475569;font-size:13px}.tp-stage-job.completedRow{display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:10px}.completedPick{width:18px;height:18px;margin-top:4px;accent-color:#2563eb}@media(max-width:520px){.tp-stage-job.completedRow{grid-template-columns:auto 1fr}.tp-stage-job.completedRow>div:last-child{grid-column:2}.tp-completed-actions .completedCount{width:100%;order:3}}
/* v69-136 special completed selection/revision */
.tp-completed-editor{border:2px solid #2563eb;margin-top:14px}.tp-completed-editor label{display:block;margin:10px 0}.tp-completed-editor textarea{width:100%;min-height:76px}.completedRow>.completedPick{flex:0 0 auto;margin:6px 10px 0 0}

/* Plan screen: keep the two status tabs aligned in the blue header; completed actions remain label-free controls. */
.tp-plan-head{align-items:flex-start}.tp-plan-head-controls{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.tp-plan-tabs{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.tp-plan-head .tp-completed-actions{margin:0;background:#ffffffeb;color:#0f172a}.tp-plan-head .tp-completed-actions button{width:auto}@media(max-width:760px){.tp-plan-head-controls{width:100%;align-items:stretch}.tp-plan-tabs{width:100%}.tp-plan-tabs button{flex:1 1 50%;width:auto}.tp-plan-head .tp-completed-actions{width:auto}}

/* v69-136: thẻ tổng quan giữ chiều cao cố định; danh sách cuộn nội bộ và tuyến công đoạn là đèn trạng thái gọn. */
.tp-stage-grid>.tp-stage-card{height:300px;min-height:300px;max-height:300px;display:flex;flex-direction:column;overflow:hidden}.tp-stage-card>.tp-stage-card-head{flex:0 0 auto}.tp-stage-card>ul{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:3px}.tp-stage-card>small{flex:0 0 auto;margin-top:4px;color:#64748b}.tp-stage-order-progress{margin-top:5px;padding-top:5px;border-top:1px dashed #dbe7f3}.tp-stage-order-progress strong{display:block;color:#0f67b1;font-size:11px}.tp-stage-order-progress>span{display:flex;flex-wrap:wrap;gap:3px;margin-top:3px}.tp-stage-order-progress i{font-style:normal;border:1px solid #cbd5e1;border-radius:999px;padding:2px 5px;background:#f1f5f9;color:#94a3b8;opacity:.72}.tp-stage-order-progress i.current{border-color:#f59e0b;background:#f59e0b;color:#fff;opacity:1;box-shadow:0 0 0 2px rgba(245,158,11,.16)}.tp-stage-order-progress i.done{border-color:#22c55e;background:#22c55e;color:#fff;opacity:1}@media(max-width:700px){.tp-stage-grid>.tp-stage-card{height:300px;min-height:300px;max-height:300px}}
/* v69-137: fixed stage cards, one-line compact route and delivery deadline */
.tp-stage-card{cursor:pointer;appearance:none;font:inherit;position:relative}
.tp-stage-card:focus-visible{outline:3px solid rgba(37,99,235,.35);outline-offset:2px}
.tp-stage-card>ul{position:relative;z-index:1;pointer-events:auto}
.tp-stage-order{font-size:10px}
.tp-stage-order-open{display:flex;flex-direction:column;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left;font:inherit;line-height:inherit;cursor:pointer}.tp-stage-order-open:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:3px}
.tp-stage-order-progress{margin-top:3px;padding-top:3px;min-width:0}
.tp-stage-order-progress strong{font-size:10px;line-height:1.1}
.tp-stage-order-progress>.tp-stage-route-line{display:flex;flex-wrap:nowrap;align-items:center;gap:1px;width:100%;margin-top:2px;overflow:hidden;white-space:nowrap}
.tp-stage-order-progress .tp-stage-route-line i{flex:1 1 0;min-width:0;padding:1px 1px;height:14px;line-height:11px;border-radius:4px;font-size:7px;letter-spacing:-.2px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:clip}
.tp-stage-order-progress .tp-stage-route-line i.current{border-color:#f59e0b;background:#f59e0b;color:#fff;box-shadow:none}
.tp-stage-order-progress .tp-stage-route-line i.done{border-color:#22c55e;background:#22c55e;color:#fff}
.tp-stage-deadline{display:block;width:max-content;max-width:100%;margin-top:3px;padding:1px 5px;border-radius:4px;font-size:8px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#dcfce7;color:#166534;border:1px solid #bbf7d0}
.tp-stage-deadline.soon{background:#fef3c7;color:#92400e;border-color:#facc15}
.tp-stage-deadline.today{background:#ef4444;color:#fff;border-color:#dc2626}
.tp-stage-deadline.overdue{background:#7f1d1d;color:#fff;border-color:#450a0a}
.tp-stage-deadline.unknown{background:#f1f5f9;color:#64748b;border-color:#cbd5e1}
/* v69-147: deadline pill sits immediately after the remaining-stage pill in every production detail route. */
.tp-compact-stage-track .tp-stage-deadline-inline{display:inline-flex;align-items:center;flex:0 0 auto;width:auto;max-width:100%;margin:0 0 0 4px;padding:2px 7px;border-radius:999px;font-size:10px;line-height:14px;font-weight:700;vertical-align:middle}
@media(max-width:700px){.tp-compact-stage-track .tp-stage-deadline-inline{font-size:9px;padding:1px 5px;margin-left:3px}}
/* v69-148 — workshop search, paper receipt bridge and plan selection alignment */
.tp-workshop-head>div{width:100%}.tp-workshop-search{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr);gap:10px;margin-top:10px}.tp-workshop-search label{display:flex;flex-direction:column;gap:5px;font-weight:700}.tp-workshop-search input{background:#fff;color:#0f172a}.tp-workshop-search-results{margin-top:10px}.tp-workshop-search-row{display:grid;grid-template-columns:minmax(170px,.8fr) minmax(220px,1.5fr) minmax(150px,.7fr);width:100%;gap:10px;align-items:center;text-align:left;margin:6px 0;background:#fff;color:#0f172a;border:1px solid #cbd5e1}.tp-workshop-search-row em{font-style:normal;color:#b45309;font-weight:700}.tp-paper-receipt-card{border-color:#60a5fa}.tp-plan-select-all{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:12px;white-space:nowrap}.tp-plan-select-all input{width:18px;height:18px}.tp-completed-actions-table-select .completedCount{margin-left:0}
@media(max-width:650px){.tp-workshop-search{grid-template-columns:1fr}.tp-workshop-search-row{grid-template-columns:1fr;gap:3px}.tp-workshop-search-row span,.tp-workshop-search-row em{font-size:12px}}
/* v69-209 — Cán màng nhiều quả, bố cục cân đối */
.tp-film-roll-section{grid-column:2;display:grid;gap:10px;padding:12px;border:1px solid #bfdbfe;border-radius:12px;background:#f8fbff}.tp-film-roll-width{margin:0}.tp-film-roll-head{display:flex;justify-content:space-between;gap:10px;align-items:end}.tp-film-roll-head small,.tp-film-roll-section>small{color:#64748b}.tp-film-roll-row{display:grid;grid-template-columns:minmax(190px,1.4fr) minmax(130px,1fr) minmax(130px,1fr) 38px;gap:10px;align-items:end;padding-top:10px;border-top:1px dashed #cbd5e1}.tp-film-roll-row label{margin:0}.tp-film-remove{height:40px;padding:0}.tp-film-roll-section>[data-film-add]{justify-self:start}@media(max-width:900px){.tp-film-roll-section{grid-column:1/-1}.tp-film-roll-row{grid-template-columns:1fr 1fr}.tp-film-remove{width:38px}}@media(max-width:520px){.tp-film-roll-section{grid-column:auto}.tp-film-roll-row{grid-template-columns:1fr}}
.v45-orders-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}.v45-orders-table{min-width:1480px}.v45-orders-table th,.v45-orders-table td{white-space:nowrap}.v45-orders-table .v45-money{text-align:right;font-variant-numeric:tabular-nums}


/* ==========================================================================
   FIX KÍCH THƯỚC ĐỒNG ĐỀU 100% CHO CÁC THẺ CÔNG ĐOẠN (ĐẶC BIỆT MỤC GIA CÔNG)
   ========================================================================== */
section.tp-stage-group,
section.tp-stage-group.process,
section.tp-stage-group.prepare,
section.tp-stage-group.print,
section.tp-stage-group.finish,
section.tp-stage-group.outsource {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 14px 0 !important;
  padding: 14px !important;
}

section.tp-stage-group.process {
  border-top: 5px solid #f59e0b !important;
}

section.tp-stage-group > h2 {
  display: block !important;
  width: 100% !important;
  margin: 0 0 12px 0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  color: #0f3f68 !important;
}

section.tp-stage-group > .tp-stage-grid {
  display: grid !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 12px !important;
}

@media (max-width: 700px) {
  section.tp-stage-group > .tp-stage-grid {
    grid-template-columns: 1fr !important;
  }
  section.tp-stage-group > .tp-stage-grid > .tp-stage-card {
    width: 100% !important;
    min-height: 280px !important;
    box-sizing: border-box !important;
  }
}
