:root{--ink:#252a2b;--muted:#758083;--bg:#f4f5f2;--card:#fff;--green:#245b4b;--gold:#b98a4b;--line:#e7e8e3;--red:#b8493f}*{box-sizing:border-box}body{margin:0;font:14px/1.5 system-ui,"Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg)}button,input,select,textarea{font:inherit}.hide{display:none!important}.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#183f35,#2c6b58)}.login-card{width:min(390px,90vw);padding:38px;background:#fff;border-radius:18px;box-shadow:0 24px 70px #102f2780;text-align:center}.mark{width:62px;height:62px;margin:auto;border-radius:18px;background:var(--green);color:white;font:700 34px/62px serif}.login h1{margin:16px 0 0}.login p{color:var(--muted);margin:5px 0 24px}.login input{width:100%;padding:13px;margin:7px 0;border:1px solid var(--line);border-radius:9px}.login button,.primary{border:0;background:var(--green);color:#fff;padding:11px 18px;border-radius:9px;cursor:pointer}.login button{width:100%;margin:14px 0}.login small{color:var(--muted)}#app{display:grid;grid-template-columns:230px 1fr;min-height:100vh}aside{background:#183f35;color:#fff;padding:25px 16px;position:fixed;width:230px;height:100vh;display:flex;flex-direction:column}.brand{padding:0 12px 26px}.brand b{display:block;font-size:21px}.brand span{opacity:.6;font-size:12px}nav{display:grid;gap:5px}nav button{border:0;background:transparent;color:#d9e5e1;padding:11px 14px;border-radius:8px;text-align:left;cursor:pointer}nav button:hover,nav button.active{background:#ffffff17;color:#fff}.user{margin-top:auto;padding:15px 12px;border-top:1px solid #ffffff20;display:flex;justify-content:space-between}.link{border:0;background:none;color:#d9e5e1}main{grid-column:2;padding:0 30px 40px}header{height:88px;display:flex;align-items:center;gap:15px}header h2{margin:0;font-size:23px}header small{color:var(--muted)}header .ghost{margin-left:auto}.menu{display:none;border:0;background:none;font-size:25px}.ghost{border:1px solid var(--line);background:white;border-radius:8px;padding:9px 13px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.card,.panel{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px}.card small{color:var(--muted)}.card strong{display:block;font-size:25px;margin-top:8px}.card.green strong{color:var(--green)}.card.red strong{color:var(--red)}.grid2{display:grid;grid-template-columns:2fr 1fr;gap:15px;margin-top:15px}.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.panel h3{margin:0}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:11px 8px;border-bottom:1px solid var(--line);white-space:nowrap}th{color:var(--muted);font-weight:500}.table-wrap{overflow:auto}.badge{padding:3px 8px;border-radius:99px;background:#fff2d8;color:#8c641f}.badge.ok{background:#e4f3ed;color:var(--green)}.toolbar{display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap}.toolbar input,.toolbar select{padding:9px;border:1px solid var(--line);border-radius:8px}.modal{position:fixed;inset:0;background:#1118;display:grid;place-items:center;z-index:9;padding:15px}.dialog{background:#fff;border-radius:14px;padding:25px;width:min(760px,96vw);max-height:92vh;overflow:auto;position:relative}.close{position:absolute;right:15px;top:12px;border:0;background:none;font-size:24px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.field label{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.field input,.field select,.field textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:7px}.span2{grid-column:span 2}.items td{padding:5px}.items input,.items select{width:100%;min-width:80px;padding:7px;border:1px solid var(--line);border-radius:6px}.danger{border:0;background:#f8e8e6;color:var(--red);border-radius:6px;padding:6px}.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#222;color:white;padding:10px 18px;border-radius:8px;display:none;z-index:20}.empty{text-align:center;color:var(--muted);padding:35px}.report{font-size:30px;color:var(--green);font-weight:700}
@media(max-width:850px){#app{display:block}aside{transform:translateX(-100%);transition:.2s;z-index:8}.open aside{transform:none}.open:after{content:"";position:fixed;inset:0;background:#0005;z-index:7}main{padding:0 14px 35px}header{height:72px}.menu{display:block}.cards{grid-template-columns:1fr 1fr}.grid2{grid-template-columns:1fr}.ghost{font-size:12px}.form-grid{grid-template-columns:1fr}.span2{grid-column:auto}}@media(max-width:480px){.cards{grid-template-columns:1fr}.card strong{font-size:22px}}
/* 供应商数量精准结算 */
.account-dialog-wide{width:min(96vw,1680px)!important;max-width:none!important}
.supplier-settlement .settlement-head{margin-top:20px;align-items:flex-end}
.supplier-settlement .settlement-head>div:last-child{display:flex;align-items:center;gap:14px}
.supplier-settlement .settlement-lines input{width:120px;min-width:100px;padding:10px;border:1px solid #ccd9d4;border-radius:9px}
.supplier-settlement .supplier-line-total{font-weight:700;color:#176d58;white-space:nowrap}
.supplier-settlement .payment-history-head{margin-top:24px}
.supplier-settlement table th,.supplier-settlement table td{padding:13px 10px}
@media(max-width:760px){.supplier-settlement .settlement-head{align-items:stretch}.supplier-settlement .settlement-head>div:last-child{justify-content:space-between}.supplier-settlement .settlement-lines{overflow-x:auto}}
.item-discount-head,.item-discount-cell{width:82px}.discount-input{display:flex;align-items:center;gap:3px}.discount-input input{width:58px!important;min-width:0!important;text-align:center}.discount-input span{color:var(--muted)}.item-discount-show{white-space:nowrap;color:#a06b18;font-weight:700}
.settlement-lines table{table-layout:auto!important}.settlement-lines .supplier-check-column{width:64px!important;min-width:64px!important;max-width:64px!important;text-align:center!important;padding:12px 18px!important}.settlement-lines .supplier-check-column input[type="checkbox"]{display:block!important;position:static!important;width:22px!important;height:22px!important;min-width:22px!important;margin:0 auto!important;cursor:pointer}.settlement-lines .supplier-address-column{width:220px!important;min-width:180px!important;line-height:1.6;font-weight:600}.settlement-lines .supplier-clickable-row{cursor:pointer;transition:background .18s ease,transform .18s ease}.settlement-lines .supplier-clickable-row:hover td:not(.supplier-check-column){background:#f1f8f5}.settlement-lines .supplier-clickable-row:active{transform:scale(.998)}.settlement-lines .supplier-clickable-row input,.settlement-lines .supplier-clickable-row button{cursor:auto}.settlement-lines .supplier-clickable-row input[type="checkbox"],.settlement-lines .supplier-clickable-row button{cursor:pointer}
.library-filter{margin-bottom:16px}.library-filter input{min-width:300px}.library-filter select{min-width:170px}.filter-count{margin-left:auto;color:var(--muted);font-size:14px;white-space:nowrap}@media(max-width:760px){.library-filter input,.library-filter select{width:100%;min-width:0}.filter-count{width:100%;margin-left:0}}
.user-dialog{width:min(760px,94vw)!important;max-width:760px!important;padding:0!important;overflow:hidden}.user-dialog>.close{top:20px!important;right:20px!important}.user-create-head{padding:30px 34px 24px;background:linear-gradient(135deg,#f3faf6,#eef7f3);border-bottom:1px solid #dce9e3}.user-create-head span{font-size:11px;letter-spacing:.24em;color:#c49342}.user-create-head h2{margin:5px 0 6px;font-size:26px}.user-create-head p{margin:0;color:var(--muted)}.user-create-form{padding:28px 34px 30px}.user-create-form .form-grid{gap:18px}.user-create-form label{font-weight:650;color:#38564e}.user-create-form input,.user-create-form select{height:52px;background:#fbfdfc}.user-create-form em{color:#c44b43;font-style:normal}.user-role-note{display:flex;flex-direction:column;gap:4px;margin-top:20px;padding:14px 16px;border-radius:12px;background:#f5f8f6;color:#60736d}.user-role-note b{color:#1c6553}.user-create-form .actions{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.user-create-form .actions button{min-width:118px}.user-create-form button:disabled{opacity:.65;cursor:not-allowed}@media(max-width:650px){.user-create-head{padding:26px 22px 20px}.user-create-form{padding:22px}.user-create-form .form-grid{grid-template-columns:1fr}.user-create-form .actions button{flex:1}}
.item-discount-total{background:#fffaf0!important}.item-discount-total span{color:#9b6b1c!important}.item-discount-total b{color:#b87917!important;font-weight:750}.invoice-summary .item-discount-total{display:flex;justify-content:space-between;align-items:center}
.supplier-settlement .payment-history-head+.table-wrap{overflow-x:auto}.supplier-settlement .payment-history-head+.table-wrap table{table-layout:auto!important;min-width:920px!important}.supplier-settlement .payment-history-head+.table-wrap th,.supplier-settlement .payment-history-head+.table-wrap td{vertical-align:middle;word-break:normal!important;overflow-wrap:normal!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(1),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(1){width:125px!important;min-width:125px!important;white-space:nowrap!important;text-align:left!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(2),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(2){width:150px!important;min-width:150px!important;white-space:normal!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(3),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(3){width:190px!important;min-width:160px!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(4),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(4){width:115px!important;min-width:115px!important;white-space:nowrap!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(5),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(5){width:130px!important;min-width:130px!important;white-space:nowrap!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(6),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(6){min-width:180px!important}.supplier-settlement .payment-history-head+.table-wrap th:nth-child(7),.supplier-settlement .payment-history-head+.table-wrap td:nth-child(7){width:130px!important;min-width:130px!important;text-align:center!important;white-space:nowrap!important}
.sales-list-table .address-cell{min-width:220px;max-width:420px;white-space:normal;line-height:1.55}.sales-list-table .row-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}.sales-list-table .row-actions button{min-width:58px}.sales-list-table .delete-order-button{color:#b94c44;border-color:#efd2ce;background:#fff8f7}.sales-list-table .delete-order-button:hover{background:#fff0ee}
.unified-account-detail .settlement-head,.supplier-settlement .settlement-head{margin-top:28px}.unified-account-detail .payment-history-head,.supplier-settlement .payment-history-head{margin-top:34px;padding-top:24px;border-top:1px solid var(--line)}.unified-account-detail .check-col,.supplier-settlement .check-col{width:54px!important;min-width:54px!important;text-align:center!important}.account-open-cell{cursor:pointer;color:#174f42;font-weight:650;transition:background .15s ease,color .15s ease}.account-open-cell:hover{background:#edf7f2!important;color:#0f725b}.account-open-cell small{display:block;margin-top:4px;color:#8aa098;font-size:10px;font-weight:400}.unified-account-detail .danger,.supplier-settlement .payment-history-head~.table-wrap .danger{white-space:nowrap;color:#b84b43;border-color:#efd2ce;background:#fff8f7}
.account-status-filter{min-width:155px;border-color:#bfcfc8!important;background:#f7fbf9!important;color:#1c5f4e;font-weight:650}.account-filter-title{color:#176d58;font-size:13px;font-weight:650}.account-status-empty td{height:96px}

/* 弹窗内容再多也不丢失底部操作按钮。 */
.dialog{max-height:calc(100dvh - 30px);overscroll-behavior:contain}.dialog.entity-dialog,.dialog.user-dialog{overflow-y:auto!important;overflow-x:hidden!important}.dialog.account-dialog-wide{overflow-y:auto!important;overflow-x:hidden!important}.dialog.account-dialog-wide>.close{position:sticky!important;float:right;top:0;z-index:20}.dialog.account-dialog-wide .supplier-settlement>.actions,.dialog.entity-dialog .entity-actions,.dialog.user-dialog .actions{position:sticky;bottom:-1px;z-index:15;margin-left:-1px;margin-right:-1px;padding:17px 1px 4px!important;background:linear-gradient(180deg,rgba(255,255,255,.9),#fff 28%);box-shadow:0 -10px 22px rgba(16,61,49,.06)}@media(max-height:720px){.dialog.entity-dialog .entity-dialog-head,.dialog.user-dialog .user-create-head{padding-top:20px!important;padding-bottom:18px!important}.dialog.entity-dialog .entity-form,.dialog.user-dialog .user-create-form{padding-top:20px!important;padding-bottom:20px!important}}

/* V42.3 订货装车费与经营费用分类 */
.supplier-loading-editor{display:grid;grid-template-columns:auto minmax(82px,120px) auto;align-items:center;gap:7px;margin-top:8px;padding-top:8px;border-top:1px dashed var(--line)}
.supplier-loading-editor label{font-size:12px;color:var(--muted);font-weight:700}.supplier-loading-editor input{width:100%!important;min-width:0!important}.supplier-loading-editor small{grid-column:1/-1;color:#9a6c24;white-space:normal;line-height:1.4}.loading-fee-included{display:block;margin-top:3px;color:#a26c18;font-size:10px;font-weight:500}
.report-cost-section{margin-top:18px;padding:20px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.84)}.report-cost-section .panel-head{gap:18px}.report-cost-section .panel-head h3{margin:0 0 5px}.report-cost-section .panel-head small{color:var(--muted)}.report-cost-section .panel-head>b{color:var(--theme-primary,var(--green));white-space:nowrap}.report-category-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:12px}.report-cost-card{padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(145deg,#fff,var(--theme-soft,#f3f8f5))}.report-cost-card span{display:block;color:var(--muted);font-size:12px}.report-cost-card strong{display:block;margin-top:7px;font-size:20px;color:#183c33}
@media(max-width:1100px){.report-category-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:650px){.supplier-loading-editor{grid-template-columns:auto 1fr}.supplier-loading-editor button{grid-column:1/-1}.report-cost-section .panel-head{align-items:flex-start;flex-direction:column}.report-category-grid{grid-template-columns:repeat(2,1fr)}}
