/* Compact cost-template editor, using the OA form and action colors. */
#modal:has(#costTemplateModalForm){width:1120px;max-width:94vw;height:fit-content;max-height:86vh;padding:0;border-radius:8px}
#modal:has(#costTemplateModalForm) #dialogBody{display:flex;flex-direction:column;height:auto;max-height:86vh;overflow:hidden}
#modal:has(#costTemplateModalForm) .dialog-head{flex:0 0 54px;padding:14px 22px;background:#edf4fb;border-bottom:1px solid #dbe5ee;position:relative;justify-content:flex-end;gap:12px}
#modal:has(#costTemplateModalForm) .dialog-head>span{margin-right:auto;font-size:16px;font-weight:500;color:#334c66;position:static;transform:none}
.cost-modal-max{font-size:20px!important;line-height:1}
#modal.cost-modal-maximized:has(#costTemplateModalForm){width:94vw;max-width:94vw;height:90vh;max-height:90vh}
#modal.cost-modal-maximized:has(#costTemplateModalForm) #dialogBody{height:100%;max-height:90vh}
#costTemplateModalForm{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;margin:0}
.cost-modal-body{padding:20px 22px;flex:0 1 auto;min-height:0;overflow:auto;background:white}
.cost-modal-meta{display:grid;grid-template-columns:100px minmax(160px,1fr) 100px minmax(160px,1fr);gap:12px 10px;align-items:center;margin-bottom:20px}
.cost-modal-meta>label:not(.cost-modal-switch){display:flex;align-items:center;justify-content:flex-end;padding:0;font-size:13px;font-weight:400;color:#587086}
.cost-modal-meta>input,.cost-modal-meta>select{width:100%;min-width:0;height:34px;border:1px solid #c7d7e6;border-radius:4px;padding:6px 9px;font:inherit;color:#33546f;background:white}
.cost-modal-meta .cost-modal-wide{grid-column:span 3}
.cost-modal-switch{display:flex!important;flex-direction:row!important;position:relative;align-items:center;justify-content:flex-start;gap:8px;font-size:13px;color:#587086}
.cost-modal-switch input{position:absolute;opacity:0;width:42px;height:24px;left:0;margin:0;cursor:pointer}
.cost-modal-switch span{width:42px;height:24px;border-radius:14px;background:#a9b8c5;pointer-events:none}
.cost-modal-switch span:after{content:'';display:block;width:18px;height:18px;border-radius:50%;background:white;margin:3px;transition:transform .15s}
.cost-modal-switch input:checked+span{background:#77a5d9}.cost-modal-switch input:checked+span:after{transform:translateX(18px)}
.cost-modal-switch input:focus-visible+span{outline:2px solid #2874c1;outline-offset:2px}.cost-modal-switch input:disabled+span{opacity:.45}.cost-modal-switch b{font-weight:400}
.cost-modal-table-wrap{overflow:auto;border:1px solid #dbe4ed;border-radius:5px}
.cost-modal-table{table-layout:fixed;min-width:0;width:100%;border-collapse:collapse}
.cost-modal-table th,.cost-modal-table td{border:0;border-right:1px solid #e3eaf1;border-bottom:1px solid #e3eaf1;padding:5px!important;text-align:center}
.cost-modal-table th{height:40px;background:#edf4fb;color:#587086;font-size:13px;font-weight:500}
.cost-modal-table th:first-child{width:52px}.cost-modal-table th:last-child{width:64px}.cost-modal-table.cost-modal-compact th:first-child,.cost-modal-table.cost-modal-compact th:last-child{width:auto}
.cost-modal-table td{height:44px}.cost-modal-table tbody tr:last-child td{border-bottom:0}.cost-modal-table th:last-child,.cost-modal-table td:last-child{border-right:0}
.cost-modal-table input,.cost-modal-table select{height:32px;width:100%;min-width:0;border:1px solid #c7d7e6;border-radius:4px;padding:5px 8px;font:inherit;color:#33546f;background:white}
.cost-modal-table input::placeholder{color:#9baaba}.cost-modal-table .agreement-supplier-field>label{display:none}.cost-modal-table .agreement-supplier-field{gap:0}.cost-modal-table .agreement-supplier-picker input{padding-right:28px!important}.cost-modal-table .agreement-supplier-search{width:27px}
.cost-modal-add{height:27px;width:32px;min-width:32px;border:1px solid #c5d9ec;border-radius:4px;background:#e7f0fa;color:#4c80b2;font-size:22px;line-height:1;cursor:pointer}
.cost-row-remove{border:0;background:none;color:#ca5c64;cursor:pointer;padding:4px}.cost-row-remove svg{fill:none;stroke:currentColor;stroke-width:1.8;width:19px;height:19px}.cost-row-number{color:#73889a;font-size:12px}
.cost-modal-summary{display:flex;justify-content:space-between;gap:16px;font-size:12px;color:#7a8da0;padding:12px 0 0}.cost-modal-summary strong{font-size:14px;font-weight:500;color:#456b8d}
.cost-modal-footer{display:flex;justify-content:flex-end;gap:10px;flex-shrink:0;background:#f7f9fc;border-top:1px solid #dbe5ee;padding:12px 22px}
.cost-modal-footer .btn{font-weight:400;font-size:13px;border-radius:4px;min-width:76px;height:34px;box-shadow:none}
.cost-save-next{background:white!important;color:#6083a6!important;border-color:#cddceb!important}.cost-save{background:#77a5d9!important;color:white!important;border-color:#77a5d9!important}.cost-close{background:white!important;color:#6083a6!important;border-color:#cddceb!important}#costModalError{padding-top:8px}
.agreement-supplier-list[popover]:not(:popover-open){display:none}.agreement-supplier-list[popover]{text-align:left}
@media(max-width:800px){.cost-modal-meta{grid-template-columns:92px minmax(120px,1fr);gap:10px}.cost-modal-meta .cost-modal-wide{grid-column:auto}.cost-modal-body{padding:16px}.cost-modal-summary{flex-wrap:wrap}.cost-modal-footer{padding:10px 16px}}

/* Price editors fit the available dialog width; narrower windows reflow fields vertically. */
.price-layout{container-type:inline-size;width:100%;min-width:0;max-width:100%}
.price-layout>.price-table{width:100%;min-width:0;max-width:100%;table-layout:fixed}
.price-layout>.price-table th{white-space:normal;overflow-wrap:anywhere;line-height:1.5;padding:6px 4px!important}
.price-layout>.price-table td{min-width:0}.price-layout>.price-table input,.price-layout>.price-table select{min-width:0;max-width:100%}
@container (max-width:1050px){
.price-layout>.price-table-dense{display:block;white-space:normal}.price-layout>.price-table-dense colgroup{display:none}.price-layout>.price-table-dense thead,.price-layout>.price-table-dense thead tr{display:block}.price-layout>.price-table-dense thead th{display:none}.price-layout>.price-table-dense thead th:has(button){display:block;width:auto!important;text-align:left;height:auto;padding:6px!important}
.price-layout>.price-table-dense tbody{display:block}.price-layout>.price-table-dense tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px;padding:12px;border-bottom:1px solid #dbe4ed;background:#fff}.price-layout>.price-table-dense tbody tr:nth-child(even){background:#f8fbfe}
.price-layout>.price-table-dense tbody td{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;height:auto!important;padding:0!important;border:0!important;text-align:left;gap:5px;min-width:0}.price-layout>.price-table-dense tbody td:before{content:attr(data-price-label);display:block;font-size:12px;line-height:18px;color:#6f8499}
.price-layout>.price-table-dense td[data-price-label="序号"]{grid-column:1/-1;flex-direction:row;align-items:center;color:#557994;font-size:12px}.price-layout>.price-table-dense td[data-price-label="删除"],.price-layout>.price-table-dense td[data-price-label="操作"]{justify-content:flex-end;align-items:flex-end}.price-layout>.price-table-dense td[data-price-label="删除"]:before,.price-layout>.price-table-dense td[data-price-label="操作"]:before{display:none}
.price-layout>.price-table-dense input,.price-layout>.price-table-dense select{width:100%;max-width:none}.price-layout>.price-table-dense .agreement-supplier-field{width:100%}
}
@container (max-width:760px){
.price-layout>.price-table{display:block;white-space:normal}.price-layout>.price-table colgroup{display:none}.price-layout>.price-table thead,.price-layout>.price-table thead tr{display:block}.price-layout>.price-table thead th{display:none}.price-layout>.price-table thead th:has(button){display:block;width:auto!important;text-align:left;height:auto;padding:6px!important}
.price-layout>.price-table tbody{display:block}.price-layout>.price-table tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px;padding:12px;border-bottom:1px solid #dbe4ed;background:#fff}.price-layout>.price-table tbody tr:nth-child(even){background:#f8fbfe}
.price-layout>.price-table tbody td{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;height:auto!important;padding:0!important;border:0!important;text-align:left;gap:5px;min-width:0}.price-layout>.price-table tbody td:before{content:attr(data-price-label);display:block;font-size:12px;line-height:18px;color:#6f8499}
.price-layout>.price-table td[data-price-label="序号"]{grid-column:1/-1;flex-direction:row;align-items:center;color:#557994;font-size:12px}.price-layout>.price-table td[data-price-label="删除"],.price-layout>.price-table td[data-price-label="操作"]{justify-content:flex-end;align-items:flex-end}.price-layout>.price-table td[data-price-label="删除"]:before,.price-layout>.price-table td[data-price-label="操作"]:before{display:none}
.price-layout>.price-table input,.price-layout>.price-table select{width:100%;max-width:none}.price-layout>.price-table .agreement-supplier-field{width:100%}
}
@container(max-width:560px){.price-layout>.price-table tbody tr{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container(max-width:340px){.price-layout>.price-table tbody tr{grid-template-columns:minmax(0,1fr)}}

.cost-company-picker{position:relative;min-width:0;width:100%}.cost-company-trigger{width:100%;min-width:0;height:34px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 9px;border:1px solid #c7d7e6;border-radius:4px;background:#fff;color:#33546f;font:inherit;text-align:left}
.cost-company-trigger>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cost-company-trigger svg{flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.5;transition:transform .15s}.cost-company-trigger[aria-expanded=true]{border-color:#80aede;box-shadow:0 0 0 2px #e6f0fb}.cost-company-trigger[aria-expanded=true] svg{transform:rotate(180deg)}
.cost-company-options{position:fixed;inset:auto;margin:0;padding:5px 0;border:1px solid #c7d7e6;border-radius:5px;box-shadow:0 4px 14px #23445f22;background:#fff;color:#33546f;font:inherit;max-width:calc(100vw - 24px);overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.cost-company-options[hidden],.cost-company-options:not(:popover-open){display:none}.cost-company-options [role=option]{padding:7px 13px;min-height:34px;line-height:20px;cursor:pointer;white-space:normal;overflow-wrap:anywhere}.cost-company-options .chosen{box-shadow:inset 3px 0 #6e9bd0;color:#396d9e}.cost-company-options .active{background:#e9f2fc;color:#295e90}
