/* ERP visual tokens. No visibility, business state, column order or event changes. */
:root{--ui-font:'Segoe UI','Microsoft YaHei',sans-serif;--ui-ink:#172a35;--ui-muted:#71848a;--ui-primary:#13776a;--ui-hover:#0e6358;--ui-tint:#edf6f3;--ui-line:#dce6e6;--ui-head:#eef4f4;--ui-danger:#b44c47;--ui-radius:6px;--ui-shadow:0 16px 48px #102f3226}
body{font-family:var(--ui-font)!important;color:var(--ui-ink)!important}
body:not(.login-page){background:#fff!important}
button,input,select,textarea,.button{font-family:var(--ui-font)!important}
/* The report / quotation artwork is intentionally outside these selectors. */
.shell main :is(h2,h3):not(.quote-paper *),dialog :is(h2,h3),.country-settings-panel :is(h2,h3),.erp-native-coa .layout h2,.erp-native-ads .modal h2{color:var(--ui-ink)!important;letter-spacing:0;font-weight:600}
.shell main h2:not(.quote-paper *),dialog h2,.country-settings-panel h2{font-size:18px!important;line-height:26px}
.shell main h3:not(.quote-paper *),dialog h3,.country-settings-panel h3{font-size:14px!important;line-height:22px}
.shell :is(.hint,.muted),.erp-native-coa :is(.note,.sub),.erp-native-goods .note{color:var(--ui-muted);font-size:12px;line-height:1.6}
.shell :is(.panel,.card,.summary-grid),.erp-native-coa .panel,.erp-native-ads :is(.card,.metric),.erp-native-quote :is(.cart-panel,.product-category,.batch-import-wrap,.search-bar){border-color:var(--ui-line)!important;border-radius:var(--ui-radius)!important;box-shadow:none!important;background:#fff}
.shell :is(.panel,.card){padding:20px}
.shell .registration-panel,.shell .ticket-panel{padding:0!important}
.shell .summary-card,.erp-native-ads .metric{border-color:var(--ui-line)!important;background:#fff!important}
/* Controls keep compact inline-table dimensions from their module styles. */
button,.button{font-size:13px;border-radius:var(--ui-radius)!important;box-shadow:none!important;transition:background-color .12s,border-color .12s}
.shell main :is(button,.button):not(table *):not(.text-button):not(.column-filter-button):not(.image-viewer *),dialog button,.erp-native-goods .top button,.erp-native-ads .top button,.country-settings-panel button{min-height:34px;padding:6px 12px;line-height:20px}
.shell main :is(button,.button):not(.secondary):not(.text-button):not(.column-filter-button):not(.ledger-cell-button):not(.ledger-image-empty):not(.kind-image *):not(.erp-cell-menu *):not(.ledger-sections *),.erp-add-record{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.erp-native-quote button,.erp-native-goods button,.erp-native-ads button,.erp-native-coa button,.shell .secondary{background:#fff!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
.erp-native-quote :is(#erpQuotePublish,.settings-save,.spec-add-btn,.batch-btn-group button:first-child,.search-bar button),.erp-native-goods :is(.primary,.erp-add-record),.erp-native-ads :is(.primary,.btn-primary),.erp-native-coa .action.primary{background:var(--ui-primary)!important;color:#fff!important;border-color:var(--ui-primary)!important}
.erp-native-quote :is(button.active,.manufacturer-tab.active),.erp-native-ads .tabs button.on,.erp-native-coa .spec.active,.erp-native-goods #manualBtn[aria-pressed=true]{background:var(--ui-tint)!important;color:var(--ui-primary)!important;border-color:#bad8cf!important}
button:not(:disabled):hover,.button:hover{filter:brightness(.97)}
button:disabled,.button[aria-disabled=true]{opacity:.5;cursor:not-allowed}
.text-button{background:transparent!important;border-color:transparent!important;color:var(--ui-muted)!important}
.erp-native-goods :is(#deleteDataBtn,#deleteConfirm),.erp-native-quote .delete-manufacturer-btn,.erp-native-ads .danger,button.danger{background:#fff4f2!important;color:var(--ui-danger)!important;border-color:#edcfca!important}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea{border:1px solid var(--ui-line)!important;border-radius:5px!important;background:#fff;color:var(--ui-ink);font-size:13px!important;box-shadow:none!important}
.shell input:not(table *):not([type=checkbox]):not([type=radio]):not([type=file]),.shell select:not(table *),dialog input:not([type=checkbox]):not([type=radio]):not([type=file]),dialog select{min-height:34px;padding:6px 10px}
textarea{padding:8px 10px;line-height:1.5;resize:vertical}
input::placeholder,textarea::placeholder{color:#91a0a4;opacity:1}
input:disabled,select:disabled,textarea:disabled,input[readonly]{background:#f3f6f6!important;color:var(--ui-muted)!important}
input[type=checkbox],input[type=radio],progress{accent-color:var(--ui-primary)!important}
input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #73b4a4!important;outline-offset:2px}
input[aria-invalid=true],textarea[aria-invalid=true]{border-color:var(--ui-danger)!important}
/* Tables: common palette and grid; row heights remain content-appropriate. */
.shell main table:not(.quote-paper table),.erp-native-goods table,.erp-native-ads table,.erp-native-quote :is(.country-settings-table,.erp-image-cart table),.erp-native-coa dialog table{font-family:var(--ui-font)!important;font-size:13px;border-color:var(--ui-line)!important}
.shell main th:not(.quote-paper *),.erp-native-goods th,.erp-native-ads th,.erp-native-quote :is(.country-settings-table th,.erp-image-cart th),.erp-native-coa dialog th{background:var(--ui-head)!important;color:#3c6069!important;border-color:var(--ui-line)!important;font-size:12px!important;font-weight:600!important}
.shell main td:not(.quote-paper *),.erp-native-goods td,.erp-native-ads td,.erp-native-quote :is(.country-settings-table td,.erp-image-cart td),.erp-native-coa dialog td{border-color:var(--ui-line)!important}
.shell main tbody tr:hover>td:not(.quote-paper *),.erp-native-goods tbody tr:hover>td{background:#f0f7f5}
.shell :is(.list-totals,.registration-total-scroll),.erp-native-goods .erp-goods-totals-scroll,.erp-native-ads tfoot td{background:var(--ui-tint)!important;color:#24454f!important}
.shell .badge{border-radius:4px;font-size:11px;background:var(--ui-tint);color:var(--ui-primary)}
.shell .badge.wait{background:#fff5df;color:#946a22}
.shell .message{border:1px solid #cbe2d8;background:var(--ui-tint);color:#245c4e;border-radius:6px}
.shell :is(.message.error,.errorlist){background:#fff4f2;color:var(--ui-danger);border-color:#edcfca}
/* Native dialogs and overlay-based dialogs share the same visual surface. */
dialog,.country-settings-panel,.erp-native-ads :is(.modal,.entry-modal){background:#fff!important;color:var(--ui-ink)!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;box-shadow:var(--ui-shadow)!important;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);font:13px/1.5 var(--ui-font)}
dialog{padding:20px;overflow:auto}
dialog::backdrop{background:#102f3266!important;backdrop-filter:blur(2px)}
.country-settings-modal,.erp-native-ads .modalbg{background:#102f3266!important;backdrop-filter:blur(2px)}
.country-settings-panel{padding:20px!important}
.modal-head,.modalhead,.entry-modal-head,.country-settings-head{background:#fff!important;color:var(--ui-ink)!important;border-bottom:1px solid var(--ui-line)!important;padding:16px 20px!important;gap:16px;align-items:center}
.modal-head h2,.modalhead h2,.entry-modal-head h2,.country-settings-head h2{font-size:18px!important;line-height:26px;margin:0!important;color:var(--ui-ink)!important}
.modal-body,.entry-modal-body{padding:20px!important;background:#fff!important}
.modal-actions,.country-settings-actions,.ledger-dialog-actions,.ocr-actions{gap:8px;align-items:center;border-top:1px solid var(--ui-line);padding-top:16px!important;margin-top:16px!important}
dialog>.panel-head,dialog>form>.panel-head{padding-bottom:14px;border-bottom:1px solid var(--ui-line);margin-bottom:16px}
.modal-head button[data-close],dialog button[aria-label^='关闭'],dialog [data-close-viewer]{width:32px;min-width:32px;min-height:32px;padding:4px!important;color:var(--ui-muted)!important;background:#fff!important;border:1px solid var(--ui-line)!important}
.erp-native-goods dialog{padding:0!important}
.erp-native-goods dialog:not(:has(.modal-head)) .modal-body{padding-top:20px!important}
.erp-native-goods .erp-catalog-entry{width:min(1240px,calc(100vw - 32px))}
.erp-catalog-entry .erp-entry-scroll{margin-bottom:12px;border:1px solid var(--ui-line);border-radius:6px;overflow:auto}
.erp-catalog-entry table{border-collapse:collapse;min-width:980px}
.erp-catalog-entry :is(th,td){padding:10px 8px!important;border:1px solid var(--ui-line)!important;vertical-align:middle}
.erp-catalog-entry th{height:38px!important}
.erp-catalog-entry input,.erp-catalog-entry select{height:34px!important;min-height:34px!important}
.erp-catalog-entry textarea{height:52px!important;min-height:52px;border-color:var(--ui-line)!important}
.erp-catalog-entry .erp-entry-scroll th:last-child{width:76px!important}
.erp-catalog-entry .erp-entry-scroll td:last-child button{white-space:nowrap;min-width:52px;padding:5px 8px!important;color:var(--ui-danger)!important;background:#fff!important;border-color:#edcfca!important}
.erp-catalog-entry [data-more]{color:var(--ui-primary)!important;border-color:#bad8cf!important;background:#fff!important}
.country-settings-head{padding:0 0 14px!important}
.country-settings-panel :is(.public-settings,.common-settings){background:#f5f9f8!important;border-radius:6px!important}
.country-settings-table-wrap{overflow:auto!important}
.country-settings-table{min-width:960px}
.country-settings-panel .settings-cancel{background:#fff!important;color:var(--ui-ink)!important;border:1px solid var(--ui-line)!important}
.erp-native-coa .layout{background:#f5f8f7}
.erp-native-coa :is(#global-panel,#single-panel){background:#fff!important;border-color:var(--ui-line)!important;border-radius:6px!important;box-shadow:none!important}
.erp-native-coa .category{color:#24454f;border-bottom-color:var(--ui-line);font-size:13px}
.erp-native-coa .category.expanded{background:var(--ui-tint)!important;color:var(--ui-primary)!important}
.erp-native-coa :is(.spec-list,.spec:hover){background:#f5f9f8!important}
.erp-native-quote .cat-header{background:var(--ui-head)!important;color:#24454f!important}
.erp-native-quote .batch-import-wrap,.erp-native-quote .search-bar{background:#f7faf9!important;border-color:var(--ui-line)!important}
.erp-native-quote .batch-import-wrap h4{color:var(--ui-ink)!important;font-weight:600}
.erp-native-quote .scroll-float-btn{background:var(--ui-primary)!important;color:#fff!important}
.erp-native-goods :is(.vendor-filter-menu,#productRowMenu),.column-filter-popup,.erp-cell-menu,.queue-toast{border-color:var(--ui-line)!important;border-radius:6px!important;box-shadow:0 6px 24px #102f3220!important;background:#fff}
.shell .sidebar{background:#102f32}.shell~.queue-toast{font-size:13px}
@media(max-width:700px){dialog,.country-settings-panel{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.modal-head,.modal-body,.entry-modal-body{padding:14px!important}}
.erp-native-quote #searchClearBtn{background:transparent!important;color:var(--ui-muted)!important;border:0!important}.country-settings-panel .common-settings-row{background:#f5f9f8!important;border-radius:6px!important}
body.erp-native-ads .modal table th{background:var(--ui-head)!important;color:#3c6069!important;border-color:var(--ui-line)!important}body.erp-native-ads .metric:nth-child(1) b,body.erp-native-ads .metric:nth-child(2) b,body.erp-native-ads .metric:nth-child(4) b{color:var(--ui-primary)!important}body.erp-native-ads .metric:has(.red) b{color:var(--ui-danger)!important}.erp-native-ads .modalhead button{min-width:32px;height:32px;border:1px solid var(--ui-line)!important;border-radius:6px!important}.erp-native-ads .modal :is(input,select){min-height:34px;padding:6px 10px}

dialog>h3:first-child{font-size:18px!important;line-height:26px!important;margin:0 0 16px!important;padding-bottom:14px;border-bottom:1px solid var(--ui-line)}

.ticket-link-stack{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:60px}.ticket-link-stack button{padding:3px 12px!important;min-height:26px!important}.ticket-table .sequence .ticket-row-unread{display:block;width:fit-content;margin:5px auto 0}.ticket-table .sequence .ticket-row-unread[hidden]{display:none}
