/* Shared foundation and components for every ERP page. */
.scan-reference { font-family:var(--font-family); }
.erp-shared-shell :is(.topbar,.rail,.tabs) { font-family:var(--font-family-shell); font-size:var(--font-size-body); line-height:var(--line-height-shell); font-weight:var(--font-weight-normal); }
.resource-scan-person { display:inline-flex; align-items:center; gap:var(--space-2); font-size:var(--scan-name-size); line-height:var(--scan-name-line); font-weight:var(--font-weight-strong); }
.resource-scan-person svg { width:var(--scan-avatar-size); height:var(--scan-avatar-size); fill:var(--color-primary); flex-shrink:0; }
.resource-scan-input { height:var(--scan-control-height); }
input.resource-scan-input:not([type="checkbox"]):not([type="radio"]):focus { background:var(--color-primary-bg); }
.resource-scan-search,.resource-scan-process { min-height:var(--scan-control-height); }
button.resource-scan-process[aria-pressed="true"],button.resource-scan-process[aria-pressed="true"]:hover:not(:disabled) { background:var(--color-primary); border-color:var(--color-primary); color:var(--color-bg); }
.resource-scan-counter { display:block; font-size:var(--scan-counter-size); line-height:var(--scan-counter-line); font-weight:var(--font-weight-normal); color:var(--scan-counter-color); text-align:center; font-variant-numeric:tabular-nums; }
.resource-scan-feedback { padding:var(--space-8); background:var(--color-bg); box-shadow:var(--shadow-popup); border-radius:var(--radius); font-size:var(--scan-feedback-size); line-height:var(--scan-feedback-line); font-weight:var(--font-weight-strong); text-align:center; overflow-wrap:anywhere; }
.resource-scan-feedback[data-tone="success"] { color:var(--color-success); }
.resource-scan-feedback[data-tone="error"] { color:var(--color-error); }
.resource-scan-feedback[data-tone="warning"] { color:var(--color-warning); }
.resource-scan-status { font-size:var(--font-size-page); line-height:var(--line-height-page); color:var(--color-link); }
.resource-scan-status[data-tone="error"] { color:var(--color-error); }
.resource-scan-table thead th { background:var(--color-bg-subtle); height:var(--scan-reference-header-height); }
.resource-scan-table td { white-space:normal; overflow-wrap:anywhere; }
.production-cost-matrix td.production-scan-name { color:var(--color-link); }
.auth-panel { color:var(--color-login-text); background:var(--color-login-panel); padding:var(--space-12); border-radius:var(--login-art-radius); }
.rail .system-navigation-entry[aria-expanded="true"] { color:var(--color-link); background:var(--color-primary-bg); }
.auth-form { display:grid; gap:var(--space-4); }
.auth-form label { display:grid; gap:var(--space-2); }
.auth-form .auth-password { display:flex; gap:var(--space-2); }
.auth-form .auth-password input { flex:1; width:0; }
.auth-form .auth-submit { width:100%; background:var(--color-login-button); border-color:var(--color-login-button); color:var(--color-bg); }
.auth-form .auth-submit:hover:not(:disabled) { background:var(--color-login-button-hover); border-color:var(--color-login-button-hover); color:var(--color-bg); }
.auth-status { color:var(--color-login-muted); min-height:var(--line-height-body); overflow-wrap:anywhere; }
.auth-header-exit { margin-left:auto; flex-shrink:0; color:inherit; background:transparent; border-color:transparent; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: var(--font-family); }
body { margin: 0; color: var(--color-text); background: var(--color-bg-layout); font-size: var(--font-size-body); line-height: var(--line-height-body); font-weight: var(--font-weight-normal); }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: var(--control-height); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); white-space: nowrap; cursor: pointer; transition: border-color var(--motion-fast), background var(--motion-fast), color var(--motion-fast); }
button:hover:not(:disabled) { color: var(--color-link); border-color: var(--color-primary); }
button:active:not(:disabled) { border-color: var(--color-primary-active); }
button.primary { color: var(--color-bg); border-color: var(--color-primary); background: var(--color-primary); }
button.primary:hover:not(:disabled) { color: var(--color-bg); border-color: var(--color-primary-hover); background: var(--color-primary-hover); }
button.primary:active:not(:disabled) { background: var(--color-primary-active); border-color: var(--color-primary-active); }
button.danger { color: var(--color-error); border-color: var(--color-error-fill); background: var(--color-bg); }
button.danger:hover:not(:disabled) { color: var(--color-bg); background: var(--color-error-fill); border-color: var(--color-error-fill); }
button.danger.primary { color: var(--color-bg); background: var(--color-error-fill); border-color: var(--color-error-fill); }
button.icon-button { width: var(--control-height); padding: var(--space-1); }
button:disabled, input:disabled, select:disabled, textarea:disabled { color: var(--color-disabled-text); background: var(--color-bg-disabled); border-color: var(--color-border); cursor: not-allowed; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-width: 0; min-height: var(--control-height); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); line-height: var(--line-height-body); }
input::placeholder, textarea::placeholder { color: var(--color-placeholder); opacity: 1; }
input:not(:disabled):hover, select:not(:disabled):hover, textarea:not(:disabled):hover { border-color: var(--color-primary-hover); }
input:disabled, select:disabled, textarea:disabled { background: var(--color-bg-disabled); }
input[type="checkbox"], input[type="radio"] { appearance: none; width: 16px; height: 16px; flex: 0 0 16px; padding: 0; margin: 3px 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); cursor: pointer; position: relative; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked { border-color: var(--color-primary); background: var(--color-primary); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; width: 5px; height: 9px; top: 1px; left: 4px; border: solid var(--color-bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type="radio"]:checked { border-color: var(--color-primary); }
input[type="radio"]:checked::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--color-primary); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { background: var(--color-bg-disabled); cursor: not-allowed; }
:where(button, input, select, textarea, a, summary, tr[tabindex], th[tabindex]):focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; box-shadow: var(--focus-ring); }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, dl { margin: 0; }
h1, .page-title { font-size: var(--font-size-page); line-height: var(--line-height-page); font-weight: var(--font-weight-strong); }
h2, .section-title { font-size: var(--font-size-title); line-height: var(--line-height-title); font-weight: var(--font-weight-strong); }
h3 { font-size: var(--font-size-body); line-height: var(--line-height-body); font-weight: var(--font-weight-medium); }
p + p { margin-top: var(--space-2); }
.muted, .form-note { color: var(--color-text-secondary); }
.caption { color: var(--color-text-muted); font-size: var(--font-size-sm); line-height: var(--line-height-sm); }
.numeric { font-variant-numeric: tabular-nums; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: 0 0 16px; }
.tag { display: inline-block; padding: 0 var(--space-2); margin: 2px var(--space-1) 2px 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg-subtle); color: var(--color-text-secondary); font-size: var(--font-size-sm); line-height: var(--line-height-sm); white-space: nowrap; }
.tag.data-value { font-size: var(--font-size-body); line-height: var(--line-height-body); }
.tag.success { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success); }
.tag.warning { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning); }
.tag.error { color: var(--color-error); background: var(--color-error-bg); border-color: var(--color-error-fill); }
table { border-collapse: separate; border-spacing: 0; font-size: var(--font-size-body); line-height: var(--line-height-body); }
.resource-switch { position: relative; width: var(--cost-switch-width); min-width: var(--cost-switch-width); height: var(--cost-switch-height); min-height: var(--cost-switch-height); justify-content: flex-end; border: 0; padding: 0; border-radius: var(--cost-switch-height); background: var(--color-disabled-text); color: var(--color-bg); text-align: right; padding-right: var(--space-2); }
.resource-switch::after { content: ''; position: absolute; top: calc((var(--cost-switch-height) - var(--cost-switch-knob)) / 2); left: calc((var(--cost-switch-height) - var(--cost-switch-knob)) / 2); width: var(--cost-switch-knob); height: var(--cost-switch-knob); background: var(--color-bg); border-radius: 50%; }
.resource-switch[aria-checked="true"] { background: var(--color-primary); justify-content: flex-start; text-align: left; padding-left: var(--space-2); }
.resource-switch[aria-checked="true"]::after { left: calc(var(--cost-switch-width) - var(--cost-switch-knob) - (var(--cost-switch-height) - var(--cost-switch-knob)) / 2); }
.resource-section-title { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-6) 0; font-size: var(--font-size-title); line-height: var(--line-height-title); font-weight: var(--font-weight-medium); }
.resource-section-title::after { content: ''; flex: 1; border-top: 1px solid var(--color-border); }
.resource-repeatable { display:grid; gap:var(--space-3); margin-bottom:var(--space-4); }
.resource-share-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) var(--control-height); gap:var(--space-4); align-items:center; }
.resource-share-row label { display:flex; align-items:center; min-width:0; gap:var(--space-2); }
.resource-share-row label > span:first-child { flex:0 0 80px; text-align:right; }
.resource-share-row input, .resource-share-row select { width:100%; min-width:0; }
.resource-dashed { border-style:dashed; }
.resource-fieldset { border:0; margin:0; padding:0; min-width:0; }
@media (max-width:640px) { .resource-share-row { grid-template-columns:minmax(0,1fr) var(--control-height); } .resource-share-row label { grid-column:1; } .resource-share-row > button { grid-column:2; grid-row:1 / 3; } }
.resource-admin-reference { font-family:var(--cost-font-family); font-size:var(--font-size-body); line-height:var(--cost-line-height); font-weight:var(--font-weight-normal); }
.resource-company-table { width:100%; table-layout:fixed; border-collapse:collapse; color:var(--color-cost-text); font-size:var(--font-size-body); line-height:var(--cost-line-height); }
.resource-company-table th,.resource-company-table td { border:1px solid var(--color-reference-border,var(--color-divider)); padding:var(--space-3) var(--space-2); text-align:center; overflow-wrap:anywhere; font-weight:var(--font-weight-normal); }
.resource-company-table input[type="checkbox"] { display:block; margin:0 auto; }
.resource-company-table td.panel-empty { text-align:left; padding:var(--space-6); }
.resource-company-table th { height:var(--company-table-head-height); background:var(--color-bg-subtle); position:sticky; top:0; z-index:1; color:var(--color-text); }
.resource-company-table td { height:var(--company-table-row-height); background:var(--color-bg); }
.resource-company-table tr:hover td,.resource-company-table tr.selected td { background:var(--color-primary-bg); }
.resource-company-table th:last-child { z-index:2; }
.resource-company-table .resource-reference-actions { justify-content:center; }
.resource-company-table img { width:auto; max-width:100%; height:calc(var(--control-height-lg) * 2); object-fit:contain; }
.resource-company-modal { --dialog-width:var(--company-dialog-width); width:min(var(--dialog-width),calc(100vw - var(--space-8))); }
.resource-company-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.resource-company-form > label { display:flex; align-items:center; gap:0; height:var(--control-height-lg); padding-right:var(--space-2); }
.resource-company-form > label > span:first-child,.resource-company-license > span { flex:0 0 29.1667%; padding-right:var(--space-2); text-align:right; }
.resource-company-form input { min-width:0; flex:1; width:100%; }
.resource-company-license { display:flex; align-items:flex-start; }
.resource-company-license > span { padding-top:var(--space-1); }
.resource-company-license .resource-upload { width:var(--company-license-size); height:var(--company-license-size); align-items:center; justify-content:center; gap:var(--space-1); padding:0; }
.resource-company-license-preview { display:flex; gap:var(--space-2); flex-wrap:wrap; }
.resource-company-license-preview:empty { display:none; }
.resource-company-license-preview img { width:var(--company-license-size); height:var(--company-license-size); object-fit:contain; }
.resource-company-license-preview figure { margin:0 0 var(--space-2); }
.resource-company-modal [role="alert"]:empty { display:none; }
@media (max-width:640px) { .resource-company-form { grid-template-columns:1fr; } }
.resource-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3) var(--space-6); }
.resource-form-grid > label { display:flex; align-items:center; gap:var(--space-2); min-width:0; }
.resource-form-grid > label > span:first-child { flex:0 0 120px; text-align:right; }
.resource-form-grid input:not([type="radio"]):not([type="checkbox"]), .resource-form-grid select { width:100%; min-width:0; }
.resource-form-grid .full { grid-column:1/-1; }
.resource-required { color:var(--color-error); margin-right:var(--space-1); }
.resource-upload { width:calc(var(--space-12) * 2); height:calc(var(--space-12) * 2); border:1px dashed var(--color-border); background:var(--color-bg-subtle); display:flex; flex-direction:column; }
.resource-image-preview { max-width:calc(var(--space-12) * 3); max-height:calc(var(--space-12) * 3); object-fit:contain; }
.resource-segment { display:flex; align-items:center; }
.resource-excel-template-tabs { display:flex; align-items:center; gap:0; overflow-x:auto; margin-bottom:var(--space-4); }
.resource-excel-template-tabs button { flex:none; border-radius:0; }
.resource-excel-template-tabs button:first-child { border-radius:var(--radius) 0 0 var(--radius); }
.resource-excel-template-tabs button:last-child { border-radius:0 var(--radius) var(--radius) 0; }
.resource-segment button { border-radius:0; }
.resource-segment button:first-child { border-radius:var(--radius) 0 0 var(--radius); }
.resource-segment button:last-child { border-radius:0 var(--radius) var(--radius) 0; }
.resource-radio-group { display:flex; gap:var(--space-4); align-items:center; flex-wrap:wrap; }
.resource-radio-group label { display:flex; gap:var(--space-2); align-items:center; }
@media (max-width:640px) { .resource-form-grid { grid-template-columns:1fr; } }
.resource-flag::before { content: '⚑'; margin-right: var(--space-1); color: var(--flag-color, var(--flag-none)); }
.resource-flag[data-flag="红色旗帜"] { --flag-color: var(--flag-red); }
.resource-flag[data-flag="黄色旗帜"] { --flag-color: var(--flag-yellow); }
.resource-flag[data-flag="绿色旗帜"] { --flag-color: var(--flag-green); }
.resource-flag[data-flag="蓝色旗帜"] { --flag-color: var(--flag-blue); }
.resource-flag[data-flag="紫色旗帜"] { --flag-color: var(--flag-purple); }
th { height: var(--space-12); vertical-align: middle; font-weight: var(--font-weight-normal); }
tbody td { height: var(--table-row-height); }
th, td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--color-divider); }
th { color: var(--color-text); background: var(--color-primary-bg); }
td.numeric, th.numeric { text-align: right; }
.pagination { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--color-divider); background: var(--color-bg); font-size: var(--font-size-body); line-height: var(--line-height-body); font-variant-numeric: tabular-nums; }
.pagination button { min-width: var(--control-height); padding: var(--space-1) var(--space-2); }
.pagination button.active { color: var(--color-link); border-color: var(--color-primary); background: var(--color-primary-bg); font-weight: var(--font-weight-medium); }
.pagination input { width: 56px; }
.pagination select { width: 104px; }
dialog { --dialog-width: 520px; width: min(var(--dialog-width), calc(100vw - 32px)); max-height: calc(100dvh - 64px); padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-lg); background: var(--color-bg); color: var(--color-text); box-shadow: var(--shadow-popup); }
dialog[open] { display: flex; flex-direction: column; }
dialog[data-size="medium"] { --dialog-width: 720px; }
dialog[data-size="excel-import"] { --dialog-width:var(--dialog-width-excel-import); }
dialog[data-size="excel-import"] .modal-footer { display:none; }
.resource-excel-import-note { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); margin-bottom:var(--space-2); }
.resource-excel-template { display:inline-flex; align-items:center; justify-content:center; flex:none; height:var(--control-height); padding:0 var(--space-4); border-radius:var(--radius-sm); background:var(--color-primary); color:var(--color-bg); text-decoration:none; }
.resource-excel-drop { width:100%; height:auto; min-height:var(--excel-drop-height); padding:var(--space-4); display:flex; flex-direction:column; justify-content:center; gap:var(--space-3); white-space:normal; border:1px dashed var(--color-border); border-radius:var(--radius-sm); background:var(--color-bg-subtle); }
.resource-excel-drop svg { width:var(--excel-upload-icon-size); height:var(--excel-upload-icon-size); fill:none; stroke:var(--color-primary); stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.resource-excel-hint { color:var(--color-text-secondary); }
.resource-excel-drop.is-dragging { border-color:var(--color-primary); background:var(--color-primary-bg); }
.resource-excel-import [role="status"] { margin-bottom:0; }
dialog.resource-drawer { --dialog-width: var(--dialog-width-freight); margin: auto auto 0; max-height: calc(100dvh - var(--control-height-lg)); height: calc(100dvh - var(--control-height-lg)); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.resource-collapse { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.resource-collapse-header { display:flex; align-items:center; min-height:var(--collapse-row-height); padding:var(--space-2) var(--space-4); gap:var(--space-2); background:var(--color-bg-subtle); border-bottom:1px solid var(--color-border); }
.resource-collapse-toggle { flex:1; text-align:left; justify-content:flex-start; border:0; background:transparent; }
.resource-collapse-toggle span:first-child { display:inline-block; width:var(--space-6); }
.resource-collapse-header > button:not(.resource-collapse-toggle) { border:0; background:transparent; color:var(--color-link); }
.resource-collapse-header > button.danger { color:var(--color-error); }
.resource-collapse-content { padding:var(--space-4); border-bottom:1px solid var(--color-border); overflow:auto; }
.resource-freight-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.resource-freight-table th, .resource-freight-table td { border:1px solid var(--color-border); height:var(--table-row-height-compact); padding:var(--space-1); text-align:center; font-weight:var(--font-weight-normal); }
.resource-freight-table th { background:var(--color-bg-subtle); }
.resource-freight-table td:first-child { text-align:left; padding:var(--space-2); }
.resource-freight-table input { width:100%; min-width:0; }
.resource-freight-table button, button.resource-link { height:auto; min-height:var(--control-height); border:0; background:transparent; color:var(--color-link); padding:var(--space-1); }
.resource-freight-table button.danger, button.resource-link.danger { color:var(--color-error); }
.resource-region-tree { list-style:none; padding:0; margin:0; }
.resource-region-tree ul { list-style:none; padding-left:var(--space-6); }
.resource-region-tree summary { display:flex; align-items:center; gap:var(--space-2); min-height:var(--control-height); cursor:pointer; }
.resource-region-tree summary::before { content:'›'; width:var(--space-3); }
.resource-region-tree details[open] > summary::before { content:'⌄'; }
.resource-region-tree label { display:inline-flex; align-items:center; gap:var(--space-2); min-height:var(--control-height); }
.resource-default-options { display:flex; flex-wrap:wrap; gap:var(--space-4); }
.resource-default-options label { display:flex; align-items:center; gap:var(--space-2); }
.resource-reference-controls { display:flex; flex-direction:column; gap:var(--space-6); padding:var(--space-3) var(--space-4) var(--space-6); flex:0 0 auto; }
.resource-reference-controls .toolbar { padding:0; min-height:var(--control-height); border-bottom:0; }
.after-sales-reference .resource-reference-controls .toolbar button { padding:0 var(--reference-button-padding); }
.resource-denominator-group { margin-bottom:var(--space-4); }
.resource-denominator-group h3 { font-size:var(--font-size-title); line-height:var(--line-height-title); font-weight:var(--font-weight-medium); margin:var(--space-4) 0 var(--space-2); }
.resource-denominator-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-2) var(--space-4); }
.resource-denominator-options label { display:flex; align-items:flex-start; gap:var(--space-2); min-width:0; }
.resource-denominator-options input { flex-shrink:0; margin-top:var(--space-1); }
.resource-actions .info { color:var(--color-primary); }
@media(max-width:900px){.resource-denominator-options {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.resource-denominator-options {grid-template-columns:1fr;}}
.resource-freight-line { display:flex; align-items:center; gap:var(--space-2); flex-wrap:nowrap; min-height:var(--control-height-lg); white-space:nowrap; }
.resource-icon { width:var(--font-size-title); height:var(--font-size-title); fill:none; stroke:currentColor; stroke-width:1.5; }
.resource-freight-line input[type="number"] { width:var(--freight-input-width); }
.resource-warning { padding:var(--space-2) var(--space-4); background:var(--color-warning-bg); color:var(--color-text); margin-bottom:var(--space-2); }
.resource-error { color:var(--color-error); }
dialog[data-size="large"] { --dialog-width: 1040px; }
dialog::backdrop { background: var(--color-mask); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--color-divider); flex-shrink: 0; }
.modal-header h2 { font-size: var(--font-size-title); line-height: var(--line-height-title); }
.modal-header button { border: 0; color: var(--color-text-secondary); width: var(--control-height); padding: var(--space-1); }
#modal-body, .modal-body { padding: var(--space-6); overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--color-divider); flex-shrink: 0; }
.modal-footer button { min-width: 80px; }
.modal-form { display:flex; flex-direction:column; flex:1; min-height:0; }
.modal-form > .modal-body { flex:1; min-height:0; }
.form-note { margin-bottom: var(--space-4); }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); }
.entry-grid label { display: flex; flex-direction: column; gap: var(--space-2); }
.entry-grid > .wide { grid-column: 1 / -1; }
.entry-grid label > span:first-child { color: var(--color-text-secondary); }
.entry-grid input, .entry-grid select, .entry-grid textarea { width: 100%; }
.required-mark { color: var(--color-error); margin-right: var(--space-1); }
.field-help { color: var(--color-text-secondary); font-size: var(--font-size-sm); line-height: var(--line-height-sm); }
.field-error { color: var(--color-error); font-size: var(--font-size-sm); line-height: var(--line-height-sm); }
[aria-invalid="true"] { border-color: var(--color-error-fill) !important; }
.query-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-divider); }
#query-name { width: 100%; }
#toast { position: fixed; z-index: 20; top: var(--space-4); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); background: var(--color-bg); box-shadow: var(--shadow-toast); }
.flag { font-size: var(--font-size-title); line-height: var(--line-height-title); }
.flag-gray { color: var(--flag-gray); } .flag-red { color: var(--flag-red); } .flag-yellow { color: var(--flag-yellow); }
.flag-green { color: var(--flag-green); } .flag-blue { color: var(--flag-blue); } .flag-purple { color: var(--flag-purple); }
.panel-tabs { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1); overflow-x: auto; min-width: 0; }
.panel-tabs button { flex: 0 0 auto; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg-subtle); color: var(--color-text-secondary); }
.panel-tabs button[aria-selected="true"] { color: var(--color-link); border-color: var(--color-primary-border); background: var(--color-bg); }
.panel-tabs.reference-panel-tabs { padding: 0; background: transparent; align-items: end; }
.panel-tabs.reference-panel-tabs button { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.panel-tabs.reference-panel-tabs button[aria-selected="true"] { border-color: var(--color-border); }
.panel-empty { padding: var(--space-6); color: var(--color-text-secondary); }
/* Shared resource-directory table and action links. */
.resource-table { width: max-content; min-width: 100%; table-layout: fixed; }
.resource-table th { position: sticky; top: 0; z-index: 2; white-space: nowrap; border-right: 1px solid var(--color-divider); }
.resource-table td { border-right: 1px solid var(--color-divider); max-width: 240px; }
.resource-table tbody tr:nth-child(even) { background: var(--color-bg-subtle); }
.resource-table tbody tr:hover { background: var(--color-primary-bg); }
.resource-table .row-actions { position: sticky; right: 0; background: var(--color-bg); white-space: nowrap; }
.resource-table thead .row-actions { background: var(--color-primary-bg); z-index: 3; }
.resource-table td .cell { max-width: 200px; }
.resource-table .check-cell { width: 48px; text-align: center; }
.resource-table .check-cell input { display: block; margin: 0 auto; }
.resource-report-table .report-fixed { position:sticky; z-index:3; background:var(--color-bg); }
.resource-report-table tr:nth-child(even) .report-fixed { background:var(--color-bg-subtle); }
.resource-report-table tr:hover .report-fixed { background:var(--color-primary-bg); }
.resource-report-table thead .report-fixed { background:var(--color-primary-bg); z-index:5; }
.resource-report-table .report-fixed-edge { border-right:1px solid var(--color-border); }
.resource-report-table .report-money { text-align:right; font-variant-numeric:tabular-nums; }
.material-reference .resource-table th { height:var(--material-header-height); text-align:center; font-weight:var(--font-weight-normal); padding:var(--space-2) var(--space-1); }
.material-reference .resource-table td { height:var(--table-row-height); text-align:center; font-size:var(--material-data-font-size); line-height:var(--material-data-line-height); padding:var(--space-2) var(--space-1); }
.material-reference .resource-table tbody tr:nth-child(even) { background:var(--color-bg); }
.material-reference .resource-table tbody tr:hover { background:var(--color-primary-bg); }
.material-reference .resource-actions { justify-content:center; gap:var(--space-3); }
.material-reference .resource-actions button, .material-reference .material-code { font-size:var(--material-data-font-size); line-height:var(--material-data-line-height); }
.material-reference .toolbar button, .material-reference .pagination button, .material-reference .pagination select, .material-reference .pagination input { height:var(--control-height-sm); min-height:var(--control-height-sm); }
.material-reference dialog[data-size="material"] { width:var(--dialog-width-material-form); }
.reference-material-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3) var(--space-6); }
.reference-material-form label { display:flex; align-items:center; gap:var(--space-2); min-width:0; }
.reference-material-form label > span { flex:0 0 90px; text-align:right; }
.reference-material-form input:not([type="radio"]), .reference-material-form select, .reference-material-form textarea { width:100%; min-width:0; }
.reference-material-form .form-wide { grid-column:1 / -1; }
.reference-material-form .material-radio { display:flex; align-items:center; gap:var(--space-2); }
@media(max-width:640px) { .reference-material-form { grid-template-columns:1fr; } }
.resource-actions { display: flex; gap: var(--space-2); }
.resource-actions button { min-height: var(--control-height-sm); padding: 0; border: 0; background: transparent; color: var(--color-link); }
.resource-actions .warning { color: var(--color-warning); }
.resource-actions .danger { color: var(--color-error); }
.resource-actions .success { color: var(--color-success); }
/* Shared resource navigation and template tabs. */
.resource-popover { position: fixed; z-index: 15; top: calc(var(--space-12) + var(--control-height-lg)); left: var(--rail-width); width: 248px; max-height: calc(100dvh - var(--space-12) - var(--control-height-lg)); overflow: auto; padding: var(--space-2); border: 1px solid var(--color-divider); border-radius: var(--radius); background: var(--color-bg); box-shadow: var(--shadow-popup); }
.resource-popover summary { padding: var(--space-3); cursor: pointer; color: var(--color-link); }
.resource-popover button { width: 100%; justify-content: flex-start; border: 0; margin-bottom: var(--space-1); }
.resource-popover [aria-current="page"] { color: var(--color-link); background: var(--color-primary-bg); }
.resource-tabs { display: flex; flex: 0 0 auto; gap: var(--space-6); padding: 0 var(--space-4); border-bottom: 1px solid var(--color-divider); overflow-x: auto; }
.resource-tabs button { flex: 0 0 auto; min-height: var(--control-height-lg); border: 0; border-radius: 0; border-bottom: 2px solid transparent; color: var(--color-text-secondary); }
.resource-tabs [aria-selected="true"] { color: var(--color-link); border-bottom-color: var(--color-primary); }
.category-list button { border: 0; border-radius: var(--radius); color: var(--color-text-secondary); background: var(--color-bg); }
.category-list button[aria-pressed="true"] { color: var(--color-link); background: var(--color-primary-bg); }
/* Compact production forms: shared across recording and subsequent workshop pages. */
.production-actions { flex: 0 0 auto; align-self: flex-end; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; }
.production-actions span { white-space: nowrap; color: var(--color-text-muted); }
.production-card { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); padding: var(--space-3); }
.production-field { display: flex; align-items: stretch; gap: var(--space-2); }
.production-field > span:first-child { display: flex; align-items: center; justify-content: center; flex: 0 0 104px; padding: var(--space-1) var(--space-2); color: var(--color-text-secondary); background: var(--color-bg-layout); }
.production-field > input, .production-field > select, .production-field > textarea, .production-field > div { flex: 1; min-width: 0; }
.production-template-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.production-fields .production-field > select, .production-fields .production-field > .production-picker-field { flex: 0 0 208px; width: 208px; }
.production-fields .production-field > .production-dependent { flex: 0 0 280px; width: 280px; }
.production-template-row .remove-project { flex: 0 0 var(--control-height); }
.remove-project { width: var(--control-height); padding: var(--space-1); color: var(--color-error); border-color: transparent; }
.resource-select-popup { position: fixed; z-index: 1000; overflow-y: auto; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-popup); }
.resource-select-popup button { display: block; width: 100%; border: 0; border-radius: 0; text-align: left; padding-inline: var(--space-2); }
.resource-select-popup button[aria-selected="true"] { background: var(--color-primary-bg); }
.resource-select-popup button[hidden] { display: none; }
.resource-select-search { position: sticky; top: 0; padding: var(--space-1); background: var(--color-bg); }
.resource-select-search input { width: 100%; }
.resource-select-empty { padding: var(--space-2); color: var(--color-text-secondary); }
.production-line-head { display: flex; align-items: center; justify-content: space-between; padding-left: var(--space-2); background: var(--color-bg-layout); color: var(--color-text-secondary); }
.production-line-fields label { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; color: var(--color-text-secondary); }
.production-line-fields input { width: 100%; padding-inline: var(--space-2); color: var(--color-text); font-variant-numeric: tabular-nums; }
.production-line-fields button { color: var(--color-text); }
.catalog-search { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.catalog-search input { flex: 1; }
.catalog-table-scroll { max-height: 40vh; overflow: auto; border: 1px solid var(--color-border); }
.catalog-table { min-width: 1600px; width: 100%; }
.catalog-table th { position: sticky; top: 0; white-space: nowrap; }
.catalog-table td { max-width: 240px; overflow-wrap: anywhere; }
.catalog-table tbody tr:hover { background: var(--color-primary-bg); cursor: pointer; }
.catalog-pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding-top: var(--space-3); }
@media (max-width: 640px) {
  dialog { max-height: calc(100dvh - 32px); }
  .entry-grid { grid-template-columns: 1fr; }
  .modal-header, #modal-body, .modal-body, .modal-footer { padding: var(--space-4); }
}
.resource-cascade { --resource-menu-width: 224px; position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.resource-menu-panel { position: fixed; width: var(--resource-menu-width); max-height: calc(100dvh - var(--space-4)); overflow-y: auto; padding: var(--space-2) 0; border-radius: var(--radius); background: var(--color-bg); box-shadow: var(--shadow-popup); pointer-events: auto; }
.resource-menu-item { width: 100%; min-height: var(--control-height-lg); height: auto; border: 0; border-radius: 0; padding: var(--space-2) var(--space-4); justify-content: space-between; text-align: left; background: var(--color-bg); }
.resource-menu-item:hover, .resource-menu-item.resource-menu-active, .resource-menu-item[aria-current="page"] { background: var(--color-primary-bg); color: var(--color-link); }
.resource-menu-arrow { margin-left: var(--space-3); }
.resource-nav-notice { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); max-width: calc(100vw - var(--space-8)); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--color-bg); box-shadow: var(--shadow-toast); z-index: 40; }
@media (max-width: 720px) { .resource-cascade { --resource-menu-width: 184px; } }
@media (max-width: 560px) { .resource-cascade { --resource-menu-width: calc(100vw / 3); } .resource-menu-item { padding-inline: var(--space-2); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Shared expression editor for main-material and accessory formulas. */
.formula-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-3) 0 var(--space-5); }
.formula-buttons button { min-width: 48px; }
.formula-heading { margin: var(--space-4) 0 var(--space-2); }
#formula-expression { width: 100%; min-height: 96px; margin-top: var(--space-3); }
/* Reference-system variants, opt-in so existing directories are unchanged. */
.resource-table-compact th, .resource-table-compact td { height: var(--table-row-height-compact); padding: calc((var(--table-row-height-compact) - var(--line-height-body) - 1px) / 2) var(--space-2); }
.resource-table-compact input[type="checkbox"], .resource-table-compact input[type="radio"] { display: block; margin: 0 auto; }
.resource-table-compact .resource-actions button { min-height: var(--line-height-body); height: var(--line-height-body); }
.resource-table-plain th, .resource-table-plain thead .row-actions { background: var(--color-bg); }
.resource-reference-query, .resource-reference-toolbar { display:flex; align-items:center; flex-wrap:nowrap; overflow-x:auto; gap:var(--space-2); flex-shrink:0; }
.after-sales-reference, .broadband-reference { font-family:var(--font-family); }
.resource-admin-query { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); column-gap:var(--reference-query-gap); row-gap:var(--space-1); }
.resource-admin-query label { display:flex; align-items:center; white-space:nowrap; gap:var(--space-2); min-width:0; }
.resource-admin-query input { min-width:0; flex:1; width:100%; }
.resource-admin-query .resource-admin-query-actions { display:flex; gap:var(--space-1); }
.resource-admin-table { table-layout:fixed; width:100%; border-collapse:collapse; }
.resource-admin-table th, .resource-admin-table td { font-family:var(--font-family); font-size:var(--font-size-body); line-height:var(--line-height-body); padding:var(--reference-table-cell-padding); border:1px solid var(--reference-table-border); text-align:center; white-space:normal; overflow-wrap:anywhere; }
.resource-admin-table th { height:var(--reference-table-head-height); background:var(--color-bg-subtle); color:var(--color-reference-heading); font-weight:var(--font-weight-strong); position:sticky; top:0; z-index:1; }
.resource-admin-table td { height:var(--reference-table-row-height); font-weight:var(--font-weight-normal); color:var(--color-text); }
.resource-admin-table tr:nth-child(even) { background:var(--color-bg); }
.resource-admin-table tbody tr:hover { background:var(--color-primary-bg); }
.resource-admin-toolbar { display:flex; gap:var(--space-2); white-space:nowrap; overflow-x:auto; }
.resource-admin-toolbar > button { flex-shrink:0; height:var(--control-height-sm); min-height:var(--control-height-sm); padding-inline:var(--space-2); }
.resource-admin-columns { display:grid; gap:var(--space-2); }
.resource-admin-columns label { display:flex; align-items:center; gap:var(--space-2); }
.resource-column-popover.resource-admin-column-popup { position:fixed; max-height:calc(100dvh - var(--space-8)); overflow:auto; }
.resource-admin-column-popup [draggable] span { margin-left:auto; color:var(--color-text-secondary); cursor:grab; }
.resource-admin-table .resource-reference-actions button::before { display:none; }
.resource-admin-table .resource-reference-actions .icon { width:var(--font-size-body); height:var(--font-size-body); flex-basis:var(--font-size-body); }
/* Employee information: shared reference list and seven-section form. */
.resource-staff-query { display:flex; align-items:center; flex-wrap:nowrap; gap:var(--staff-query-gap); }
.resource-staff-query label { display:flex; align-items:center; gap:var(--space-4); white-space:nowrap; flex:none; }
.resource-staff-query :is(input,select) { width:var(--staff-query-width); }
.resource-staff-query-actions { display:flex; flex:none; gap:var(--space-1); }
.resource-staff-table { table-layout:fixed; border-collapse:collapse; }
.resource-staff-table :is(th,td) { text-align:center; border:1px solid var(--color-divider); padding:var(--space-3) var(--space-2); white-space:normal; overflow-wrap:anywhere; }
.resource-staff-table th { height:var(--staff-table-head-height); background:var(--color-bg-subtle); font-weight:var(--font-weight-normal); position:sticky; top:0; z-index:1; }
.resource-staff-table td { height:var(--staff-table-row-height); }
.resource-staff-table tbody tr { background:var(--color-bg); }
.resource-staff-table tbody tr:hover { background:var(--color-primary-bg); }
.resource-staff-table :is(th,td):last-child { position:sticky; right:0; background:inherit; }
.resource-staff-table th:last-child { background:var(--color-bg-subtle); z-index:2; }
.resource-staff-modal { --dialog-width:var(--dialog-width-staff); height:calc(100dvh - var(--space-8) * 2); max-height:calc(100dvh - var(--space-8) * 2); }
.resource-staff-modal[open] { display:flex; flex-direction:column; }
.resource-staff-modal .modal-header { flex:none; }
.resource-staff-modal .modal-form { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.resource-staff-modal .modal-body { flex:1; min-height:0; overflow:auto; padding:var(--space-6); }
.resource-staff-modal .modal-footer { flex:none; }
.resource-staff-editor { display:flex; min-width:740px; min-height:100%; }
.resource-staff-tabs { flex:0 0 var(--staff-tab-width); border-right:1px solid var(--color-divider); margin-right:var(--space-3); }
.resource-staff-tabs button { display:flex; width:100%; min-height:var(--staff-tab-height); justify-content:center; border:0; border-right:2px solid transparent; border-radius:0; color:var(--color-text-secondary); }
.resource-staff-tabs button[aria-selected="true"] { border-right-color:var(--color-primary); color:var(--color-primary); }
.resource-staff-panels { flex:1; min-width:0; }
.resource-staff-section { min-height:var(--staff-section-height); display:flex; align-items:center; background:var(--color-staff-section); padding:var(--space-2) var(--space-3); margin-bottom:var(--space-3); font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); color:var(--color-text-secondary); }
.resource-staff-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3) var(--space-4); margin-bottom:var(--space-3); }
.resource-staff-fields > label { display:flex; align-items:center; min-width:0; white-space:nowrap; }
.resource-staff-fields > label > span { flex:0 0 var(--staff-form-label-width); text-align:right; padding-right:var(--space-2); }
.resource-staff-fields :is(input,select,textarea) { flex:1; min-width:0; width:100%; }
.resource-staff-fields input[readonly] { background:var(--color-bg-disabled); color:var(--color-text-secondary); }
.resource-staff-table .resource-reference-actions button::before { display:none; }
.resource-staff-fields .full { grid-column:1/-1; }
.resource-staff-fields .resource-staff-spacer { visibility:hidden; }
.resource-staff-identity { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; justify-items:center; row-gap:var(--space-12); margin-top:var(--space-8); }
.resource-staff-id-icon { width:var(--staff-id-icon-size); height:var(--staff-upload-height); }
.resource-staff-id-card { fill:var(--color-staff-id-card); }
.resource-staff-id-person { fill:var(--color-staff-id-person); }
.resource-staff-id-line { stroke:var(--color-staff-id-line); }
.resource-staff-upload { position:relative; width:var(--staff-upload-width); min-height:var(--staff-upload-height); border:1px dashed var(--color-border); background:var(--color-bg-subtle); border-radius:var(--radius-sm); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:var(--space-2); }
.resource-staff-upload .icon { width:var(--staff-upload-icon-size); height:var(--staff-upload-icon-size); flex:0 0 var(--staff-upload-icon-size); color:var(--color-text-muted); }
.resource-staff-upload img { max-width:100%; max-height:var(--staff-upload-height); object-fit:contain; }
.resource-staff-attachment-list { display:grid; gap:var(--space-2); margin-top:var(--space-4); }
.resource-staff-attachment-list > div { display:flex; align-items:center; gap:var(--space-3); overflow-wrap:anywhere; }
.resource-staff-attachment-list a { flex:1; }
.resource-staff-error { color:var(--color-error); margin-top:var(--space-3); }
.resource-staff-error:empty { display:none; }
.resource-reference-query label { display:flex; align-items:center; white-space:nowrap; flex-shrink:0; gap:var(--space-2); margin-right:var(--reference-query-gap, var(--space-4)); }
.resource-reference-query input, .resource-reference-query #query-name { width:var(--reference-query-width, 320px); flex-shrink:0; }
.resource-reference-query { padding-bottom:var(--reference-query-bottom, var(--space-4)); }
.resource-reference-toolbar { padding-bottom:var(--reference-actions-bottom, var(--space-4)); }
.after-sales-reference .resource-reference-query button, .after-sales-reference .resource-reference-toolbar button { height:var(--control-height); padding:0 var(--reference-button-padding); gap:var(--space-2); flex-shrink:0; }
.after-sales-reference :is(.resource-reference-query,.resource-reference-toolbar,.resource-reference-actions) .icon { width:var(--font-size-body); height:var(--font-size-body); flex-basis:var(--font-size-body); }
.after-sales-reference .resource-table th { background:var(--color-bg-subtle); color:var(--color-reference-heading); font-weight:var(--reference-header-weight); }
.after-sales-reference .resource-table td, .after-sales-reference .resource-table th { border-color:var(--color-reference-border); }
.after-sales-reference .resource-table tbody tr:nth-child(even) { background:var(--color-bg); }
.resource-reference-actions { display:flex; align-items:center; justify-content:center; gap:var(--space-2); white-space:nowrap; }
.resource-reference-actions button { height:var(--line-height-body); min-height:var(--line-height-body); border:0; padding:0; background:transparent; gap:0; }
.resource-reference-actions button.success { color:var(--color-success); }
.resource-reference-actions button.danger { color:var(--color-error); }
.resource-reference-actions button::before { content:''; height:var(--font-size-sm); border-left:1px solid var(--color-reference-border,var(--color-divider)); margin-right:var(--space-2); }
.resource-reference-actions button:hover:not(:disabled) { background:transparent; text-decoration:underline; }
.resource-reference-modal { font-family:var(--reference-dialog-font,var(--font-family)); border-radius:var(--radius-sm); }
.resource-reference-modal .modal-header { padding:var(--space-4) var(--space-6); }
.resource-reference-modal .modal-header h2 { color:var(--color-reference-heading,var(--color-text)); line-height:var(--reference-dialog-line,var(--line-height-title)); }
.resource-reference-modal .modal-header button { height:var(--reference-dialog-line,var(--line-height-title)); min-height:var(--reference-dialog-line,var(--line-height-title)); padding:0; }
.resource-reference-modal .reference-form > label { height:var(--reference-form-row-height,var(--control-height-lg)); margin:0; }
.resource-reference-modal .reference-form > label > span:first-child { flex-basis:var(--reference-form-label-width,104px); }
.resource-reference-modal .reference-form { padding-right:var(--reference-form-end-gap,0px); }
.resource-reference-modal .modal-footer { padding:var(--reference-footer-padding,var(--space-3)) var(--space-4); }
.resource-reference-modal .modal-footer button { min-width:var(--control-height); padding-inline:var(--space-4); }
.resource-table-centered th, .resource-table-centered td { text-align: center; }
.resource-question-table th, .resource-question-table td { height:var(--reference-question-row-height); padding:var(--space-3) var(--space-4); }
.resource-category-select { position:relative; min-width:0; flex:1; }
.resource-category-select > button { width:100%; justify-content:space-between; text-align:left; }
.resource-category-select > button::after { content:'⌄'; color:var(--color-text-secondary); }
.resource-category-options { position:absolute; top:100%; left:0; display:flex; width:100%; background:var(--color-bg); box-shadow:var(--shadow-popup); border-radius:var(--radius-sm); z-index:5; }
.resource-category-options[hidden] { display:none; }
.resource-category-options > div { flex:1; min-width:0; max-height:var(--dialog-width-reference-form); overflow:auto; }
.resource-category-options button { width:100%; border:0; border-radius:0; justify-content:space-between; padding:var(--space-2) var(--space-3); background:transparent; }
.resource-category-options button:hover, .resource-category-options button[aria-selected="true"] { color:var(--color-link); background:var(--color-primary-bg); }
.resource-reference-modal .reference-form fieldset { height:var(--reference-form-row-height); margin:0; }
.resource-reference-modal .reference-form legend { width:var(--reference-form-label-width); }
.process-reference { font-family:var(--font-family); }
.process-reference .resource-table th { font-weight:var(--process-header-weight); }
.process-reference .category-list button { line-height:var(--process-category-line-height); }
button.success.primary { color: var(--color-bg); background: var(--color-success-fill); border-color: var(--color-success-fill); }
button.success.primary:hover:not(:disabled) { color: var(--color-bg); background: var(--color-success); border-color: var(--color-success); }
.resource-table-centered .resource-actions { align-items: center; justify-content: center; }
.resource-actions .action-divider { height: 14px; border-left: 1px solid var(--color-border); }
.resource-pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; }
.resource-pagination button { min-width: var(--control-height); padding-inline: var(--space-2); border-color: transparent; background: transparent; }
.resource-pagination button[aria-current="page"] { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-bg); }
.resource-pagination button:disabled { border-color: transparent; background: transparent; }
.resource-pagination select { width: 104px; }
.resource-pagination input { width: 56px; }
.resource-pagination label { display: flex; align-items: center; gap: var(--space-2); }
dialog[data-size="reference-form"] { --dialog-width: var(--dialog-width-reference-form); }
dialog[data-size="reference-picker"] { --dialog-width: var(--dialog-width-reference-picker); }
dialog[data-size="reference-expression"] { --dialog-width: var(--dialog-width-reference-expression); }
dialog[data-size="reference-main-form"] { --dialog-width: var(--dialog-width-reference-main-form); }
dialog[data-size="reference-main-expression"] { --dialog-width: var(--dialog-width-reference-main-expression); }
dialog[data-size="reference-binding"] { --dialog-width: var(--dialog-width-reference-binding); }
.reference-query { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-4); flex: 0 0 auto; }
.reference-query label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.reference-query label > span { flex: 0 0 104px; text-align: right; white-space: nowrap; color: var(--color-text-secondary); }
.reference-query input,.reference-query select { width: 100%; min-width: 0; }
.resource-date-range { display:flex; align-items:center; gap:var(--space-1); min-width:0; width:100%; }
.resource-date-range input { flex:1; min-width:0; }
.resource-date-range > span { flex:0 0 auto; color:var(--color-text-secondary); }
.reference-query .toolbar { grid-column: 1 / -1; padding: 0; }
.resource-statistics-controls { display:flex; flex-wrap:nowrap; overflow-x:auto; padding:var(--space-2) var(--space-4); gap:var(--space-2); flex-shrink:0; }
.resource-statistics-controls > * { flex-shrink:0; }
.toolbar > .resource-statistics-controls {padding:0;overflow:visible;}
.resource-statistics-controls label {display:flex;align-items:center;gap:var(--space-2);white-space:nowrap;}
.resource-table-scroll {overflow:auto;max-height:60vh;}
.resource-text-link {border:0;background:transparent;color:var(--color-link);padding:0;text-decoration:underline;}
.expression-token-editor:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; box-shadow: var(--focus-ring); }
@media (max-width: 1200px) { .reference-query { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .reference-query { grid-template-columns: 1fr; } }
.reference-form > label { display: flex; align-items: center; gap: 0; margin-bottom: var(--space-4); }
.resource-multiselect { position:relative; flex:1; min-width:0; }
.resource-multiselect-trigger { width:100%; text-align:left; justify-content:flex-start; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resource-multiselect-panel { position:absolute; top:100%; left:0; right:0; z-index:5; padding:var(--space-2); background:var(--color-bg); border:1px solid var(--color-border); border-radius:var(--radius); box-shadow:var(--shadow-popup); }
.resource-multiselect-options { max-height:240px; overflow:auto; }
.resource-multiselect-options label { display:flex; align-items:center; gap:var(--space-2); padding:var(--space-2); }
.resource-multiselect-options input[type="checkbox"] { flex-shrink:0; }
.resource-multiselect-actions { display:flex; justify-content:flex-end; gap:var(--space-2); border-top:1px solid var(--color-divider); padding-top:var(--space-2); }
.reference-form > label > span:first-child { flex: 0 0 104px; text-align: right; padding-right: var(--space-2); }
.reference-form input:not([type="radio"]):not([type="checkbox"]), .reference-form select { min-width: 0; flex: 1; width: 100%; }
.reference-form input[readonly] { background: var(--color-bg-layout); }
.reference-form > label > button { flex: 0 0 116px; }
.reference-form fieldset { display: flex; align-items: center; gap: var(--space-4); padding: 0; border: 0; margin: 0 0 var(--space-4); }
.reference-form legend { float: left; width: 104px; text-align: right; padding-right: var(--space-2); }
.reference-form fieldset label { display: flex; align-items: center; gap: var(--space-2); }
.expression-token-editor { min-height: 112px; padding: var(--space-4); margin-top: var(--space-6); border: 1px solid var(--color-divider); background: var(--color-bg); box-shadow: inset 0 3px 8px rgb(0 0 0 / 6%); }
.expression-token-editor:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.expression-token { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: var(--control-height); margin: 0 var(--space-2) var(--space-2) 0; padding-inline: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg-subtle); }
.expression-buttons { display: flex; flex-wrap: wrap; gap: var(--space-6); margin: var(--space-3) 0 var(--space-6); }
.expression-buttons button { min-width: 48px; }
.expression-buttons[data-kind="variables"] { display: grid; grid-template-columns: repeat(5,minmax(48px,88px)); justify-content: space-between; gap: var(--space-3) var(--space-6); }
.expression-buttons[data-kind="variables"] button { min-width: 88px; }
.expression-buttons[data-kind="digits"] { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: var(--space-4); }
.expression-buttons[data-kind="digits"] button { min-width: 0; }
.expression-heading { margin-top: var(--space-4); }
@media (max-width: 640px) { .expression-buttons[data-kind="variables"] { grid-template-columns: repeat(3,minmax(48px,88px)); } }
@media (max-width: 640px) { .expression-buttons[data-kind="digits"] { grid-template-columns: repeat(5,minmax(0,1fr)); } }
.template-process-picker { position:relative; min-width:0; }
.cascade-trigger { width:100%; text-align:left; }
.cascade-panel { display:flex; position:absolute; z-index:10; top:100%; left:0; width:100%; background:var(--color-bg); border:1px solid var(--color-border); border-radius:var(--radius); box-shadow:var(--shadow-popup); }
.cascade-panel[hidden] { display:none; }
.cascade-panel > div { flex:1; min-width:0; max-height:240px; overflow:auto; padding:var(--space-2); }
.cascade-panel button { display:block; width:100%; text-align:left; border:0; }
.cascade-panel button[aria-pressed="true"] { background:var(--color-primary-bg); color:var(--color-link); }
.resource-matrix { border-collapse:collapse; width:max-content; min-width:100%; }
.resource-matrix th,.resource-matrix td { min-width:120px; max-width:300px; padding:var(--space-2) var(--space-3); height:var(--table-row-height-compact); border:1px solid var(--color-divider); text-align:center; white-space:nowrap; font-weight:var(--font-weight-normal); }
.resource-matrix thead th { position:sticky; top:0; z-index:2; background:var(--color-primary-bg); }
.resource-matrix tr > :first-child { position:sticky; left:0; z-index:1; min-width:150px; background:var(--color-bg-subtle); }
.resource-matrix thead tr > :first-child { z-index:3; }
.resource-matrix td { background:var(--color-bg); }
.resource-matrix .matrix-formula { border:0; background:transparent; color:var(--color-link); text-decoration:underline; height:auto; padding:0; }
.resource-matrix.accessory-matrix th,.resource-matrix.accessory-matrix td { min-width:64px; max-width:none; }
.resource-matrix.accessory-matrix thead tr:first-child th { position:static; }
.resource-matrix.accessory-matrix thead tr:last-child th { position:static; }
.resource-matrix.accessory-matrix tr > :first-child { position:static; min-width:96px; }
.resource-matrix.accessory-matrix tfoot td { background:var(--color-bg-subtle); }
/* 原系统辅料页：浅蓝双层表头，14px正文，固定列宽，不随空余宽度拉伸。 */
.resource-matrix.accessory-matrix { min-width:0; table-layout:fixed; font-family:var(--cost-font-family); font-size:var(--cost-font-size); line-height:var(--cost-line-height); color:var(--color-cost-text); }
.resource-matrix.accessory-matrix th,.resource-matrix.accessory-matrix td { padding:var(--space-1); min-width:0; height:var(--accessory-row-height); font-size:var(--cost-font-size); line-height:var(--cost-line-height); font-weight:var(--font-weight-normal); }
.resource-matrix.accessory-matrix thead th { height:var(--accessory-header-height); background:var(--color-primary-bg); }
.resource-matrix.accessory-matrix tr > :first-child { min-width:0; background:var(--color-bg); }
.resource-matrix.accessory-matrix thead tr > :first-child { background:var(--color-primary-bg); }
.resource-matrix.accessory-matrix tfoot td { background:var(--color-bg-subtle); }
.accessory-matrix col.aux-template { width:64px; }
.accessory-matrix col.aux-property { width:96px; }
.accessory-matrix col.aux-processing { width:80px; }
.accessory-matrix col.aux-dimension { width:64px; }
.accessory-matrix col.aux-value { width:72px; }
/* 原系统录单用料表：白底黑框，两层表头，不拉伸填满页面。 */
.production-cost-scroll { max-width:100%; overflow:auto; }
.production-cost-matrix { border-collapse:collapse; table-layout:fixed; width:max-content; background:var(--color-bg); color:var(--color-cost-text); font-family:var(--cost-font-family); font-size:var(--cost-font-size); line-height:var(--cost-line-height); font-weight:var(--font-weight-normal); }
.production-cost-matrix th,.production-cost-matrix td { border:1px solid var(--color-cost-grid); padding:var(--cost-cell-padding); text-align:center; white-space:nowrap; background:var(--color-bg); color:var(--color-cost-text); vertical-align:middle; }
.production-cost-matrix th { height:var(--cost-header-height); padding-block:var(--space-1); font-weight:var(--cost-header-weight); }
.production-cost-summary th { font-weight:var(--font-weight-normal); }
.production-cost-matrix td { height:var(--cost-row-height); font-weight:var(--font-weight-normal); }
.production-cost-matrix col.cost-property { width:96px; }
.production-cost-matrix col.cost-product { width:132px; }
.production-cost-matrix col.cost-number { width:88px; }
.production-cost-matrix col.cost-total { width:80px; }
/* 原系统工价：每条明细独立一张紧凑分组表，无底部合计或横线。 */
.production-wage-tables { display:flex; flex-direction:column; align-items:flex-start; gap:var(--space-4); width:max-content; }
.production-cost-matrix.production-wage-matrix { table-layout:auto; }
.production-wage-matrix td { height:var(--wage-row-height); }
.production-wage-matrix col.wage-property { width:65px; }
.production-wage-matrix col.wage-number { width:37px; }
.production-wage-matrix col.wage-total { width:51px; }
.production-cost-matrix.production-accessory-matrix { table-layout:auto; }
.production-accessory-matrix th { font-weight:var(--font-weight-normal); }
.production-accessory-matrix col.aux-property { width:94px; }
.production-accessory-matrix col.aux-processing { width:78px; }
.production-accessory-matrix col.aux-dimension { width:42px; }
.production-accessory-matrix col.aux-value { width:44px; }
.production-cost-scroll:has(.production-accessory-matrix) { margin-bottom:var(--space-2); }
.production-cost-scroll[aria-label="主料用量表格，可横向滚动"] { margin-bottom:var(--space-2); }
.matrix-sidebar-heading { padding:var(--space-3); margin:0; background:var(--color-bg-subtle); border-bottom:1px solid var(--color-divider); }
.matrix-group { display:flex; justify-content:space-between; gap:var(--space-2); }
.matrix-group span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 原系统订单列表尺寸配置，正文和操作仍使用公共角色。 */
.order-reference #orders td {
  font-size: var(--order-data-font-size);
  line-height: var(--order-data-line-height);
  padding: var(--order-cell-padding) var(--space-2);
}
.order-reference #orders th {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-normal);
  padding: var(--space-2);
}
.order-reference .quick {
  background: var(--color-primary-bg);
  border-color: var(--color-primary-border);
}
.order-reference .reference-recording-toolbar .quick { background:var(--color-primary-soft); color:var(--color-text); border-color:var(--color-primary-border); font-weight:var(--font-weight-normal); }
.reference-recording-toolbar button { min-height:var(--control-height-sm); padding-block:0; border-radius:var(--radius-sm); }
.order-reference .reference-recording-toolbar .quick.active { color:var(--color-text); font-weight:var(--font-weight-normal); }
.reference-recording-toolbar .count { color:var(--color-error); }
.reference-recording-toolbar .toolbar-actions > button:disabled { background:var(--color-primary); border-color:var(--color-primary); color:var(--color-bg); opacity:var(--opacity-disabled, .6); }
.reference-recording-toolbar .toolbar-actions > button:disabled:first-child::before { content:"⟳"; }
.reference-recording-toolbar .toolbar-actions > button:disabled:nth-child(2)::before { content:"▣"; }
.order-reference .online-number { display:inline-block; max-width:100%; padding:0 var(--space-1); border:1px solid var(--color-border); border-radius:var(--radius-sm); background:var(--color-bg-subtle); color:var(--color-text-secondary); vertical-align:middle; }
/* Shared member directory, adapted to the ERP theme. */
.member-card { background:var(--color-bg); border:1px solid var(--color-border); border-radius:var(--radius-lg); padding:var(--space-4); min-width:0; }
.member-tree button { width:100%; text-align:left; margin-bottom:var(--space-1); }
.member-tree button[aria-current] { color:var(--color-link); background:var(--color-primary-bg); }
.member-tree details > summary { cursor:pointer; padding:var(--space-2); }
.member-tree .member-tree { margin-left:var(--space-4); }
.member-sources { display:flex; gap:var(--space-2); overflow:auto; margin:var(--space-4) 0; }
.member-sources > * { flex:1 0 160px; text-align:left; }
/* Shared inline after-sales registration roles. */
.resource-after-editor{overflow:auto}.resource-after-editor table{min-width:1730px;width:100%;table-layout:fixed;border-collapse:collapse;font-size:var(--font-size-body);line-height:var(--line-height-body)}.resource-after-editor th{height:var(--reference-table-header-height,38px);padding:var(--space-2);text-align:center}.resource-after-editor td{padding:0;height:var(--control-height);border:1px solid var(--color-border)}.resource-after-editor input,.resource-after-editor select,.resource-after-editor [data-picker],.resource-after-upload{width:100%;font:inherit;font-weight:var(--font-weight-normal);height:var(--control-height);min-height:var(--control-height);border:0;border-radius:0;background:var(--color-bg);text-align:left;padding:var(--space-1) var(--space-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.resource-after-editor [data-picker].is-empty,.resource-after-upload{color:var(--color-text-disabled)}.resource-after-editor [data-list="questions"]::after{content:'⌄';float:right;color:var(--color-text-disabled)}.resource-after-editor .resource-after-actions{white-space:nowrap;text-align:center}.resource-after-actions button{border:0;background:transparent;padding:0 var(--space-1);height:var(--control-height);font:inherit;color:var(--color-primary)}.resource-after-actions [data-save]:not([data-existing]){color:var(--color-success)}.resource-after-actions [data-delete]{color:var(--color-error)}.resource-after-editor input[type="file"]{display:none}.resource-after-badge{display:inline-block;padding:0 var(--space-2);border-radius:var(--radius-sm);color:var(--color-primary);background:var(--color-primary-bg);font-weight:var(--font-weight-normal)}
.resource-after-picker{width:min(1500px,calc(100vw - var(--space-8)));max-height:90vh}.resource-after-picker-query{display:flex;gap:var(--space-2);padding:var(--space-4)}.resource-after-picker-columns{display:flex;overflow:auto;max-height:60vh;padding:var(--space-4);gap:var(--space-2)}.resource-after-picker-columns section{flex:1;min-width:180px}.resource-after-picker-columns h3{font-size:var(--font-size-section);font-weight:var(--font-weight-normal);padding:var(--space-2);background:var(--color-primary-bg);color:var(--color-primary)}.resource-after-picker-columns button{display:block;width:100%;text-align:left;border-radius:0;border-width:0 0 1px;padding:var(--space-3)}.resource-after-picker-columns button[aria-pressed="true"]{background:var(--color-primary-bg)}
.resource-after-images{display:flex;gap:var(--space-2)}.resource-after-images img{width:var(--control-height-lg);height:var(--control-height-lg);object-fit:cover}
.resource-after-editor [data-picker].is-empty,.resource-after-upload,.resource-after-editor [data-list="questions"]::after{color:var(--color-disabled-text)}
.resource-after-editor td input:not([type="checkbox"]):not([type="radio"]),.resource-after-editor td select{border:0;border-radius:0;padding:var(--space-1) var(--space-2)}
.resource-after-editor table{min-width:1630px}.resource-after-editor th{height:var(--accessory-header-height)}
.resource-after-badge{color:var(--color-bg);background:var(--after-sales-color);border-radius:var(--control-height)}.resource-after-picker-columns h3{font-size:var(--font-size-title)}
.resource-cash-editor { overflow:auto; }
.resource-cash-editor table { width:100%; min-width:var(--cash-editor-min-width,1200px); table-layout:fixed; }
.resource-cash-editor th { height:var(--order-header-height,38px); padding:var(--space-1); font-weight:var(--font-weight-normal); }
.resource-cash-editor td { height:var(--control-height); padding:0; }
.resource-cash-editor input,.resource-cash-editor select { width:100%; min-width:0; border-radius:var(--radius-sm); font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-cash-editor td:has(input:disabled),.resource-cash-editor input:disabled { background:var(--color-bg-disabled); color:var(--color-disabled-text); }
.resource-cash-editor input:disabled { border-color:transparent; border-radius:0; cursor:not-allowed; }
.resource-cash-editor td:last-child button { padding:var(--space-1); border:0; background:transparent; }
.resource-cash-editor .resource-reference-add { color:var(--color-success); }
.resource-cash-upload { display:block; position:relative; text-align:center; color:var(--color-text-secondary); cursor:pointer; }
.resource-cash-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.resource-cash-upload:focus-within { outline:2px solid var(--color-primary); }
.resource-comment-editor { overflow:auto; }
.resource-invoice-editor { overflow:auto; }
.resource-invoice-editor table { width:var(--invoice-editor-width); table-layout:fixed; font-family:var(--cost-font-family); }
.resource-invoice-editor th { height:var(--order-header-height); padding:var(--space-1); font-weight:var(--font-weight-normal); }
.resource-invoice-editor td { height:var(--control-height); padding:0; }
.resource-invoice-editor input,.resource-invoice-editor select { width:100%; min-width:0; font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); border-radius:var(--radius-sm); }
.resource-invoice-editor th:last-child,.resource-invoice-editor td:last-child { position:sticky; right:0; background:var(--color-bg); }
.resource-invoice-editor th:last-child { background:var(--color-primary-bg); }
.resource-invoice-editor td:last-child button { padding:var(--space-1); border:0; background:transparent; font-size:var(--order-data-font-size); }
.resource-invoice-editor .resource-reference-save { color:var(--color-link); }
.resource-invoice-editor .resource-reference-delete,.resource-invoice-notice>span { color:var(--color-error); }
.resource-invoice-editor .resource-reference-add { color:var(--color-success); }
.resource-invoice-notice { padding:var(--space-1) 0; }
.resource-invoice-notice p { margin:0; }
.invoice-operation-column { width:var(--invoice-operation-width); }
.resource-invoice-list { table-layout:fixed; width:max-content; }
.resource-invoice-list td { height:var(--table-row-height); padding:var(--order-cell-padding); font-size:var(--order-data-font-size); line-height:var(--order-data-line-height); font-weight:var(--font-weight-normal); white-space:normal; overflow-wrap:anywhere; }
.resource-invoice-list th { height:var(--order-header-height); padding:var(--order-cell-padding); font-weight:var(--font-weight-normal); }
.resource-invoice-list tr.current td { background:var(--color-primary-soft); }
.resource-comment-editor table { width:var(--comment-editor-width); table-layout:fixed; font-family:var(--cost-font-family); }
.resource-comment-editor th { height:var(--order-header-height); padding:var(--space-1); font-weight:var(--font-weight-normal); text-align:center; }
.resource-comment-editor td { height:var(--control-height); padding:0; }
.resource-comment-editor td input,.resource-comment-editor td select,.resource-comment-editor td>button { width:100%; min-width:0; border-radius:var(--radius-sm); font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-comment-editor td:last-child button { width:auto; padding:var(--space-1); border:0; background:transparent; }
.resource-comment-feedback { margin:var(--space-2); color:var(--color-error); }
.resource-comment-editor .resource-reference-save,.resource-cash-editor .resource-reference-save { color:var(--color-link); }
.resource-comment-editor .resource-reference-delete,.resource-cash-editor .resource-reference-delete { color:var(--color-error); }
.resource-comment-editor td>button { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resource-comment-editor .resource-after-images { flex-wrap:wrap; }
.resource-comment-list { table-layout:fixed; width:max-content; }
.resource-comment-list td { height:var(--comment-list-row-height); padding:var(--space-1); font-size:var(--order-data-font-size); line-height:var(--order-data-line-height); font-weight:var(--font-weight-normal); white-space:normal; overflow-wrap:anywhere; }
.resource-comment-list th { height:var(--order-header-height); padding:var(--space-1); font-weight:var(--font-weight-normal); }
.resource-comment-list tr.current td { background:var(--color-primary-soft); }
.resource-comment-picker,.resource-comment-category { --dialog-width:var(--comment-picker-width); border-radius:var(--radius-sm); }
.resource-comment-picker .modal-header,.resource-comment-category .modal-header { gap:var(--space-3); flex-wrap:nowrap; }
.resource-comment-picker .modal-header input,.resource-comment-category .modal-header input { width:var(--comment-picker-search-width); min-width:0; }
.resource-comment-picker .modal-header [data-query],.resource-comment-category .modal-header [data-query] { width:auto; padding:0 var(--space-4); color:var(--color-bg); }
.resource-comment-picker h2,.resource-comment-category h2 { flex:0 0 auto; margin-right:var(--space-8); }
.resource-comment-chips { display:flex; gap:var(--space-2); flex-wrap:wrap; min-height:var(--space-12); padding:var(--space-2); margin:var(--space-2); background:var(--color-bg-layout); }
.resource-comment-options { display:flex; overflow:auto; max-height:60vh; padding:0 var(--space-2) var(--space-2); gap:var(--space-1); }
.resource-comment-options section { flex:1; min-width:var(--comment-picker-column); }
.resource-comment-options h3 { margin:0; font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); padding:var(--space-3); background:var(--color-primary-bg); color:var(--color-primary); border-radius:var(--radius-sm); }
.resource-comment-options button { width:100%; display:block; text-align:left; padding:var(--space-3); height:auto; min-height:var(--space-12); border-width:0 0 1px; border-radius:0; }
.resource-comment-options button[aria-pressed="true"] { background:var(--color-success); color:var(--color-bg); }
.resource-comment-category { --dialog-width:var(--comment-category-width); }
.resource-comment-category .resource-comment-options button[aria-pressed="true"] { background:var(--color-primary-bg); color:var(--color-primary); }
.resource-comment-badge { display:inline-block; padding:0 var(--space-2); border-radius:var(--control-height); background:var(--after-sales-color); color:var(--color-bg); font-size:var(--font-size-sm); line-height:var(--line-height-sm); }
/* 原订单查询区：日期选择位于分组标题，筛选内容独立滚动。 */
.resource-reference-search .search-buttons,.resource-reference-search .filter-footer { gap:0; padding:0; border:0; }
.resource-reference-search .search-buttons { margin-bottom:var(--reference-search-gap); }
.resource-reference-search .search-buttons button,.resource-reference-search .filter-footer button { flex:1; min-width:0; }
.resource-reference-search .search-identifiers { gap:var(--reference-search-gap); padding:0; }
.resource-reference-search .filter-section { border-top:var(--reference-search-gap) solid var(--color-bg-layout); }
.resource-reference-search .filter-section summary { padding:var(--reference-search-padding); font-weight:var(--font-weight-normal); }
.resource-reference-search .filter-options { padding:0 var(--reference-search-padding) var(--reference-search-padding); }
.resource-reference-search .filter-scroll label { padding:0; align-items:center; min-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-reference-search .filter-options>input { width:100%; margin:0; }
.resource-reference-search .reference-date-heading { width:var(--reference-search-date-width); min-width:0; }
.resource-reference-search .resource-reference-date { display:block; position:relative; margin-bottom:var(--reference-search-gap); }
.resource-reference-date input { width:100%; }
.resource-reference-date input[data-has-value="false"]::-webkit-datetime-edit { color:transparent; }
.resource-reference-date>span { position:absolute; left:var(--space-3); top:50%; transform:translateY(-50%); color:var(--color-placeholder); pointer-events:none; }
.resource-reference-date:has(input[data-has-value="true"])>span { display:none; }
.resource-reference-search .hours { display:flex; justify-content:space-between; gap:0; margin:0; white-space:nowrap; }
.resource-reference-search .hours input { width:var(--reference-search-hours-width); height:var(--control-height-sm); min-height:var(--control-height-sm); min-width:0; padding:0 var(--space-1); }
.resource-reference-search .reference-remark-option input[type="text"] { width:var(--reference-search-text-width); min-width:0; flex:1; }
.resource-demo-note { margin:var(--space-2); color:var(--color-text-secondary); }
.resource-urgent-badge{display:table;margin:0 auto var(--space-1);padding:0 var(--space-2);border-radius:var(--control-height);color:var(--color-bg);background:var(--color-success);font-size:var(--font-size-sm);font-weight:var(--font-weight-normal);line-height:var(--line-height-sm)}
.resource-after-cascade{position:fixed;inset:auto;margin:0;padding:0;display:flex;max-width:calc(100vw - var(--space-4));background:var(--color-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:var(--radius);box-shadow:var(--shadow-popup);font:var(--font-size-body)/var(--line-height-body) var(--font-family);overflow-x:auto}
.resource-after-cascade:not(:popover-open){display:none}
.resource-after-cascade section{min-width:var(--after-category-width,160px);max-height:var(--after-category-height,240px);overflow-y:auto;border-right:1px solid var(--color-border)}
.resource-after-cascade button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:var(--control-height);padding:var(--space-2) var(--space-3);background:transparent;border:0;border-radius:0;color:inherit;font:inherit;font-weight:400;white-space:nowrap;text-align:left;gap:var(--space-3)}
.resource-after-cascade button:hover,.resource-after-cascade button[aria-expanded="true"]{background:var(--color-primary-bg)}
.resource-after-cascade{background:var(--color-bg)}

/* 售后与评价共用原系统用户选择窗口；不影响 ERP 外框。 */
.resource-person-picker { --dialog-width:var(--person-picker-width); font-family:var(--cost-font-family); border-radius:var(--radius-sm); }
.resource-person-picker .modal-header { gap:var(--space-8); padding:var(--space-4) var(--space-6); flex-wrap:nowrap; }
.resource-person-picker h2 { flex:none; font-size:var(--font-size-title); line-height:var(--line-height-title); font-weight:var(--font-weight-strong); margin:0; }
.resource-person-query { display:flex; flex:1; align-items:center; gap:0; min-width:0; }
.resource-person-query input { width:var(--person-picker-search-width); min-width:0; font:inherit; }
.resource-person-picker .modal-header [data-query] { flex:none; width:auto; height:var(--control-height); padding:0 var(--space-4); color:var(--color-bg); }
.resource-person-picker .modal-header [data-close] { flex:none; }
.resource-person-chips { display:flex; flex-wrap:wrap; flex:none; gap:var(--space-2); margin:var(--space-2) var(--space-2) var(--space-1); padding:var(--space-1) 0; min-height:var(--person-picker-heading-height); background:var(--person-picker-strip-color); }
.resource-person-chips button { display:flex; align-items:center; justify-content:space-between; width:var(--person-picker-chip-width); padding-inline:var(--space-3); font:inherit; }
.resource-person-columns { display:flex; position:relative; flex:1 1 auto; overflow:auto; height:var(--person-picker-content-height); max-height:60vh; margin:0 var(--space-2) var(--space-2); gap:var(--space-1); }
.resource-person-columns section { flex:1; min-width:var(--person-picker-column); }
.resource-person-columns h3 { display:flex; align-items:center; margin:0; height:var(--person-picker-heading-height); padding:var(--space-2); background:var(--color-primary-bg); color:var(--color-primary); border-radius:var(--radius-sm); font:inherit; font-weight:var(--font-weight-normal); }
.resource-person-columns button { display:flex; align-items:center; justify-content:space-between; width:100%; height:var(--person-picker-row-height); padding:var(--space-2) var(--space-3); text-align:left; border-width:0 0 1px; border-radius:0; font:inherit; font-weight:var(--font-weight-normal); }
.resource-person-columns button[aria-pressed="true"] { background:var(--color-success); color:var(--color-bg); border-radius:var(--radius-sm); }
.resource-person-empty { position:absolute; top:var(--person-picker-heading-height); margin:var(--space-3); font:inherit; }
.resource-comment-editor.resource-after-editor table { min-width:var(--comment-editor-width); font-size:var(--font-size-body); line-height:var(--line-height-body); }
.resource-comment-editor.resource-after-editor td input,.resource-comment-editor.resource-after-editor td select,.resource-comment-editor.resource-after-editor td>[data-picker] { height:var(--control-height); border:0; border-radius:0; padding:var(--space-1) var(--space-2); font:inherit; }
.resource-comment-editor [data-picker="questionId"]::after { content:'⌄'; float:right; color:var(--color-disabled-text); }
.resource-comment-editor.resource-after-editor .resource-after-upload { border:0; border-radius:0; padding:var(--space-1) var(--space-2); }
.resource-comment-editor.resource-after-editor [data-save]:not([data-existing]) { color:var(--color-success); }
.resource-comment-editor .resource-reference-date { display:block; position:relative; }
.account-reference { --font-family: var(--cost-font-family); }
.resource-account-table { table-layout:fixed; min-width:1380px; width:100%; border-collapse:collapse; font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-account-table th,.resource-account-table td { border:1px solid var(--color-divider); padding:var(--space-2); text-align:center; font-weight:var(--font-weight-normal); overflow-wrap:anywhere; }
.resource-account-table th { height:var(--table-row-height-compact); padding-block:var(--space-1); background:var(--color-primary-bg); position:sticky; top:0; z-index:1; }
.resource-account-table td { height:var(--account-table-row-height); background:var(--color-bg); }
.resource-account-table tr:nth-child(even) td { background:var(--color-bg-subtle); }
.resource-account-table tr:hover td,.resource-account-table tr.current td { background:var(--color-primary-bg); }
.resource-table tbody tr[aria-current="true"] td { background:var(--color-primary-bg); }
.resource-account-table [data-money] { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.resource-account-income { color:var(--color-success); }
.resource-account-expense { color:var(--color-error); }
.resource-account-requests td { height:var(--account-request-row-height); }
.resource-account-tree { overflow:auto; flex:1; min-height:0; }
.resource-account-tree details { margin-left:var(--account-tree-indent); }
.resource-account-tree summary,.resource-account-tree button { cursor:pointer; min-height:var(--control-height); line-height:var(--line-height-body); white-space:nowrap; }
.resource-account-tree button { display:block; border:0; background:transparent; color:var(--color-text-secondary); padding:var(--space-1) var(--space-2); border-radius:var(--radius-sm); max-width:100%; }
.resource-account-tree button[aria-current="true"] { color:var(--color-primary); background:var(--color-primary-bg); }
.resource-account-tree summary { color:var(--color-text-secondary); padding:var(--space-1); }
.resource-account-modal { width:var(--dialog-width-reference-form); }
.resource-account-modal .reference-form label { height:var(--control-height-lg); margin-bottom:0; }
.resource-account-modal .reference-form label:last-child { height:var(--control-height); }
.collection-reference.resource-account-modal .reference-form label { height:var(--reference-form-row-height); }
.collection-reference .resource-account-table { min-width:var(--collection-table-width); }
.collection-reference .resource-account-table td { height:auto; font-size:var(--collection-data-size); line-height:var(--collection-data-line); padding:var(--collection-cell-block) var(--collection-cell-inline); }
.collection-reference .resource-account-table th { height:auto; padding:var(--collection-cell-block) var(--collection-cell-inline); }
.resource-column-popover{position:absolute;top:100%;left:0;z-index:var(--z-popover,100);width:var(--column-popover-width,250px);padding:var(--space-3);background:var(--color-bg);border:1px solid var(--color-divider);border-radius:var(--radius-sm);box-shadow:var(--shadow-toast)}
.resource-column-popover header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--color-divider);padding-bottom:var(--space-2)}
.resource-column-popover label{display:flex;align-items:center;gap:var(--space-2);height:var(--control-height)}
.resource-transfer-modal{width:var(--transfer-dialog-width);max-width:calc(100vw - var(--space-8))}
.resource-transfer-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-inline:var(--space-1)}
.resource-transfer-form>label{display:flex;align-items:center;min-width:0;min-height:var(--transfer-form-row-height);margin:0}
.resource-transfer-form>label>span:first-child{flex:0 0 var(--transfer-form-label-width);text-align:right;padding-right:var(--space-2);white-space:nowrap}
.resource-transfer-form input,.resource-transfer-form select,.resource-transfer-form textarea{width:100%;min-width:0;flex:1}
.resource-transfer-form>label{padding-right:var(--transfer-form-end-gap)}
.resource-transfer-form input:disabled{background:var(--color-bg-layout);color:var(--color-text-disabled,var(--color-text-secondary))}
.resource-transfer-wide{grid-column:1/-1;padding-top:var(--space-2)}
.resource-transfer-form textarea{height:var(--transfer-textarea-height)}
.resource-transfer-upload{position:relative;display:flex;flex:1;align-items:center;justify-content:center;min-height:var(--transfer-upload-height);border:1px dashed var(--color-border);background:var(--color-bg-layout,var(--color-bg));border-radius:var(--radius-sm);color:var(--color-primary)}
.resource-transfer-upload input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;height:100%}
.resource-transfer-attachments{grid-column:1/-1;padding-left:var(--transfer-form-label-width)}
.resource-transfer-attachments>div{display:flex;gap:var(--space-2);align-items:center}
.resource-transfer-attachments button{height:var(--control-height-sm);border:0;color:var(--color-error)}
.resource-transfer-table{min-width:var(--transfer-table-width)}
.resource-transfer-table th:last-child,.resource-transfer-table td:last-child{position:sticky;right:0;background:var(--color-bg);z-index:2}
.resource-transfer-table th:last-child{background:var(--color-primary-bg)}
@media(max-width:640px){.resource-transfer-form{grid-template-columns:minmax(0,1fr)}.resource-transfer-form label:nth-child(odd):not(.resource-transfer-wide){padding-right:0}.resource-transfer-wide{grid-column:1}}
.resource-account-modal input:disabled { background:var(--color-bg-disabled); }
.resource-account-modal [role="alert"]:empty { display:none; }
.account-reference .account-toolbar button { padding-inline:var(--space-4); min-width:var(--account-button-width); }
.account-reference .account-toolbar button.quick { color:var(--color-text); background:var(--color-primary-soft); border-color:var(--color-primary-border); }
.account-reference .resource-date-range input[type="date"] { height:var(--control-height); padding:var(--space-1); }
/* Shared after-sales report query and grouped matrix. */
.resource-summary-query {display:flex;align-items:center;gap:var(--space-2);flex-wrap:nowrap;overflow-x:auto;padding:var(--space-2);flex-shrink:0;}
.resource-summary-query label {display:flex;align-items:center;gap:var(--space-2);white-space:nowrap;flex-shrink:0;}
.resource-summary-query input,.resource-summary-query select {width:calc(var(--control-height) * 5);}
.resource-summary-query button {flex-shrink:0;}
.resource-summary-matrix th {text-align:center;background:var(--color-primary-bg);font-weight:var(--font-weight-normal);}
.resource-summary-matrix {font-size:var(--font-size-body);line-height:var(--line-height-shell);}
.resource-summary-query {font-size:var(--font-size-body);line-height:var(--line-height-shell);}
.resource-summary-matrix td {text-align:center;white-space:nowrap;}
.resource-summary-matrix thead th {height:calc(var(--control-height) * 2);}
.resource-summary-matrix button {font:inherit;}
.resource-process-progress { border:1px solid var(--color-border); padding:var(--space-1); font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-process-log { list-style:none; margin:0; padding:0; }
.resource-process-log li { padding:var(--space-1) 0; white-space:nowrap; }
.resource-process-log li:nth-child(odd) { background:var(--color-bg-subtle); }
.resource-process-log li:last-child { border-bottom:0; }
.resource-process-log time { font-variant-numeric:tabular-nums; }
.resource-process-empty { margin:var(--space-2) 0; color:var(--color-text-secondary); }
.resource-sku-entry { --sku-entry-card-width:330px; --sku-entry-label-width:80px; --sku-entry-select-width:156px; border-top:1px solid var(--color-border); font-family:var(--cost-font-family); font-size:var(--font-size-body); line-height:var(--line-height-body); font-weight:var(--font-weight-normal); }
.resource-sku-entry .detail-content { padding:var(--space-2); overflow:auto; }
.resource-sku-entry .production-cards { align-items:flex-start; }
.resource-sku-entry .production-card { width:var(--sku-entry-card-width); flex-basis:var(--sku-entry-card-width); border:1px solid var(--color-border); padding:var(--space-4); border-radius:var(--radius-sm); }
.resource-sku-entry .production-field { display:flex; align-items:center; gap:var(--space-1); margin-bottom:0; }
.resource-sku-entry .production-field > span { flex:0 0 var(--sku-entry-label-width); background:var(--color-bg-subtle); padding:var(--space-1); min-height:var(--control-height); text-align:center; white-space:nowrap; }
.resource-sku-entry .production-field > select { width:var(--sku-entry-select-width); flex:none; }
.resource-sku-entry .production-template-row { display:flex; align-items:center; }
.resource-sku-entry .production-template-row .production-field { flex:1; }
.resource-sku-entry .production-note textarea { min-width:0; min-height:var(--control-height); height:var(--control-height); }
.resource-sku-entry .production-line-head { display:none; }
.resource-sku-entry .production-line-fields .material-cell { flex-basis:var(--sku-entry-label-width); }
.resource-sku-entry .production-line-fields label > span { text-align:center; }
.resource-sku-entry .production-line-fields .material-cell > span { background:var(--color-bg-subtle); }
.resource-sku-entry .production-line-fields .production-size-value { min-height:var(--control-height); white-space:normal; overflow-wrap:anywhere; text-align:center; }
.resource-sku-entry .production-line-actions { margin-block:var(--space-1); }
.resource-sku-entry .production-actions > button { min-width:calc(var(--control-height)*2); }
.resource-sku-entry .production-actions { align-self:flex-end; flex:none; display:flex; gap:var(--space-2); margin-bottom:var(--space-2); }
.resource-sku-entry .production-actions [data-save-status] { max-width:160px; }
#goods-table tr[aria-expanded="true"] td { background:var(--color-primary-bg); }

/* Keep each opened business page mounted while another workbench tab is active. */
.workbench-overlay body > :not([data-workbench-page]) { visibility: hidden; }
iframe[data-workbench-page] { position: fixed; inset: 0; z-index: 2000; width: 100%; height: 100%; border: 0; background: var(--color-bg); }
