/* Desktop density aligned with the user's Wise365 reference. */
:root,body{font-size:13px;line-height:1.45}
button,input,select,textarea{font-size:13px;border-radius:3px}
button,.btn{padding:5px 12px;min-height:30px;border-radius:3px}
input,select,textarea,.input,.select{padding:6px 9px;border-radius:3px}
input:not([type=checkbox]):not([type=radio]),select{min-height:32px}
textarea{min-height:64px}
.workspace-nav{width:180px;padding:14px 10px;font-size:13px;line-height:1.45}
.workspace-nav a{padding:7px 12px;border-radius:3px}
.workspace-nav .workspace-brand{font-size:20px;padding-bottom:12px}
.workspace-nav h2{margin:14px 12px 4px;letter-spacing:0}
.workspace-flow{margin:18px 8px 0;padding-top:12px}
.unified-workspace{padding-left:180px}
.unified-workspace #app>header{padding:12px 18px;min-height:64px}
h1,.unified-workspace .title{font-size:20px}
header p{margin-top:4px;font-size:12px}
main{margin:12px auto;padding:0 14px}
.unified-workspace .main{padding:16px}
.tabs{gap:6px;margin-bottom:10px}
.tabs button{min-width:84px;font-size:13px;padding:6px 12px}
.stats{gap:22px}.stats b{font-size:17px}
.toolbar{gap:6px;margin:10px 0}
.toolbar input{max-width:300px}
.card,.panel{border-radius:3px;box-shadow:none}
.card table td,.card table th,.table td,.table th{height:36px;padding:6px 9px;font-size:12px;line-height:1.5;vertical-align:middle}
.card table th{width:130px;font-weight:600;background:#f7f7f7}
.card table th:nth-child(2){width:220px}
.card table th.row-number{width:44px;min-width:44px}
.card table th:nth-last-child(2){width:78px}
.card table th:last-child{width:190px}
.card table td:last-child button{padding:2px 8px;min-height:24px;margin:0 6px 0 0;font-size:12px}
.card table td .link-button{padding:0;min-height:0;font-weight:500}
.pill{padding:2px 7px;font-size:12px;border-radius:10px}
.pagebar{padding:9px 12px;gap:8px}
.subtabs{gap:5px;margin:8px 0 4px}
.approval-tabs .link-button{padding:4px 8px}
dialog{border-radius:5px;max-height:94vh;width:min(1440px,96vw)}
dialog header{padding:10px 16px}dialog h2{font-size:17px}
dialog form,dialog .content{padding:14px 16px}
.grid,.proxy-form-grid{gap:12px 18px}
label{font-size:13px;gap:5px}
.proxy-form-group{margin:8px 0 14px;padding:12px;border-radius:4px}
.proxy-form-group>summary{font-size:14px;padding-bottom:10px}
.proxy-form-grid input,.proxy-form-grid select{min-height:32px}
.subtitle{margin-bottom:12px;font-size:12px}
.customer-banner,.linked-orders{padding:10px 12px;margin-bottom:12px;border-radius:4px}
.buttons{padding-top:12px;margin-top:14px;gap:7px}
.date-display{min-height:32px;padding:6px 9px;border-radius:3px;font-size:13px}
.date-parts select{min-height:30px;padding:5px}
.date-parts button{min-height:28px;padding:4px}
.top{margin-bottom:14px}.panel-head{padding:10px 14px}.panel-title{font-size:14px}
.filters{padding:9px 14px;gap:7px}.table th{font-size:12px}
.modal{border-radius:5px}.modal-head,.modal-body{padding:14px 16px}.modal-foot{padding:10px 16px}
.form-grid{gap:10px 14px}.field label{font-size:13px}
.customer{gap:7px}.face{width:26px;height:26px;border-radius:4px}.tag{padding:2px 6px}
@media(max-width:800px){.workspace-nav{width:auto;padding:8px}.unified-workspace{padding-left:0}.unified-workspace .main{padding:12px}.toolbar{flex-wrap:wrap}}

/* Keep explicit default widths instead of stretching every column to fill the screen. Native header dragging remains enabled. */
.card table.order-list-table{width:1px;min-width:0;table-layout:fixed}
.card table.order-list-table th{min-width:60px;max-width:none}
.card table.order-list-table th.row-number{min-width:44px}

.pill.service-stopped{background:#e5e7eb;color:#626b77}
.pill.service-overdue{background:#e53935;color:#fff}
.table-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0;flex-wrap:wrap}
.status-legend{display:flex;align-items:center;gap:8px;color:#748499;font-size:12px}
.table-scroll-controls{display:flex;align-items:center;gap:7px;margin-left:auto}
.order-list-card{overflow:hidden;max-width:100%}
.order-table-scroll{overflow:auto;max-height:65vh;width:100%;scrollbar-width:auto;scrollbar-color:#9aa9bb #eef2f6}
.order-table-scroll::-webkit-scrollbar{height:13px;width:10px}
.order-table-scroll::-webkit-scrollbar-thumb{background:#9aa9bb;border:2px solid #eef2f6;border-radius:6px}
.order-table-scroll::-webkit-scrollbar-track{background:#eef2f6}
.order-table-scroll thead th{position:sticky;top:0;z-index:1}
.order-table-scroll:focus-visible{outline:2px solid #3389d2;outline-offset:-2px}

#visibility .field-checks{max-height:46vh;overflow:auto;margin-top:10px;border:1px solid #e2e8ef}#visibility .field-row{border-width:0 0 1px;border-radius:0;padding:7px 10px}#visibility .field-row[hidden]{display:none}.field-row-actions{display:flex;align-items:center;gap:6px}.field-row-actions small{min-width:95px}#fieldSearch{width:100%;margin-top:10px}#fieldEditor textarea{min-height:150px}

#fieldEditOptions[hidden]{display:none}
.dropdown-kinds{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 14px}
#dropdownSearch{width:min(520px,100%);margin-bottom:14px}
.dropdown-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-height:56vh;overflow:auto;padding:2px}
.dropdown-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:8px;padding:14px;min-height:120px;border:1px solid #dce5ef;background:#fff;overflow:hidden}
.dropdown-card strong{font-size:15px}.dropdown-card span{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#718096}.dropdown-card b{font-size:12px;color:#1779d5;font-weight:500}.dropdown-card[hidden]{display:none}
.dropdown-option-list{max-height:48vh;overflow:auto;margin:12px 0}.dropdown-option{display:flex;gap:10px;margin:8px 0}.dropdown-option input{flex:1}.dropdown-option span{display:flex;gap:5px}.dropdown-shared{padding:10px;background:#f0f6ff;color:#566a83;line-height:1.7;font-size:12px}
@media(max-width:800px){.dropdown-cards{grid-template-columns:1fr}}

/* Unified order product selection */
.product-item{border:1px solid #dce4ef;border-radius:6px;margin:10px 0;padding:12px;background:#fff}.product-item>summary{font-weight:600;color:#386bbe;cursor:pointer}.product-item-top{display:flex;align-items:end;justify-content:space-between;margin:12px 0}.product-item-top label{max-width:200px}.product-picker{border:1px solid #dce4ef;background:#f7faff;padding:12px;margin-top:12px}.product-picker-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:280px;overflow:auto}.product-picker-results>div,.catalog-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border-bottom:1px solid #e5eaf1}.product-picker-results small,.catalog-row small{display:block;color:#7b8898;margin-top:4px}.catalog-list{max-height:62vh;overflow:auto}.product-field-checks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:42vh;overflow:auto}.product-field-checks label{display:flex;gap:8px;align-items:center}.product-field-checks input{width:auto}.product-picker[hidden],.catalog-row[hidden]{display:none}@media(max-width:900px){.product-picker-results,.product-field-checks{grid-template-columns:repeat(2,minmax(0,1fr))}}

.product-amount-row{display:grid;grid-template-columns:140px minmax(160px,1fr) 180px auto;gap:18px;align-items:center}.product-amount-row small{display:block;color:#7b8898;margin-bottom:6px}.product-amount-row label{margin:0}.product-amount-row strong{font-weight:500}.product-extra-fields{margin-top:12px;border-top:1px solid #e5eaf1;padding-top:10px}.product-extra-fields summary{color:#386bbe;cursor:pointer}.product-extra-fields .grid{margin-top:12px}.product-amount-total{text-align:right;padding:10px 2px;color:#52647c}.product-amount-total b{color:#2864b4}@media(max-width:700px){.product-amount-row{grid-template-columns:1fr 1fr;gap:10px}}

.product-amount-row{grid-template-columns:110px minmax(140px,1fr) repeat(3,minmax(100px,150px)) auto;gap:12px}@media(max-width:1000px){.product-amount-row{grid-template-columns:repeat(3,minmax(0,1fr))}}

.product-field-group{min-width:0}.product-field-group h4{margin:10px 0;padding:7px 10px;background:#f3f7fc;color:#45658b;border-left:3px solid #7ca6d8;font-size:13px}

/* 客户资料保持两行；文字链接不继承普通按钮的最小高度。 */
#customers .table td,#public .table td,#overview .table td{height:50px!important;min-height:50px!important;max-height:none!important;padding:6px 10px!important}
.table .customer{height:auto;min-height:36px;max-width:100%;align-items:center}
.table .customer>div:last-child{flex:1;min-width:0;line-height:18px}
.table .customer .customer-name{height:auto;min-height:0;max-height:none;padding:0;margin:0;border:0;border-radius:0;line-height:18px;font-size:13px;box-shadow:none}
.table .customer small{display:flex;align-items:center;gap:4px;min-width:0;margin-top:2px;line-height:16px;font-size:12px;color:var(--muted)}
.table .customer small .customer-name{flex:0 1 auto;min-width:0;color:var(--muted);font-size:12px;font-weight:400;line-height:16px}
.table .customer .face{flex:0 0 26px}

/* 订单表单独立滚动，标题与保存操作始终留在弹窗内。 */
dialog[open]:has(> #record){display:flex;flex-direction:column;overflow:hidden;max-height:94vh;max-height:94dvh}
dialog:has(> #record)>header{flex-shrink:0}
dialog #record{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0;margin:0}
#record>.record-scroll{min-height:0;overflow:auto;padding:14px 16px;overscroll-behavior:contain;scroll-padding-bottom:16px}
#record>.record-actions{flex-shrink:0;flex-wrap:wrap;align-items:center;margin:0;padding:10px 16px;background:#fff;border-top:1px solid #dce4ef;box-shadow:0 -3px 10px #24364b08;z-index:2}

/* 全部编辑弹窗采用固定首尾、中间独立滚动。 */
dialog[open]:has(> .fixed-action-panel){display:flex;flex-direction:column;overflow:hidden;max-height:94vh;max-height:94dvh}
dialog:has(> .fixed-action-panel)>header{flex-shrink:0}
dialog>.fixed-action-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0;margin:0}
.fixed-action-panel>.fixed-action-scroll{min-height:0;overflow:auto;padding:14px 16px;overscroll-behavior:contain;scroll-padding-bottom:16px}
.fixed-action-panel>.fixed-action-footer{flex-shrink:0;flex-wrap:wrap;align-items:center;margin:0;padding:10px 16px;background:#fff;border-top:1px solid #dce4ef;box-shadow:0 -3px 10px #24364b08}
/* 客户新增、编辑、转单、跟进弹窗共用同一规则。 */
.modal-back .modal{display:flex;flex-direction:column;overflow:hidden;max-height:94vh;max-height:94dvh}
.modal>.modal-head{flex-shrink:0}
.modal>form{display:flex;flex-direction:column;min-height:0;overflow:hidden;margin:0}
.modal>.modal-body,.modal>form>.modal-body{min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-bottom:16px}
.modal .modal-foot{flex-shrink:0;flex-wrap:wrap;background:#fff;margin:0;padding:10px 16px;border-top:1px solid #dce4ef;box-shadow:0 -3px 10px #24364b08}

/* Approved compact product editor: left labels, two columns, independent groups. */
#record .product-extra-fields > .grid {display:block}
#record .product-field-group {border:0;border-radius:0;padding:0;margin:0 0 16px;background:#fff}
#record .product-field-group > summary {color:#438ac6;font-size:12px;font-weight:400;padding:9px 0;border-bottom:1px dotted #c6dbee;cursor:pointer}
#record .product-field-group > .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 22px;padding:14px 0}
#record .product-field-group .grid > label {display:grid;grid-template-columns:115px minmax(0,1fr);align-items:center;gap:5px 10px;margin:0;font-size:12px;min-width:0}
#record .product-field-group .product-field-label {color:#6e7b8d;line-height:1.5;overflow-wrap:anywhere}
#record .product-field-group input:not([type=checkbox]),#record .product-field-group select {width:100%;min-width:0;height:30px;min-height:30px;border-radius:3px;font-size:12px;padding:4px 8px}
#record .product-field-group textarea {min-height:60px;font-size:12px;border-radius:3px}
#record .product-field-group label > small,#record .product-field-group label > .document-list {grid-column:2}
#record .product-field-group label.wide {grid-column:1/-1}
#record .product-extra-fields {margin-top:10px}
#record .product-extra-fields > summary {font-size:12px;padding:7px 0}
@media(max-width:720px){#record .product-field-group > .grid{grid-template-columns:1fr}#record .product-field-group .grid > label{grid-template-columns:95px minmax(0,1fr)}}

.column-order-row{display:flex;align-items:center;gap:10px;padding:6px;border-bottom:1px solid #edf0f5}.column-order-row input{width:70px}.column-order-row span{flex:1}.product-field-checks label{display:flex!important;align-items:center;gap:8px}.product-field-checks input[type=checkbox]{width:auto!important;min-height:0!important}.inline-field-builder{padding:12px;border:1px solid #d7e1ee;margin:12px 0}.inline-field-builder .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
