:root { --xw-inventory-ready: 1; }
/* Five explicit business routes only. Never theme Feishu, login or admin pages. */
body.xw-inventory-theme {
  --xi-bg:#141641; --xi-panel:#202344; --xi-head:#292d50; --xi-field:#191d3a;
  --xi-line:#343858; --xi-border:#4b5073; --xi-text:#e0e3f0; --xi-muted:#aeb3ce;
  --ant-primary-color:#287d38; --ant-primary-color-hover:#318a42;
  color:var(--xi-text); background:var(--xi-bg); color-scheme:dark;
}
body.xw-inventory-theme #root main.ant-pro-basicLayout-content { background:var(--xi-bg); color:var(--xi-text); }
body.xw-inventory-theme :is(.ant-pro-page-container-warp,.ant-page-header,.ant-page-header-ghost) { background:transparent; }
body.xw-inventory-theme :is(.ant-breadcrumb,.ant-breadcrumb a,.ant-breadcrumb-separator,.ant-page-header-heading-sub-title) { color:var(--xi-muted); }
body.xw-inventory-theme :is(.ant-breadcrumb>span:last-child,.ant-page-header-heading-title) { color:var(--xi-text); }
body.xw-inventory-theme :is(.ant-pro-table-search,.ant-pro-table-list-toolbar,.ant-card,.ant-pro-card,.ant-table,.ant-table-container,.ant-table-content,.ant-table-body,.ant-table-footer,.ant-table-summary) { background:var(--xi-panel); color:var(--xi-text); border-color:var(--xi-line); }
body.xw-inventory-theme :is(.ant-card-head,.ant-pro-card-header,.ant-pro-table-list-toolbar-title,.ant-pro-table-list-toolbar-left,.ant-pro-table-list-toolbar-right,.ant-form-item-label>label) { color:var(--xi-text); border-color:var(--xi-line); }
body.xw-inventory-theme :is(.ant-input,.ant-input-affix-wrapper,.ant-input-number,.ant-picker,.ant-select:not(.ant-select-customize-input) .ant-select-selector) { background:var(--xi-field); color:var(--xi-text); border-color:var(--xi-border); border-radius:4px; }
body.xw-inventory-theme :is(.ant-input-number-input,.ant-picker-input>input,.ant-select-selection-item) { color:var(--xi-text); }
body.xw-inventory-theme :is(input::placeholder,.ant-select-selection-placeholder) { color:#959bb8; }
body.xw-inventory-theme :is(.ant-select-arrow,.ant-picker-suffix,.ant-picker-separator,.ant-input-prefix,.ant-input-suffix) { color:var(--xi-muted); }
body.xw-inventory-theme :is(.ant-input-clear-icon,.ant-select-clear,.ant-picker-clear) { background:var(--xi-field); color:var(--xi-muted); }
body.xw-inventory-theme :is(.ant-input:focus,.ant-input-affix-wrapper-focused,.ant-select-focused:not(.ant-select-disabled) .ant-select-selector,.ant-picker-focused) { border-color:#a5acd8; box-shadow:0 0 0 2px #a5acd81a; }
body.xw-inventory-theme .ant-btn { background:transparent; color:var(--xi-text); border-color:#555b7b; border-radius:4px; box-shadow:none; }
body.xw-inventory-theme .ant-btn:hover:not(:disabled) { background:#333858; border-color:#8990b5; color:#fff; }
body.xw-inventory-theme .ant-btn-primary:not(:disabled) { background:#287d38; border-color:#39934a; color:#fff; }
body.xw-inventory-theme .ant-btn-primary:hover:not(:disabled) { background:#318a42; border-color:#39934a; }
/* Existing export/import buttons have inline blue styles; retain their handlers. */
body.xw-inventory-theme .ant-pro-table-list-toolbar .ant-btn:not(.ant-btn-dangerous) { background:transparent!important; border-color:#555b7b!important; color:var(--xi-text)!important; }
body.xw-inventory-theme .ant-modal-body .ant-btn-primary:not(:disabled) { background:#287d38!important; border-color:#39934a!important; color:#fff; }
body.xw-inventory-theme .ant-btn-dangerous { color:#ffaaa9!important; border-color:#b85e69!important; }
body.xw-inventory-theme .ant-btn-link { border-color:transparent; color:#b5c2f4; }
body.xw-inventory-theme :is(.ant-btn:disabled,.ant-input:disabled,.ant-input-disabled,.ant-select-disabled .ant-select-selector,.ant-picker-disabled) { background:#252841!important; border-color:#3c405a!important; color:#9398b0!important; cursor:not-allowed; }
body.xw-inventory-theme :is(.ant-btn,.ant-pagination-item-link):focus-visible { outline:2px solid #b6b9e8; outline-offset:2px; }
body.xw-inventory-theme .ant-table-thead>tr>th { background:var(--xi-head); color:#c6cbe4; border-color:#44496b; font-weight:500; }
body.xw-inventory-theme .ant-table-thead>tr>th::before { background:#44496b!important; }
body.xw-inventory-theme .ant-table-tbody>tr>td { background:var(--xi-panel); color:var(--xi-text); border-color:var(--xi-line); }
body.xw-inventory-theme .ant-table-tbody>tr:hover>td,
body.xw-inventory-theme .ant-table-tbody>tr>td.ant-table-cell-row-hover { background:#2a2f51; }
body.xw-inventory-theme .ant-table-tbody>tr.ant-table-row-selected>td { background:#32395a; }
body.xw-inventory-theme :is(.ant-table-cell-fix-left,.ant-table-cell-fix-right,.ant-table-sticky-holder) { background:var(--xi-panel); }
body.xw-inventory-theme :is(.ant-table-placeholder,.ant-empty-description,.ant-pagination,.ant-pagination-total-text,.ant-form-item-extra) { color:var(--xi-muted); }
body.xw-inventory-theme :is(.ant-table-placeholder:hover>td,.ant-table-placeholder>td) { background:var(--xi-panel)!important; }
body.xw-inventory-theme :is(.ant-pagination-item,.ant-pagination-prev .ant-pagination-item-link,.ant-pagination-next .ant-pagination-item-link,.ant-pagination-options-quick-jumper input) { background:var(--xi-field); border-color:var(--xi-border); color:var(--xi-text); }
body.xw-inventory-theme .ant-pagination-item a { color:var(--xi-text); }
body.xw-inventory-theme .ant-pagination-item-active { background:#353b60; border-color:#7982ad; }
body.xw-inventory-theme .ant-pagination-disabled .ant-pagination-item-link { color:#777e9e; border-color:#343858; }
body.xw-inventory-theme :is(.ant-table-body,.ant-table-content) { scrollbar-color:#555a7d var(--xi-panel); }
/* Portals live under body rather than the React root. Route gating covers them. */
body.xw-inventory-theme :is(.ant-modal-content,.ant-modal-header,.ant-modal-footer,.ant-drawer-content,.ant-drawer-header,.ant-popover-inner,.ant-select-dropdown,.ant-picker-panel-container,.ant-picker-panel,.ant-picker-footer) { background:var(--xi-panel); color:var(--xi-text); border-color:var(--xi-border); }
body.xw-inventory-theme :is(.ant-modal-title,.ant-modal-close,.ant-modal-confirm-title,.ant-modal-confirm-content,.ant-drawer-title,.ant-drawer-close,.ant-popover-message,.ant-popover-title,.ant-select-item,.ant-picker-header,.ant-picker-content th,.ant-picker-cell-in-view,.ant-picker-header button) { color:var(--xi-text); border-color:var(--xi-line); }
body.xw-inventory-theme :is(.ant-select-item-option-active:not(.ant-select-item-option-disabled),.ant-select-item-option-selected:not(.ant-select-item-option-disabled)) { background:#353b60; color:#fff; }
body.xw-inventory-theme .ant-select-item-option-disabled { color:#7c829d; }
body.xw-inventory-theme .ant-picker-cell { color:#7c829d; }
body.xw-inventory-theme .ant-picker-cell-in-view { color:var(--xi-text); }
body.xw-inventory-theme .ant-picker-cell:hover:not(.ant-picker-cell-disabled):not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end) .ant-picker-cell-inner { background:#353b60; }
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-in-range::before,
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single)::before,
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single)::before { background:#304b4b; }
body.xw-inventory-theme :is(.ant-picker-cell-selected,.ant-picker-cell-range-start,.ant-picker-cell-range-end) .ant-picker-cell-inner { background:#287d38!important; color:#fff; }
body.xw-inventory-theme .ant-picker-cell-disabled::before { background:#14162d; }
body.xw-inventory-theme .ant-picker-cell-disabled .ant-picker-cell-inner { color:#727895; }
body.xw-inventory-theme .ant-picker-header-view button:hover { color:#b5c2f4; }
body.xw-inventory-theme .ant-picker-header { border-bottom-color:var(--xi-line); }
body.xw-inventory-theme :is(.ant-picker-ranges,.ant-picker-time-panel,.ant-picker-panel-container .ant-picker-panel) { border-color:var(--xi-line); }
body.xw-inventory-theme .ant-spin-container::after { background:var(--xi-panel); }
body.xw-inventory-theme .ant-form-item-explain-error { color:#ffaaa9; }
body.xw-inventory-theme .ant-form-item-has-error :is(.ant-input,.ant-picker,.ant-select-selector) { border-color:#e88c98!important; }
/* Shared order date filters and permission-controlled import task dialogs. */
body.xw-inventory-theme .ant-pro-table-search .ant-picker { width:100%; min-width:0; }
body.xw-inventory-theme .ant-picker-input>input::placeholder { color:#959bb8; }
body.xw-inventory-theme .ant-picker-range-arrow::before { background:var(--xi-panel); }
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before { border-color:#8abc94; }
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover::before,
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-range-hover-start::before,
body.xw-inventory-theme .ant-picker-cell-in-view.ant-picker-cell-range-hover-end::before { background:#3b5557; }
body.xw-inventory-theme .ant-picker-cell-range-hover::after,
body.xw-inventory-theme .ant-picker-cell-range-hover-start::after,
body.xw-inventory-theme .ant-picker-cell-range-hover-end::after { border-color:#8abc94!important; }
body.xw-inventory-theme .ant-picker-today-btn { color:#a5d4ae; }
body.xw-inventory-theme .ant-progress-text { color:var(--xi-text); }
body.xw-inventory-theme .ant-progress-inner { background:#343858; }
body.xw-inventory-theme .ant-progress-circle-trail { stroke:#343858; }
body.xw-inventory-theme .ant-progress-status-exception .ant-progress-text { color:#ffaaa9; }
body.xw-inventory-theme .ant-progress-status-success .ant-progress-text { color:#a5d4ae; }
body.xw-inventory-theme :is(.ant-upload-list,.ant-upload-list-item-name,.ant-upload-list-item-card-actions .anticon) { color:var(--xi-text); }
body.xw-inventory-theme .ant-upload-list-item:hover .ant-upload-list-item-info { background:#2a2f51; }
body.xw-inventory-theme .ant-upload-list-item-error { color:#ffaaa9; }
body.xw-inventory-theme .ant-table-tbody .ant-btn-link.ant-btn-dangerous { background:transparent!important; border-color:transparent!important; color:#ffaaa9!important; }
body.xw-inventory-theme .ant-popover-inner-content { color:var(--xi-text); }
body.xw-inventory-theme .ant-popover-arrow-content { background:var(--xi-panel); }
body.xw-inventory-theme :is(.ant-table-column-sorters:hover,.ant-table-thead th.ant-table-column-sort) { background:#303557; }
body.xw-inventory-theme .ant-table-column-sorter { color:#aeb3ce; }
body.xw-inventory-theme .ant-table-column-sorter :is(.active) { color:#b5c2f4; }
